fix typo, DieDebug -> DebugDie
[lhc/web/wiklou.git] / includes / SpecialUnusedimages.php
1 <?php
2 /**
3 *
4 * @package MediaWiki
5 * @subpackage SpecialPage
6 */
7
8 /** */
9 require_once("QueryPage.php");
10
11 /**
12 * @package MediaWiki
13 * @subpackage SpecialPage
14 */
15 class UnusedimagesPage extends QueryPage {
16
17 function getName() {
18 return 'Unusedimages';
19 }
20
21 function sortDescending() {
22 return false;
23 }
24 function isSyndicated() { return false; }
25
26 function getSQL() {
27 $dbr =& wfGetDB( DB_SLAVE );
28 extract( $dbr->tableNames( 'image','imagelinks' ) );
29
30 return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description' .
31 ' FROM '.$image.' LEFT JOIN '.$imagelinks.' ON img_name=il_to WHERE il_to IS NULL ';
32 }
33
34 function formatResult( $skin, $result ) {
35 global $wgLang, $wgContLang;
36 $title = Title::makeTitle( NS_IMAGE, $result->title );
37
38 $imageUrl = htmlspecialchars( Image::wfImageUrl( $result->title ) );
39 $return =
40 # The 'desc' linking to the image page
41 '('.$skin->makeKnownLinkObj( $title, wfMsg('imgdesc') ).') '
42 # Link to the image itself
43 . '<a href="' . $imageUrl . '">' . htmlspecialchars( $title->getText() ) . '</a>'
44 # Last modified date
45 . ' . . '.$wgLang->timeanddate($result->value)
46 # Link to username
47 . ' . . '.$skin->makeLinkObj( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text)
48 # If there is a description, show it
49 . $skin->commentBlock( $result->img_description );
50
51 return $return;
52 }
53
54 function getPageHeader() {
55 return wfMsg( "unusedimagestext" );
56 }
57
58 }
59
60 /**
61 * Entry point
62 */
63 function wfSpecialUnusedimages() {
64 list( $limit, $offset ) = wfCheckLimits();
65 $uip = new UnusedimagesPage();
66
67 return $uip->doQuery( $offset, $limit );
68 }
69 ?>