From: Tim Starling Date: Wed, 23 Aug 2006 05:00:16 +0000 (+0000) Subject: Suppress links to empty categories X-Git-Tag: 1.31.0-rc.0~55923 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=14d347a28cdb5fcb7a028bf5de4e7a32d258e99f;p=lhc%2Fweb%2Fwiklou.git Suppress links to empty categories --- diff --git a/skins/disabled/HTMLDump.php b/skins/disabled/HTMLDump.php index 20ec01e386..2adf338911 100644 --- a/skins/disabled/HTMLDump.php +++ b/skins/disabled/HTMLDump.php @@ -75,7 +75,13 @@ class SkinHTMLDump extends SkinTemplate { } if ( $nt->getNamespace() == NS_CATEGORY ) { - return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); + # Determine if the category has any articles in it + $dbr =& wfGetDB( DB_SLAVE ); + $hasMembers = $dbr->selectField( 'categorylinks', '1', + array( 'cl_to' => $nt->getDBkey() ), __METHOD__ ); + if ( $hasMembers ) { + return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix ); + } } if ( $text == '' ) {