Only generate truecolor PNGs if original image is already truecolor.
[lhc/web/wiklou.git] / includes / SpecialWantedpages.php
1 <?php
2
3 require_once ( "QueryPage.php" ) ;
4
5 class WantedPagesPage extends QueryPage {
6
7 function getName() {
8 return "Wantedpages";
9 }
10
11 function isExpensive() {
12 return true;
13 }
14
15 function getSQL() {
16 # We cheat and return the full-text from bl_to in the title.
17 # In the future, a pre-parsed name will be available.
18 return
19 "SELECT 'Wantedpages' as type,
20 0 as namespace,
21 bl_to as title,
22 COUNT(DISTINCT bl_from) as value
23 FROM brokenlinks
24 GROUP BY bl_to
25 HAVING value > 1";
26 }
27
28 function formatResult( $skin, $result ) {
29 global $wgLang;
30
31 $nt = Title::newFromDBkey( $result->title );
32 if( is_null( $nt ) ) {
33 return "<!-- Bad title '" . htmlspecialchars( $result->title ) . "' -->";
34 }
35 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" );
36 $nl = wfMsg( "nlinks", $result->value );
37 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl,
38 "target=" . $nt->getPrefixedURL() );
39
40 return "{$plink} ({$nlink})";
41 }
42 }
43
44 function wfSpecialWantedpages()
45 {
46 list( $limit, $offset ) = wfCheckLimits();
47
48 $wpp = new WantedPagesPage();
49
50 $wpp->doQuery( $offset, $limit );
51 }
52
53 ?>