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
{
25 function isExpensive() {
28 function isSyndicated() { return false; }
31 $dbr =& wfGetDB( DB_SLAVE
);
32 $page = $dbr->tableName( 'page' );
33 $text = $dbr->tableName( 'text' );
34 $name = $dbr->addQuotes( $this->getName() );
36 # FIXME: Not only is this teh suck, it will fail
37 # if we compress revisions on save as it will return
38 # the compressed size.
40 "SELECT $name as type,
41 page_namespace as namespace,
43 LENGTH(old_text) AS value
45 WHERE page_namespace=".NS_MAIN
." AND page_is_redirect=0
46 AND page_latest=old_id";
49 function sortDescending() {
53 function formatResult( $skin, $result ) {
54 global $wgLang, $wgContLang;
55 $nb = wfMsg( "nbytes", $wgLang->formatNum( $result->value
) );
56 $link = $skin->makeKnownLink( $result->title
, $wgContLang->convert( $result->title
) );
57 return "{$link} ({$nb})";
64 function wfSpecialShortpages() {
65 list( $limit, $offset ) = wfCheckLimits();
67 $spp = new ShortPagesPage();
69 return $spp->doQuery( $offset, $limit );