* Truncate summary of page moves in revision comment field to avoid broken multibyte...
[mediawiki.git] / includes / specials / SpecialWantedtemplates.php
blob329d7a3f497af80d609a4268e5ffd7b7c5e6265e
1 <?php
2 /**
3 * @file
4 * @ingroup SpecialPage
5 */
7 /**
8 * A querypage to list the most wanted templates - implements Special:Wantedtemplates
9 * based on SpecialWantedcategories.php by Ævar Arnfjörð Bjarmason <avarab@gmail.com>
10 * makeWlhLink() taken from SpecialMostlinkedtemplates by Rob Church <robchur@gmail.com>
12 * @ingroup SpecialPage
14 * @author Danny B.
15 * @copyright Copyright © 2008, Danny B.
16 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
18 class WantedTemplatesPage extends WantedQueryPage {
20 function getName() {
21 return 'Wantedtemplates';
24 function getSQL() {
25 $dbr = wfGetDB( DB_SLAVE );
26 list( $templatelinks, $page ) = $dbr->tableNamesN( 'templatelinks', 'page' );
27 $name = $dbr->addQuotes( $this->getName() );
28 return
30 SELECT $name as type,
31 tl_namespace as namespace,
32 tl_title as title,
33 COUNT(*) as value
34 FROM $templatelinks LEFT JOIN
35 $page ON tl_title = page_title AND tl_namespace = page_namespace
36 WHERE page_title IS NULL AND tl_namespace = ". NS_TEMPLATE ."
37 GROUP BY tl_namespace, tl_title
42 /**
43 * constructor
45 function wfSpecialWantedTemplates() {
46 list( $limit, $offset ) = wfCheckLimits();
48 $wpp = new WantedTemplatesPage();
50 $wpp->doQuery( $offset, $limit );