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,
34 page_is_redirect as redirect,
37 JOIN $page ON page_id = rev_page
38 WHERE page_namespace = " . NS_MAIN
. "
39 GROUP BY page_namespace, page_title, page_is_redirect
41 // ^^^ This was probably here to weed out redirects.
42 // Since we mark them as such now, it might be
43 // useful to remove this. People _do_ create pages
44 // and never revise them, they aren't necessarily
48 function sortDescending() {
52 function formatResult( $skin, $result ) {
53 global $wgLang, $wgContLang;
55 $nt = Title
::makeTitleSafe( $result->namespace, $result->title
);
56 $text = $wgContLang->convert( $nt->getPrefixedText() );
58 $plink = $skin->makeKnownLinkObj( $nt, $text );
60 $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
61 $wgLang->formatNum( $result->value
) );
62 $redirect = $result->redirect ?
' - ' . wfMsg( 'isredirect' ) : '';
63 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ) . $redirect;
66 return wfSpecialList( $plink, $nlink );
70 function wfSpecialFewestrevisions() {
71 list( $limit, $offset ) = wfCheckLimits();
72 $frp = new FewestrevisionsPage();
73 $frp->doQuery( $offset, $limit );