SpecialUncategorizedpages.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @file
  4. * @ingroup SpecialPage
  5. */
  6. /**
  7. * A special page looking for page without any category.
  8. * @ingroup SpecialPage
  9. */
  10. class UncategorizedPagesPage extends PageQueryPage {
  11. var $requestedNamespace = NS_MAIN;
  12. function getName() {
  13. return "Uncategorizedpages";
  14. }
  15. function sortDescending() {
  16. return false;
  17. }
  18. function isExpensive() {
  19. return true;
  20. }
  21. function isSyndicated() { return false; }
  22. function getSQL() {
  23. $dbr = wfGetDB( DB_SLAVE );
  24. list( $page, $categorylinks ) = $dbr->tableNamesN( 'page', 'categorylinks' );
  25. $name = $dbr->addQuotes( $this->getName() );
  26. return
  27. "
  28. SELECT
  29. $name as type,
  30. page_namespace AS namespace,
  31. page_title AS title,
  32. page_title AS value
  33. FROM $page
  34. LEFT JOIN $categorylinks ON page_id=cl_from
  35. WHERE cl_from IS NULL AND page_namespace={$this->requestedNamespace} AND page_is_redirect=0
  36. ";
  37. }
  38. }
  39. /**
  40. * constructor
  41. */
  42. function wfSpecialUncategorizedpages() {
  43. list( $limit, $offset ) = wfCheckLimits();
  44. $lpp = new UncategorizedPagesPage();
  45. return $lpp->doQuery( $offset, $limit );
  46. }