Manual talk:Hooks/SpecialRecentChangesQuery

From MediaWiki.org
Jump to: navigation, search

The hook parameters should be extended and also pass $query_options to allow a modification. I suggest

function fnMyHook( &$conds, &$tables, &$join_conds, $opts , &$query_options )

--Wikinaut 02:16, 29 January 2010 (UTC)

Fixed in r61670.

[edit] Compact view of recent changes: list only the most recent change of a page, suppress older

See Extension:OnlyRecentRecentChanges.

A long-felt need for my wikis was to suppress the listing of older revisions of a page. Add the following code to your $IP/LocalSettings.php to have any changed page only listed once. --Wikinaut 20:49, 13 February 2010 (UTC) Feedback is welcome.

// see http://www.mediawiki.org/wiki/Manual:Hooks/SpecialRecentChangesQuery
function onlyRecentRecentChanges( &$conds, &$tables, &$join_conds, $opts, &$query_options = array() ) {
        $tables[] = 'page';
        $conds[] = 'rc_this_oldid=page_latest';
        return true;
}
$wgHooks['SpecialRecentChangesQuery'][] = 'onlyRecentRecentChanges';
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox