r109 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108‎ | r109 | r110 >
Date:09:53, 9 February 2002
Author:vibber
Status:old
Tags:
Comment:
More non-English Talk page fixes
Modified paths:
  • /trunk/phpwiki/fpw/wikiPage.php (modified) (history)
  • /trunk/phpwiki/fpw/wikiTextEn.php (modified) (history)

Diff [purge]

Index: trunk/phpwiki/fpw/wikiPage.php
@@ -153,7 +153,7 @@
154154 $n = explode ( ":" , $this->title ) ;
155155 if ( count ( $n ) == 1 ) $n = $n[0] ;
156156 else $n = $n[1] ;
157 - global $wikiSQLServer , $wikiTalk , $wikiUser ;
 157+ global $wikiSQLServer , $wikiTalk , $wikiUser , $wikiNamespaceTalk ;
158158 $connection = getDBconnection () ;
159159 mysql_select_db ( $wikiSQLServer , $connection ) ;
160160 $sql = "SELECT cur_title FROM cur WHERE cur_title LIKE \"%:$n\"" ;
@@ -168,9 +168,13 @@
169169 }
170170
171171 if ( stristr ( $this->namespace , $wikiTalk ) == false ) {
172 - $n2 = ucfirst ( $this->namespace ) ;
173 - if ( $n2 != "" ) $n2 .= " " ;
174 - $n2 .= ucfirst ( $wikiTalk ) ;
 172+ #$n2 = ucfirst ( $this->namespace ) ;
 173+ #if ( $n2 != "" ) $n2 .= " " ;
 174+ #$n2 .= ucfirst ( $wikiTalk ) ;
 175+ if ( $this->namespace != "" )
 176+ $n2 = str_replace ( "$1" , ucfirst ( $this->namespace ) , $wikiNamespaceTalk ) ;
 177+ else
 178+ $n2 = ucfirst ( $wikiTalk ) ;
175179 $dummy = new wikiTitle ;
176180 $dummy->setTitle ( $n2.":$n" ) ;
177181 #if ( $dummy->doesTopicExist ( $connection ) ) $style = "color:green;text-decoration:none" ;
@@ -182,7 +186,9 @@
183187 while ( $s = mysql_fetch_object ( $result ) ) {
184188 $t = explode ( ":" , $s->cur_title ) ;
185189 $t = $u->getNiceTitle ( $t[0] ) ;
186 - if ( strtolower ( substr ( $t , -strlen($wikiTalk) ) ) != $wikiTalk and strtolower ( $t ) != $this->namespace )
 190+ #if ( strtolower ( substr ( $t , -strlen($wikiTalk) ) ) != $wikiTalk and strtolower ( $t ) != $this->namespace )
 191+ # Assumes that $wikiTalk is a substring of $wikiNamespaceTalk
 192+ if ( !stristr ( $t, $wikiTalk ) and strtolower ( $t ) != $this->namespace )
187193 #array_push ( $a , "<a style=\"color:green;text-decoration:none\" href=\"".wikiLink("$t:$n")."\">$t</a>" ) ;
188194 array_push ( $a , "<a class=\"green\" href=\"".wikiLink("$t:$n")."\">$t</a>" ) ;
189195 }
Index: trunk/phpwiki/fpw/wikiTextEn.php
@@ -35,6 +35,7 @@
3636 #$wikiAllowedNamespaces = array ( "wikipedia" , "talk" , "user" , "" , "wikipedia talk" , "user talk" ) ;
3737 $wikiTalk = "talk" ;
3838 $wikiUser = "user" ;
 39+$wikiNamespaceTalk = "$1 Talk" ;
3940 $wikiAllowedNamespaces = array ( "wikipedia" , $wikiTalk , $wikiUser , "" , "wikipedia $wikiTalk" , "$wikiUser $wikiTalk" ) ;
4041
4142 # Editing

Status & tagging log