dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* useless calls to tableName
[lhc/web/wiklou.git]
/
includes
/
SpecialCategories.php
diff --git
a/includes/SpecialCategories.php
b/includes/SpecialCategories.php
index
4e06560
..
90da68f
100644
(file)
--- a/
includes/SpecialCategories.php
+++ b/
includes/SpecialCategories.php
@@
-1,7
+1,20
@@
<?php
<?php
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
+/**
+ *
+ */
require_once("QueryPage.php");
require_once("QueryPage.php");
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
class CategoriesPage extends QueryPage {
function getName() {
class CategoriesPage extends QueryPage {
function getName() {
@@
-12,15
+25,23
@@
class CategoriesPage extends QueryPage {
return false;
}
return false;
}
+ function isSyndicated() { return false; }
+
+ function getPageHeader() {
+ return wfMsgWikiHtml('categoriespagetext') . "<br />\n";
+ }
function getSQL() {
$NScat = NS_CATEGORY;
$dbr =& wfGetDB( DB_SLAVE );
$categorylinks = $dbr->tableName( 'categorylinks' );
function getSQL() {
$NScat = NS_CATEGORY;
$dbr =& wfGetDB( DB_SLAVE );
$categorylinks = $dbr->tableName( 'categorylinks' );
-
return "SELECT DISTIN
CT 'Categories' as type,
+
$s= "SELE
CT 'Categories' as type,
{$NScat} as namespace,
cl_to as title,
{$NScat} as namespace,
cl_to as title,
- 1 as value
- FROM $categorylinks";
+ 1 as value,
+ COUNT(*) as count
+ FROM $categorylinks
+ GROUP BY cl_to";
+ return $s;
}
function sortDescending() {
}
function sortDescending() {
@@
-28,14
+49,17
@@
class CategoriesPage extends QueryPage {
}
function formatResult( $skin, $result ) {
}
function formatResult( $skin, $result ) {
- global $wgLang;
$title = Title::makeTitle( NS_CATEGORY, $result->title );
$title = Title::makeTitle( NS_CATEGORY, $result->title );
- return $skin->makeLinkObj( $title, $title->getText() );
+ $plink = $skin->makeLinkObj( $title, $title->getText() );
+ $nlinks = wfMsg( 'nlinks', $result->count );
+ return "$plink ($nlinks)";
}
}
}
}
-function wfSpecialCategories()
-{
+/**
+ *
+ */
+function wfSpecialCategories() {
list( $limit, $offset ) = wfCheckLimits();
$cap = new CategoriesPage();
list( $limit, $offset ) = wfCheckLimits();
$cap = new CategoriesPage();