5 * @subpackage SpecialPage
9 require_once("QueryPage.php");
13 * @subpackage SpecialPage
15 class UnusedimagesPage
extends QueryPage
{
18 return 'Unusedimages';
21 function sortDescending() {
24 function isSyndicated() { return false; }
27 $dbr =& wfGetDB( DB_SLAVE
);
28 extract( $dbr->tableNames( 'image','imagelinks' ) );
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 ';
34 function formatResult( $skin, $result ) {
35 global $wgLang, $wgContLang;
36 $title = Title
::makeTitle( NS_IMAGE
, $result->title
);
38 $imageUrl = htmlspecialchars( Image
::imageUrl( $result->title
) );
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>'
45 . ' . . '.$wgLang->timeanddate($result->value
)
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
);
54 function getPageHeader() {
55 return wfMsg( "unusedimagestext" );
63 function wfSpecialUnusedimages() {
64 list( $limit, $offset ) = wfCheckLimits();
65 $uip = new UnusedimagesPage();
67 return $uip->doQuery( $offset, $limit );