r56967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56966‎ | r56967 | r56968 >
Date:00:36, 27 September 2009
Author:midom
Status:ok
Tags:
Comment:
quick hack for special:mostlinkedpages - in case of misermode it won't show pages that have less than 100 links.
probably the cutoff can be calculated out of total count of articles or something, may come up with that later :)
Modified paths:
  • /branches/wmf-deployment/includes/specials/SpecialMostlinked.php (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/includes/specials/SpecialMostlinked.php
@@ -26,7 +26,12 @@
2727 * Note: Getting page_namespace only works if $this->isCached() is false
2828 */
2929 function getSQL() {
 30+ global $wgMiserMode;
 31+
3032 $dbr = wfGetDB( DB_SLAVE );
 33+
 34+ if ($wgMiserMode) { $cutoff = 100; } else { $cutoff = 1; }
 35+
3136 list( $pagelinks, $page ) = $dbr->tableNamesN( 'pagelinks', 'page' );
3237 return
3338 "SELECT 'Mostlinked' AS type,
@@ -37,7 +42,7 @@
3843 FROM $pagelinks
3944 LEFT JOIN $page ON pl_namespace=page_namespace AND pl_title=page_title
4045 GROUP BY pl_namespace, pl_title, page_namespace
41 - HAVING COUNT(*) > 1";
 46+ HAVING COUNT(*) > $cutoff";
4247 }
4348
4449 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r59693Merged r56967 from wmf-deployment: for performance, don't consider pages with...tstarling05:38, 3 December 2009

Status & tagging log