r31 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30‎ | r31 | r32 >
Date:14:26, 3 November 2001
Author:magnus_manske
Status:old
Tags:
Comment:
small changes and fixes
Modified paths:
  • /trunk/phpwiki/fpw/basicFunctions.php (modified) (history)
  • /trunk/phpwiki/fpw/databaseFunctions.php (modified) (history)
  • /trunk/phpwiki/fpw/specialPages.php (modified) (history)
  • /trunk/phpwiki/fpw/wiki.phtml (modified) (history)
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiTitle.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/wikiTitle.php
@@ -81,8 +81,8 @@
8282 }
8383
8484 # Converts a secure title back to a nice-looking one
85 - function getNiceTitle ( $s ) {
86 - if ( !isset ( $s ) ) $s = $this->secureTitle ;
 85+ function getNiceTitle ( $s = "" ) {
 86+ if ( $s == "" ) $s = $this->secureTitle ;
8787 $s = str_replace ( "_" , " " , $s ) ;
8888 $s = str_replace ( "\\'" , "'" , $s ) ;
8989 $s = str_replace ( "\\\\" , "\\" , $s ) ;
Index: trunk/phpwiki/fpw/basicFunctions.php
@@ -3,7 +3,7 @@
44 function error ( $error ) {
55 $page = new WikiPage ;
66 $page->special ( "Yikes! An error!" ) ;
7 - $page->contents = "<h2>$error!</h2>Return to the [[:HomePage|HomePage]]!" ;
 7+ $page->contents = "<h2>$error!</h2>Return to the [[:Main Page|Main Page]]!" ;
88 return $page->renderPage () ;
99 }
1010
@@ -21,42 +21,60 @@
2222 # Called when editing/saving a page
2323 function edit ( $title ) {
2424 global $EditBox , $SaveButton , $PreviewButton , $MinorEdit ;
25 - global $user , $CommentBox , $vpage , $EditTime ;
 25+ global $user , $CommentBox , $vpage , $EditTime , $THESCRIPT ;
2626 $npage = new WikiPage ;
2727 $npage->title = $title ;
2828 $npage->makeAll () ;
2929 $ret = "" ;
3030 if ( !$vpage->canEdit() ) return "<h3>You cannot edit this page!</h3>" ; # Check for allowance
31 -
3231 if ( $EditTime == "" ) $EditTime = date ( "YmdHis" ) ; # Stored for edit conflict detection
 32+ $editConflict = false ;
3333
3434 if ( isset ( $SaveButton ) ) { # The edit is finished, someone pressed the "Save" button
3535 unset ( $SaveButton ) ;
 36+ $doSave = true ;
3637 if ( $vpage->doesTopicExist() ) {
3738 $lastTime = getMySQL ( "cur" , "cur_timestamp" , "cur_title=\"$vpage->secureTitle\"" ) ;
38 - if ( tsc($EditTime) < tsc($lastTime) ) return "<h1>While you were typing, someone saved another version of this article!</h1>" ;
 39+ if ( tsc($EditTime) < tsc($lastTime) ) {
 40+ $doSave = false ;
 41+ $ret .= "<h1>Edit conflict!</h1>\n" ;
 42+ $ret .= "<b>Someone saved this page after you started editing. The top textbox contains the saved text. " ;
 43+ $ret .= "Only the text in the top textbox will be saved.</b><br>\n" ;
 44+ $ret .= "Scroll down to see your edited text.<br>\n" ;
 45+ $oldSubmittedText = $EditBox ;
 46+ $oldSubmittedText = str_replace ( "\\'" , "'" , $oldSubmittedText ) ;
 47+ $oldSubmittedText = str_replace ( "\\\"" , "\"" , $oldSubmittedText ) ;
 48+ $EditTime = date ( "YmdHis" ) ; # reset time counter
 49+ $npage->load ( $npage->title ) ;
 50+ $text = $npage->contents ;
 51+ $editConflict = true ;
 52+ }
3953 }
40 - $text = $EditBox ;
41 - $text = str_replace ( "\\'" , "'" , $text ) ;
42 - $text = str_replace ( "\\\"" , "\"" , $text ) ;
43 - if ( $user->isLoggedIn ) $text = str_replace ( "~~~" , "[[user:$user->name|$user->name]]" , $text ) ;
44 - else $text = str_replace ( "~~~" , $user->getLink() , $text ) ;
45 - $title = str_replace ( "\\'" , "'" , $title ) ;
46 - $title = str_replace ( "\\\"" , "\"" , $title ) ;
47 - $npage->title = $title ;
48 - $npage->makeAll () ;
49 - if ( $npage->doesTopicExist() ) $npage->backup() ;
50 - else { $MinorEdit = 2 ; $npage->ensureExistence () ; }
51 - if ( !$user->isLoggedIn ) $npage->setEntry ( $text , $CommentBox , 0 , $user->getLink() , $MinorEdit*1 ) ;
52 - else $npage->setEntry ( $text , $CommentBox , $user->id , $user->name , $MinorEdit*1 ) ;
53 - global $wasSaved ;
54 - $wasSaved = true ;
55 - return "" ;
 54+ if ( $doSave ) {
 55+ $text = $EditBox ;
 56+ $text = str_replace ( "\\'" , "'" , $text ) ;
 57+ $text = str_replace ( "\\\"" , "\"" , $text ) ;
 58+ $text = str_replace ( "&" , "&amp;" , $text ) ;
 59+ if ( $user->isLoggedIn ) $text = str_replace ( "~~~" , "[[user:$user->name|$user->name]]" , $text ) ;
 60+ else $text = str_replace ( "~~~" , $user->getLink() , $text ) ;
 61+ $title = str_replace ( "\\'" , "'" , $title ) ;
 62+ $title = str_replace ( "\\\"" , "\"" , $title ) ;
 63+ $npage->title = $title ;
 64+ $npage->makeAll () ;
 65+ if ( $npage->doesTopicExist() ) $npage->backup() ;
 66+ else { $MinorEdit = 2 ; $npage->ensureExistence () ; }
 67+ if ( !$user->isLoggedIn ) $npage->setEntry ( $text , $CommentBox , 0 , $user->getLink() , $MinorEdit*1 ) ;
 68+ else $npage->setEntry ( $text , $CommentBox , $user->id , $user->name , $MinorEdit*1 ) ;
 69+ global $wasSaved ;
 70+ $wasSaved = true ;
 71+ return "" ;
 72+ }
5673 } else if ( isset ( $PreviewButton ) ) { # Generating a preview to append to the page
5774 unset ( $PreviewButton ) ;
5875 $text = $EditBox ;
5976 $text = str_replace ( "\\'" , "'" , $text ) ;
6077 $text = str_replace ( "\\\"" , "\"" , $text ) ;
 78+ $text = str_replace ( "&" , "&amp;" , $text ) ;
6179 $append = "<hr>\n<h2>Preview :</h2>\n".$npage->parseContents($text)."<hr><h3>Remember, this is only a preview and not yet saved!</h3>" ;
6280 } else if ( $npage->doesTopicExist() ) { # The initial edit request for an existing page
6381 $npage->load ( $npage->title ) ;
@@ -69,21 +87,25 @@
7088 else $checked = "" ;
7189 if ( $CommentBox == "" ) $CommentBox = "*" ;
7290
73 -
7491 # Just trying to set the initial keyboard focus to the edit window; doesn't work, though...
7592 global $bodyOptions , $headerScript ;
7693 $headerScript = "<script> <!-- function setfocus() { document.f.EditBox.focus(); } --> </script>" ;
7794 $bodyOptions = " onLoad=setfocus()" ;
7895
7996 $ret .= "<form method=POST name=f>" ;
80 - $ret .= "<textarea tabindex=1 name=EditBox rows=".$user->options["rows"]." cols=".$user->options["cols"]." STYLE=\"width:100%\" WRAP=virtual>$text</textarea><br>\n" ;
 97+ $ret .= "<textarea tabindex=1 name=EditBox rows=".$user->options["rows"]." cols=".$user->options["cols"]." STYLE=\"width:100%\" WRAP=virtual>".$text."</textarea><br>\n" ;
8198 $ret .= "Summary:<input tabindex=2 type=text value=\"$CommentBox\" name=CommentBox size=50 maxlength=200> \n" ;
8299 $ret .= "<input tabindex=3 type=checkbox name=MinorEdit $checked value=1>This is a minor edit \n" ;
83100 $ret .= "<input tabindex=4 type=submit value=Save name=SaveButton> \n" ;
84101 $ret .= "<input tabindex=5 type=submit value=Preview name=PreviewButton>\n" ;
85102 $ret .= "<input type=hidden value=\"$EditTime\" name=EditTime>\n" ;
86 - $ret .= "</form>" ;
87103
 104+ if ( $editConflict ) {
 105+ $ret .= "<br><hr><br><b>This is the text you submitted :</b><br>\n" ;
 106+ $ret .= "<textarea name=NotIMPORTANT rows=".$user->options["rows"]." cols=".$user->options["cols"]." STYLE=\"width:100%\" WRAP=virtual>$oldSubmittedText</textarea><br>\n" ;
 107+ }
 108+ $ret .= " <a href=\"$THESCRIPT?title=$vpage->secureTitle\"><i>Return without saving changes</i></a></form>" ;
 109+
88110 return $ret.$append ;
89111 }
90112
@@ -104,7 +126,7 @@
105127 $ti = new wikiTitle ;
106128 $ti->setTitle ( $title ) ;
107129 $theMiddle = "<h1>Your page <a href=\"$THESCRIPT?title=$ti->secureTitle\">$title</a> was successfully saved!</h1>" ;
108 - $theMiddle .= "(If this page doesn't forward automatically, you have a really lame browser...)" ;
 130+ $theMiddle .= "(If this page doesn't forward automatically, please click on the link above)" ;
109131 $headerScript .= "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=$THESCRIPT?title=$vpage->secureTitle\">";
110132 }
111133 $ret .= $vpage->getMiddle ( $theMiddle ) ;
Index: trunk/phpwiki/fpw/databaseFunctions.php
@@ -1,8 +1,8 @@
22 <?
33 function getDBconnection () {
44 $server="127.0.0.1" ;
5 - $user="root" ;
6 - $passwd="" ;
 5+ $user="manske" ;
 6+ $passwd="KMnO4" ;
77 $connection=mysql_connect ( $server , $user , $passwd ) ;
88 return $connection ;
99 }
Index: trunk/phpwiki/fpw/specialPages.php
@@ -99,7 +99,7 @@
100100 global $ButtonSave ;
101101 global $vpage , $user ;
102102 $vpage->title = "User Settings" ;
103 - if ( !$user->isLoggedIn ) return "You are not logged in! [[special:userLogin|Log in]] or go to the [[:HomePage|Home Page]]" ;
 103+ if ( !$user->isLoggedIn ) return "You are not logged in! [[special:userLogin|Log in]] or go to the [[:Main Page|Main Page]]" ;
104104 $ret = "" ;
105105
106106 if ( isset ( $ButtonSave ) ) {
@@ -240,7 +240,7 @@
241241 $vpage->special ( "The Most Wanted Pages" ) ;
242242 $vpage->namespace = "" ;
243243 $allPages = array () ;
244 - $ret = "'''These articles don't exist, but other articles link to them!''' (the top 50)\n\n" ;
 244+ $ret = "'''These articles don't exist, but other articles link to them!''' (the top 50)<br>\n" ;
245245
246246 $connection = getDBconnection () ;
247247 mysql_select_db ( "wikipedia" , $connection ) ;
@@ -248,7 +248,6 @@
249249 $result = mysql_query ( $sql , $connection ) ;
250250 while ( $s = mysql_fetch_object ( $result ) ) {
251251 $allPages[$s->cur_title] = -999999999999 ; # Effectively removing existing topics from list
252 - $u = explode ( "\n" , $s->cur_linked_links ) ; foreach ( $u as $x ) $allPages[$x] += 1 ;
253252 $u = explode ( "\n" , $s->cur_unlinked_links ) ; foreach ( $u as $x ) $allPages[$x] += 1 ;
254253 }
255254 mysql_free_result ( $result ) ;
@@ -256,12 +255,20 @@
257256
258257
259258 arsort ( $allPages ) ;
260 - array_shift ( $allPages ) ; # Removing blank "link"
 259+ $allPages = array_slice ( $allPages , 0 , 200 ) ; # Reducing needed memory
 260+ $ti = new wikiTitle ;
261261 $k = array_keys ( $allPages ) ;
262 - for ( $a = 0 ; $a < 50 ; $a++ ) {
 262+
 263+ $a = 0 ;
 264+ $o = array () ;
 265+ while ( count ( $o ) < 50 ) {
263266 $x = $k[$a] ;
264 - $ret .= "[[$x|".$vpage->getNiceTitle($x)."]] is wanted by ".$allPages[$x]." articles.<br>\n" ;
 267+ $a++ ;
 268+ $ti->setTitle ( $x ) ;
 269+ if ( $x != "" and !$ti->doesTopicExist() )
 270+ array_push ( $o , "<li><a href=\"$THESCRIPT?action=edit&title=$x\">".$ti->getNiceTitle($x)."</a> is wanted by ".$allPages[$x]." articles.</li>\n" ) ;
265271 }
 272+ $ret .= "<nowiki><ol>".implode ( "" , $o )."</ol></nowiki>" ;
266273 return $ret ;
267274 }
268275
@@ -271,7 +278,7 @@
272279 $vpage->special ( "The Orphans" ) ;
273280 $vpage->namespace = "" ;
274281 $allPages = array () ;
275 - $ret = "'''These articles exist, but no articles link to them!'''\n\n" ;
 282+ $ret = "'''These articles exist, but no articles link to them!''' (the first 50)\n\n" ;
276283
277284 $connection = getDBconnection () ;
278285 mysql_select_db ( "wikipedia" , $connection ) ;
@@ -284,7 +291,10 @@
285292 }
286293 mysql_free_result ( $result ) ;
287294 mysql_close ( $connection ) ;
288 -
 295+
 296+ asort ( $allPages ) ;
 297+ $allPages = array_slice ( $allPages , 0 , 50 ) ;
 298+
289299 $orphans = array () ;
290300 $v = array_keys ( $allPages ) ;
291301 foreach ( $v as $x ) {
@@ -825,7 +835,7 @@
826836 $message = "File <b>$removeFile</b> deleted!" ;
827837 unset ( $removeFile ) ;
828838 } else if (isset($Upload_name) or isset($Upload)) {
829 - if ( $no_copyright != "AFFIRMED" ) return "You need to affirm that the file is not violating copygights. Return to the <a href=\"$THESCRIPT?action=upload\">Upload page</a>" ;
 839+ if ( $no_copyright != "AFFIRMED" ) return "<nowiki>You need to affirm that the file is not violating copygights. Return to the <a href=\"$THESCRIPT?title=special:upload\">Upload page</a></nowiki>" ;
830840 $Upload_name = ereg_replace(" ", "_", $Upload_name);
831841 $abc = split("\.", $Upload_name);
832842
Index: trunk/phpwiki/fpw/wiki.phtml
@@ -11,6 +11,18 @@
1212 include_once ( "./wikiPage.php" ) ;
1313 include_once ( "./wikiUser.php" ) ;
1414
 15+# Checking for talk subpage
 16+function fixTalk ( $title ) {
 17+ $sp = explode ( "/" , $title ) ;
 18+ $ns = explode ( ":" , $title ) ;
 19+ $lsp = array_pop ( $sp ) ;
 20+ if ( strtolower ( $lsp ) == "talk" and count ( $sp ) > 0 ) {
 21+ if ( count ( $ns ) == 1 or strtolower ( $ns[0] ) == "talk" )
 22+ $title = "talk:".implode ( "/" , $sp ) ;
 23+ }
 24+ return $title ;
 25+ }
 26+
1527 # Main program
1628 global $action , $title , $pageTitle ;
1729 global $user , $search , $expiration ;
@@ -24,8 +36,9 @@
2537
2638 # Default settings
2739 if ( $action == "" ) $action = "view" ;
28 - if ( $title == "" ) $title = "HomePage" ;
29 -
 40+ if ( $title == "" ) $title = "Main Page" ;
 41+
 42+ $title = fixTalk ( $title ) ;
3043 $theTitle = new wikiTitle ;
3144 $theTitle->title = urldecode ( $title ) ;
3245 $theTitle->makeSecureTitle () ;
Index: trunk/phpwiki/fpw/wikiPage.php
@@ -4,6 +4,7 @@
55
66 class WikiPage extends WikiTitle {
77 var $contents ; # The actual article body
 8+ var $backLink ; # For redirects
89 var $knownLinkedLinks , $knownUnlinkedLinks ; # Used for faster display
910
1011 #### Database management functions
@@ -11,6 +12,7 @@
1213 # This loads an article from the database, or calls a special function instead (all pages with "special:" namespace)
1314 function load ( $t , $doRedirect = true ) {
1415 global $action , $user ;
 16+ if ( $doRedirect ) $this->backLink = "" ;
1517 $this->knownLinkedLinks = array () ;
1618 $this->knownUnlinkedLinks = array () ;
1719 $this->title = $t ;
@@ -65,11 +67,13 @@
6668 $this->makeURL () ;
6769 $this->splitTitle () ;
6870 if ( strtolower ( substr ( $this->contents , 0 , 9 ) ) == "#redirect" and $doRedirect and $action != "edit" ) { # #REDIRECT
 71+ $this->backLink = "(redirected from <a href=\"$THESCRIPT?action=edit&title=$this->secureTitle\">".$this->getNiceTitle()."</a>)" ;
6972 $z = $this->contents ;
70 - $z = strstr ( $z , "[[" ) ;
71 - $z = str_replace ( "[[" , "" , $z ) ;
72 - $z = str_replace ( "]]" , "" , $z ) ;
73 - $this->load ( trim($z) , false ) ;
 73+# $z = strstr ( $z , "[[" ) ;
 74+ $z = substr ( $z , 10 ) ;
 75+ $z = str_replace ( "[" , "" , $z ) ;
 76+ $z = str_replace ( "]" , "" , $z ) ;
 77+ $this->load ( trim($z) , false , $backLink ) ;
7478 }
7579 }
7680
@@ -199,7 +203,7 @@
200204 }
201205
202206 #### Rendering functions
203 - # This function converts wiki-style internal links like [[HomePage]] with the appropriate HTML code
 207+ # This function converts wiki-style internal links like [[Main Page]] with the appropriate HTML code
204208 # It has to handle namespaces, subpages, and alternate names (as in [[namespace:page/subpage name]])
205209 function replaceInternalLinks ( $s ) {
206210 global $THESCRIPT ;
@@ -253,7 +257,7 @@
254258
255259 # This function replaces wiki-style image links with the HTML code to display them
256260 function parseImages ( $s ) {
257 - $s = ereg_replace ( "http://([a-zA-Z0-9_/:.]*)\.(png|jpg|jpeg|tif|tiff|gif)" , "<img src=\"http://\\1.\\2\">" , $s ) ;
 261+ $s = ereg_replace ( "([^[])http://([a-zA-Z0-9_/:.\-]*)\.(png|jpg|jpeg|tif|tiff|gif)" , "\\1<img src=\"http://\\2.\\3\">" , $s ) ;
258262 return $s ;
259263 }
260264
@@ -264,7 +268,8 @@
265269 $a = explode ( "[http://" , " ".$s ) ;
266270 $s = array_shift ( $a ) ;
267271 $s = substr ( $s , 1 ) ;
268 - $image = "<img src=earth_small.png valign=center border=0>" ; # Remove or set to blank for no image
 272+ $image = "" ; # with an <img tag, this will be displayed before external links
 273+ $linkStyle = "style=\"color:#3333BB;text-decoration:none\"" ;
269274 foreach ( $a as $t ) {
270275 $b = spliti ( "]" , $t , 2 ) ;
271276 if ( count($b) < 2 ) $s .= "Illegal link : ?$b[0]?" ;
@@ -281,13 +286,13 @@
282287 if ( substr_count ( $b[1] , "<hr>" ) > 0 ) $cnt = 1 ;
283288 $link = "~http://".$link ;
284289 if ( $user->options["showHover"] == "yes" ) $hover = "title=\"$link\"" ;
285 - $s .= "<a href=\"$link\" $hover>$image$text</a>" ;
286 - $s .= $b[1] ;
 290+ $theLink = "<a href=\"$link\" $linkStyle $hover>$image$text</a>" ;
 291+ $s .= $theLink.$b[1] ;
287292 }
288293 }
289294
290295 $o = "A-Za-z0-9/\.:?&=_~%-@^" ;
291 - $s = eregi_replace ( "([^~\"])http://([$o]+)([^$o])" , "\\1<a href=\"http://\\2\">".$image."http://\\2</a>\\3" , $s ) ;
 296+ $s = eregi_replace ( "([^~\"])http://([$o]+)([^$o])" , "\\1<a href=\"http://\\2\" $linkStyle>".$image."http://\\2</a>\\3" , $s ) ;
292297 $s = str_replace ( "~http://" , "http://" , $s ) ;
293298
294299 return $s ;
@@ -325,16 +330,23 @@
326331
327332 # This function is called to replace wiki-style tags with HTML, e.g., the first occurrence of ''' with <b>, the second with </b>
328333 function pingPongReplace ( $f , $r1 , $r2 , $s ) {
329 - $a = explode ( $f , " ".$s ) ;
330 - if ( count ( $a ) == 1 ) return $s ;
331 - $s = substr ( array_shift ( $a ) , 1 ) ;
332 - $r = $r1 ;
333 - foreach ( $a as $t ) {
334 - $s .= $r.$t ;
335 - if ( $r == $r1 ) $r = $r2 ;
336 - else $r = $r1 ;
 334+ $ret = "" ;
 335+ $lines = explode ( "\n" , $s ) ;
 336+ foreach ( $lines as $s ) {
 337+ $a = explode ( $f , " ".$s ) ;
 338+ $app = "" ;
 339+ $s = substr ( array_shift ( $a ) , 1 ) ;
 340+ $r = $r1 ;
 341+ if ( count ( $a ) % 2 != 0 ) $app = $f.array_pop ( $a ) ;
 342+ foreach ( $a as $t ) {
 343+ $s .= $r.$t ;
 344+ if ( $r == $r1 ) $r = $r2 ;
 345+ else $r = $r1 ;
 346+ }
 347+ if ( $ret != "" ) $ret .= "\n" ;
 348+ $ret .= $s.$app ;
337349 }
338 - return $s ;
 350+ return $ret ;
339351 }
340352
341353 # This function organizes the <nowiki> parts and calls subPageContents() for the wiki parts
@@ -355,7 +367,7 @@
356368 if ( count ( $c ) == 2 ) {
357369 array_push ( $b , $c[0] ) ;
358370 $s .= $d.$c[1] ;
359 - } else $s .= "&lt;nowiki&gt;".$x ;
 371+ } else $s .= "<nowiki>".$x ;
360372 }
361373
362374 # If called from setEntry(), only parse internal links and return dummy entry
@@ -399,9 +411,10 @@
400412 $s = $this->pingPongReplace ( "''" , "<i>" , "</i>" , $s ) ;
401413 $s = $this->pingPongReplace ( "====" , "<h4>" , "</h4>" , $s ) ;
402414 $s = $this->pingPongReplace ( "===" , "<h3>" , "</h3>" , $s ) ;
 415+ $s = $this->pingPongReplace ( "==" , "<h2>" , "</h2>" , $s ) ;
403416
404417 # Automatic links to subpages (e.g., /Talk -> [[/Talk]]
405 - $s = ereg_replace ( "([\n| ])/([a-zA-Z0-9_]*)" , "\\1[[/\\2|/\\2]]" , $s ) ;
 418+ $s = ereg_replace ( "([\n| ])/([a-zA-Z0-9]+)" , "\\1[[/\\2|/\\2]]" , $s ) ;
406419
407420 # Parsing through the text line by line
408421 # The main thing happening here is handling of lines starting with * # : etc.
@@ -491,7 +504,7 @@
492505 global $user , $oldID , $version ;
493506 $editOldVersion = "" ;
494507 if ( $oldID != "" ) $editOldVersion="&oldID=$oldID&version=$version" ;
495 - $ret = "<a href=\"$THESCRIPT\">Homepage</a>" ;
 508+ $ret = "<a href=\"$THESCRIPT\">Main Page</a>" ;
496509
497510 $spl = $this->getSubpageList () ;
498511 if ( count ( $spl ) > 0 and $this->subpageTitle != "" ) {
@@ -532,11 +545,12 @@
533546 $subText = array () ;
534547 if ( $user->isLoggedIn ) {
535548 if ( $user->doWatch($this->title) )
536 - array_push($subText,"<br><a href=\"$THESCRIPT?action=watch&title=$this->secureTitle&mode=no\">Stop watching this article for me</a>");
537 - else array_push($subText,"<br><a href=\"$THESCRIPT?action=watch&title=$this->secureTitle&mode=yes\">Watch this article for me</a>") ;
 549+ array_push($subText,"<a href=\"$THESCRIPT?action=watch&title=$this->secureTitle&mode=no\">Stop watching this article for me</a>");
 550+ else array_push($subText,"<a href=\"$THESCRIPT?action=watch&title=$this->secureTitle&mode=yes\">Watch this article for me</a>") ;
538551 }
539552 if ( $action == "view" and !$this->isSpecialPage ) array_push ( $subText , "<a href=\"$THESCRIPT?action=print&title=$this->secureTitle\">Printable version</a>" ) ;
540 - $ret .= implode ( " | " , $subText ) ;
 553+ if ( $this->backLink != "" ) array_push ( $subText , $this->backLink ) ;
 554+ $ret .= "<br>".implode ( " | " , $subText ) ;
541555 }
542556 $ret .= "</td>\n<td valign=top width=200 rowspan=2 nowrap>".$user->getLink()."<br>" ;
543557 if ( $user->isLoggedIn ) $ret .= "<a href=\"$THESCRIPT?title=special:userLogout\">Log out</a> | <a href=\"$THESCRIPT?title=special:editUserSettings\">Preferences</a>" ;
@@ -555,7 +569,7 @@
556570 $editOldVersion = "" ;
557571 if ( $oldID != "" ) $editOldVersion="&oldID=$oldID&version=$version" ;
558572 $column = "<nowiki>" ;
559 - $column .= "<a href=\"$THESCRIPT?title=HomePage\">HomePage</a>\n" ;
 573+ $column .= "<a href=\"$THESCRIPT\">Main Page</a>\n" ;
560574 $column .= "<br><a href=\"$THESCRIPT?title=special:RecentChanges\">Recent Changes</a>\n" ;
561575 if ( $this->canEdit() ) $column .= "<br><a href=\"$THESCRIPT?action=edit&title=$this->url$editOldVersion\">Edit this page</a>\n" ;
562576

Status & tagging log