I figured out how to turn of the section [edit] links for people who are not logged in. I still want [edit] links for people who ARE logged in.
Go to includes/Skin.php line 526
Change:
Code:
if( !$wgUser->getOption( 'editsection' ) ) {
to this:
Code:
if( !$wgUser->getOption( 'editsection' ) || !$wgUser->isLoggedIn() ) {
Is there any more graceful or efficient way to do this?
二、
Another way of doing it, insert just above the </head> tags on your skin.php (ie MonoBook.php)
Code:
<?php if(!$this->data['loggedin']==1) { ?>
<style>
.editsection { display: none !important; }
</style>
<?php } ?>
三、
I didn't think of this before but actually the recommended way is by adding this line in your LocalSettings.php
$wgDefaultUserOptions ['editsection'] = false;
四、
Removing the section edit link also for "Logged in" Users
Hi!
I want to remove the "Edit section" links ALSO FOR LOGGED IN USERs.
I have seen your posts and also found the "wgDefaultUserOptions" boolean to hide the edit section link for anonymous users.
I am working on a wiki for very low level users and I am forcing them to edit the articles using a template. Therefore, I would like to remove the edit section link from the article.
How could I do it?
Perhaps ... (instead of negation of loggedin ...).
?php if($this->data['loggedin']==1) { ?>
<style>
.editsection { display: none !important; }
</style>
<?php } ?>
What do you mean? Is there another better way?
Is there some boolean like "wgDefaultUserOptions" (for example wgLoggedInUserOptions) for this configuration?
Thanks
五、
Why don't you just put it in your Common.css?
Code:
.editsection {
display: none;
}
六、
or place __NOEDITSECTION__ on the page
七、
I did it as I wrote yesterday
?php if($this->data['loggedin']==1) { ?>
<style>
.editsection { display: none !important; }
</style>
<?php } ?>
and of course it works. Thank you for your BETTER ways of doing that.
Question for Bradlee: if I change it in Common.css, will be the settings in Monobook.php overwritten?
Thank you.
本文永久链接: http://www.zzxj.net/blog/fxs_2008/archive/2010/02/18/114.html
发表于 @ 2010年02月18日 |评论(loading... )|收藏