00001 <?php 00018 class WantedTemplatesPage extends WantedQueryPage { 00019 00020 function getName() { 00021 return 'Wantedtemplates'; 00022 } 00023 00024 function getSQL() { 00025 $dbr = wfGetDB( DB_SLAVE ); 00026 list( $templatelinks, $page ) = $dbr->tableNamesN( 'templatelinks', 'page' ); 00027 $name = $dbr->addQuotes( $this->getName() ); 00028 return 00029 " 00030 SELECT $name as type, 00031 tl_namespace as namespace, 00032 tl_title as title, 00033 COUNT(*) as value 00034 FROM $templatelinks LEFT JOIN 00035 $page ON tl_title = page_title AND tl_namespace = page_namespace 00036 WHERE page_title IS NULL AND tl_namespace = ". NS_TEMPLATE ." 00037 GROUP BY tl_namespace, tl_title 00038 "; 00039 } 00040 } 00041 00045 function wfSpecialWantedTemplates() { 00046 list( $limit, $offset ) = wfCheckLimits(); 00047 00048 $wpp = new WantedTemplatesPage(); 00049 00050 $wpp->doQuery( $offset, $limit ); 00051 }