Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

SpecialWantedpages.php

Go to the documentation of this file.
00001 <?php 00002 00003 require_once ( "QueryPage.php" ) ; 00004 00005 class WantedPagesPage extends QueryPage { 00006 00007 function getName() { 00008 return "Wantedpages"; 00009 } 00010 00011 function isExpensive() { 00012 return true; 00013 } 00014 00015 function getSQL() { 00016 # We cheat and return the full-text from bl_to in the title. 00017 # In the future, a pre-parsed name will be available. 00018 return 00019 "SELECT 'Wantedpages' as type, 00020 0 as namespace, 00021 bl_to as title, 00022 COUNT(DISTINCT bl_from) as value 00023 FROM brokenlinks 00024 GROUP BY bl_to 00025 HAVING value > 1"; 00026 } 00027 00028 function formatResult( $skin, $result ) { 00029 global $wgLang; 00030 00031 $nt = Title::newFromDBkey( $result->title ); 00032 if( is_null( $nt ) ) { 00033 return "<!-- Bad title '" . htmlspecialchars( $result->title ) . "' -->"; 00034 } 00035 $plink = $skin->makeBrokenLink( $nt->getPrefixedText(), "" ); 00036 $nl = wfMsg( "nlinks", $result->value ); 00037 $nlink = $skin->makeKnownLink( $wgLang->specialPage( "Whatlinkshere" ), $nl, 00038 "target=" . $nt->getPrefixedURL() ); 00039 00040 return "{$plink} ({$nlink})"; 00041 } 00042 } 00043 00044 function wfSpecialWantedpages() 00045 { 00046 list( $limit, $offset ) = wfCheckLimits(); 00047 00048 $wpp = new WantedPagesPage(); 00049 00050 $wpp->doQuery( $offset, $limit ); 00051 } 00052 00053 ?>

Generated on Tue Jun 29 23:40:07 2004 for Mediawiki by doxygen 1.3.7