Anyone have much experience with the Restricted Namespaces patch?
http://meta.wikimedia.org/wiki/Hidden_pages#version_1.5 http://bugzilla.wikimedia.org/show_bug.cgi?id=1924
I've got it installed and configured... works great.
When a user logs in, a list of the namespaces to which s/he has access is presented. I would like to add that list to the sidebar between the navigation box (MediaWiki:Sidebar) and the search box (MediaWiki:Search).
Any thoughts on the best way to approach this?
Dan
On 5/24/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
When a user logs in, a list of the namespaces to which s/he has access is presented. I would like to add that list to the sidebar between the navigation box (MediaWiki:Sidebar) and the search box (MediaWiki:Search).
Anyone?
This is the code in SpecialUserlogin.php that prints the list... I want to repeat this in the sidebar...
if ($wgUser->getRMainPages() != NULL) { # We are going to put some links to restricted namespaces # that the user has access to, so we disable the warning. $wgLinkWarn = false;
$wgOut->addWikiText("<hr><b>Restricted Namespace Access<br>".str_replace( '_', ' ',$wgUser->getRMainPages())."</b><hr>"); $wgOut->returnToMain(false); } else { $wgOut->returnToMain( $auto ); }
Pointers?
Dan
On 5/24/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
Anyone have much experience with the Restricted Namespaces patch?
http://meta.wikimedia.org/wiki/Hidden_pages#version_1.5 http://bugzilla.wikimedia.org/show_bug.cgi?id=1924
I've got it installed and configured... works great.
When a user logs in, a list of the namespaces to which s/he has access is presented. I would like to add that list to the sidebar between the navigation box (MediaWiki:Sidebar) and the search box (MediaWiki:Search).
Figured out how to do this myself.... I've attached the patch to Skin.php if anyone is interested. It really makes the restricted namespaces patch much more useful.
Question now... is it possible to do this with an extension rather than editing source itself?
Dan
On 6/30/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
Figured out how to do this myself.... I've attached the patch to Skin.php if anyone is interested. It really makes the restricted namespaces patch much more useful.
It appears that your attachment hasn't come through to the mailing list. Or maybe I misunderstood and the patch would go on bug 1924, but I can't see it there either. It really ought to go there. If you can take a moment to donate it, I'm sure one of the guys there could use it. =)
On 7/1/06, Sy Ali sy1234@gmail.com wrote:
On 6/30/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
Figured out how to do this myself.... I've attached the patch to Skin.php if anyone is interested. It really makes the restricted namespaces patch much more useful.
It appears that your attachment hasn't come through to the mailing list. Or maybe I misunderstood and the patch would go on bug 1924, but I can't see it there either. It really ought to go there. If you can take a moment to donate it, I'm sure one of the guys there could use it. =)
Good idea... I didn't even think of that... if anyone needs it, it's now attached to bug 1924...
http://bugzilla.wikimedia.org/attachment.cgi?id=2046&action=view
Dan
On 7/3/06, Dan Davis hokie99cpe+wiki@gmail.com wrote:
Good idea... I didn't even think of that... if anyone needs it, it's now attached to bug 1924...
http://bugzilla.wikimedia.org/attachment.cgi?id=2046&action=view
Dan
For those interested, I have updated the Restricted Namespaces patches for v.1.7.1. I made a once over and didn't find anything major busted... but, if you use 'em and find something wrong, let me know please. :)
Get 'em here: http://bugzilla.wikimedia.org/attachment.cgi?id=2082
One thing, and maybe someone here can fill me in, I was not able to integrate a snippet from an earlier version of the patch into Parser.php. If you can tell me where/how this should fit in to the 1.7.1 code, I would appreciate it... or, if you can tell me that it's not needed, that's even better!
*************** *** 2527,2532 **** --- 2537,2546 ---- if ( !$found ) { # Check for NS: (namespace expansion) $mwNs = MagicWord::get( MAG_NS ); + if ( $part1 == 'ns' ) { + $text = $linestart . $wgContLang->getNsText( $this->mTitle->getNamespace() ); + $found = true; + } if ( $mwNs->matchStartAndRemove( $part1 ) ) { if ( intval( $part1 ) || $part1 == "0" ) { $text = $linestart . $wgContLang->getNsText( intval( $part1 ) ); ***************
Dan
mediawiki-l@lists.wikimedia.org