* (bug 23276) Add hook to Special:NewPages to modify query
authorSam Reed <reedy@users.mediawiki.org>
Sat, 24 Apr 2010 11:05:15 +0000 (11:05 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 24 Apr 2010 11:05:15 +0000 (11:05 +0000)
Patch by Dan Barrett

RELEASE-NOTES
docs/hooks.txt
includes/specials/SpecialNewpages.php

index 423aae1..2bec9f1 100644 (file)
@@ -52,6 +52,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * When visiting a "red link" of a deleted file, a deletion and move log excerpt
   is provided on the Upload form.
 * (bug 22647) Add category details in search results.
+* (bug 23276) Add hook to Special:NewPages to modify query
 
 === Bug fixes in 1.17 ===
 * (bug 17560) Half-broken deletion moved image files to deletion archive
index e3be921..1e99af4 100644 (file)
@@ -1472,6 +1472,11 @@ $movePage: MovePageForm object
 $oldTitle: old title (object)
 $newTitle: new title (object)
 
+'SpecialNewpagesConditions': called when building sql query for Special:NewPages
+&$special: NewPagesPager object (subclass of ReverseChronologicalPager)
+&opts: FormOptions object containing special page options
+&$conds: array of WHERE conditionals for query
+
 'SpecialPage_initList': called when setting up SpecialPage::$mList, use this
 hook to remove a core special page
 $list: list (array) of core special pages
index 91d552e..5bc34a5 100644 (file)
@@ -435,6 +435,9 @@ class NewPagesPager extends ReverseChronologicalPager {
                if ( $this->opts->getValue( 'hideredirs' ) ) {
                        $conds['page_is_redirect'] = 0;
                }
+  
+               // Allow changes to the New Pages query
+               wfRunHooks('SpecialNewpagesConditions', array(&$this, $this->opts, &$conds));
 
                $info = array(
                        'tables' => array( 'recentchanges', 'page' ),