SpecialUncategorizedimages.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. /**
  3. * Special page lists images which haven't been categorised
  4. *
  5. * @file
  6. * @ingroup SpecialPage
  7. * @author Rob Church <robchur@gmail.com>
  8. */
  9. /**
  10. * @ingroup SpecialPage
  11. */
  12. class UncategorizedImagesPage extends ImageQueryPage {
  13. function getName() {
  14. return 'Uncategorizedimages';
  15. }
  16. function sortDescending() {
  17. return false;
  18. }
  19. function isExpensive() {
  20. return true;
  21. }
  22. function isSyndicated() {
  23. return false;
  24. }
  25. function getSQL() {
  26. $dbr = wfGetDB( DB_SLAVE );
  27. list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' );
  28. $ns = NS_FILE;
  29. return "SELECT 'Uncategorizedimages' AS type, page_namespace AS namespace,
  30. page_title AS title, page_title AS value
  31. FROM {$page} LEFT JOIN {$categorylinks} ON page_id = cl_from
  32. WHERE cl_from IS NULL AND page_namespace = {$ns} AND page_is_redirect = 0";
  33. }
  34. }
  35. function wfSpecialUncategorizedimages() {
  36. $uip = new UncategorizedImagesPage();
  37. list( $limit, $offset ) = wfCheckLimits();
  38. return $uip->doQuery( $offset, $limit );
  39. }