Index: trunk/phpwiki/fpw/wikiPage.php |
— | — | @@ -29,9 +29,9 @@ |
30 | 30 | if ( $this->namespace == "special" ) { # Special page, calling appropriate function |
31 | 31 | $allowed = $wikiAllowedSpecialPages ; # List of allowed special pages |
32 | 32 | 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 | + } |
36 | 36 | $call = $this->mainTitle ; |
37 | 37 | if ( !in_array ( strtolower ( $call ) , $allowed ) ) { |
38 | 38 | $this->isSpecialPage = true ; |
— | — | @@ -566,7 +566,7 @@ |
567 | 567 | if ( count ( $b ) == 1 ) $s .= "<pre>$x" ; |
568 | 568 | else { |
569 | 569 | #$x = htmlspecialchars ( $b[0] ) ; |
570 | | - $x = str_replace ( array ( "<" , ">" ) , array ( "<" , ">" ) , $b[0] ) ; |
| 570 | + $x = str_replace ( array ( "<" , ">" ) , array ( "<" , ">" ) , $b[0] ) ; |
571 | 571 | $s .= "<pre>$x</pre>$b[1]" ; |
572 | 572 | } |
573 | 573 | } |
— | — | @@ -1007,7 +1007,7 @@ |
1008 | 1008 | if(count($wikiEncodingNames) > 1) { # Shortcut for switching character encodings |
1009 | 1009 | global $THESCRIPT; |
1010 | 1010 | $u = $THESCRIPT . "?" . getenv("QUERY_STRING"); |
1011 | | - $u = getenv ( "REQUEST_URI" ) ; |
| 1011 | + $u = getenv ( "REQUEST_URI" ) ; |
1012 | 1012 | $u = preg_replace("/[\?\&]encoding=[0-9]+/", "", $u); |
1013 | 1013 | $u .= ((!strchr($u, "?") && strstr($THESCRIPT,$u)) ? "?" : "&"); |
1014 | 1014 | foreach ( $wikiEncodingNames as $i => $enc ) { |
— | — | @@ -1029,26 +1029,30 @@ |
1030 | 1030 | global $wikiMainPage , $wikiRecentChanges , $wikiRecentChangesLink , $wikiUpload , $wikiPopularPages , $wikiLongPages , $action ; |
1031 | 1031 | global $user , $oldID , $version , $wikiEditThisPage , $wikiDeleteThisPage , $wikiHistory , $wikiMyWatchlist , $wikiAskSQL ; |
1032 | 1032 | global $wikiStatistics , $wikiNewPages , $wikiOrphans , $wikiMostWanted , $wikiAllPages , $wikiRandomPage , $wikiStubs , $wikiListUsers ; |
1033 | | - global $wikiBugReports , $wikiBugReportsLink ; |
| 1033 | + global $wikiRecentLinked, $wikiRecentLinkedLink ; |
| 1034 | + global $wikiBugReports , $wikiBugReportsLink ; |
| 1035 | + |
1034 | 1036 | $editOldVersion = "" ; |
1035 | 1037 | if ( $oldID != "" ) $editOldVersion="&oldID=$oldID&version=$version" ; |
1036 | 1038 | $column = "" ; |
1037 | 1039 | $column .= "<a href=\"".wikiLink("")."\">$wikiMainPage</a>\n" ; |
1038 | 1040 | $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" ; |
1040 | 1045 | else if ( !$this->isSpecialPage ) $column .= "<br>Protected page\n" ; |
1041 | 1046 | |
1042 | | - $temp = $this->isSpecialPage ; |
1043 | | - if ( $action == "" ) $this->isSpecialPage = false ; |
| 1047 | + $temp = $this->isSpecialPage ; |
| 1048 | + if ( $action == "" ) $this->isSpecialPage = false ; |
1044 | 1049 | 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 ; |
1046 | 1051 | |
1047 | | - |
1048 | 1052 | if ( $this->canProtect() ) $column .= "<br><a href=\"".wikiLink("special:protectpage&target=".urldecode($this->url))."\">Protect this page</a>\n" ; |
1049 | 1053 | # To be implemented later |
1050 | 1054 | # if ( $this->canAdvance() ) $column .= "<br><a href=\"".wikiLink("special:Advance&topic=$this->safeTitle")."\">Advance</a>\n" ; |
1051 | 1055 | |
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" ; |
1053 | 1057 | if ( !$this->isSpecialPage ) $column .= "<br><a href=\"".wikiLink(urldecode($this->url)."&action=history")."\">$wikiHistory</a>\n" ; |
1054 | 1058 | $column .= "<br><a href=\"".wikiLink("special:Upload")."\">$wikiUpload</a>\n" ; |
1055 | 1059 | $column .= "<hr>" ; |
— | — | @@ -1065,7 +1069,7 @@ |
1066 | 1070 | if ( $user->isLoggedIn ) { |
1067 | 1071 | $column .= "<br>\n<a href=\"".wikiLink("special:WatchList")."\">$wikiMyWatchlist</a>" ; |
1068 | 1072 | } |
1069 | | - $column .= "<br>\n<a href=\"".wikiLink($wikiBugReportsLink)."\">$wikiBugReports</a>" ; |
| 1073 | + $column .= "<br>\n<a href=\"".wikiLink($wikiBugReportsLink)."\">$wikiBugReports</a>" ; |
1070 | 1074 | $a = $this->getOtherNamespaces () ; |
1071 | 1075 | if ( count ( $a ) > 0 ) $column .= "<hr>".implode ( "<br>\n" , $a ) ; |
1072 | 1076 | |
— | — | @@ -1183,16 +1187,16 @@ |
1184 | 1188 | $middle = $this->cache ; |
1185 | 1189 | #$middle = "<p>(cached)</p>" . $this->cache ; #FIXME |
1186 | 1190 | |
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 ) ; |
1197 | 1201 | } else { |
1198 | 1202 | $middle = $this->parseContents($middle) ; |
1199 | 1203 | if ( $this->canBeCached ) { # Generating cache |