5 * @subpackage SpecialPage
9 require_once("QueryPage.php");
14 class UnusedimagesPage
extends QueryPage
{
17 return 'Unusedimages';
20 function sortDescending() {
25 $dbr =& wfGetDB( DB_SLAVE
);
26 extract( $dbr->tableNames( 'image','imagelinks' ) );
28 return 'SELECT img_name as title, img_user, img_user_text, img_timestamp as value, img_description' .
29 ' FROM '.$image.' LEFT JOIN '.$imagelinks.' ON img_name=il_to WHERE il_to IS NULL ';
32 function formatResult( $skin, $result ) {
33 global $wgLang, $wgContLang;
34 $title = Title
::makeTitle( NS_IMAGE
, $result->title
);
35 $ins = $wgContLang->getNsText(NS_IMAGE
);
38 # The 'desc' linking to the image page
39 '('.$skin->makeKnownLink( $ins.':'.$result->title
, wfMsg('imgdesc') ).') '
40 # Link to the image itself
41 . '<a href="'.Image
::wfImageUrl($title->getText()).'">'.$title->getText().'</a>'
43 . ' . . '.$wgLang->timeanddate($result->value
)
45 . ' . . '.$skin->makeLink($wgContLang->getNsText(NS_USER
).':'.$result->img_user_text
,$result->img_user_text
);
47 # If there is a description, show it
48 if($result->img_description
!= '') {
49 $return .= ' <em>('.$result->img_description
.')</em>';
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 );