From 14d347a28cdb5fcb7a028bf5de4e7a32d258e99f Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 23 Aug 2006 05:00:16 +0000 Subject: [PATCH] Suppress links to empty categories --- skins/disabled/HTMLDump.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 == '' ) { -- 2.20.1