Hello all,
Is there a way to make the RecentChanges list ignore changes in certain namespaces (e.g. USER and USER_TALK)? I think it's a bit odd that changes on my user page's ToDo list show up in the global RecentChanges list, so it'd be nice if I could fix that somehow.
Thanks,
F.
IIRC I have once done such by hacking the code (rewriting the SQL statement).
On 3/18/07, Frederik Dohr fdg001@gmx.net wrote:
Hello all,
Is there a way to make the RecentChanges list ignore changes in certain namespaces (e.g. USER and USER_TALK)? I think it's a bit odd that changes on my user page's ToDo list show up in the global RecentChanges list, so it'd be nice if I could fix that somehow.
Thanks,
F.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
If you want to only show a single Namespace, you can use the 'namespace' url parameter.
For example, consider mediawiki.org:
Original: http://www.mediawiki.org/wiki/Special:Recentchanges Only Main: http://www.mediawiki.org/wiki?title=Special:Recentchanges&namespace=0 Only Template: http://www.mediawiki.org/wiki?title=Special:Recentchanges&namespace=10
It's a relatively simple hack to change the default 'namespace' filter to one of these (currently it defaults to null). To do this, crack open $IP/includes/Specialrecentchanges.php and find this line:
/* text */ 'namespace' => null,
Change 'null' to whatever Namespace you want to display - 0 for Main, 2 for User, 4 for Project, etc.
Along those same lines, if you only want to omit one namespace (for example User), you can do the same steps as above, and also change the default value for the 'invert' parameter. When 'invert' is set to true, the 'namespace' parameter acts as a blacklist instead of a whitelist.
Filtering on more than one namespace requires more hacking. If many people have this request, it may make sense to patch-in a 'namespaces' parameter, which is a comma separated list of namespaces to filter on.
It might also make sense to move the $defaults specification from inside the wfSpecialRecentchanges() method to somewhere in DefaultSettings.php to make modifications to the default behavior easier.
-- Jim R. Wilson (jimbojw)
On 3/18/07, Frederik Dohr fdg001@gmx.net wrote:
IIRC I have once done such by hacking the code (rewriting the SQL
statement).
Sounds scary. I'll take a look though, maybe I'll figure it out - it might(!) actually be quite easy...
-- F.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Thanks for the extensive info, Jim!
For now, I'll exclude the USER namespace - though that means the USER TALK namespace will still be listed...
-- F.
----- Original Message ----- From: Jim Wilson Date: 2007-03-18 19:27
If you want to only show a single Namespace, you can use the 'namespace' url parameter.
For example, consider mediawiki.org:
Original: http://www.mediawiki.org/wiki/Special:Recentchanges Only Main: http://www.mediawiki.org/wiki?title=Special:Recentchanges&namespace=0 Only Template: http://www.mediawiki.org/wiki?title=Special:Recentchanges&namespace=10
It's a relatively simple hack to change the default 'namespace' filter to one of these (currently it defaults to null). To do this, crack open $IP/includes/Specialrecentchanges.php and find this line:
/* text */ 'namespace' => null,
Change 'null' to whatever Namespace you want to display - 0 for Main, 2 for User, 4 for Project, etc.
Along those same lines, if you only want to omit one namespace (for example User), you can do the same steps as above, and also change the default value for the 'invert' parameter. When 'invert' is set to true, the 'namespace' parameter acts as a blacklist instead of a whitelist.
Filtering on more than one namespace requires more hacking. If many people have this request, it may make sense to patch-in a 'namespaces' parameter, which is a comma separated list of namespaces to filter on.
It might also make sense to move the $defaults specification from inside the wfSpecialRecentchanges() method to somewhere in DefaultSettings.php to make modifications to the default behavior easier.
-- Jim R. Wilson (jimbojw)
I've tried this today - unsuccessfully:
In SpecialRecentchanges.php, I've changed the code as you've described: 'namespace' => null to either one of the following: 'namespace' => '2', 'namespace' => 2, /* not sure if that makes a difference in PHP */ 'namespace' => NS_USER, /* probably the best solution */ (as well as changing "invert" to true)
However, nothing has changed whatsoever; the RecentChanges list is still the same (I've also tried it with the URL parameter "action=purge", but to no avail). Even if I do not invert the results (i.e. only want to display results from the USER namespace), the RecentChanges list does not change one bit.
This is very puzzling to me - though I assume there's a very simple explanation for it... !?
-- F.
There may be something in there I didn't account for - I haven't tested any of this (just looked at the code).
In general, it's not a good idea to hack the core code unless you have a good reason to do so. Are you trying to limit the namespaces for your personal use, or for everybody?
If you're trying to keep everyone from seeing changes in other namespaces, the "proper" place to hack the code would be later on in that method - during the SQL query generation step. My suggestion was just to alter the defaults - not limit functionality.
-- Jim
On 3/19/07, Frederik Dohr fdg001@gmx.net wrote:
I've tried this today - unsuccessfully:
In SpecialRecentchanges.php, I've changed the code as you've described: 'namespace' => null to either one of the following: 'namespace' => '2', 'namespace' => 2, /* not sure if that makes a difference in PHP */ 'namespace' => NS_USER, /* probably the best solution */ (as well as changing "invert" to true)
However, nothing has changed whatsoever; the RecentChanges list is still the same (I've also tried it with the URL parameter "action=purge", but to no avail). Even if I do not invert the results (i.e. only want to display results from the USER namespace), the RecentChanges list does not change one bit.
This is very puzzling to me - though I assume there's a very simple explanation for it... !?
-- F.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
In general, it's not a good idea to hack the core code unless you have a good reason to do so.
I agree. A nice thing might be to "hijack" (overload?) that function by re-writing it in the LocalSettings.php - not sure whether/how that'd be possible though...
Are you trying to limit the namespaces for your personal use, or for everybody?
For everybody; I think it's a bit odd when changes on user pages appear on the global RecentChanges list...
If you're trying to keep everyone from seeing changes in other namespaces, the "proper" place to hack the code would be later on in that method - during the SQL query generation step. My suggestion was just to alter the defaults - not limit functionality.
I'll look into it - though it's not really a crucial issue, but rather a minor annoyance.
Thanks for you assistance!
-- F.
mediawiki-l@lists.wikimedia.org