4 * Special page for listing the articles with the fewest revisions.
7 * @addtogroup SpecialPage
8 * @author Martin Drashkov
10 class FewestrevisionsPage
extends QueryPage
{
13 return 'Fewestrevisions';
16 function isExpensive() {
20 function isSyndicated() {
25 $dbr = wfGetDB( DB_SLAVE
);
26 list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' );
28 return "SELECT 'Fewestrevisions' as type,
29 page_namespace as namespace,
33 JOIN $page ON page_id = rev_page
34 WHERE page_namespace = " . NS_MAIN
. "
39 function sortDescending() {
43 function formatResult( $skin, $result ) {
44 global $wgLang, $wgContLang;
46 $nt = Title
::makeTitleSafe( $result->namespace, $result->title
);
47 $text = $wgContLang->convert( $nt->getPrefixedText() );
49 $plink = $skin->makeKnownLinkObj( $nt, $text );
51 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
52 $wgLang->formatNum( $result->value
) );
53 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
55 return wfSpecialList( $plink, $nlink );
59 function wfSpecialFewestrevisions() {
60 list( $limit, $offset ) = wfCheckLimits();
61 $frp = new FewestrevisionsPage();
62 $frp->doQuery( $offset, $limit );