diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 18:12:39 +0000 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2006-10-11 18:12:39 +0000 |
commit | 183851b06bd6c52f3cae5375f433da720d410447 (patch) | |
tree | a477257decbf3360127f6739c2f9d0ec57a03d39 /includes/SpecialUncategorizedimages.php |
MediaWiki 1.7.1 wiederhergestellt
Diffstat (limited to 'includes/SpecialUncategorizedimages.php')
-rw-r--r-- | includes/SpecialUncategorizedimages.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/includes/SpecialUncategorizedimages.php b/includes/SpecialUncategorizedimages.php new file mode 100644 index 00000000..38156976 --- /dev/null +++ b/includes/SpecialUncategorizedimages.php @@ -0,0 +1,55 @@ +<?php + +/** + * Special page lists images which haven't been categorised + * + * @package MediaWiki + * @subpackage Special pages + * @author Rob Church <robchur@gmail.com> + */ + +class UncategorizedImagesPage extends QueryPage { + + function getName() { + return 'Uncategorizedimages'; + } + + function sortDescending() { + return false; + } + + function isExpensive() { + return true; + } + + function isSyndicated() { + return false; + } + + function getSQL() { + $dbr =& wfGetDB( DB_SLAVE ); + extract( $dbr->tableNames( 'page', 'categorylinks' ) ); + $ns = NS_IMAGE; + + return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace, + page_title AS title, page_title AS value + FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from + WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0"; + } + + function formatResult( &$skin, $row ) { + global $wgContLang; + $title = Title::makeTitleSafe( NS_IMAGE, $row->title ); + $label = htmlspecialchars( $wgContLang->convert( $title->getText() ) ); + return $skin->makeKnownLinkObj( $title, $label ); + } + +} + +function wfSpecialUncategorizedimages() { + $uip = new UncategorizedImagesPage(); + list( $limit, $offset ) = wfCheckLimits(); + return $uip->doQuery( $offset, $limit ); +} + +?> |