5 * @subpackage SpecialPage
11 require_once("QueryPage.php");
14 * SpecialShortpages extends QueryPage. It is used to return the shortest
15 * pages in the database.
17 * @subpackage SpecialPage
19 class ShortPagesPage
extends QueryPage
{
26 * This query is indexed as of 1.5
28 function isExpensive() {
32 function isSyndicated() {
37 $dbr =& wfGetDB( DB_SLAVE
);
38 $page = $dbr->tableName( 'page' );
39 $name = $dbr->addQuotes( $this->getName() );
42 "SELECT $name as type,
43 page_namespace as namespace,
46 FROM $page FORCE INDEX (page_len)
47 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0";
50 function sortDescending() {
54 function formatResult( $skin, $result ) {
55 global $wgLang, $wgContLang;
56 $nb = htmlspecialchars( wfMsg( 'nbytes', $wgLang->formatNum( $result->value
) ) );
57 $title = Title
::makeTitle( $result->namespace, $result->title
);
58 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
59 $histlink = $skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' );
60 return "({$histlink}) $link ({$nb})";
67 function wfSpecialShortpages() {
68 list( $limit, $offset ) = wfCheckLimits();
70 $spp = new ShortPagesPage();
72 return $spp->doQuery( $offset, $limit );