Second part of bug 4083: Special:Validation doesn't check wpEditToken
[mediawiki.git] / includes / SpecialMostrevisions.php
blob6bc807e4cffa1a2c546c08ee68fa494ebbda1457
1 <?php
2 /**
3 * A special page to show pages in the
5 * @package MediaWiki
6 * @subpackage SpecialPage
8 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
9 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
10 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
13 /* */
14 require_once 'QueryPage.php';
16 /**
17 * @package MediaWiki
18 * @subpackage SpecialPage
20 class MostrevisionsPage extends QueryPage {
22 function getName() { return 'Mostrevisions'; }
23 function isExpensive() { return true; }
24 function isSyndicated() { return false; }
26 function getSQL() {
27 $dbr =& wfGetDB( DB_SLAVE );
28 extract( $dbr->tableNames( 'revision', 'page' ) );
29 return
31 SELECT
32 'Mostrevisions' as type,
33 page_namespace as namespace,
34 page_title as title,
35 COUNT(*) as value
36 FROM $revision
37 LEFT JOIN $page ON page_id = rev_page
38 WHERE page_namespace = " . NS_MAIN . "
39 GROUP BY rev_page
40 HAVING COUNT(*) > 1
44 function formatResult( $skin, $result ) {
45 global $wgContLang;
47 $nt = Title::makeTitle( $result->namespace, $result->title );
48 $text = $wgContLang->convert( $nt->getPrefixedText() );
50 $plink = $skin->makeKnownLinkObj( $nt, $text );
52 $nl = wfMsg( 'nrevisions', $result->value );
53 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
55 return "$plink ($nlink)";
59 /**
60 * constructor
62 function wfSpecialMostrevisions() {
63 list( $limit, $offset ) = wfCheckLimits();
65 $wpp = new MostrevisionsPage();
67 $wpp->doQuery( $offset, $limit );