Beginnings of on-page author credits. Added code to Skin to add credits,
[mediawiki.git] / includes / SpecialCategories.php
blob1a3efca0cceee5c71a0b1182a6c2d4ae52476624
1 <?php
3 function wfSpecialCategories()
5 global $wgUser, $wgOut , $wgLang;
7 $sk = $wgUser->getSkin() ;
8 $sc = "Special:Categories" ;
10 # List all existant categories.
11 # Note: this list could become *very large*
12 $r = "<ol>\n" ;
13 $sql = "SELECT cur_title FROM cur WHERE cur_namespace=".Namespace::getCategory() ;
14 $res = wfQuery ( $sql, DB_READ ) ;
15 while ( $x = wfFetchObject ( $res ) ) {
16 $title =& Title::makeTitle( NS_CATEGORY, $x->cur_title );
17 $r .= "<li>" ;
18 $r .= $sk->makeKnownLinkObj ( $title, $title->getText() ) ;
19 $r .= "</li>\n" ;
21 wfFreeResult ( $res ) ;
22 $r .= "</ol>\n" ;
24 $r .= "<hr />\n" ;
26 # Links to category pages that haven't been created.
27 # FIXME: This could be slow if there are a lot, but the title index should
28 # make it reasonably snappy since we're using an index.
29 $cat = wfStrencode( $wgLang->getNsText( NS_CATEGORY ) );
30 $sql = "SELECT DISTINCT bl_to FROM brokenlinks WHERE bl_to LIKE \"{$cat}:%\"" ;
31 $res = wfQuery ( $sql, DB_READ ) ;
32 $r .= "<ol>\n" ;
33 while ( $x = wfFetchObject ( $res ) ) {
34 $title = Title::newFromDBkey( $x->bl_to );
35 $r .= "<li>" ;
36 $r .= $sk->makeBrokenLinkObj( $title, $title->getText() ) ;
37 $r .= "</li>\n" ;
39 wfFreeResult ( $res ) ;
40 $r .= "</ol>\n" ;
42 $wgOut->addHTML ( $r ) ;