You are here Home > Know-how > MediaWiki - CMS > Reference Tips & Tricks > MediaWiki Recipes (Tips)
MediaWiki - CMS
 

4.6 MediaWiki Recipes (Tips)

15.06.2007
4.5 How do I add a table of contents? [  up  ] - [ A - Z ] - [ top ] 4.7 Error Messages (Hints)

MediaWiki Recipes

  1. Log editing activities of specific Wiki pages
    [ includes/EditPage.php → function editForm ]
    if ( 'save' == $formtype ) {
    if (preg_match("/\/Main_Page$/", $this->mTitle->getFullURL())) {
    	error_log("Main Page was edited by " . $wgUser->getName());
    }
    ...
    
  2. Main Page should only be editable by WikiSysop, protected or not
    [ includes/EditPage.php → function editForm ]
    if ( 'save' == $formtype ) {
    if ((preg_match("/\/Main_Page$/", $this->mTitle->getFullURL()) &&
    		$wgUser->getName() != "WikiSysop")) {
    	error_log("Main Page can only be edited by WikiSysop!");
    	$this->userNotLoggedInPage();
    	return;
    }
    ...
    
    You would usually click to the [protect] tab to protect a page.
    Only users with 'sysop' privileges can edit these pages.
  3. Prevent publishing of anonymous users
    → See Block anonymous users
  4. A username 'Foo' should be authorized with any password
    Includes authplugin
  5. Remove rights from users
    For example, a common user should not move pages anymore.
    → See Authorization
  6. Setup a read-only Wiki
    → See Authorization
  7. Password Change Event
    See Includes specialpreferences
  8. How to suppress the ‹title› on a Wiki page?
    Add this code at the top of the Wiki page:
    <html>
    <script language="JavaScript">
    document.write('<style type="text/css">h1.firstHeading { display: none; }</style>'); 
    </script>
    </html>
    



See also:
Authorization


4.5 How do I add a table of contents?       A - Z Index       Top       Disclaimer       4.7 Error Messages (Hints)


$Id: recipes.html,v 1.97 2007/06/15 11:49:14 webcms Exp $
copyright © 2005-2007 by reto