[ PHPXref.com ] [ Generated: Sun Jul 20 20:51:36 2008 ] [ UniWakka 0.5.2 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/setup/ -> install.php (source)

   1  <?php
   2  /**
   3   * This file is part of UniWakka
   4   *
   5   * Copyright (C) 2004  Andrea Rossato
   6   * 
   7   * UniWakka is free software; you can redistribute it and/or
   8   * modify it under the terms of the GNU General Public License
   9   * as published by the Free Software Foundation; either version 2
  10   * of the License, or (at your option) any later version.
  11   * 
  12   * UniWakka is distributed in the hope that it will be useful,
  13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15   * GNU General Public License for more details.
  16   * 
  17   * You should have received a copy of the GNU General Public License
  18   * along with this program; if not, write to the Free Software
  19   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20   * 
  21   */
  22  
  23  /** 
  24   * This file was originally written by Hendrik Mans for WakkaWiki
  25   * and released under the terms of the modified BSD license 
  26   * (see docs/Wakka.LICENSE).
  27   * Wakka Copyright (c) 2002, Hendrik Mans <hendrik@mans.de>
  28   * Modifications by Andrea Rossato <andrea.rossato@ing.unitn.it>
  29   * Licence: GPL
  30   */
  31  
  32  // fetch configuration
  33  $config = $_POST["config"];
  34  //print_r($config);
  35  $newVersion = "0.5.2";
  36  // test configuration
  37  print("<strong>Testing Configuration</strong><br />\n");
  38  test("Testing MySQL connection settings...", $dblink = @mysql_connect($config["mysql_host"], $config["mysql_user"], $config["mysql_password"]));
  39  test("Looking for database...", @mysql_select_db($config["mysql_database"], $dblink), "The database you configured was not found. Remember, it needs to exist before you can install/upgrade Wakka!");
  40  print("<br />\n");
  41  
  42  // do installation stuff
  43  if (!$version = trim($wakkaConfig["wakka_version"])) $version = "0";
  44  switch ($version)
  45  {
  46  // new installation
  47  case "0":
  48      print("<strong>Installing Stuff</strong><br />\n");
  49      test("Creating uniwakka_subwikis table...",
  50           @mysql_query(
  51                "CREATE TABLE uniwakka_subwikis (".
  52                "id int(10) NOT NULL auto_increment,".
  53                "site_name varchar(255) NOT NULL default '',".
  54                "table_prefix varchar(255) NOT NULL default '',".
  55                "root_page varchar(255) NOT NULL default '',".
  56                "wakka_name varchar(255) NOT NULL default '',".
  57                "base_url varchar(255) NOT NULL default '',".
  58                "rewrite_mode char(1) default NULL,".
  59                "mathml char(1) NOT NULL default '',".
  60                "action_path varchar(255) default NULL,".
  61                "handler_path varchar(255) default NULL,".
  62                "header_action varchar(255) default NULL,".
  63                "footer_action varchar(255) default NULL,".
  64                "css varchar(255) default NULL,".
  65                "navigation_links varchar(255) default NULL,".
  66                "referrers_purge_time varchar(255) default NULL,".
  67                "pages_purge_time varchar(255) default NULL,".
  68                "hide_comments char(1) default NULL,".
  69                "default_write_acl varchar(255) default NULL,".
  70                "default_read_acl varchar(255) default NULL,".
  71                "default_comment_acl varchar(255) default NULL,".
  72                "meta_keywords varchar(255) default NULL,".
  73                "meta_description varchar(255) default NULL,".
  74                "mail_admin varchar(255) default NULL,".
  75                "email_notification enum('Y','N') NOT NULL default 'N',".
  76                "admin_user varchar(80) NOT NULL default '',".
  77                "rdf_rights varchar(255) default NULL,".
  78                "rdf_lang varchar(255) default NULL,".
  79                "aspell char(1) default NULL,".
  80                "aspell_dict varchar(255) default NULL,".
  81                "aspell_command varchar(255) default NULL,".
  82                "private char(1) default NULL,".
  83                "PRIMARY KEY (id)".
  84                ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
  85  
  86      test("Creating page table...",
  87           @mysql_query(
  88                "CREATE TABLE ".$config["table_prefix"]."pages (".
  89                "id int(10) unsigned NOT NULL auto_increment,".
  90                "tag varchar(50) NOT NULL default '',".
  91                "time datetime NOT NULL default '0000-00-00 00:00:00',".
  92                "body mediumtext NOT NULL,".
  93                "body_r mediumtext NOT NULL,".
  94                "owner varchar(50) NOT NULL default '',".
  95                "user varchar(50) NOT NULL default '',".
  96                "latest enum('Y','N') NOT NULL default 'N',".
  97                "handler varchar(30) NOT NULL default 'page',".
  98                "comment_on varchar(50) NOT NULL default '',".
  99                "PRIMARY KEY  (id),".
 100                "FULLTEXT KEY tag (tag,body),".
 101                "KEY idx_tag (tag),".
 102                "KEY idx_time (time),".
 103                "KEY idx_latest (latest),".
 104                "KEY idx_comment_on (comment_on)".
 105                ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 106      test("Creating ACL table...",
 107          @mysql_query(
 108              "CREATE TABLE ".$config["table_prefix"]."acls (".
 109                "page_tag varchar(50) NOT NULL default '',".
 110              "privilege varchar(20) NOT NULL default '',".
 111                "list text NOT NULL,".
 112               "PRIMARY KEY  (page_tag,privilege)".
 113              ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 114      test("Creating link tracking table...",
 115          @mysql_query(
 116              "CREATE TABLE ".$config["table_prefix"]."links (".
 117              "from_tag char(50) NOT NULL default '',".
 118                "to_tag char(50) NOT NULL default '',".
 119                "UNIQUE KEY from_tag (from_tag,to_tag),".
 120                "KEY idx_from (from_tag),".
 121                "KEY idx_to (to_tag)".
 122              ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 123      test("Creating referrer table...",
 124          @mysql_query(
 125              "CREATE TABLE ".$config["table_prefix"]."referrers (".
 126                "page_tag char(50) NOT NULL default '',".
 127                "referrer char(150) NOT NULL default '',".
 128                "time datetime NOT NULL default '0000-00-00 00:00:00',".
 129                "KEY idx_page_tag (page_tag),".
 130                "KEY idx_time (time)".
 131              ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 132      test("Creating biblio table...",
 133           @mysql_query(
 134                "CREATE TABLE ".$config["table_prefix"]."biblio (".
 135                "id int(10) NOT NULL auto_increment,".
 136                "bibkey varchar(50) NOT NULL default '',".
 137                "bibtype varchar(30) NOT NULL default '',".
 138                "author varchar(255) NOT NULL default '',".
 139                "editor varchar(255) NOT NULL default '',".
 140                "title varchar(255) NOT NULL default '',".
 141                "chapter varchar(255) NOT NULL default '',".
 142                "booktitle varchar(255) NOT NULL default '',".
 143                "isbn varchar(30) NOT NULL default '',".
 144                "journal varchar(255) NOT NULL default '',".
 145                "issn varchar(30) NOT NULL default '',".
 146                "volume varchar(10) NOT NULL default '',".
 147                "number varchar(10) NOT NULL default '',".
 148                "pages varchar(15) NOT NULL default '',".
 149                "series varchar(255) NOT NULL default '',".
 150                "publisher varchar(255) NOT NULL default '',".
 151                "address varchar(255) NOT NULL default '',".
 152                "edition varchar(50) NOT NULL default '',".
 153                "organization varchar(255) NOT NULL default '',".
 154                "school varchar(255) NOT NULL default '',".
 155                "institution varchar(255) NOT NULL default '',".
 156                "type varchar(255) NOT NULL default '',".
 157                "howpublished varchar(255) NOT NULL default '',".
 158                "month varchar(20) NOT NULL default '',".
 159                "year varchar(30) NOT NULL default '0',".
 160                "url varchar(100) NOT NULL default '',".
 161                "crossref varchar(50) NOT NULL default '',".
 162                "keywords varchar(255) NOT NULL default '',".
 163                "abstract text NOT NULL,".
 164                "note text NOT NULL,".
 165                "annote text NOT NULL,".
 166                "time datetime NOT NULL default '0000-00-00 00:00:00',".
 167                "owner varchar(30) NOT NULL default '',".
 168                "user varchar(50) NOT NULL default '',".
 169                "latest enum('Y','N') NOT NULL default 'N',".
 170                "handler varchar(30) NOT NULL default '',".
 171                "PRIMARY KEY(id),".
 172                "FULLTEXT KEY author (author,title,keywords,abstract,note,annote)".
 173                ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 174  
 175      test("Creating files table...",
 176           @mysql_query(
 177                "CREATE TABLE ".$config["table_prefix"]."files (".
 178                "id int(9) NOT NULL auto_increment,".
 179                "bin_data mediumblob NOT NULL,".
 180                "description varchar(255) NOT NULL default '',".
 181                "filename varchar(50) NOT NULL default '',".
 182                "filetype varchar(50) NOT NULL default '',".
 183                "filesize varchar(50) NOT NULL default '',".
 184                "user varchar(50) NOT NULL default '',".
 185                "time datetime NOT NULL default '0000-00-00 00:00:00',".
 186                "PRIMARY KEY  (id)".
 187                ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 188      
 189      
 190      test("Creating user table...",
 191           @mysql_query(
 192                "CREATE TABLE ".$config["table_prefix"]."users (".
 193                "name varchar(80) NOT NULL default '',".
 194                "password varchar(32) NOT NULL default '',".
 195                "email varchar(50) NOT NULL default '',".
 196                "motto text NOT NULL,".
 197                "revisioncount int(10) unsigned NOT NULL default '20',".
 198                "changescount int(10) unsigned NOT NULL default '50',".
 199                "doubleclickedit enum('Y','N') NOT NULL default 'Y',".
 200                "signuptime datetime NOT NULL default '0000-00-00 00:00:00',".
 201                "show_comments enum('Y','N') NOT NULL default 'N',".
 202                "PRIMARY KEY  (name),".
 203                "KEY idx_name (name),".
 204                "KEY idx_signuptime (signuptime)".
 205                ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 206      mysql_query("insert into ".$config["table_prefix"]."pages set tag = '".$config["root_page"]."', body = '".mysql_escape_string("Welcome to your [[http://uniwakka.sourceforge.net UniWakka]] site! Click on the \"Edit this page\" link at the bottom to get started.\n\nAlso don't forget to visit [[http://uniwakka.sourceforge.net UniWakka]]!\n\nUseful pages: OrphanedPages, WantedPages, TextSearch, BiblioImport, BiblioInsert, BiblioManage, BiblioSearch.")."', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 207      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'RecentChanges', body = '{{RecentChanges}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 208      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'RecentlyCommented', body = '{{RecentlyCommented}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 209      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'UserSettings', body = '{{UserSettings}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 210      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'PageIndex', body = '{{PageIndex}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 211      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'WantedPages', body = '{{WantedPages}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 212      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'OrphanedPages', body = '{{OrphanedPages}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 213      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'TextSearch', body = '{{TextSearch}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 214      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'MyPages', body = '{{MyPages}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 215      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'MyChanges', body = '{{MyChanges}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 216      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioImport', body = '{{biblioimport}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 217      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioInsert', body = '{{biblioinsert}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 218      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioManage', body = '{{bibliomanage}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 219      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioSearch', body = '{{bibliosearch}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 220      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'MyBibliography', body = '{{mybibliomanage}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 221      test("Adding some pages...", 1);
 222      test("Reticulating splines...", 1);
 223      test("Writing TPS report...", 1);
 224      break;
 225      
 226      // The funny upgrading stuff. Make sure these are in order! //
 227      // And yes, there are no break;s here. This is on purpose.  //
 228      
 229      // from wakka 0.1.2 to uniwakka 0.2
 230   case "0.1.2":
 231   case "0.1.3-dev":
 232   case "0.1":
 233   case "0.1-dev":
 234   case "0.2":
 235   case "0.2-dev":
 236   case "0.2.1":
 237     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 238     test("Creating uniwakka_subwikis table...",
 239           @mysql_query(
 240                "CREATE TABLE uniwakka_subwikis (".
 241                "id int(10) NOT NULL auto_increment,".
 242                "site_name varchar(255) NOT NULL default '',".
 243                "table_prefix varchar(255) NOT NULL default '',".
 244                "root_page varchar(255) NOT NULL default '',".
 245                "wakka_name varchar(255) NOT NULL default '',".
 246                "base_url varchar(255) NOT NULL default '',".
 247                "rewrite_mode char(1) default NULL,".
 248                "mathml char(1) NOT NULL default '',".
 249                "action_path varchar(255) default NULL,".
 250                "handler_path varchar(255) default NULL,".
 251                "header_action varchar(255) default NULL,".
 252                "footer_action varchar(255) default NULL,".
 253                "css varchar(255) default NULL,".
 254                "navigation_links varchar(255) default NULL,".
 255                "referrers_purge_time varchar(255) default NULL,".
 256                "pages_purge_time varchar(255) default NULL,".
 257                "hide_comments char(1) default NULL,".
 258                "default_write_acl varchar(255) default NULL,".
 259                "default_read_acl varchar(255) default NULL,".
 260                "default_comment_acl varchar(255) default NULL,".
 261                "meta_keywords varchar(255) default NULL,".
 262                "meta_description varchar(255) default NULL,".
 263                "mail_admin varchar(255) default NULL,".
 264                "email_notification enum('Y','N') NOT NULL default 'N',".
 265                "admin_user varchar(80) NOT NULL default '',".
 266                "rdf_rights varchar(255) default NULL,".
 267                "rdf_lang varchar(255) default NULL,".
 268                "aspell char(1) default NULL,".
 269                "aspell_dict varchar(255) default NULL,".
 270                "aspell_command varchar(255) default NULL,".
 271                "private char(1) default NULL,".
 272                "PRIMARY KEY (id)".
 273                ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 274     test("Creating biblio table...",
 275      @mysql_query(
 276               "CREATE TABLE ".$config["table_prefix"]."biblio (".
 277               "id int(10) NOT NULL auto_increment,".
 278               "bibkey varchar(50) NOT NULL default '',".
 279               "bibtype varchar(30) NOT NULL default '',".
 280               "author varchar(255) NOT NULL default '',".
 281               "editor varchar(255) NOT NULL default '',".
 282               "title varchar(255) NOT NULL default '',".
 283               "chapter varchar(255) NOT NULL default '',".
 284               "booktitle varchar(255) NOT NULL default '',".
 285               "isbn varchar(30) NOT NULL default '',".
 286               "journal varchar(255) NOT NULL default '',".
 287               "issn varchar(30) NOT NULL default '',".
 288               "volume varchar(10) NOT NULL default '',".
 289               "number varchar(10) NOT NULL default '',".
 290               "pages varchar(15) NOT NULL default '',".
 291               "series varchar(255) NOT NULL default '',".
 292               "publisher varchar(255) NOT NULL default '',".
 293               "address varchar(255) NOT NULL default '',".
 294               "edition varchar(50) NOT NULL default '',".
 295               "organization varchar(255) NOT NULL default '',".
 296               "school varchar(255) NOT NULL default '',".
 297               "institution varchar(255) NOT NULL default '',".
 298               "type varchar(255) NOT NULL default '',".
 299               "howpublished varchar(255) NOT NULL default '',".
 300               "month varchar(20) NOT NULL default '',".
 301               "year varchar(30) NOT NULL default '0',".
 302               "url varchar(100) NOT NULL default '',".
 303               "crossref varchar(50) NOT NULL default '',".
 304               "keywords varchar(255) NOT NULL default '',".
 305               "abstract text NOT NULL,".
 306               "note text NOT NULL,".
 307               "annote text NOT NULL,".
 308               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 309               "owner varchar(30) NOT NULL default '',".
 310               "user varchar(50) NOT NULL default '',".
 311               "latest enum('Y','N') NOT NULL default 'N',".
 312               "handler varchar(30) NOT NULL default '',".
 313               "PRIMARY KEY(id),".
 314               "FULLTEXT KEY author (author,title,keywords,abstract,note,annote)".
 315               ") TYPE=MyISAM", $dblink), "Already exists?", 0);
 316      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioImport', body = '{{biblioimport}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 317      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioInsert', body = '{{biblioinsert}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 318      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioManage', body = '{{bibliomanage}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 319      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'BiblioSearch', body = '{{bibliosearch}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 320      mysql_query("insert into ".$config["table_prefix"]."pages set tag = 'MyBibliography', body = '{{mybibliomanage}}', user = 'WakkaInstaller', time = now(), latest = 'Y'", $dblink);
 321     test("Just very slightly altering the page table...", 
 322  
 323      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body` `body` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 324     test("Just very slightly altering the page table...", 
 325      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body_r` `body_r` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 326     test("Just very slightly altering the page table...", 
 327      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 328     //versione 0.4.4
 329     test("Creating files table...",
 330      @mysql_query(
 331               "CREATE TABLE ".$config["table_prefix"]."files (".
 332               "id int(9) NOT NULL auto_increment,".
 333               "bin_data mediumblob NOT NULL,".
 334               "description varchar(255) NOT NULL default '',".
 335               "filename varchar(50) NOT NULL default '',".
 336               "filetype varchar(50) NOT NULL default '',".
 337               "filesize varchar(50) NOT NULL default '',".
 338               "user varchar(50) NOT NULL default '',".
 339               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 340               "PRIMARY KEY  (id)".
 341               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 342     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 343       { 
 344         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 345         mysql_free_result($r);
 346  
 347         if (isset($acls)) {
 348       foreach ($acls as $list) {
 349         test("Updating ACLs to the new format...", 
 350          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 351       }
 352         }
 353         unset($acls);
 354       }
 355        
 356     break;
 357     
 358   case "0.3.0":
 359   case "0.3.1":
 360   case "0.3.2":
 361     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 362     test("Creating uniwakka_subwikis table...",
 363      @mysql_query(
 364               "CREATE TABLE uniwakka_subwikis (".
 365               "id int(10) NOT NULL auto_increment,".
 366               "site_name varchar(255) NOT NULL default '',".
 367               "table_prefix varchar(255) NOT NULL default '',".
 368               "root_page varchar(255) NOT NULL default '',".
 369               "wakka_name varchar(255) NOT NULL default '',".
 370               "base_url varchar(255) NOT NULL default '',".
 371               "rewrite_mode char(1) default NULL,".
 372               "mathml char(1) NOT NULL default '',".
 373               "action_path varchar(255) default NULL,".
 374               "handler_path varchar(255) default NULL,".
 375               "header_action varchar(255) default NULL,".
 376               "footer_action varchar(255) default NULL,".
 377               "css varchar(255) default NULL,".
 378               "navigation_links varchar(255) default NULL,".
 379               "referrers_purge_time varchar(255) default NULL,".
 380               "pages_purge_time varchar(255) default NULL,".
 381               "hide_comments char(1) default NULL,".
 382               "default_write_acl varchar(255) default NULL,".
 383               "default_read_acl varchar(255) default NULL,".
 384               "default_comment_acl varchar(255) default NULL,".
 385               "meta_keywords varchar(255) default NULL,".
 386               "meta_description varchar(255) default NULL,".
 387               "mail_admin varchar(255) default NULL,".
 388               "rdf_rights varchar(255) default NULL,".
 389               "rdf_lang varchar(255) default NULL,".
 390               "aspell char(1) default NULL,".
 391               "aspell_dict varchar(255) default NULL,".
 392               "aspell_command varchar(255) default NULL,".
 393               "private char(1) default NULL,".
 394               "PRIMARY KEY (id)".
 395               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 396     
 397     test("Just very slightly altering the page table...", 
 398      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body` `body` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 399     test("Just very slightly altering the page table...", 
 400      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body_r` `body_r` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 401     test("Just very slightly altering the page table...", 
 402      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 403  
 404     //versione 0.4.4
 405     test("Creating files table...",
 406      @mysql_query(
 407               "CREATE TABLE ".$config["table_prefix"]."files (".
 408               "id int(9) NOT NULL auto_increment,".
 409               "bin_data mediumblob NOT NULL,".
 410               "description varchar(255) NOT NULL default '',".
 411               "filename varchar(50) NOT NULL default '',".
 412               "filetype varchar(50) NOT NULL default '',".
 413               "filesize varchar(50) NOT NULL default '',".
 414               "user varchar(50) NOT NULL default '',".
 415               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 416               "PRIMARY KEY  (id)".
 417               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 418     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 419       { 
 420         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 421         mysql_free_result($r);
 422  
 423         if (isset($acls)) {
 424       foreach ($acls as $list) {
 425         test("Updating ACLs to the new format...", 
 426          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 427       }
 428         }
 429         unset($acls);
 430       }
 431     
 432     break;
 433  
 434   case "0.3.3":
 435     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 436     test("Renaming sites table to uniwakka_subwikis...", 
 437      @mysql_query("alter table sites RENAME uniwakka_subwikis", $dblink), "Already done? Hmm!", 0);
 438     test("Just very slightly altering the uniwakka_subwikis table...", 
 439      @mysql_query("alter table uniwakka_subwikis add mathml CHAR (1) not null default '' after rewrite_mode", $dblink), "Already done? Hmm!", 0);
 440     test("Adding some fields to the uniwakka_subiwikis table...", 
 441      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 442     test("Just very slightly altering the page table...", 
 443      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body` `body` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 444     test("Just very slightly altering the page table...", 
 445      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `body_r` `body_r` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 446     test("Just very slightly altering the page table...", 
 447      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 448  
 449     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 450       { 
 451         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 452         mysql_free_result($r);
 453  
 454         if (isset($acls)) {
 455       foreach ($acls as $list) {
 456         test("Updating ACLs to the new format...", 
 457          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 458       }
 459         }
 460         unset($acls);
 461       }
 462  
 463     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 464     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 465     mysql_free_result($r);
 466  
 467     if (isset($sites)) {
 468       foreach ($sites as $v) {
 469         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 470          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `body` `body` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 471         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 472          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `body_r` `body_r` MEDIUMTEXT NOT NULL", $dblink), "Already done? Hmm!", 0);
 473         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 474          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 475  
 476         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 477       {
 478         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 479         mysql_free_result($r1);
 480         if (isset($acls)) {
 481           foreach ($acls as $list) {
 482             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 483              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 484           }
 485         }
 486         unset($acls);
 487       }
 488         
 489       }
 490     }
 491  
 492     test("Correcting a typo in table biblio...", 
 493      @mysql_query("ALTER TABLE ".$config["table_prefix"]."biblio CHANGE `organiazation` `organization` VARCHAR( 255 ) NOT NULL", $dblink), "Already done? Hmm!", 0);
 494     test("Adding crossref field to the biblio table...", 
 495      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 496     
 497     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 498     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 499     mysql_free_result($r);
 500     
 501     if (isset($sites)) {
 502       foreach ($sites as $v) {
 503         test("Correcting a typo in table biblio of ".$v["wakka_name"]."...", 
 504          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio CHANGE `organiazation` `organization` VARCHAR( 255 ) NOT NULL", $dblink), "Already done? Hmm!", 0);
 505         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 506          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 507  
 508       }
 509     }
 510  
 511     //versione 0.4.4
 512     test("Creating files table...",
 513      @mysql_query(
 514               "CREATE TABLE ".$config["table_prefix"]."files (".
 515               "id int(9) NOT NULL auto_increment,".
 516               "bin_data mediumblob NOT NULL,".
 517               "description varchar(255) NOT NULL default '',".
 518               "filename varchar(50) NOT NULL default '',".
 519               "filetype varchar(50) NOT NULL default '',".
 520               "filesize varchar(50) NOT NULL default '',".
 521               "user varchar(50) NOT NULL default '',".
 522               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 523               "PRIMARY KEY  (id)".
 524               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 525     
 526     
 527     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 528     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 529     mysql_free_result($r);
 530     
 531     if (isset($sites)) {
 532       foreach ($sites as $v) {
 533         
 534         test("Creating files table in ".$v["site_name"]."...",
 535          @mysql_query(
 536               "CREATE TABLE ".$v["table_prefix"]."files (".
 537               "id int(9) NOT NULL auto_increment,".
 538               "bin_data mediumblob NOT NULL,".
 539               "description varchar(255) NOT NULL default '',".
 540               "filename varchar(50) NOT NULL default '',".
 541               "filetype varchar(50) NOT NULL default '',".
 542               "filesize varchar(50) NOT NULL default '',".
 543               "user varchar(50) NOT NULL default '',".
 544               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 545               "PRIMARY KEY  (id)".
 546               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 547       }
 548       
 549     }
 550  
 551     break;
 552  
 553   case "0.4.0":
 554   case "0.4.1":
 555   case "0.4.2":
 556     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 557     test("Renaming sites table to uniwakka_subwikis...", 
 558      @mysql_query("alter table sites RENAME uniwakka_subwikis", $dblink), "Already done? Hmm!", 0);
 559     test("Adding some fields to the uniwakka_subiwikis table...", 
 560      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 561     test("Correcting a typo in table biblio...", 
 562      @mysql_query("ALTER TABLE ".$config["table_prefix"]."biblio CHANGE `organiazation` `organization` VARCHAR( 255 ) NOT NULL", $dblink), "Already done? Hmm!", 0);
 563     test("Adding crossref field to the biblio table...", 
 564      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 565     test("Just very slightly altering the page table...", 
 566      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 567     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 568       { 
 569         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 570         mysql_free_result($r);
 571  
 572         if (isset($acls)) {
 573       foreach ($acls as $list) {
 574         test("Updating ACLs to the new format...", 
 575          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 576       }
 577         }
 578         unset($acls);
 579       }
 580     
 581     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 582     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 583     mysql_free_result($r);
 584     
 585     if (isset($sites)) {
 586       foreach ($sites as $v) {
 587         test("Correcting a typo in table biblio of ".$v["wakka_name"]."...", 
 588          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio CHANGE `organiazation` `organization` VARCHAR( 255 ) NOT NULL", $dblink), "Already done? Hmm!", 0);
 589         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 590          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 591         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 592          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 593  
 594         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 595       {
 596         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 597         mysql_free_result($r1);
 598         if (isset($acls)) {
 599           foreach ($acls as $list) {
 600             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 601              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 602           }
 603         }
 604         unset($acls);
 605       }
 606  
 607  
 608       }
 609     }
 610     //versione 0.4.4
 611     test("Creating files table...",
 612      @mysql_query(
 613               "CREATE TABLE ".$config["table_prefix"]."files (".
 614               "id int(9) NOT NULL auto_increment,".
 615               "bin_data mediumblob NOT NULL,".
 616               "description varchar(255) NOT NULL default '',".
 617               "filename varchar(50) NOT NULL default '',".
 618               "filetype varchar(50) NOT NULL default '',".
 619               "filesize varchar(50) NOT NULL default '',".
 620               "user varchar(50) NOT NULL default '',".
 621               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 622               "PRIMARY KEY  (id)".
 623               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 624     
 625     
 626     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 627     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 628     mysql_free_result($r);
 629     
 630     if (isset($sites)) {
 631       foreach ($sites as $v) {
 632         
 633         test("Creating files table in ".$v["site_name"]."...",
 634          @mysql_query(
 635               "CREATE TABLE ".$v["table_prefix"]."files (".
 636               "id int(9) NOT NULL auto_increment,".
 637               "bin_data mediumblob NOT NULL,".
 638               "description varchar(255) NOT NULL default '',".
 639               "filename varchar(50) NOT NULL default '',".
 640               "filetype varchar(50) NOT NULL default '',".
 641               "filesize varchar(50) NOT NULL default '',".
 642               "user varchar(50) NOT NULL default '',".
 643               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 644               "PRIMARY KEY  (id)".
 645               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 646       }
 647       
 648     }
 649  
 650     break;
 651     
 652   case "0.4.3":
 653     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 654     test("Renaming sites table to uniwakka_subwikis...", 
 655      @mysql_query("alter table sites RENAME uniwakka_subwikis", $dblink), "Already done? Hmm!", 0);
 656     test("Adding some fields to the uniwakka_subiwikis table...", 
 657      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 658     test("Creating files table...",
 659      @mysql_query(
 660               "CREATE TABLE ".$config["table_prefix"]."files (".
 661               "id int(9) NOT NULL auto_increment,".
 662               "bin_data mediumblob NOT NULL,".
 663               "description varchar(255) NOT NULL default '',".
 664               "filename varchar(50) NOT NULL default '',".
 665               "filetype varchar(50) NOT NULL default '',".
 666               "filesize varchar(50) NOT NULL default '',".
 667               "user varchar(50) NOT NULL default '',".
 668               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 669               "PRIMARY KEY  (id)".
 670               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 671     
 672     test("Just very slightly altering the page table...", 
 673      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 674     test("Adding crossref field to the biblio table...", 
 675      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 676     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 677       { 
 678         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 679         mysql_free_result($r);
 680  
 681         if (isset($acls)) {
 682       foreach ($acls as $list) {
 683         test("Updating ACLs to the new format...", 
 684          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 685       }
 686         }
 687         unset($acls);
 688       }
 689     
 690     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 691     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 692     mysql_free_result($r);
 693     
 694     if (isset($sites)) {
 695       foreach ($sites as $v) {
 696         
 697         test("Creating files table in ".$v["site_name"]."...",
 698          @mysql_query(
 699               "CREATE TABLE ".$v["table_prefix"]."files (".
 700               "id int(9) NOT NULL auto_increment,".
 701               "bin_data mediumblob NOT NULL,".
 702               "description varchar(255) NOT NULL default '',".
 703               "filename varchar(50) NOT NULL default '',".
 704               "filetype varchar(50) NOT NULL default '',".
 705               "filesize varchar(50) NOT NULL default '',".
 706               "user varchar(50) NOT NULL default '',".
 707               "time datetime NOT NULL default '0000-00-00 00:00:00',".
 708               "PRIMARY KEY  (id)".
 709               ") TYPE=MyISAM;", $dblink), "Already exists?", 0);
 710         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 711          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 712         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 713          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 714  
 715         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 716       {
 717         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 718         mysql_free_result($r1);
 719         if (isset($acls)) {
 720           foreach ($acls as $list) {
 721             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 722              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 723           }
 724         }
 725         unset($acls);
 726       }
 727  
 728  
 729       }
 730       
 731     }
 732     break;
 733   case "0.4.4":
 734     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 735     test("Renaming sites table to uniwakka_subwikis...", 
 736      @mysql_query("alter table sites RENAME uniwakka_subwikis", $dblink), "Already done? Hmm!", 0);
 737     test("Adding some fields to the uniwakka_subiwikis table...", 
 738      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 739     test("Just very slightly altering the page table...", 
 740      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 741     test("Adding crossref field to the biblio table...", 
 742      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 743    
 744     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 745       { 
 746         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 747         mysql_free_result($r);
 748  
 749         if (isset($acls)) {
 750       foreach ($acls as $list) {
 751         test("Updating ACLs to the new format...", 
 752          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 753       }
 754         }
 755         unset($acls);
 756       }
 757  
 758     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 759     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 760     mysql_free_result($r);
 761     
 762     if (isset($sites)) {
 763       foreach ($sites as $v) {
 764         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 765          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 766         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 767          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 768         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 769       {
 770         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 771         mysql_free_result($r1);
 772         if (isset($acls)) {
 773           foreach ($acls as $list) {
 774             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 775              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 776           }
 777         }
 778         unset($acls);
 779       }
 780  
 781       }
 782       
 783     }
 784  
 785  
 786  
 787     break;
 788  
 789   case "0.4.5":
 790     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 791     test("Adding some fields to the uniwakka_subiwikis table...", 
 792      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 793     test("Just very slightly altering the page table...", 
 794      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 795     test("Adding crossref field to the biblio table...", 
 796      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 797     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 798       { 
 799         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 800         mysql_free_result($r);
 801  
 802         if (isset($acls)) {
 803       foreach ($acls as $list) {
 804         test("Updating ACLs to the new format...", 
 805          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 806       }
 807         }
 808         unset($acls);
 809       }
 810     
 811     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 812     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 813     mysql_free_result($r);
 814     
 815     if (isset($sites)) {
 816       foreach ($sites as $v) {
 817         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 818          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 819         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 820          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 821         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 822       {
 823         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 824         mysql_free_result($r1);
 825         if (isset($acls)) {
 826           foreach ($acls as $list) {
 827             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 828              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 829           }
 830         }
 831         unset($acls);
 832       }
 833       }
 834       
 835     }
 836     break;
 837  
 838   case "0.4.6":
 839   case "0.4.7":
 840     print("<strong>".$version." to ".$newVersion."</strong><br />\n");
 841     test("Adding some fields to the uniwakka_subiwikis table...", 
 842      @mysql_query("ALTER TABLE `uniwakka_subwikis` ADD `email_notification` ENUM( 'Y', 'N' ) DEFAULT 'N' NOT NULL AFTER `mail_admin` , ADD `admin_user` VARCHAR( 80 ) NOT NULL AFTER `email_notification`", $dblink), "Already done? Hmm!", 0);
 843     test("Just very slightly altering the page table...", 
 844      @mysql_query("ALTER TABLE ".$config["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 845     test("Adding crossref field to the biblio table...", 
 846      @mysql_query("ALTER TABLE `".$config["table_prefix"]."biblio` ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 847     if ($r = @mysql_query("select * from ".$config["table_prefix"]."acls where list like '%%'", $dblink)) 
 848       { 
 849         while ($row = mysql_fetch_assoc($r)) $acls[] = $row;
 850         mysql_free_result($r);
 851  
 852         if (isset($acls)) {
 853       foreach ($acls as $list) {
 854         test("Updating ACLs to the new format...", 
 855          @mysql_query("update ".$config["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 856       }
 857         }
 858         unset($acls);
 859       }
 860     $r = mysql_query("select * from uniwakka_subwikis", $dblink);
 861     while ($row = mysql_fetch_assoc($r)) $sites[] = $row;
 862     mysql_free_result($r);
 863     
 864     if (isset($sites)) {
 865       foreach ($sites as $v) {
 866         test("Just very slightly altering the page table of ".$v["wakka_name"]."...", 
 867          @mysql_query("ALTER TABLE ".$v["table_prefix"]."pages CHANGE `latest` `latest` ENUM( 'Y', 'N', 'D' ) DEFAULT 'N' NOT NULL", $dblink), "Already done? Hmm!", 0);
 868         test("Adding crossref field to the biblio table of ".$v["wakka_name"]."...", 
 869          @mysql_query("ALTER TABLE ".$v["table_prefix"]."biblio ADD `crossref` VARCHAR( 50 ) NOT NULL AFTER `url`", $dblink), "Already done? Hmm!", 0);
 870         if ($r1 = @mysql_query("select * from ".$v["table_prefix"]."acls where list like '%%'", $dblink)) 
 871       {
 872         while ($row = mysql_fetch_assoc($r1)) $acls[] = $row;
 873         mysql_free_result($r1);
 874         if (isset($acls)) {
 875           foreach ($acls as $list) {
 876             test("Updating ACLs to the new format in ".$v["wakka_name"]."......", 
 877              @mysql_query("update ".$v["table_prefix"]."acls set list = '".mysql_escape_string(str_replace("", "+", str_replace("§","+", $list["list"])))."' where page_tag = '".$list["page_tag"]."' and privilege = '".$list["privilege"]."'", $dblink), "Already done? Hmm!", 0);
 878           }
 879         }
 880         unset($acls);
 881       }
 882       }
 883       
 884     }
 885  
 886     break;
 887   case "0.5.0":
 888   case "0.5.1":
 889     test("Nothing to be done...", 1);
 890     break;
 891  }
 892  ?>
 893  
 894  <p>
 895  In the next step, the installer will try to write the updated configuration file, <tt><?php echo $wakkaConfigLocation ?></tt> and will write the MathML Stylesheet <tt>xml/pmathml.xsl</tt>.
 896  Please make sure the web server has write access to those files, or you will have to edit them manually.
 897  Once again, see <a href="http://uniwakka.sourceforge.net/" target="_blank">UniWakka</a> for details.
 898  </p>
 899  
 900  <form action="<?php echo myLocation(); ?>?installAction=writeconfig" method="POST">
 901  <input type="hidden" name="config" value="<?php echo htmlspecialchars(serialize($config)) ?>" />
 902  <input type="submit" value="Continue" />
 903  </form>


[ Powered by PHPXref - Served by Debian GNU/Linux ]