[pmwiki-users] Is there a way to disable a cookbook in some Group and how ?

Petko Yotov 5ko at 5ko.fr
Fri Jan 29 19:55:35 CST 2010


On Friday 29 January 2010 07:51:41, ABClf wrote :
> Can someone confirm that, in config, the "if not" has to be written !=
> (third line)
> 
> $pagename = ResolvePageName($pagename); 
> list($group, $name) = explode('.', $pagename);
> 
> if ($group != 'Private' && $action == 'edit') {
> include_once("$FarmD/cookbook/authorcontrib.php"); }

Yes, "not equal" can be written "!=" and the above looks fine. Just a note, it 
should be placed at the very bottom of config.php, or it may interfere with 
other recipes. See the "order of customizations" part here:

  http://www.pmwiki.org/wiki/PmWiki/LocalCustomizations#configphp-order

Another way to disable this particular recipe in a selected group is to 
include it like before in config.php (no ResolvePageName) to add to 
local/Private.php something like:

<?php

  @unset($RecentChangesFmt[$AuthorContribAuthorPage],
    $RecentChangesFmt[$AuthorContribOtherPage]);

This should do it.

Petko



More information about the pmwiki-users mailing list