r189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r188‎ | r189 | r190 >
Date:22:12, 23 February 2002
Author:hidders
Status:old
Tags:
Comment:
introduce new special page "watch page links"
Modified paths:
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/wikiPage.php
@@ -29,9 +29,9 @@
3030 if ( $this->namespace == "special" ) { # Special page, calling appropriate function
3131 $allowed = $wikiAllowedSpecialPages ; # List of allowed special pages
3232 if ( in_array ( "is_sysop" , $user->rights ) ) { # Functions just for sysops
33 - array_push ( $allowed , "asksql" ) ;
34 - array_push ( $allowed , "blockip" ) ;
35 - }
 33+ array_push ( $allowed , "asksql" ) ;
 34+ array_push ( $allowed , "blockip" ) ;
 35+ }
3636 $call = $this->mainTitle ;
3737 if ( !in_array ( strtolower ( $call ) , $allowed ) ) {
3838 $this->isSpecialPage = true ;
@@ -566,7 +566,7 @@
567567 if ( count ( $b ) == 1 ) $s .= "<pre>$x" ;
568568 else {
569569 #$x = htmlspecialchars ( $b[0] ) ;
570 - $x = str_replace ( array ( "<" , ">" ) , array ( "&lt;" , "&gt;" ) , $b[0] ) ;
 570+ $x = str_replace ( array ( "<" , ">" ) , array ( "&lt;" , "&gt;" ) , $b[0] ) ;
571571 $s .= "<pre>$x</pre>$b[1]" ;
572572 }
573573 }
@@ -1007,7 +1007,7 @@
10081008 if(count($wikiEncodingNames) > 1) { # Shortcut for switching character encodings
10091009 global $THESCRIPT;
10101010 $u = $THESCRIPT . "?" . getenv("QUERY_STRING");
1011 - $u = getenv ( "REQUEST_URI" ) ;
 1011+ $u = getenv ( "REQUEST_URI" ) ;
10121012 $u = preg_replace("/[\?\&]encoding=[0-9]+/", "", $u);
10131013 $u .= ((!strchr($u, "?") && strstr($THESCRIPT,$u)) ? "?" : "&");
10141014 foreach ( $wikiEncodingNames as $i => $enc ) {
@@ -1029,26 +1029,30 @@
10301030 global $wikiMainPage , $wikiRecentChanges , $wikiRecentChangesLink , $wikiUpload , $wikiPopularPages , $wikiLongPages , $action ;
10311031 global $user , $oldID , $version , $wikiEditThisPage , $wikiDeleteThisPage , $wikiHistory , $wikiMyWatchlist , $wikiAskSQL ;
10321032 global $wikiStatistics , $wikiNewPages , $wikiOrphans , $wikiMostWanted , $wikiAllPages , $wikiRandomPage , $wikiStubs , $wikiListUsers ;
1033 - global $wikiBugReports , $wikiBugReportsLink ;
 1033+ global $wikiRecentLinked, $wikiRecentLinkedLink ;
 1034+ global $wikiBugReports , $wikiBugReportsLink ;
 1035+
10341036 $editOldVersion = "" ;
10351037 if ( $oldID != "" ) $editOldVersion="&oldID=$oldID&version=$version" ;
10361038 $column = "" ;
10371039 $column .= "<a href=\"".wikiLink("")."\">$wikiMainPage</a>\n" ;
10381040 $column .= "<br><a href=\"".wikiLink("special:$wikiRecentChangesLink")."\">$wikiRecentChanges</a>\n" ;
1039 - if ( $this->canEdit() ) $column .= "<br><a href=\"".wikiLink(urldecode($this->url)."$editOldVersion&action=edit")."\">$wikiEditThisPage</a>\n" ;
 1041+ if ( !$this->isSpecialPage )
 1042+ $column .= "<br><a href=\"".wikiLink("special:$wikiRecentLinkedLink&target=".urldecode($this->url))."\">$wikiRecentLinked</a>\n" ;
 1043+ if ( $this->canEdit() )
 1044+ $column .= "<br><a href=\"".wikiLink(urldecode($this->url)."$editOldVersion&action=edit")."\">$wikiEditThisPage</a>\n" ;
10401045 else if ( !$this->isSpecialPage ) $column .= "<br>Protected page\n" ;
10411046
1042 - $temp = $this->isSpecialPage ;
1043 - if ( $action == "" ) $this->isSpecialPage = false ;
 1047+ $temp = $this->isSpecialPage ;
 1048+ if ( $action == "" ) $this->isSpecialPage = false ;
10441049 if ( $this->canDelete() ) $column .= "<br><a href=\"".wikiLink("special:deletepage&target=".urldecode($this->url))."\">$wikiDeleteThisPage</a>\n" ;
1045 - $this->isSpecialPage = $temp ;
 1050+ $this->isSpecialPage = $temp ;
10461051
1047 -
10481052 if ( $this->canProtect() ) $column .= "<br><a href=\"".wikiLink("special:protectpage&target=".urldecode($this->url))."\">Protect this page</a>\n" ;
10491053 # To be implemented later
10501054 # if ( $this->canAdvance() ) $column .= "<br><a href=\"".wikiLink("special:Advance&topic=$this->safeTitle")."\">Advance</a>\n" ;
10511055
1052 - if ( in_array ( "is_sysop" , $user->rights ) ) $column .= "<br><a href=\"".wikiLink("special:AskSQL")."\">$wikiAskSQL</a>\n" ;
 1056+ if ( in_array ( "is_sysop" , $user->rights ) ) $column .= "<br><a href=\"".wikiLink("special:AskSQL")."\">$wikiAskSQL</a>\n" ;
10531057 if ( !$this->isSpecialPage ) $column .= "<br><a href=\"".wikiLink(urldecode($this->url)."&action=history")."\">$wikiHistory</a>\n" ;
10541058 $column .= "<br><a href=\"".wikiLink("special:Upload")."\">$wikiUpload</a>\n" ;
10551059 $column .= "<hr>" ;
@@ -1065,7 +1069,7 @@
10661070 if ( $user->isLoggedIn ) {
10671071 $column .= "<br>\n<a href=\"".wikiLink("special:WatchList")."\">$wikiMyWatchlist</a>" ;
10681072 }
1069 - $column .= "<br>\n<a href=\"".wikiLink($wikiBugReportsLink)."\">$wikiBugReports</a>" ;
 1073+ $column .= "<br>\n<a href=\"".wikiLink($wikiBugReportsLink)."\">$wikiBugReports</a>" ;
10701074 $a = $this->getOtherNamespaces () ;
10711075 if ( count ( $a ) > 0 ) $column .= "<hr>".implode ( "<br>\n" , $a ) ;
10721076
@@ -1183,16 +1187,16 @@
11841188 $middle = $this->cache ;
11851189 #$middle = "<p>(cached)</p>" . $this->cache ; #FIXME
11861190
1187 - # Need to check for other-language links, which do not appear in the link arrays
1188 - $this->otherLanguages = array () ;
1189 - global $wikiOtherLanguages ;
1190 - preg_replace ( "/\[\[([a-z]{2})\:\s*([^\]]+)\s*\]\]/ie" ,
1191 - "( ( ( \$langurl = \$wikiOtherLanguages[\$lang = strtolower ( \"\$1\" )] ) != '' )
1192 - ? ( \$this->otherLanguages[\$lang] = str_replace ( '\\$1' ,
1193 - ucfirstIntl ( str_replace ( array ( '+' , '%25' ) , array ( '_' , '%' ) , nurlencode ( \"\$2\" ) ) ) ,
1194 - \$langurl ) )
1195 - : '' )" ,
1196 - $this->contents ) ;
 1191+ # Need to check for other-language links, which do not appear in the link arrays
 1192+ $this->otherLanguages = array () ;
 1193+ global $wikiOtherLanguages ;
 1194+ preg_replace ( "/\[\[([a-z]{2})\:\s*([^\]]+)\s*\]\]/ie" ,
 1195+ "( ( ( \$langurl = \$wikiOtherLanguages[\$lang = strtolower ( \"\$1\" )] ) != '' )
 1196+ ? ( \$this->otherLanguages[\$lang] = str_replace ( '\\$1' ,
 1197+ ucfirstIntl ( str_replace ( array ( '+' , '%25' ) , array ( '_' , '%' ) , nurlencode ( \"\$2\" ) ) ) ,
 1198+ \$langurl ) )
 1199+ : '' )" ,
 1200+ $this->contents ) ;
11971201 } else {
11981202 $middle = $this->parseContents($middle) ;
11991203 if ( $this->canBeCached ) { # Generating cache

Status & tagging log