3 function wfSpecialShortpages()
5 global $wgUser, $wgOut, $wgLang, $wgTitle;
6 $fname = "wfSpecialShortpages";
9 $vsp = $wgLang->getValidSpecialPages();
10 $log = new LogPage( $vsp["Shortpages"] );
11 $log->mUpdateRecentChanges
= false;
15 $log->showAsDisabledPage();
19 list( $limit, $offset ) = wfCheckLimits();
21 $sql = "SELECT cur_title, LENGTH(cur_text) AS len FROM cur " .
22 "WHERE cur_namespace=0 AND cur_is_redirect=0 ORDER BY " .
23 "LENGTH(cur_text) LIMIT {$offset}, {$limit}";
24 $res = wfQuery( $sql, $fname );
26 $top = wfShowingResults( $offset, $limit );
27 $wgOut->addHTML( "<p>{$top}\n" );
29 $sl = wfViewPrevNext( $offset, $limit,
30 $wgLang->specialPage( "Shortpages" ) );
31 $wgOut->addHTML( "<br>{$sl}\n" );
33 $sk = $wgUser->getSkin();
34 $s = "<ol start=" . ( $offset +
1 ) . ">";
35 while ( $obj = wfFetchObject( $res ) ) {
36 $nb = str_replace( "$1", $obj->len
, wfMsg( "nbytes" ) );
37 $link = $sk->makeKnownLink( $obj->cur_title
, "" );
38 $s .= "<li>{$link} ({$nb})</li>\n";
42 $wgOut->addHTML( $s );
43 $wgOut->addHTML( "<p>{$sl}\n" );
47 if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable
48 $log->replaceContent( $s );