8 * Special page for listing the articles with the fewest revisions.
10 * @ingroup SpecialPage
11 * @author Martin Drashkov
13 class FewestrevisionsPage
extends QueryPage
{
16 return 'Fewestrevisions';
19 function isExpensive() {
23 function isSyndicated() {
28 $dbr = wfGetDB( DB_SLAVE
);
29 list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' );
31 return "SELECT 'Fewestrevisions' as type,
32 page_namespace as namespace,
36 JOIN $page ON page_id = rev_page
37 WHERE page_namespace = " . NS_MAIN
. "
42 function sortDescending() {
46 function formatResult( $skin, $result ) {
47 global $wgLang, $wgContLang;
49 $nt = Title
::makeTitleSafe( $result->namespace, $result->title
);
50 $text = $wgContLang->convert( $nt->getPrefixedText() );
52 $plink = $skin->makeKnownLinkObj( $nt, $text );
54 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
55 $wgLang->formatNum( $result->value
) );
56 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
58 return wfSpecialList( $plink, $nlink );
62 function wfSpecialFewestrevisions() {
63 list( $limit, $offset ) = wfCheckLimits();
64 $frp = new FewestrevisionsPage();
65 $frp->doQuery( $offset, $limit );