Handle nested li in ol or ul. That happens when someone use something like:
[lhc/web/wiklou.git] / includes / SpecialMostrevisions.php
1 <?php
2 /**
3 * A special page to show pages in the
4 *
5 * @package MediaWiki
6 * @subpackage SpecialPage
7 *
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
11 */
12
13 /* */
14 require_once 'QueryPage.php';
15
16 /**
17 * @package MediaWiki
18 * @subpackage SpecialPage
19 */
20 class MostrevisionsPage extends QueryPage {
21
22 function getName() { return 'Mostrevisions'; }
23 function isExpensive() { return true; }
24 function isSyndicated() { return false; }
25
26 function getSQL() {
27 $dbr =& wfGetDB( DB_SLAVE );
28 extract( $dbr->tableNames( 'revision', 'page' ) );
29 return
30 "
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
41 ";
42 }
43
44 function formatResult( $skin, $result ) {
45 global $wgContLang;
46
47 $nt = Title::makeTitle( $result->namespace, $result->title );
48 $text = $wgContLang->convert( $nt->getPrefixedText() );
49
50 $plink = $skin->makeKnownLinkObj( $nt, $text );
51
52 $nl = wfMsg( 'nrevisions', $result->value );
53 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
54
55 return wfSpecialList($plink, $nlink);
56 }
57 }
58
59 /**
60 * constructor
61 */
62 function wfSpecialMostrevisions() {
63 list( $limit, $offset ) = wfCheckLimits();
64
65 $wpp = new MostrevisionsPage();
66
67 $wpp->doQuery( $offset, $limit );
68 }
69
70 ?>