From: Sam Reed Date: Sat, 24 Apr 2010 11:05:15 +0000 (+0000) Subject: * (bug 23276) Add hook to Special:NewPages to modify query X-Git-Tag: 1.31.0-rc.0~37023 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=7c0aecb42b61a4a835645be0095001f444781203;p=lhc%2Fweb%2Fwiklou.git * (bug 23276) Add hook to Special:NewPages to modify query Patch by Dan Barrett --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 423aae1011..2bec9f1bbd 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/docs/hooks.txt b/docs/hooks.txt index e3be9214cb..1e99af4f60 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -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 diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 91d552e874..5bc34a5098 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -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' ),