r21 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r20‎ | r21 | r22 >
Date:14:51, 7 October 2001
Author:magnus_manske
Status:old
Tags:
Comment:
more fixed
Modified paths:
  • /trunk/phpwiki/fpw/specialPages.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiTitle.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiUser.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/specialPages.php
@@ -8,15 +8,22 @@
99
1010 function edit ( $title ) {
1111 global $EditBox , $SaveButton , $PreviewButton , $MinorEdit ;
12 - global $user , $CommentBox , $vpage ;
 12+ global $user , $CommentBox , $vpage , $EditTime ;
1313 $npage = new WikiPage ;
1414 $npage->title = $title ;
1515 $npage->makeAll () ;
1616 $ret = "" ;
1717 if ( !$vpage->canEdit() ) return "<h3>You cannot edit this page!</h3>" ;
1818
 19+ if ( $EditTime == "" ) $EditTime = date ( "YmdHis" ) ;
 20+
 21+
1922 if ( isset ( $SaveButton ) ) {
2023 unset ( $SaveButton ) ;
 24+ if ( $vpage->doesTopicExist() ) {
 25+ $lastTime = getMySQL ( "cur" , "cur_timestamp" , "cur_title=\"$vpage->secureTitle\"" ) ;
 26+ if ( tsc($EditTime) < tsc($lastTime) ) return "<h1>While you were typing, someone saved another version of this article!</h1>" ;
 27+ }
2128 $text = $EditBox ;
2229 $text = str_replace ( "\\'" , "'" , $text ) ;
2330 $text = str_replace ( "\\\"" , "\"" , $text ) ;
@@ -62,6 +69,7 @@
6370 $ret .= "<input tabindex=3 type=checkbox name=MinorEdit $checked value=1>This is a minor edit \n" ;
6471 $ret .= "<input tabindex=4 type=submit value=Save name=SaveButton> \n" ;
6572 $ret .= "<input tabindex=5 type=submit value=Preview name=PreviewButton>\n" ;
 73+ $ret .= "<input type=hidden value=\"$EditTime\" name=EditTime>\n" ;
6674 $ret .= "</form>" ;
6775
6876 return $ret.$append ;
@@ -81,7 +89,7 @@
8290 $action = "" ;
8391 $ret .= $vpage->getFooter() ;
8492 $action = "edit" ;
85 - if ( $wasSaved ) return view ( $title ) ;
 93+ if ( $wasSaved ) $ret .= "<h1>Your page was successfully saved!</h1><META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$PHP_SELF?title=$vpage->secureTitle\">" ;
8694 return $ret ;
8795 }
8896
@@ -176,7 +184,7 @@
177185 if ( isset ( $ButtonSave ) ) {
178186 unset ( $ButtonSave ) ;
179187 global $QuickBar , $NewTopics , $UnderlineLinks , $AutoTalk , $ShowHover , $ROWS , $COLS , $doSkin ;
180 - global $OLDPASSWORD , $NEWPASSWORD , $RETYPEPASSWORD , $EMAIL , $RESULTSPERPAGE , $doJustify ;
 188+ global $OLDPASSWORD , $NEWPASSWORD , $RETYPEPASSWORD , $EMAIL , $RESULTSPERPAGE , $doJustify , $ChangesLayout ;
181189 if ( $RESULTSPERPAGE < 2 ) $RESULTSPERPAGE = 20 ;
182190 $user->options["quickBar"] = $QuickBar ;
183191 $user->options["markupNewTopics"] = $NewTopics ;
@@ -188,6 +196,7 @@
189197 $user->options["justify"] = $doJustify ;
190198 $user->options["resultsPerPage"] = $RESULTSPERPAGE ;
191199 $user->options["skin"] = $doSkin ;
 200+ $user->options["changesLayout"] = $ChangesLayout ;
192201 $user->email = $EMAIL ;
193202
194203 if ( $OLDPASSWORD == $user->password ) {
@@ -275,14 +284,12 @@
276285 $ret .= "<input type=radio value=None ".$sk["None"]." name=doSkin>None (Standard)<br>\n" ;
277286 $ret .= "<input type=radio value=\"Star Trek\" ".$sk["Star Trek"]." name=doSkin>Star Trek<br>\n" ;
278287
279 - # ??
280 - $ret .= "</td>" ;
281 - $ret .= "<td></td></tr>" ;
282 -# $nt[$user->options["markupNewTopics"]] = "checked" ;
283 -# $ret .= "</td><td valign=top nowrap><b>New Topics :</b><br>\n" ;
284 -# $ret .= "<input type=radio value=normal ".$nt["normal"]." name=NewTopics>Normal (Standard)<br>\n" ;
285 -# $ret .= "<input type=radio value=red ".$nt["red"]." name=NewTopics>Red<br>\n" ;
286 -# $ret .= "</td></tr>" ;
 288+ # Changes layout
 289+ $cl[$user->options["changesLayout"]] = "checked" ;
 290+ $ret .= "</td><td valign=top nowrap><b>New Topics :</b><br>\n" ;
 291+ $ret .= "<input type=radio value=classic ".$cl["classic"]." name=ChangesLayout>Classic (Standard)<br>\n" ;
 292+ $ret .= "<input type=radio value=table ".$cl["table"]." name=ChangesLayout>As a table<br>\n" ;
 293+ $ret .= "</td></tr>" ;
287294
288295 $ret .= "<tr><td><center><input type=submit value=Save name=ButtonSave></center></td>" ;
289296 $ret .= "<td><center><input type=reset value=Reset name=ButtonReset></center></td></tr>" ;
@@ -588,7 +595,8 @@
589596 $xyz = new WikiTitle ;
590597 $editTypes = array ( "0"=>"" , "1"=>"<font color=green>M</font>" , "2"=>"<font color=red>N</font>" ) ;
591598 $ret = " (<b>Legend :</b> ".$editTypes["1"]."=Minor edit ; ".$editTypes["2"]."=New article.)" ;
592 - $ret .= "<table width=100% border=0 cellpadding=2 cellspacing=0>\n" ;
 599+ if ( $user->options["changesLayout"] == "table" ) $ret .= "<table width=100% border=0 cellpadding=2 cellspacing=0>\n" ;
 600+ else $ret .= "<ul>\n" ;
593601 $dummy = "$PHP_SELF?x=y" ;
594602 foreach ( $arr as $s ) {
595603 $nt = $xyz->getNiceTitle ( $s->cur_title ) ;
@@ -596,7 +604,8 @@
597605 $time = date ( "H:i" , tsc ( $s->cur_timestamp ) ) ;
598606 if ( $day != $lastDay ) {
599607 $lastDay = $day ;
600 - $ret .= "<tr><td width=100% colspan=6".$user->options["tabLine0"]."><b>$day</b></td></tr>" ;
 608+ if ( $user->options["changesLayout"] == "table" ) $ret.="<tr><td width=100% colspan=6".$user->options["tabLine0"]."><b>$day</b></td></tr>";
 609+ else $ret .= "</ul><b>$day</b><ul>\n" ;
601610 $color = $color1 ;
602611 }
603612 $u = $s->cur_user_text ;
@@ -608,33 +617,53 @@
609618 $comment = trim($s->cur_comment) ;
610619 if ( $comment == "*" ) $comment = "" ;
611620 if ( $s->cur_minor_edit == 1 ) $comment = "<font size=-1><i>$comment</i></font>" ;
612 -
613621 $minor = $editTypes[$s->cur_minor_edit] ;
614622
615 - $t = "<tr><td$color valign=top width=0%>" ;
 623+ if ( $user->options["changesLayout"] == "table" ) $t = "<tr><td$color valign=top width=0%>" ;
 624+ else $t = "<li>" ;
 625+
616626 if ( $s->version == "current" ) $t .= "<a href=\"$PHP_SELF?title=$s->cur_title&diff=yes\">(diff)</a>&nbsp;" ;
617627 else if ( $s->version != "" ) $t .= "<a href=\"$PHP_SELF?title=$s->cur_title&oldID=$s->old_id&version=$s->version&diff=yes\">(diff)</a>&nbsp;" ;
618628 else $t .= "<a href=\"$PHP_SELF?title=$s->cur_title&diff=yes\">(diff)</a>" ;
619 - $t .= "</td><td$color valign=top>" ;
 629+
 630+ if ( $user->options["changesLayout"] == "table" ) $t .= "</td><td$color valign=top>" ;
 631+ else $t .= " " ;
 632+
620633 if ( $s->version == "current" ) $t .= "<a href=\"$PHP_SELF?$s->cur_title\">$nt</a></td>" ;
621634 else if ( $s->version != "" ) $t .= "<a href=\"$PHP_SELF?$s->cur_title&oldID=$s->old_id&version=$s->version\">$nt ($s->version)</a></td>" ;
622635 else $t .= "<a href=\"$PHP_SELF?title=$s->cur_title\">$nt</a>" ;
623 - $t .= "<td$color valign=top width=0% nowrap>$time</td>" ;
 636+
 637+ if ( $user->options["changesLayout"] == "table" ) $t .= "<td$color valign=top width=0% nowrap>$time</td>" ;
 638+ else $t = str_replace ( "</td>" , "; " , $t ) . " ($time) " ;
624639 if ( $s->version != "" ) {
625640 $v = new wikiTitle ;
626641 $v->title = $s->cur_user_text ;
627642 $v->makeSecureTitle () ;
628 - if ( $s->cur_user == 0 ) $t .= "<td$color valign=top nowrap>$s->cur_user_text!!</td>" ;
629 - else $t .= "<td$color valign=top nowrap><a href=\"$PHP_SELF?title=user:$v->secureTitle\">$s->cur_user_text</a></td>" ;
 643+ if ( $user->options["changesLayout"] == "table" ) $t .= "<td$color valign=top nowrap>" ;
 644+ if ( $s->cur_user == 0 ) $t .= "$s->cur_user_text!!</td>" ;
 645+ else $t .= "<a href=\"$PHP_SELF?title=user:$v->secureTitle\">$s->cur_user_text</a></td>" ;
 646+ if ( $user->options["changesLayout"] == "table" ) $t .= "</td>" ;
 647+ else $t .= "; " ;
630648 }
631 - else $t .= "<td$color valign=top nowrap>$u</td>" ;
632 - $t .= "<td$color valign=top>$minor</td>" ;
633 - $t .= "<td$color >$comment</td>" ;
634 - $ret .= $t."</tr>\n" ;
 649+ else {
 650+ if ( $user->options["changesLayout"] == "table" ) $t .= "<td$color valign=top nowrap>$u</td>" ;
 651+ else $t .= $u ;
 652+ }
 653+ if ( $user->options["changesLayout"] == "table" ) $t .= "<td$color valign=top>$minor</td>" ;
 654+ else $t .= " $minor" ;
 655+ if ( $user->options["changesLayout"] == "table" ) $t .= "<td$color >$comment</td>" ;
 656+ else $t .= " <b>$comment</b>" ;
 657+ if ( $user->options["changesLayout"] == "table" ) $t .= "</tr>\n" ;
 658+ else $t .= "</li>\n" ;
 659+ $ret .= $t ;
635660 if ( $color == $color1 ) $color = $color2 ;
636661 else $color = $color1 ;
637662 }
638 - $ret .= "</table>" ;
 663+ if ( $user->options["changesLayout"] == "table" ) $ret .= "</table>" ;
 664+ else {
 665+ $ret = "$ret</ul>\n" ;
 666+ $ret = str_replace ( "</td>" , "" , $ret ) ;
 667+ }
639668 return "<nowiki>$ret</nowiki>" ;
640669 }
641670
@@ -1002,7 +1031,7 @@
10031032 return $ret ;
10041033 }
10051034
1006 -# select old_id,old_title,old_timestamp,old_old_version from old order by old_timestamp desc
 1035+# A little hack; disabled; to enable, allow function call in wikiPage->load()
10071036 function askSQL () {
10081037 global $Save , $question ;
10091038 $ret = "" ;
Index: trunk/phpwiki/fpw/wikiPage.php
@@ -10,7 +10,27 @@
1111 $this->isSpecialPage = false ;
1212 $this->revision = "current" ;
1313 if ( $this->namespace == "special" ) {
 14+ $allowed = array () ; # I know this is crude, but...
 15+ array_push ( $allowed , "userlogin" ) ;
 16+ array_push ( $allowed , "userlogout" ) ;
 17+ array_push ( $allowed , "recentchanges" ) ;
 18+ array_push ( $allowed , "upload" ) ;
 19+ array_push ( $allowed , "statistics" ) ;
 20+ array_push ( $allowed , "lonelypages" ) ;
 21+ array_push ( $allowed , "wantedpages" ) ;
 22+ array_push ( $allowed , "allpages" ) ;
 23+ array_push ( $allowed , "randompage" ) ;
 24+ array_push ( $allowed , "shortpages" ) ;
 25+ array_push ( $allowed , "listusers" ) ;
 26+ array_push ( $allowed , "watchlist" ) ;
 27+ array_push ( $allowed , "special_pages" ) ;
 28+ array_push ( $allowed , "editusersettings" ) ;
1429 $call = $this->mainTitle ;
 30+ if ( !in_array ( strtolower ( $call ) , $allowed ) ) {
 31+ $this->isSpecialPage = true ;
 32+ $this->contents = "<h1>No such special page \"$call\"!</h1>" ;
 33+ return ;
 34+ }
1535 $this->title = $call ;
1636 $this->contents = $call () ;
1737 $this->isSpecialPage = true ;
@@ -79,6 +99,34 @@
80100 if ( count ( $a ) > 0 ) array_unshift ( $a , "[[$mother]]" ) ;
81101 return $a ;
82102 }
 103+ function getOtherNamespaces () {
 104+ $a = array () ;
 105+ if ( $this->isSpecialPage ) return $a ;
 106+ $n = explode ( ":" , $this->secureTitle ) ;
 107+ if ( count ( $n ) == 1 ) $n = $n[0] ;
 108+ else $n = $n[1] ;
 109+ $connection = getDBconnection () ;
 110+ mysql_select_db ( "wikipedia" , $connection ) ;
 111+ $sql = "SELECT cur_title FROM cur WHERE cur_title LIKE \"%:$n\"" ;
 112+ $result = mysql_query ( $sql , $connection ) ;
 113+ $u = new WikiTitle ;
 114+ if ( $this->namespace != "" ) {
 115+ $dummy = new wikiTitle ;
 116+ $dummy->setTitle ( $n ) ;
 117+ if ( $dummy->doesTopicExist ( $connection ) )
 118+ array_push ( $a , "<a style=\"color:green;text-decoration:none\" href=\"$PHP_SELF?title=$n\">:".$this->getNiceTitle($n)."</a>" ) ;
 119+ }
 120+ if ( $this->namespace != "talk" ) array_push ( $a , "<a style=\"color:green;text-decoration:none\" href=\"$PHP_SELF?title=talk:$n\">Talk</a>" ) ;
 121+ while ( $s = mysql_fetch_object ( $result ) ) {
 122+ $t = explode ( ":" , $s->cur_title ) ;
 123+ $t = $u->getNiceTitle ( $t[0] ) ;
 124+ if ( strtolower ( $t ) != "talk" and strtolower ( $t ) != $this->namespace )
 125+ array_push ( $a , "<a style=\"color:green;text-decoration:none\" href=\"$PHP_SELF?title=$t:$n\">$t</a>" ) ;
 126+ }
 127+ if ( $result != "" ) mysql_free_result ( $result ) ;
 128+ mysql_close ( $connection ) ;
 129+ return $a ;
 130+ }
83131 function ensureExistence () {
84132 $this->makeSecureTitle () ;
85133 if ( $this->doesTopicExist() ) return ;
@@ -144,7 +192,7 @@
145193 $link = $this->getLinkTo ( $topic ) ;
146194 $topic->setTitle ( $link ) ;
147195
148 - if ( count ( $c ) == 1 ) array_push ( $c , $topic->getNiceTitle($topic->secureTitle) ) ;
 196+ if ( count ( $c ) == 1 ) array_push ( $c , $topic->getMainTitle() ) ;
149197 $text = $c[1] ;
150198
151199
@@ -176,8 +224,6 @@
177225 return $s ;
178226 }
179227 function replaceExternalLinks ( $s ) {
180 -# $s = ereg_replace ( "\[http://([^] ]*) ([^]]*)\]" , "<a href=\"http://\\1\">\\2</a>" , $s ) ;
181 -# $s = ereg_replace ( "http://([a-zA-Z0-9_/=?:.]*)\.(htm|html|cgi)" , "<a href=\"http://\\1.\\2\">\\1.\\2</a>" , $s ) ;
182228 global $user ;
183229 $cnt = 1 ;
184230 $a = explode ( "[http://" , " ".$s ) ;
@@ -204,8 +250,8 @@
205251 }
206252 }
207253
208 -# $o = "A-Za-z0-9/\.:?&=~%-@^" ;
209 -# $s = eregi_replace ( "([^~])http://([$o]+)([^$o])" , "\\1<a href=\"http://\\2\">http://\\2</a>\\3" , $s ) ;
 254+ $o = "A-Za-z0-9/\.:?&=~%-@^" ;
 255+ $s = eregi_replace ( "([^~])http://([$o]+)([^$o])" , "\\1<a href=\"http://\\2\">http://\\2</a>\\3" , $s ) ;
210256 $s = str_replace ( "~http://" , "http://" , $s ) ;
211257
212258 return $s ;
@@ -265,19 +311,26 @@
266312 }
267313 return $s ;
268314 }
269 - function subParseContents ( $s ) {
270 - global $user ;
271 - $s = ereg_replace ( "([^=|\[])([a-z]*[A-Z]+[a-z]+[A-Z]+[A-Za-z]*)( |\n|\.)" , "\\1[[\\2]]\\3" , $s ) ;
 315+ function removeHTMLtags ( $s ) {
272316 $s = eregi_replace ( "<a (.*)>" , "&lt;a \\1&gt;" , $s ) ;
273317 $s = eregi_replace ( "</a(.*)>" , "&lt;/a\\1&gt;" , $s ) ;
274318 $s = eregi_replace ( "<script(.*)>" , "&lt;script\\1&gt;" , $s ) ;
275319 $s = eregi_replace ( "</script(.*)>" , "&lt;/script\\1&gt;" , $s ) ;
 320+ return $s ;
 321+ }
 322+ function subParseContents ( $s ) {
 323+ global $user ;
 324+# Removed autoLink for mixedThings; wasn't working, anyway...
 325+# $s = ereg_replace ( "([\.|\n| )([a-z0-9]*[A-Z0-9]+[A-Za-z0-9]*)( |\n|\.)" , "\\1[[\\2]]\\3" , $s ) ;
 326+ $s = $this->removeHTMLtags ( $s ) ;
276327 $s = ereg_replace ( "-----*" , "<hr>" , $s ) ;
277328 $s = str_replace ( "<HR>" , "<hr>" , $s ) ;
278329 $s = $this->replaceVariables ( $s ) ;
279330 $s = $this->pingPongReplace ( "'''" , "<b>" , "</b>" , $s ) ;
280331 $s = $this->pingPongReplace ( "''" , "<i>" , "</i>" , $s ) ;
281332
 333+ $s = ereg_replace ( "([\n| ])/([a-zA-Z0-9_]*)" , "\\1[[/\\2|/\\2]]" , $s ) ;
 334+
282335 $justify = "" ;
283336 if ( $user->options["justify"] == "yes" ) $justify = " align=justify" ;
284337 $a = explode ( "\n" , $s ) ;
@@ -410,9 +463,10 @@
411464 $column .= "<a href=\"$PHP_SELF?title=HomePage\">HomePage</a>\n" ;
412465 $column .= "<br><a href=\"$PHP_SELF?title=special:RecentChanges\">Recent Changes</a>\n" ;
413466 if ( $this->canEdit() ) $column .= "<br><a href=\"$PHP_SELF?action=edit&title=$this->url\">Edit this page</a>\n" ;
414 - if ( $this->canDelete() ) $column .= "<br><a href=\"$PHP_SELF?action=deletepage&title=$this->url\">Delete this page</a>\n" ;
415 - if ( $this->canProtect() ) $column .= "<br><a href=\"$PHP_SELF?action=protectpage&title=$this->url\">Protect this page</a>\n" ;
416 - if ( $this->canAdvance() ) $column .= "<br><a href=\"$PHP_SELF?title=special:Advance&topic=$this->safeTitle\">Advance</a>\n" ;
 467+# No user management due to request of Larry
 468+# if ( $this->canDelete() ) $column .= "<br><a href=\"$PHP_SELF?action=deletepage&title=$this->url\">Delete this page</a>\n" ;
 469+# if ( $this->canProtect() ) $column .= "<br><a href=\"$PHP_SELF?action=protectpage&title=$this->url\">Protect this page</a>\n" ;
 470+# if ( $this->canAdvance() ) $column .= "<br><a href=\"$PHP_SELF?title=special:Advance&topic=$this->safeTitle\">Advance</a>\n" ;
417471 if ( !$this->isSpecialPage ) $column .= "<br><a href=\"$PHP_SELF?action=history&title=$this->url\">History</a>\n" ;
418472 $column .= "<br><a href=\"$PHP_SELF?title=special:Upload\">Upload files</a>\n" ;
419473 $column .= "<hr>" ;
@@ -426,6 +480,8 @@
427481 if ( $user->isLoggedIn ) {
428482 $column .= "<br>\n<a href=\"$PHP_SELF?title=special:WatchList\">My watchlist</a>" ;
429483 }
 484+ $a = $this->getOtherNamespaces () ;
 485+ if ( count ( $a ) > 0 ) $column .= "<hr>".implode ( "<br>\n" , $a ) ;
430486 return $column."</nowiki>" ;
431487 }
432488 function getMiddle ( $ret ) {
@@ -437,7 +493,7 @@
438494 $spl = $this->getSubpageList () ;
439495 if ( count ( $spl ) > 0 ) $column .= "<font size=-1>".$this->parseContents ( "<hr>".implode ( "<br>\n" , $spl ) )."</font>" ;
440496
441 - $column = "<td ".$user->options["quickBarBackground"]." width=110 valign=top nowrap>".$column."</td>" ;
 497+ $column = "<td ".$user->options["quickBarBackground"]." width=120 valign=top nowrap>".$column."</td>" ;
442498 $ret = "<td valign=top>".$ret."</td>" ;
443499 global $HTTP_USER_AGENT ;
444500 if ( stristr ( $HTTP_USER_AGENT , "MSIE" ) ) $border = "border=1 frame=void rules=cols" ;
@@ -457,6 +513,9 @@
458514 if ( stristr ( $HTTP_USER_AGENT , "MSIE" ) ) $border = "border=1 frame=above rules=none" ;
459515 else $border = "border=0" ;
460516 $ret = "<table width=100% $border bordercolor=black cellspacing=0><tr><td>$ret</td></tr></table>" ;
 517+ if ( !$this->isSpecialPage ) $ret .= "<a href=\"$PHP_SELF?title=$this->secureTitle&diff=yes\">(diff)</a> " ;
 518+ $a = $this->getOtherNamespaces () ;
 519+ if ( count ( $a ) > 0 ) $ret .= "Other namespaces : ".implode ( " | " , $a ) ;
461520 $ret .= "<FORM>Search: <INPUT TYPE=text NAME=search SIZE=20></FORM>" ;
462521 return $ret ;
463522 }
@@ -483,8 +542,8 @@
484543 $sql = "SELECT cur_old_version FROM cur WHERE cur_title=\"$this->secureTitle\"" ;
485544 $result = mysql_query ( $sql , $connection ) ;
486545 $s = mysql_fetch_object ( $result ) ;
487 - $s->old_old_version = 1234567 ; #Dummy
488546 $sql = "SELECT * FROM old WHERE old_id=$s->cur_old_version" ;
 547+ $s->old_old_version = $s->cur_old_version ;
489548 }
490549
491550 $fc = $user->options["background"] ;
@@ -509,6 +568,7 @@
510569 foreach ( $dl as $x ) $ret .= "<tr><td bgcolor=#DD0000><font$fc>$x</font></td></tr>\n" ;
511570 $ret .= "</table>\n" ;
512571 } else if ( isset ( $oldID ) and $s->old_old_version == 0 ) $ret .= "This is the first version of this article. All text is new!<br>\n" ;
 572+ else if ( !isset ( $oldID ) ) $ret .= "This is the first version of this article. All text is new!<br>\n" ;
513573 else $ret .= "No diff possible. Reason unknown. Blame the programmer! Tell him SQL said \"$sql\"<br>\n" ;
514574 mysql_close ( $connection ) ;
515575
Index: trunk/phpwiki/fpw/wikiUser.php
@@ -69,6 +69,7 @@
7070 if ( $this->options["autoTalk"] == "" ) $this->options["autoTalk"] = "no" ;
7171 if ( $this->options["cols"] == "" ) $this->options["cols"] = "60" ;
7272 if ( $this->options["rows"] == "" ) $this->options["rows"] = "20" ;
 73+ if ( $this->options["changesLayout"] == "" ) $this->options["changesLayout"] = "classic" ;
7374 if ( $this->options["justify"] == "" ) $this->options["justify"] = "no" ;
7475 if ( $this->options["resultsPerPage"] == "" ) $this->options["resultsPerPage"] = "20" ;
7576 if ( $this->options["skin"] == "" ) $this->options["skin"] = "None" ;
Index: trunk/phpwiki/fpw/wikiTitle.php
@@ -11,6 +11,11 @@
1212 if ( !$this->validateTitle() ) return false ;
1313 if ( $this->isSpecialPage and $action != "edit" ) return false ;
1414 if ( $this->namespace == "special" ) return false ;
 15+
 16+ # Allowing only a handful of namespaces
 17+ $allowed = array ( "wikipedia" , "talk" , "user" , "" ) ;
 18+ if ( !in_array ( strtolower ( $this->namespace ) , $allowed ) ) return false ;
 19+
1520 return true ;
1621 }
1722 function canDelete () {
@@ -94,6 +99,12 @@
95100 }
96101 function makeAll () { $this->makeSecureTitle(); $this->makeURL(); }
97102 function setTitle ( $t ) { $this->title = $t ; $this->makeAll() ; }
 103+ function getMainTitle () {
 104+ $r = $this->title ;
 105+ if ( $this->hasNamespace and $this->namespace != "" ) $r = $this->namespace.":$r" ;
 106+ if ( $this->subpageTitle != "" ) $r .= "/".$this->subpageTitle ;
 107+ return $r ;
 108+ }
98109 function doesTopicExist ( $conn = "" ) {
99110 $this->makeSecureTitle () ;
100111 if ( $this->namespace == "special" ) return true ;

Status & tagging log