From 11e7c31c1ee49254567dde8ba4a1b2f09b11daf3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 30 Aug 2004 08:22:15 +0000 Subject: [PATCH] In the allpages index, make the whole line links to hopefully reduce the confusion factor. Some people thought that the link was actually a link _to_ the first page listed. Since the centering is done with a table (yecch) each line is actually three separate links, for the first page, "to", and last page. All go to the same place, and on Monobook with link underlining off it should look pretty decent. It's less attractive on the classic skins with underlining on, but it's better than the old look i think. Also, removed the old caching with LogPage, since this no longer works. Either the index generation needs to be made a lot faster, or the index points should be saved in the querycache table. http://bugzilla.wikipedia.org/show_bug.cgi?id=250 --- includes/SpecialAllpages.php | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index 90348e0e98..3432a8d17e 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -57,16 +57,8 @@ function indexShowToplevel ( $namespace = 0 ) $fname = "indexShowToplevel"; $namespace = intval ($namespace); - # Cache - $vsp = $wgLang->getValidSpecialPages(); - $log = new LogPage( $vsp["Allpages"] ); - $log->mUpdateRecentChanges = false; - - global $wgMiserMode; - if ( $wgMiserMode ) { - $log->showAsDisabledPage(); - return; - } + # TODO: Either make this *much* faster or cache the title index points + # in the querycache table. $dbr =& wfGetDB( DB_SLAVE ); $cur = $dbr->tableName( 'cur' ); @@ -157,9 +149,6 @@ function indexShowToplevel ( $namespace = 0 ) $out2 = $nsForm . '
'; } - # Saving cache - $log->replaceContent( $out ); - $wgOut->addHtml( $out2 . $out ); } @@ -169,14 +158,16 @@ function indexShowline( $inpoint, $outpoint, $namespace = 0 ) $sk = $wgUser->getSkin(); $dbr =& wfGetDB( DB_SLAVE ); - $inpointf = str_replace( "_", " ", $inpoint ); - $outpointf = str_replace( "_", " ", $outpoint ); - $queryparams = 'from=' . $dbr->strencode( $inpoint ); - if ( $namespace > 0 ) { $queryparams .= '&namespace='.intval($namespace); } + $inpointf = htmlspecialchars( str_replace( "_", " ", $inpoint ) ); + $outpointf = htmlspecialchars( str_replace( "_", " ", $outpoint ) ); + $queryparams = $namespace ? ('namespace='.intval($namespace)) : ''; + $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint ); + $link = $special->escapeLocalUrl( $queryparams ); + $out = wfMsg( 'alphaindexline', - $sk->makeKnownLink( $wgLang->specialPage( "Allpages" ), $inpointf, $queryparams ) . '', - '' . $outpointf + "$inpointf", + "$outpointf" ); return ''.$out.''; } -- 2.20.1