4 * Special page for listing the articles with the fewest revisions.
6 * @addtogroup SpecialPage
7 * @author Martin Drashkov
9 class FewestrevisionsPage
extends QueryPage
{
12 return 'Fewestrevisions';
15 function isExpensive() {
19 function isSyndicated() {
24 $dbr = wfGetDB( DB_SLAVE
);
25 list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' );
27 return "SELECT 'Fewestrevisions' as type,
28 page_namespace as namespace,
32 JOIN $page ON page_id = rev_page
33 WHERE page_namespace = " . NS_MAIN
. "
38 function sortDescending() {
42 function formatResult( $skin, $result ) {
43 global $wgLang, $wgContLang;
45 $nt = Title
::makeTitleSafe( $result->namespace, $result->title
);
46 $text = $wgContLang->convert( $nt->getPrefixedText() );
48 $plink = $skin->makeKnownLinkObj( $nt, $text );
50 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
51 $wgLang->formatNum( $result->value
) );
52 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
54 return wfSpecialList( $plink, $nlink );
58 function wfSpecialFewestrevisions() {
59 list( $limit, $offset ) = wfCheckLimits();
60 $frp = new FewestrevisionsPage();
61 $frp->doQuery( $offset, $limit );