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">&lt;<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>&gt;</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>
&gt; In config.php I have<br>
&gt;   $WikiDir = new PageStore(&#39;wiki.d/$Group/$FullName&#39;);<br>
&gt;   $LockFile = &quot;/home/tahi/public_html/pmwiki/wikishared.d/.flock&quot;;<br>
&gt;   $WikiLibDirs = array(<br>
&gt;      &amp;$WikiDir,<br>
&gt;      new<br>
&gt; PageStore(&#39;/home/tahi/public_html/pmwiki/wikishared.d/$Group/$FullName&#39;,<br>
&gt;  1), new PageStore(&#39;$FarmD/wikilib.d/$FullName&#39;));<br>
&gt;<br>
&gt; What I want to achieve is having some shared groups of pages that can be<br>
&gt; updated and added to (ie new pages) from both websites.<br>
&gt; Where a group is not in the shared directory I want it to update the local<br>
&gt; website folder (this happens now).<br>
</div>...<br>
<div class="im">&gt; existing pages are updated in their existing locations, but new<br>
&gt; pages are added in to local folder.<br>
</div>...<br>
<div class="im">&gt; If anyone can suggest how I can have all new pages in a shared group only<br>
&gt;  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>
&lt;?php<br>
## only alter the directories when a page is posted in this group<br>
if (@$_REQUEST[&#39;action&#39;]==&#39;edit&#39;<br>
  &amp;&amp; preg_grep(&#39;/^post/&#39;, array_keys($_REQUEST) ) ) {<br>
  $WikiDir = new PageStore(&#39;$FarmD/shared.d/$FullName&#39;);<br>
  $WikiLibDirs = array(  &amp;$WikiDir,<br>
    new PageStore(&#39;$FarmD/wikilib.d/$FullName&#39;)  );<br>
<div class="im">}<br>
<br>
&gt; I can test for a pagename in config.php by using   $pagename =<br>
&gt; ResolvePageName($pagename);<br>
&gt; 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(&#39;.&#39;, ResolvePageName($pagename));<br>
  if ($group==&#39;PmWiki&#39;) { /*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>