3 function wfSpecialLonelypages()
5 global $wgUser, $wgOut, $wgLang, $wgTitle;
6 $fname = "wfSpecialLonelypages";
9 $vsp = $wgLang->getValidSpecialPages();
10 $log = new LogPage( $vsp["Lonelypages"] );
11 $log->mUpdateRecentChanges
= false;
15 $log->showAsDisabledPage();
19 list( $limit, $offset ) = wfCheckLimits();
21 $sql = "SELECT cur_title FROM cur LEFT JOIN links ON " .
22 "cur_id=l_to WHERE l_to IS NULL AND cur_namespace=0 AND " .
23 "cur_is_redirect=0 ORDER BY cur_title LIMIT {$offset}, {$limit}";
24 $res = wfQuery( $sql, $fname );
26 $sk = $wgUser->getSkin();
28 $top = wfShowingResults( $offset, $limit );
29 $wgOut->addHTML( "<p>{$top}\n" );
31 $sl = wfViewPrevNext( $offset, $limit,
32 $wgLang->specialPage( "Lonelypages" ) );
33 $wgOut->addHTML( "<br>{$sl}\n" );
35 $s = "<ol start=" . ( $offset +
1 ) . ">";
36 while ( $obj = wfFetchObject( $res ) ) {
37 $link = $sk->makeKnownLink( $obj->cur_title
, "" );
38 $s .= "<li>{$link}</li>\n";
42 $wgOut->addHTML( $s );
43 $wgOut->addHTML( "<p>{$sl}\n" );
46 if ( $offset > 0 OR $limit < 50 ) return ; #Not suitable
47 $log->replaceContent( $s );