FYI,<div>on page <a href="http://pmwiki.org/wiki/PmWiki/LocalCustomizations">http://pmwiki.org/wiki/PmWiki/LocalCustomizations</a></div><div><br></div><div><a href="http://pmwiki.org/wiki/PmWiki/LocalCustomizations"></a>I found the following (just shows you have to know where to look)</div>
<div><br></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 19px; "><p class="vspace question" style="margin-top: 1em; margin-bottom: 0.75em; margin-left: 0px; margin-right: 0px; font-weight: bold; ">
How do I get the group / page name in a local configuration file (e.g. <em>local/config.php</em>)?</p><p style="margin-top: 0px; margin-bottom: 0px; margin-left: 2em; ">Use the following markup in pmwiki-2.1.beta21 or newer:</p>
<div class="vspace" style="margin-top: 1.33em; "></div><div class="indent" style="margin-left: 40px; "><pre class="escaped" style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin-top: 0px; margin-bottom: 0px; margin-left: 2em; ">
## Get the group and page name
$pagename = ResolvePageName($pagename);
$page = PageVar($pagename, '$FullName');
$group = PageVar($pagename, '$Group');
$name = PageVar($pagename, '$Name');</pre><pre class="escaped" style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin-top: 0px; margin-bottom: 0px; margin-left: 2em; ">
<br></pre><pre class="escaped" style="font-size: 0.9em; font-family: 'Lucida Console', 'Andale Mono', 'Courier New', Courier, monospace; line-height: 1.2em; margin-top: 0px; margin-bottom: 0px; margin-left: 2em; ">
<br></pre></div></span>cheers</div><div><br></div><div>Simon</div><div><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>