diff options
Diffstat (limited to 'includes/specials/SpecialWantedtemplates.php')
-rw-r--r-- | includes/specials/SpecialWantedtemplates.php | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/includes/specials/SpecialWantedtemplates.php b/includes/specials/SpecialWantedtemplates.php index ae43c237..ab9d6046 100644 --- a/includes/specials/SpecialWantedtemplates.php +++ b/includes/specials/SpecialWantedtemplates.php @@ -33,35 +33,23 @@ */ class WantedTemplatesPage extends WantedQueryPage { - function getName() { - return 'Wantedtemplates'; + function __construct( $name = 'Wantedtemplates' ) { + parent::__construct( $name ); } - function getSQL() { - $dbr = wfGetDB( DB_SLAVE ); - list( $templatelinks, $page ) = $dbr->tableNamesN( 'templatelinks', 'page' ); - $name = $dbr->addQuotes( $this->getName() ); - return - " - SELECT $name as type, - tl_namespace as namespace, - tl_title as title, - COUNT(*) as value - FROM $templatelinks LEFT JOIN - $page ON tl_title = page_title AND tl_namespace = page_namespace - WHERE page_title IS NULL AND tl_namespace = ". NS_TEMPLATE ." - GROUP BY tl_namespace, tl_title - "; + function getQueryInfo() { + return array ( + 'tables' => array ( 'templatelinks', 'page' ), + 'fields' => array ( 'tl_namespace AS namespace', + 'tl_title AS title', + 'COUNT(*) AS value' ), + 'conds' => array ( 'page_title IS NULL', + 'tl_namespace' => NS_TEMPLATE ), + 'options' => array ( + 'GROUP BY' => 'tl_namespace, tl_title' ), + 'join_conds' => array ( 'page' => array ( 'LEFT JOIN', + array ( 'page_namespace = tl_namespace', + 'page_title = tl_title' ) ) ) + ); } } - -/** - * constructor - */ -function wfSpecialWantedTemplates() { - list( $limit, $offset ) = wfCheckLimits(); - - $wpp = new WantedTemplatesPage(); - - $wpp->doQuery( $offset, $limit ); -} |