5 * Special page for listing the articles with the fewest revisions.
8 * @subpackage Special pages
9 * @author Martin Drashkov
12 class FewestrevisionsPage
extends QueryPage
{
15 return 'Fewestrevisions';
18 function isExpensive() {
22 function isSyndicated() {
27 $dbr = wfGetDB( DB_SLAVE
);
28 list( $revision, $page ) = $dbr->tableNamesN( 'revision', 'page' );
30 return "SELECT 'Fewestrevisions' as type,
31 page_namespace as namespace,
35 JOIN $page ON page_id = rev_page
36 WHERE page_namespace = " . NS_MAIN
. "
41 function sortDescending() {
45 function formatResult( $skin, $result ) {
46 global $wgLang, $wgContLang;
48 $nt = Title
::makeTitleSafe( $result->namespace, $result->title
);
49 $text = $wgContLang->convert( $nt->getPrefixedText() );
51 $plink = $skin->makeKnownLinkObj( $nt, $text );
53 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
54 $wgLang->formatNum( $result->value
) );
55 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' );
57 return wfSpecialList( $plink, $nlink );
61 function wfSpecialFewestrevisions() {
62 list( $limit, $offset ) = wfCheckLimits();
63 $frp = new FewestrevisionsPage();
64 $frp->doQuery( $offset, $limit );