r419 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r418‎ | r419 | r420 >
Date:08:02, 23 May 2002
Author:lcrocker
Status:old
Tags:
Comment:
Major reorganization of database, a few small fixes.
Modified paths:
  • /trunk/phpwiki/newcodebase/Article.php (modified) (history)
  • /trunk/phpwiki/newcodebase/GlobalFunctions.php (modified) (history)
  • /trunk/phpwiki/newcodebase/InterText.php (deleted) (history)
  • /trunk/phpwiki/newcodebase/Language.php (modified) (history)
  • /trunk/phpwiki/newcodebase/LocalSettings.php (modified) (history)
  • /trunk/phpwiki/newcodebase/Namespace.php (added) (history)
  • /trunk/phpwiki/newcodebase/OutputPage.php (modified) (history)
  • /trunk/phpwiki/newcodebase/Skin.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialAllpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialAsksql.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialBlockip.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialContributions.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialDebug.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialDeletepage.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialListusers.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialLonelypages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialLongpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialMovepage.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialNewpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialPopularpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialPreferences.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialProtectpage.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialRandompage.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialRecentchanges.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialShortpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialSpecialpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialSqldump.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialStatistics.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialUpload.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialUserlogin.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialUserlogout.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialVote.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialWantedpages.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialWatchlist.php (modified) (history)
  • /trunk/phpwiki/newcodebase/SpecialWhatlinkshere.php (modified) (history)
  • /trunk/phpwiki/newcodebase/UpdateClasses.php (modified) (history)
  • /trunk/phpwiki/newcodebase/docs/language.doc (added) (history)
  • /trunk/phpwiki/newcodebase/sql/buildtables.sql (modified) (history)
  • /trunk/phpwiki/newcodebase/sql/convertdb.php (modified) (history)
  • /trunk/phpwiki/newcodebase/wiki.phtml (modified) (history)

Diff [purge]

Index: trunk/phpwiki/newcodebase/InterText.php
@@ -1,3 +0,0 @@
2 -<?
3 -include_once( "./Language.php" );
4 -?>
Index: trunk/phpwiki/newcodebase/SpecialMovepage.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "movepage" ) );
98 $wgOut->addHTML( "<p>(TODO: Move page)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/Skin.php
@@ -38,7 +38,7 @@
3939 $s .= "a { text-decoration: none; }\n";
4040 }
4141 if ( 1 == $wgUser->getOption( "markupNewTopics" ) ) {
42 - $s .= "a.new { color: red; text-decoration: none; }\n";
 42+ $s .= "a.new { color: white; background: blue; }\n";
4343 }
4444 $s .= "//--></style>\n";
4545 return $s;
@@ -478,9 +478,9 @@
479479 }
480480 }
481481
482 -include_once( "./SkinStandard.php" );
483 -include_once( "./SkinStarTrek.php" );
484 -include_once( "./SkinNostalgia.php" );
485 -include_once( "./SkinCologneBlue.php" );
 482+include_once( "SkinStandard.php" );
 483+include_once( "SkinStarTrek.php" );
 484+include_once( "SkinNostalgia.php" );
 485+include_once( "SkinCologneBlue.php" );
486486
487487 ?>
Index: trunk/phpwiki/newcodebase/SpecialUserlogout.php
@@ -5,7 +5,6 @@
66 global $wgUser, $wgOut, $returnto;
77
88 $wgUser->logout();
9 - $wgOut->setPageTitle( wfMsg( "userlogout" ) );
109 $wgOut->setRobotpolicy( "noindex,nofollow" );
1110 $wgOut->addHTML( wfMsg( "logouttext" ) . "\n<p>" );
1211 $wgOut->returnToMain();
Index: trunk/phpwiki/newcodebase/sql/buildtables.sql
@@ -1,106 +1,85 @@
22 # MySQL script for creating wikipedia database
3 -#
43
5 -#
6 -# Table structure for table 'cur'
7 -#
 4+CREATE TABLE user (
 5+ user_id int(5) unsigned NOT NULL auto_increment,
 6+ user_name varchar(40) binary NOT NULL,
 7+ user_rights tinyblob,
 8+ user_password tinyblob,
 9+ user_email tinytext,
 10+ user_options blob,
 11+ user_watch mediumblob,
 12+ user_nickname tinyblob,
 13+ UNIQUE KEY user_id (user_id),
 14+ UNIQUE KEY user_name (user_name(20))
 15+) TYPE=MyISAM PACK_KEYS=1;
816
 17+# "Current" version of each article
 18+#
919 CREATE TABLE cur (
10 - cur_id mediumint(8) unsigned NOT NULL auto_increment,
 20+ cur_id int(8) unsigned NOT NULL auto_increment,
1121 cur_namespace tinyint(2) unsigned NOT NULL default '0',
1222 cur_title varchar(255) binary NOT NULL default '',
1323 cur_text mediumtext,
1424 cur_comment tinyblob,
15 - cur_user mediumint(8) unsigned default '0',
16 - cur_user_text tinyblob,
17 - cur_old_version mediumint(8) unsigned default '0',
 25+ cur_user int(5) unsigned default '0',
 26+ cur_revision int(5) unsigned default '0',
1827 cur_timestamp timestamp(14) NOT NULL,
1928 cur_minor_edit tinyint(1) default '0',
2029 cur_restrictions tinyblob,
21 - cur_params mediumtext,
2230 cur_counter bigint(20) unsigned default '0',
23 - cur_cache mediumtext,
2431 cur_ind_title varchar(255) default NULL,
25 - INDEX cur_namespace (cur_namespace),
26 - INDEX cur_title (cur_title),
2732 UNIQUE KEY cur_id (cur_id),
28 - INDEX timeind (cur_timestamp),
29 - FULLTEXT KEY cur_ind_title (cur_ind_title),
30 - FULLTEXT KEY cur_text (cur_text)
 33+ INDEX cur_namespace (cur_namespace),
 34+ INDEX cur_title (cur_title(30)),
 35+ INDEX cur_timestamp (cur_timestamp),
 36+ FULLTEXT INDEX cur_ind_title (cur_ind_title),
 37+ FULLTEXT INDEX cur_text (cur_text)
3138 ) TYPE=MyISAM PACK_KEYS=1;
3239
 40+# Historical versions of articles
3341 #
34 -# Table structure for table 'linked'
35 -#
36 -
37 -CREATE TABLE linked (
38 - linked_to varchar(255) binary NOT NULL default '',
39 - linked_from varchar(255) binary NOT NULL default '',
40 - KEY linked_to (linked_to),
41 - KEY linked_from (linked_from)
42 -) TYPE=MyISAM PACK_KEYS=1;
43 -
44 -#
45 -# Table structure for table 'old'
46 -#
47 -
4842 CREATE TABLE old (
49 - old_id mediumint(8) unsigned NOT NULL auto_increment,
 43+ old_id int(8) unsigned NOT NULL auto_increment,
5044 old_namespace tinyint(2) unsigned NOT NULL default '0',
5145 old_title varchar(255) binary NOT NULL default '',
5246 old_text mediumtext,
5347 old_comment tinyblob,
54 - old_user mediumint(8) unsigned default '0',
55 - old_user_text tinyblob,
56 - old_old_version mediumint(8) unsigned default '0',
 48+ old_user int(5) unsigned default '0',
 49+ old_revision int(5) unsigned default '0',
5750 old_timestamp timestamp(14) NOT NULL,
5851 old_minor_edit tinyint(1) default '0',
5952 UNIQUE KEY old_id (old_id),
60 - KEY timeind (old_timestamp),
61 - KEY old_title (old_title)
 53+ INDEX old_namespace (old_namespace),
 54+ INDEX old_title (old_title(30)),
 55+ INDEX old_timestamp (old_timestamp)
6256 ) TYPE=MyISAM PACK_KEYS=1;
6357
 58+# Internal links: values are external keys into cur
6459 #
65 -# Table structure for table 'unlinked'
66 -#
 60+CREATE TABLE linked (
 61+ linked_from int(8) unsigned NOT NULL default '0',
 62+ linked_to int(8) unsigned NOT NULL default '0',
 63+ INDEX linked_from (linked_from),
 64+ INDEX linked_to (linked_to)
 65+) TYPE=MyISAM;
6766
68 -CREATE TABLE unlinked (
69 - unlinked_from varchar(255) binary NOT NULL default '',
70 - unlinked_to varchar(255) binary NOT NULL default '',
71 - KEY unlinked_from (unlinked_from),
72 - KEY unlinked_to (unlinked_to)
73 -) TYPE=MyISAM PACK_KEYS=1;
74 -
 67+# Site-wide statistics.
7568 #
76 -# Table structure for table 'user'
77 -#
78 -
79 -CREATE TABLE user (
80 - user_id mediumint(8) unsigned NOT NULL auto_increment,
81 - user_name varchar(40) binary NOT NULL,
82 - user_rights tinytext,
83 - user_password tinytext,
84 - user_email tinytext,
85 - user_options mediumtext,
86 - user_watch mediumtext,
87 - user_nickname tinytext,
88 - UNIQUE KEY user_id (user_id),
89 - UNIQUE KEY user_name (user_name)
90 -) TYPE=MyISAM PACK_KEYS=1;
91 -
9269 CREATE TABLE site_stats (
93 - ss_row_id mediumint(8) unsigned NOT NULL,
 70+ ss_row_id int(8) unsigned NOT NULL,
9471 ss_total_views bigint(20) unsigned default '0',
9572 ss_total_edits bigint(20) unsigned default '0',
9673 ss_good_articles bigint(20) unsigned default '0',
9774 UNIQUE KEY ss_row_id (ss_row_id)
9875 ) TYPE=MyISAM;
9976
 77+# Users and/or IP addresses blocked from editing
 78+#
10079 CREATE TABLE ipblocks (
10180 ipb_address varchar(40) binary default '',
102 - ipb_user mediumint(8) unsigned default '0',
103 - ipb_by mediumint(8) unsigned default '0',
104 - ipb_reason mediumtext default '',
 81+ ipb_user int(8) unsigned default '0',
 82+ ipb_by int(8) unsigned default '0',
 83+ ipb_reason blob default '',
10584 INDEX ipb_address (ipb_address),
10685 INDEX ipb_user (ipb_user)
10786 ) TYPE=MyISAM PACK_KEYS=1;
Index: trunk/phpwiki/newcodebase/sql/convertdb.php
@@ -1,196 +1,268 @@
22 <?
33 # Script for converting May 2002 version of wikipedia
44 # database into the format for the "newwiki" software.
5 -# Intended to be run from the php command line.
 5+# Intended to be run from the php command line. It has
 6+# to be run from the same directory as the code so that
 7+# all the includes work.
 8+
 9+# Must find and include utility classes from main code,
 10+# and define a few of its globals.
611 #
7 -include_once( "../Namespace.php" );
 12+include_once( "LocalSettings.php" );
 13+include_once( "GlobalFunctions.php" );
 14+include_once( "Language.php" );
 15+include_once( "Namespace.php" );
 16+include_once( "User.php" );
 17+include_once( "Title.php" );
 18+include_once( "Article.php" );
819
9 -$DBserver = "127.0.0.1";
10 -$DBname = "wikidb";
11 -$DBuser = "wikiuser";
12 -$DBpassword = "xxx";
 20+global $wgUser, $wgLang, $wgOut, $wgTitle;
 21+$wgLangClass = "Language" . ucfirst( $wgLanguageCode );
 22+$wgLang = new $wgLangClass();
 23+
 24+# Name of old databse, SQL file to produce, and global progress counter.
 25+#
 26+$wgDBname = "wikidb";
1327 $outfilename = "newdb.sql";
 28+$count = 0;
1429
15 -$conn = mysql_connect( $DBserver, $DBuser, $DBpassword )
16 - or die( "Can't connect to database server." );
17 -mysql_select_db( $DBname, $conn ) or die( "Can't select database." );
18 -print "Connected to database.\n";
 30+# Actual code begins here. Some code may be commented out.
 31+#
1932
20 -$outf = fopen( $outfilename, "w" )
21 - or die( "Can't open output file.\n" );
22 -
2333 set_time_limit(0);
 34+$outf = fopen( $outfilename, "w" ) or die( "Can't open output file.\n" );
2435
2536
26 -# USER
27 -#
28 -print "Converting USER table.\n";
29 -$sql = "SELECT * FROM user";
30 -$res = mysql_query( $sql, $conn );
31 -if ( ! $res ) die( "Can't open \"user\" table." );
 37+convertUserTable();
 38+convertCurTable();
 39+convertOldTable();
3240
33 -p_start();
34 -while ( $row = mysql_fetch_object( $res ) ) {
3541
36 - if ( 0 == ( $progressCount % 100 ) ) {
37 - if ( 0 != $progressCount ) { fwrite( $outf, ";\n" ) ; }
 42+# All done
 43+#
 44+fclose( $outf );
 45+print "Done.\n";
 46+exit();
3847
39 - fwrite( $outf, "INSERT INTO user (user_id,user_name,user_rights," .
40 - "user_password,user_email,user_options,user_watch,user_nickname)" .
41 - " VALUES " );
42 - } else {
43 - fwrite( $outf, "," );
44 - }
45 - # Need to do some tweaking of options here
46 - #
47 - $ops = strencode(urldecode($row->user_options));
48 - $name = strencode($row->user_name);
49 - $rights = strencode($row->user_rights);
50 - $email = strencode($row->user_email);
51 - $pwd = strencode($row->user_password);
52 - $watch = strencode($row->user_watch);
5348
54 - fwrite( $outf, "({$row->user_id},'$name','$rights','$pwd','$email'," .
55 - "'$ops','$watch','')" );
56 - progress();
57 -}
58 -mysql_free_result( $res );
59 -fwrite( $outf, ";\n" );
60 -p_end();
61 -
62 -# CUR
6349 #
 50+#
 51+function convertUserTable()
 52+{
 53+ global $count, $outf;
 54+ $count = 0;
6455
65 -print "Converting CUR table.\n";
66 -$sql = "SELECT * FROM cur";
67 -$res = mysql_query( $sql, $conn );
68 -if ( ! $res ) die( "Can't open \"cur\" table." );
 56+ print "Converting USER table.\n";
 57+ $conn = wfGetDB();
 58+ $sql = "SELECT user_id,user_name,user_rights,user_password," .
 59+ "user_email,user_options,user_watch FROM user";
 60+ $res = mysql_query( $sql, $conn );
 61+ if ( ! $res ) die( "Can't open \"user\" table." );
6962
70 -p_start();
71 -while ( $row = mysql_fetch_object( $res ) ) {
 63+ while ( $row = mysql_fetch_object( $res ) ) {
 64+ if ( 0 == ( $count % 100 ) ) {
 65+ if ( 0 != $count ) { fwrite( $outf, ";\n" ) ; }
7266
73 - if ( 0 == ( $progressCount % 100 ) ) {
74 - if ( 0 != $progressCount ) { fwrite( $outf, ";\n" ) ; }
 67+ fwrite( $outf, "INSERT INTO user (user_id,user_name,user_rights," .
 68+ "user_password,user_email,user_options,user_watch,user_nickname)" .
 69+ " VALUES " );
 70+ } else {
 71+ fwrite( $outf, "," );
 72+ }
 73+ $ops = fixUserOptions( $row->user_options );
 74+ $name = wfStrencode( $row->user_name );
 75+ $rights = wfStrencode( $row->user_rights );
 76+ $email = wfStrencode( $row->user_email );
 77+ $pwd = wfStrencode( $row->user_password );
 78+ $watch = wfStrencode( $row->user_watch );
7579
76 - fwrite( $outf, "INSERT INTO cur (cur_id,cur_namespace," .
77 - "cur_title,cur_text,cur_comment,cur_user,cur_user_text," .
78 - "cur_old_version,cur_timestamp,cur_minor_edit," .
79 - "cur_restrictions,cur_params,cur_counter," .
80 - "cur_ind_title) VALUES " );
81 - } else {
82 - fwrite( $outf, "," );
 80+ fwrite( $outf, "({$row->user_id},'$name','$rights','$pwd','$email'," .
 81+ "'$ops','$watch','')" );
 82+
 83+ if ( ( ++$count % 1000 ) == 0 ) {
 84+ print "$count records processed.\r";
 85+ }
8386 }
84 - if ( preg_match( "/^([A-Za-z][A-Za-z0-9 _]*):(.*)$/",
85 - $row->cur_title, $m ) ) {
86 - $ns = $m[1];
87 - $t = $m[2];
88 - } else {
89 - $ns = "";
90 - $t = $row->cur_title;
91 - }
92 - $namespace = Namespace::getIndex( $ns );
93 - $title = strencode( $t );
94 - $text = strencode( $row->cur_text );
95 - $com = strencode( $row->cur_comment );
96 - $cut = strencode( $row->cur_user_text );
97 - $cr = strencode( $row->cur_restrictions );
98 - $cp = strencode( $row->cur_params );
99 - $cit = strencode( $row->cur_ind_title );
100 -
101 - fwrite( $outf, "({$row->cur_id},$namespace,'$title','$text'," .
102 - "'$com',{$row->cur_user},'$cut',{$row->cur_old_version}," .
103 - "'{$row->cur_timestamp}',{$row->cur_minor_edit},'$cr','$cp'," .
104 - "{$row->cur_counter},'$cit')" );
105 - progress();
 87+ print "$count records processed.\n";
 88+ mysql_free_result( $res );
 89+ fwrite( $outf, ";\n" );
10690 }
107 -mysql_free_result( $res );
108 -fwrite( $outf, ";\n" );
109 -p_end();
11091
111 -# OLD
112 -#
11392
114 -print "Converting OLD table.\n";
115 -$sql = "SELECT * FROM old";
116 -$res = mysql_query( $sql, $conn );
117 -if ( ! $res ) die( "Can't open \"old\" table." );
 93+function convertCurTable()
 94+{
 95+ global $count, $outf;
 96+ $count = 0;
11897
119 -p_start();
120 -while ( $row = mysql_fetch_object( $res ) ) {
 98+ print "Converting CUR table.\n";
 99+ $conn = wfGetDB();
 100+ $sql = "SELECT cur_id,cur_title,cur_text,cur_comment,cur_user," .
 101+ "cur_old_version,cur_timestamp,cur_minor_edit,cur_restrictions," .
 102+ "cur_counter,cur_ind_title FROM cur";
 103+ $res = mysql_query( $sql, $conn );
 104+ if ( ! $res ) die( "Can't open \"cur\" table." );
121105
122 - if ( 0 == ( $progressCount % 100 ) ) {
123 - if ( 0 != $progressCount ) { fwrite( $outf, ";\n" ) ; }
 106+ while ( $row = mysql_fetch_object( $res ) ) {
 107+ if ( 0 == ( $count % 100 ) ) {
 108+ if ( 0 != $count ) { fwrite( $outf, ";\n" ) ; }
124109
125 - fwrite( $outf, "INSERT INTO old (old_id,old_namespace," .
126 - "old_title,old_text,old_comment,old_user,old_user_text," .
127 - "old_old_version,old_timestamp,old_minor_edit) VALUES " );
128 - } else {
129 - fwrite( $outf, "," );
 110+ fwrite( $outf, "INSERT INTO cur (cur_id,cur_namespace," .
 111+ "cur_title,cur_text,cur_comment,cur_user," .
 112+ "cur_revision,cur_timestamp,cur_minor_edit," .
 113+ "cur_restrictions,cur_counter," .
 114+ "cur_ind_title) VALUES " );
 115+ } else {
 116+ fwrite( $outf, "," );
 117+ }
 118+ if ( preg_match( "/^([A-Za-z][A-Za-z0-9 _]*):(.*)$/",
 119+ $row->cur_title, $m ) ) {
 120+ $ns = $m[1];
 121+ $t = $m[2];
 122+ } else {
 123+ $ns = "";
 124+ $t = $row->cur_title;
 125+ }
 126+ if ( 0 == strcasecmp( "Log", $ns ) ) {
 127+ $ns = "Wikipedia";
 128+ $t .= " log";
 129+ }
 130+ $namespace = Namespace::getIndex( $ns );
 131+ $title = wfStrencode( $t );
 132+ $text = wfStrencode( $row->cur_text );
 133+ $com = wfStrencode( $row->cur_comment );
 134+ $cr = wfStrencode( $row->cur_restrictions );
 135+ $cp = wfStrencode( $row->cur_params );
 136+ $cit = wfStrencode( $row->cur_ind_title );
 137+
 138+ fwrite( $outf, "({$row->cur_id},$namespace,'$title','$text'," .
 139+ "'$com',{$row->cur_user},{$row->cur_old_version}," .
 140+ "'{$row->cur_timestamp}',{$row->cur_minor_edit},'$cr'," .
 141+ "{$row->cur_counter},'$cit')" );
 142+
 143+ if ( ( ++$count % 1000 ) == 0 ) {
 144+ print "$count records processed.\r";
 145+ }
130146 }
131 - if ( preg_match( "/^([A-Za-z][A-Za-z0-9 _]*):(.*)$/",
132 - $row->old_title, $m ) ) {
133 - $ns = $m[1];
134 - $t = $m[2];
135 - } else {
136 - $ns = "";
137 - $t = $row->old_title;
138 - }
139 - $namespace = Namespace::getIndex( $ns );
140 - $title = strencode( $t );
141 - $text = strencode( $row->old_text );
142 - $com = strencode( $row->old_comment );
143 - $cut = strencode( $row->old_user_text );
144 -
145 - fwrite( $outf, "({$row->old_id},$namespace,'$title','$text'," .
146 - "'$com',{$row->old_user},'$cut',{$row->old_old_version}," .
147 - "'{$row->old_timestamp}',{$row->old_minor_edit} )" );
148 - progress();
 147+ print "$count records processed.\n";
 148+ mysql_free_result( $res );
 149+ fwrite( $outf, ";\n" );
149150 }
150 -mysql_free_result( $res );
151 -fwrite( $outf, ";\n" );
152 -p_end();
153151
154152
 153+function convertOldTable()
 154+{
 155+ global $count, $outf;
 156+ $count = 0;
155157
156 -fclose( $outf );
 158+ print "Converting OLD table.\n";
 159+ $conn = wfGetDB();
 160+ $sql = "SELECT old_id,old_title,old_text,old_comment,old_user," .
 161+ "old_old_version,old_timestamp,old_minor_edit FROM old";
 162+ $res = mysql_query( $sql, $conn );
 163+ if ( ! $res ) die( "Can't open \"old\" table." );
157164
158 -# All done
159 -#
160 -print "Database converted. You should now run the
161 -\"updatedb\" script to fill in the derived tables.
162 -";
 165+ while ( $row = mysql_fetch_object( $res ) ) {
 166+ if ( 0 == ( $count % 100 ) ) {
 167+ if ( 0 != $count ) { fwrite( $outf, ";\n" ) ; }
163168
164 -function p_start()
165 -{
166 - global $progressCount;
167 - $progressCount = 0;
168 -}
 169+ fwrite( $outf, "INSERT INTO old (old_id,old_namespace," .
 170+ "old_title,old_text,old_comment,old_user," .
 171+ "old_revision,old_timestamp,old_minor_edit) VALUES " );
 172+ } else {
 173+ fwrite( $outf, "," );
 174+ }
 175+ if ( preg_match( "/^([A-Za-z][A-Za-z0-9 _]*):(.*)$/",
 176+ $row->old_title, $m ) ) {
 177+ $ns = $m[1];
 178+ $t = $m[2];
 179+ } else {
 180+ $ns = "";
 181+ $t = $row->old_title;
 182+ }
 183+ if ( 0 == strcasecmp( "Log", $ns ) ) {
 184+ continue;
 185+ }
 186+ $namespace = Namespace::getIndex( $ns );
 187+ $title = wfStrencode( $t );
 188+ $text = wfStrencode( $row->old_text );
 189+ $com = wfStrencode( $row->old_comment );
169190
170 -function p_end()
171 -{
172 - global $progressCount;
173 - print "$progressCount records processed.\n\n";
 191+ fwrite( $outf, "({$row->old_id},$namespace,'$title','$text'," .
 192+ "'$com',{$row->old_user},{$row->old_old_version}," .
 193+ "'{$row->old_timestamp}',{$row->old_minor_edit} )" );
 194+
 195+ if ( ( ++$count % 1000 ) == 0 ) {
 196+ print "$count records processed.\r";
 197+ }
 198+ }
 199+ print "$count records processed.\n";
 200+ mysql_free_result( $res );
 201+ fwrite( $outf, ";\n" );
174202 }
175203
176 -function progress()
 204+function fixUserOptions( $in )
177205 {
178 - global $progressCount;
 206+ $s = urldecode( $in );
 207+ $a = explode( "\n", $s );
179208
180 - ++$progressCount;
181 - if ( 0 == ( $progressCount % 1000 ) ) {
182 - print "$progressCount records processed.\n";
 209+ foreach ( $a as $l ) {
 210+ if ( preg_match( "/^([A-Za-z0-9_]+)=(.*)/", $l, $m ) ) {
 211+ $ops[$m[1]] = $m[2];
 212+ }
183213 }
184 -}
 214+ unset( $ops["showStructure"] );
 215+ unset( $ops["autowikify"] );
 216+ unset( $ops["viewFrames"] );
 217+ unset( $ops["textTableBackground"] );
 218+ unset( $ops["text"] );
 219+ unset( $ops["background"] );
 220+ unset( $ops["forceQuickbar"] );
 221+ unset( $ops["tabLine0"] );
 222+ unset( $ops["tabLine1"] );
 223+ unset( $ops["tabLine2"] );
185224
186 -function strencode( $s )
187 -{
188 - $s = str_replace( "\\", "\\\\", $s );
189 - $s = str_replace( "\r", "\\r", $s );
190 - $s = str_replace( "\n", "\\n", $s );
191 - $s = str_replace( "\"", "\\\"", $s );
192 - $s = str_replace( "'", "\\'", $s );
193 - $s = str_replace( "\0", "\\0", $s );
194 - return $s;
 225+ if ( $ops["changesLayout"] == "classic" ) {
 226+ $ops["changesLayout"] = 1;
 227+ } else {
 228+ unset( $ops["changesLayout"] );
 229+ }
 230+ $q = strtolower( $ops["quickBar"] );
 231+ if ( $q == "none" ) { $q = 0; }
 232+ else if ( $q == "left" ) { $q = 1; }
 233+ else { $q = 2; }
 234+ $ops["quickBar"] = $q;
 235+
 236+ if ( $ops["markupNewTopics"] == "inverse" ) {
 237+ $ops["markupNewTopics"] = 1;
 238+ } else {
 239+ unset( $ops["markupNewTopics"] );
 240+ }
 241+ $sk = substr( strtolower( $ops["skin"] ), 0, 4 );
 242+ if ( "star" == $sk ) { $sk = 1; }
 243+ else if ( "nost" == $sk ) { $sk = 2; }
 244+ else if ( "colo" == $sk ) { $sk = 3; }
 245+ else { $sk = 0; }
 246+ $ops["skin"] = $sk;
 247+
 248+ $toggles = array( "underlineLinks", "justify",
 249+ "numberHeadings", "hideMinor", "rememberPassword",
 250+ "showHover" );
 251+
 252+ foreach ( $toggles as $op ) {
 253+ $lop = strtolower( $op );
 254+ if ( ( "yes" == $lop ) || ( "on" == $lop ) ) {
 255+ $ops[$op] = 1;
 256+ } else {
 257+ unset( $ops[$op] );
 258+ }
 259+ }
 260+ $a = array();
 261+
 262+ foreach ( $ops as $oname => $oval ) {
 263+ array_push( $a, "$oname=$oval" );
 264+ }
 265+ $s = implode( "\n", $a );
 266+ return urlencode( $s );
195267 }
196268
197269 ?>
Index: trunk/phpwiki/newcodebase/SpecialProtectpage.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "protectpage" ) );
98 $wgOut->addHTML( "<p>(TODO: Protect page)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialRandompage.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "randompage" ) );
98 $wgOut->addHTML( "<p>(TODO: Random page)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/Language.php
@@ -16,7 +16,7 @@
1717 /* private */ $wgUserTogglesEn = array(
1818 "showHover" => "Show hoverbox over wiki links",
1919 "underlineLinks" => "Underline links",
20 - "markupNewTopics" => "Show links to empty topics in red",
 20+ "markupNewTopics" => "Highlight links to empty topics",
2121 "justify" => "Justify paragraphs",
2222 "hideMinor" => "Hide minor edits in recent changes",
2323 "numberHeadings" => "Auto-number headings",
@@ -354,6 +354,6 @@
355355 }
356356 }
357357
358 -include_once( "./Language" . ucfirst( $wgLanguageCode ) . ".php" );
 358+include_once( "Language" . ucfirst( $wgLanguageCode ) . ".php" );
359359
360360 ?>
Index: trunk/phpwiki/newcodebase/SpecialBlockip.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "blockip" ) );
98 $wgOut->addHTML( "<p>(TODO: Block IP)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialAllpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "allpages" ) );
98 $wgOut->addHTML( "<p>(TODO: All pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/OutputPage.php
@@ -105,6 +105,7 @@
106106 $this->setHTMLTitle( wfMsg( "errorpagetitle" ) );
107107 $this->setPageTitle( wfMsg( $title ) );
108108 $this->setRobotpolicy( "noindex,nofollow" );
 109+ $this->setArticleFlag( false );
109110
110111 $this->mBodytext = "";
111112 $this->addHTML( "<p>" . wfMsg( $msg ) . "\n" );
@@ -113,10 +114,10 @@
114115
115116 function databaseError( $op )
116117 {
117 - $this->mDebugtext .= "MySQL: " . mysql_errno() . ": " .
118 - mysql_error() . "\n";
 118+ wfDebug( "MySQL: " . mysql_errno() . ": " . mysql_error() . "\n" );
119119 $this->setPageTitle( wfMsg( "databaseerror" ) );
120120 $this->setRobotpolicy( "noindex,nofollow" );
 121+ $this->setArticleFlag( false );
121122
122123 $this->mBodytext = str_replace( "$1", $op, wfMsg( "dberrortext" ) );
123124 $this->returnToMain();
@@ -717,7 +718,7 @@
718719 }
719720 $p = $this->mRobotpolicy;
720721 if ( "" == $p ) { $p = "index,follow"; }
721 - $ret .= "<meta name=\"robots\" content=\"$p\">";
 722+ $ret .= "<meta name=\"robots\" content=\"$p\">\n";
722723
723724 if ( count( $this->keywords ) > 0 ) {
724725 $ret .= "<meta name=\"keywords\" content=\"" .
Index: trunk/phpwiki/newcodebase/SpecialListusers.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "listusers" ) );
98 $wgOut->addHTML( "<p>(TODO: List users)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialAsksql.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "asksql" ) );
98 $wgOut->addHTML( "<p>(TODO: Ask SQL)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialDeletepage.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "deletepage" ) );
98 $wgOut->addHTML( "(TODO: Delete page)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/wiki.phtml
@@ -4,15 +4,15 @@
55 session_register( "wsUserName" );
66 session_register( "wsUserPassword" );
77
8 -include_once( "./LocalSettings.php" );
9 -include_once( "./GlobalFunctions.php" );
10 -include_once( "./InterText.php" );
11 -include_once( "./Namespace.php" );
12 -include_once( "./Skin.php" );
13 -include_once( "./OutputPage.php" );
14 -include_once( "./User.php" );
15 -include_once( "./Title.php" );
16 -include_once( "./Article.php" );
 8+include_once( "LocalSettings.php" );
 9+include_once( "GlobalFunctions.php" );
 10+include_once( "Language.php" );
 11+include_once( "Namespace.php" );
 12+include_once( "Skin.php" );
 13+include_once( "OutputPage.php" );
 14+include_once( "User.php" );
 15+include_once( "Title.php" );
 16+include_once( "Article.php" );
1717
1818 global $action, $title, $search, $target;
1919 global $target, $returnto;
Index: trunk/phpwiki/newcodebase/SpecialPreferences.php
@@ -86,6 +86,7 @@
8787 global $wpRows, $wpCols, $wpSaveprefs, $wpReset;
8888
8989 $wgOut->setPageTitle( wfMsg( "preferences" ) );
 90+ $wgOut->setArticleFlag( false );
9091
9192 wfDebug( "Prefs: err=\"$err\"\n" );
9293 if ( "" != $err ) {
Index: trunk/phpwiki/newcodebase/SpecialWantedpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "wantedpages" ) );
98 $wgOut->addHTML( "<p>(TODO: Wanted pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialWatchlist.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "watchlist" ) );
98 $wgOut->addHTML( "<p>(TODO: Watch list)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialUserlogin.php
@@ -121,6 +121,7 @@
122122
123123 $wgOut->setPageTitle( wfMsg( "loginsuccesstitle" ) );
124124 $wgOut->setRobotpolicy( "noindex,nofollow" );
 125+ $wgOut->setArticleFlag( false );
125126 $wgOut->addHTML( $msg . "\n<p>" );
126127 $wgOut->returnToMain();
127128 }
@@ -162,6 +163,7 @@
163164 }
164165 $wgOut->setPageTitle( wfMsg( "userlogin" ) );
165166 $wgOut->setRobotpolicy( "noindex,nofollow" );
 167+ $wgOut->setArticleFlag( false );
166168
167169 if ( "" == $err ) {
168170 $wgOut->addHTML( "<h2>$li:</h2>\n" );
Index: trunk/phpwiki/newcodebase/SpecialWhatlinkshere.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "whatlinkshere" ) );
98 $wgOut->addHTML( "<p>(TODO: What links here)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialNewpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "newpages" ) );
98 $wgOut->addHTML( "<p>(TODO: New pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialRecentchanges.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "recentchanges" ) );
98 $wgOut->addWikiText( wfMsg( "recentchangestext" ) );
109
1110 $wgOut->addHTML( "<p>(TODO: Recent changes list)\n" );
Index: trunk/phpwiki/newcodebase/LocalSettings.php
@@ -2,7 +2,7 @@
33 # For local site-specific settings. This should be the
44 # only thing you need to configure to install the software.
55
6 -include_once( "./DefaultSettings.php" );
 6+include_once( "DefaultSettings.php" );
77
88 # URLs for the wiki site
99 #
Index: trunk/phpwiki/newcodebase/SpecialVote.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "vote" ) );
98 $wgOut->addHTML( "<p>(TODO: Vote)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialLongpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "longpages" ) );
98 $wgOut->addHTML( "<p>(TODO: Long pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialShortpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "shortpages" ) );
98 $wgOut->addHTML( "<p>(TODO: Short pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialLonelypages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "lonelypages" ) );
98 $wgOut->addHTML( "<p>(TODO: Orphaned pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/Article.php
@@ -4,8 +4,8 @@
55 class Article {
66 /* private */ var $mTitle; # WikiTitle object
77 /* private */ var $mContent, $mContentLoaded;
8 - /* private */ var $mUser, $mTimestamp, $mParams;
9 - /* private */ var $mCounter, $mComment, $mOldversion;
 8+ /* private */ var $mUser, $mTimestamp;
 9+ /* private */ var $mCounter, $mComment, $mRevision;
1010 /* private */ var $mMinorEdit;
1111
1212 function Article( $t )
@@ -14,7 +14,7 @@
1515 $this->mContentLoaded = false;
1616 $this->mUser = $this->mCounter = -1; # Not loaded
1717 $this->mTimestamp = $this->mComment = "";
18 - $this->mOldversion = 0;
 18+ $this->mRevision = 0;
1919 }
2020
2121 function getContent()
@@ -35,8 +35,8 @@
3636 if ( 0 == $id ) return;
3737
3838 $conn = wfGetDB();
39 - $sql = "SELECT cur_text,cur_timestamp,cur_user,cur_counter, " .
40 - "cur_params FROM cur WHERE cur_id=$id";
 39+ $sql = "SELECT cur_text,cur_timestamp,cur_user,cur_counter " .
 40+ "FROM cur WHERE cur_id=$id";
4141 wfDebug( "Art: 1: $sql\n" );
4242 $res = mysql_query( $sql, $conn );
4343
@@ -47,7 +47,6 @@
4848 $this->mContent = $s->cur_text;
4949 $this->mUser = $s->cur_user;
5050 $this->mCounter = $s->cur_counter;
51 - $this->mParams = $s->cur_params;
5251 $this->mTimestamp = $s->cur_timestamp;
5352 }
5453 mysql_free_result( $res );
@@ -70,7 +69,7 @@
7170 if ( -1 != $this->mUser ) return;
7271
7372 $conn = wfGetDB();
74 - $sql = "SELECT cur_user,cur_timestamp,cur_old_version," .
 73+ $sql = "SELECT cur_user,cur_timestamp,cur_revision," .
7574 "cur_comment,cur_minor_edit FROM cur WHERE " .
7675 "cur_id=" . $this->getID();
7776 wfDebug( "Art: 3: $sql\n" );
@@ -81,7 +80,7 @@
8281 $this->mUser = $s->cur_user;
8382 $this->mTimestamp = $s->cur_timestamp;
8483 $this->mComment = $s->cur_comment;
85 - $this->mOldversion = $s->cur_old_version;
 84+ $this->mRevision = $s->cur_revision;
8685 $this->mMinorEdit = $s->cur_minor_edit;
8786 }
8887 }
@@ -241,12 +240,13 @@
242241
243242 $conn = wfGetDB();
244243 $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text," .
245 - "cur_comment,cur_user,cur_timestamp,cur_minor_edit," .
246 - "cur_old_version,cur_counter) VALUES ('" .
247 - $this->mTitle->getNamespace() . "', '" .
 244+ "cur_comment,cur_user,cur_timestamp,cur_minor_edit,cur_counter," .
 245+ "cur_restrictions,cur_revision,cur_ind_title) VALUES (" .
 246+ $this->mTitle->getNamespace() . ", '" .
248247 $this->mTitle->getDBKey() . "', '" .
249248 wfStrencode( $text ) . "', '" . wfStrencode( $summary ) . "', '" .
250 - $wgUser->getID() . "', '" . date( "YmdHis" ) . "', 0, 0, 0)";
 249+ $wgUser->getID() . "', '" . date( "YmdHis" ) . "', 0, 0, '', 0, '" .
 250+ $this->mTitle->getPrefixedText() . "')";
251251
252252 wfDebug( "Art: 2: $sql\n" );
253253 $res = mysql_query( $sql, $conn );
@@ -268,13 +268,13 @@
269269 $this->loadLastEdit();
270270 $conn = wfGetDB();
271271 $sql = "INSERT INTO old (old_namespace,old_title,old_text," .
272 - "old_comment,old_user,old_old_version,old_timestamp," .
273 - "old_minor_edit) VALUES ('" .
274 - $this->mTitle->getNamespace() . "', '" .
 272+ "old_comment,old_user,old_revision,old_timestamp," .
 273+ "old_minor_edit) VALUES (" .
 274+ $this->mTitle->getNamespace() . ", '" .
275275 $this->mTitle->getDBKey() . "', '" .
276276 wfStrencode( $this->getContent() ) . "', '" .
277277 wfStrencode( $this->mComment ) . "', " .
278 - $this->mUser . ", " . $this->mOldversion . ", '" .
 278+ $this->mUser . ", " . $this->mRevision . ", '" .
279279 $this->mTimestamp . "', " . $me1 . ")";
280280
281281 wfDebug( "Art: 4: $sql\n" );
@@ -283,9 +283,9 @@
284284 $wgOut->databaseError( wfMsg( "updatingarticle" ) );
285285 return;
286286 }
287 - $cond = "(old_namespace='" . $this->mTitle->getNamespace() .
288 - "' AND old_title='" . $this->mTitle->getDBKey() .
289 - "' AND old_old_version={$this->mOldversion})";
 287+ $cond = "(old_namespace=" . $this->mTitle->getNamespace() .
 288+ " AND old_title='" . $this->mTitle->getDBKey() .
 289+ "' AND old_revision={$this->mRevision})";
290290 $newid = wfGetSQL( "old", "old_id", $cond );
291291 if ( 0 == $newid ) {
292292 $wgOut->databaseError( wfMsg( "updatingarticle" ) );
@@ -296,7 +296,7 @@
297297 "',cur_comment='" . wfStrencode( $summary ) .
298298 "',cur_minor_edit={$me2}, cur_user=" . $wgUser->getID() .
299299 ", cur_timestamp='" . date( "YmdHis" ) .
300 - "',cur_old_version=$newid " .
 300+ "',cur_revision=$newid " .
301301 "WHERE cur_id=" . $this->getID();
302302
303303 wfDebug( "Art: 5: $sql\n" );
@@ -360,6 +360,8 @@
361361
362362 $wgOut->setPageTitle( wfMsg( "blockedtitle" ) );
363363 $wgOut->setRobotpolicy( "noindex,nofollow" );
 364+ $wgOut->setArticleFlag( false );
 365+
364366 $id = $wgUser->blockedBy();
365367 $reason = $wgUser->blockedFor();
366368
@@ -378,6 +380,8 @@
379381
380382 $wgOut->setPageTitle( wfMsg( "readonly" ) );
381383 $wgOut->setRobotpolicy( "noindex,nofollow" );
 384+ $wgOut->setArticleFlag( false );
 385+
382386 $wgOut->addWikiText( wfMsg( "readonlytext" ) );
383387 $wgOut->returnToMain();
384388 }
Index: trunk/phpwiki/newcodebase/SpecialUpload.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "upload" ) );
98 $wgOut->addHTML( "<p>(TODO: Upload)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialSqldump.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "sqldup" ) );
98 $wgOut->addHTML( "<p>(TODO: SQL dump)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialDebug.php
@@ -4,8 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( "Debug" );
9 -
108 $wgOut->addWikiText( "
119
1210 == Heading ==
Index: trunk/phpwiki/newcodebase/GlobalFunctions.php
@@ -26,8 +26,8 @@
2727 $wgTotalViews = -1;
2828 $wgTotalEdits = -1;
2929
30 -include_once( "./DatabaseFunctions.php" );
31 -include_once( "./UpdateClasses.php" );
 30+include_once( "DatabaseFunctions.php" );
 31+include_once( "UpdateClasses.php" );
3232
3333 function wfLocalLink( $a )
3434 {
@@ -87,7 +87,7 @@
8888 global $wgValidSpecialPages, $wgSysopSpecialPages;
8989
9090 $wgOut->setArticleFlag( false );
91 - $wgOut->setPageTitle( $wgTitle->getText() );
 91+ $wgOut->setPageTitle( wfMsg( strtolower( $wgTitle->getText() ) ) );
9292
9393 $t = $wgTitle->getDBKey();
9494 if ( in_array( $t, $wgValidSpecialPages ) ||
Index: trunk/phpwiki/newcodebase/SpecialStatistics.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "statistics" ) );
98 $wgOut->addHTML( "<p>(TODO: Statistics)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/Namespace.php
@@ -0,0 +1,65 @@
 2+<?
 3+# This is a utility class with only static functions
 4+# for dealing with namespaces. Everything is hardcoded,
 5+# and will have to be internationalized.
 6+#
 7+# Note "Special" is treated, well, specially, and doesn't
 8+# really fit into the system--it has to be tested for
 9+# independently.
 10+#
 11+$wgNamespaceNamesEn = array(
 12+ 0 => "", 1 => "Talk", 2 => "User", 3 => "User_talk",
 13+ 4 => "Wikipedia", 5 => "Wikipedia_talk"
 14+);
 15+
 16+class Namespace {
 17+
 18+ function getName( $index )
 19+ {
 20+ global $wgNamespaceNamesEn;
 21+ if ( -1 == $index ) { return "Special"; }
 22+ else { return $wgNamespaceNamesEn[$index]; }
 23+ }
 24+
 25+ function getIndex( $name )
 26+ {
 27+ global $wgNamespaceNamesEn;
 28+
 29+ foreach ( $wgNamespaceNamesEn as $i => $n ) {
 30+ if ( 0 == strcmp( $n, $name ) ) {
 31+ return $i;
 32+ }
 33+ }
 34+ return -1;
 35+ }
 36+
 37+ function isTalk( $index )
 38+ {
 39+ if ( 1 == $index || 3 == $index || 5 == $index ) {
 40+ return true;
 41+ }
 42+ return false;
 43+ }
 44+
 45+ # Get the talk namespace corresponding to the given index
 46+ #
 47+ function getTalk( $index )
 48+ {
 49+ if ( Namespace::isTalk( $index ) ) {
 50+ return $index;
 51+ } else {
 52+ return $index + 1;
 53+ }
 54+ }
 55+
 56+ function getSubject( $index )
 57+ {
 58+ if ( Namespace::isTalk( $index ) ) {
 59+ return $index - 1;
 60+ } else {
 61+ return $index;
 62+ }
 63+ }
 64+}
 65+
 66+?>
Property changes on: trunk/phpwiki/newcodebase/Namespace.php
___________________________________________________________________
Added: svn:eol-style
167 + native
Added: svn:keywords
268 + Author Date Id Revision
Index: trunk/phpwiki/newcodebase/UpdateClasses.php
@@ -1,8 +1,8 @@
22 <?
33 # See deferred.doc
44
5 -include_once( "./UserUpdate.php" );
6 -include_once( "./ViewCountUpdate.php" );
7 -include_once( "./SiteStatsUpdate.php" );
 5+include_once( "UserUpdate.php" );
 6+include_once( "ViewCountUpdate.php" );
 7+include_once( "SiteStatsUpdate.php" );
88
99 ?>
Index: trunk/phpwiki/newcodebase/SpecialRecentchangeslinked.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "recentchangeslinked" ) );
98 $wgOut->addHTML( "<p>(TODO: Recent changes linked)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialSpecialpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "specialpages" ) );
98 $wgOut->addHTML( "<p>(TODO: Special pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/docs/language.doc
@@ -0,0 +1,22 @@
 2+LANGUAGE.DOC
 3+
 4+THe Language object handles all readable text produced by the
 5+software. The most used function is getMessage(), usually
 6+called with the wrapper function wfMsg() which calls that method
 7+on the global language object. It just returns a piece of text
 8+given a text key. It is recommended that you use each key only
 9+once--bits of text in different contexts that happen to be
 10+identical in English may not be in other languages, so it's
 11+better to add new keys than to reuse them a lot. Likewise,
 12+if there is text that gets combined with things like names and
 13+titles, it is better to put markers like "$1" inside a piece
 14+of text and use str_replace() than to compose such messages in
 15+code.
 16+
 17+While the system is running, there will be one global language
 18+object, which will be a subtype of Language. The methods in
 19+these objects will return the native text requested if available,
 20+otherwise they fall back to sending English text (which is why
 21+the LanguageEn object has no code at all--it just inherits the
 22+English defaults of the Language base class.
 23+
Property changes on: trunk/phpwiki/newcodebase/docs/language.doc
___________________________________________________________________
Added: svn:eol-style
124 + native
Added: svn:keywords
225 + Author Date Id Revision
Index: trunk/phpwiki/newcodebase/SpecialPopularpages.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "popularpages" ) );
98 $wgOut->addHTML( "<p>(TODO: Popular pages)" );
109 }
1110
Index: trunk/phpwiki/newcodebase/SpecialContributions.php
@@ -4,7 +4,6 @@
55 {
66 global $wgUser, $wgOut;
77
8 - $wgOut->setPageTitle( wfMsg( "contributions" ) );
98 $wgOut->addHTML( "<p>(TODO: Contributions)" );
109 }
1110

Status & tagging log