r10201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10200‎ | r10201 | r10202 >
Date:03:08, 19 July 2005
Author:avar
Status:old
Tags:
Comment:
* Putting redirects in the allpagesredirect class so that they can be styled
differently from normal pages
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -221,7 +221,7 @@
222222
223223 $dbr =& wfGetDB( DB_SLAVE );
224224 $res = $dbr->select( 'page',
225 - array( 'page_namespace', 'page_title' ),
 225+ array( 'page_namespace', 'page_title', 'page_is_redirect' ),
226226 array(
227227 'page_namespace' => $namespace,
228228 'page_title >= ' . $dbr->addQuotes( $fromKey )
@@ -242,7 +242,9 @@
243243 while( ($n < $indexMaxperpage) && ($s = $dbr->fetchObject( $res )) ) {
244244 $t = Title::makeTitle( $s->page_namespace, $s->page_title );
245245 if( $t ) {
246 - $link = $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false );
 246+ $link = ($s->page_is_redirect ? '<div class="allpagesredirect">' : '' ) .
 247+ $sk->makeKnownLinkObj( $t, htmlspecialchars( $t->getText() ), false, false ) .
 248+ ($s->page_is_redirect ? '</div>' : '' );
247249 } else {
248250 $link = '[[' . htmlspecialchars( $s->page_title ) . ']]';
249251 }

Status & tagging log