Thank to Eemeli and Petko for such useful advice.<div>Simon<br><br><div class="gmail_quote">2009/9/13 Petko Yotov <span dir="ltr"><<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Saturday 12 September 2009 07:06:09 Simon wrote:<br>
> In config.php I have<br>
> $WikiDir = new PageStore('wiki.d/$Group/$FullName');<br>
> $LockFile = "/home/tahi/public_html/pmwiki/wikishared.d/.flock";<br>
> $WikiLibDirs = array(<br>
> &$WikiDir,<br>
> new<br>
> PageStore('/home/tahi/public_html/pmwiki/wikishared.d/$Group/$FullName',<br>
> 1), new PageStore('$FarmD/wikilib.d/$FullName'));<br>
><br>
> What I want to achieve is having some shared groups of pages that can be<br>
> updated and added to (ie new pages) from both websites.<br>
> Where a group is not in the shared directory I want it to update the local<br>
> website folder (this happens now).<br>
</div>...<br>
<div class="im">> existing pages are updated in their existing locations, but new<br>
> pages are added in to local folder.<br>
</div>...<br>
<div class="im">> If anyone can suggest how I can have all new pages in a shared group only<br>
> be added the the shared directory I would appreciate it<br>
<br>
</div>You can re-define the $WikiLibDirs array in two local/SharedGroup.php files in<br>
both wikis:<br>
<br>
<?php<br>
## only alter the directories when a page is posted in this group<br>
if (@$_REQUEST['action']=='edit'<br>
&& preg_grep('/^post/', array_keys($_REQUEST) ) ) {<br>
$WikiDir = new PageStore('$FarmD/shared.d/$FullName');<br>
$WikiLibDirs = array( &$WikiDir,<br>
new PageStore('$FarmD/wikilib.d/$FullName') );<br>
<div class="im">}<br>
<br>
> I can test for a pagename in config.php by using $pagename =<br>
> ResolvePageName($pagename);<br>
> How can I test for a groupname in config.php?<br>
<br>
</div>You can get the group by something like this (at the end of config.php):<br>
<br>
list($group, $name) = explode('.', ResolvePageName($pagename));<br>
if ($group=='PmWiki') { /*do something...*/}<br>
<font color="#888888"><br>
Petko<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>____<br><a href="http://kiwiwiki.co.nz">http://kiwiwiki.co.nz</a><br>
</div>