[pmwiki-users] How can I set up a private area?

H. Fox haganfox at users.sourceforge.net
Wed Jan 18 10:26:45 CST 2006


On 1/18/06, Hans <design at softflow.co.uk> wrote:
> Sunday, January 15, 2006, 9:49:32 PM, H. wrote:
> > Better yet, leave Site/AllRecentChanges alone, read-protect that page,
> > and create a Main/AllRecentChanges expressly for non-private users.
> > Here's some code to do that in config.php:
>
> >    $thisgroup = FmtPageName('$Group', $pagename);
> >    if ($thisgroup != 'MyPrivateGroup') {
> >    $RecentChangesFmt['Main.AllRecentChanges'] =
> >      '* [[$Group.$Name]]  . . . $CurrentTime $[by] '
> >        .'$AuthorLink: [=$ChangeSummary=]';
> >    }
>
> unfortunately i could not get this to work, ALL recent changes get
> posted to the page despite this code. But when i created a new page
> for it (SiteRecentChanges)(saved a new page with just a single space
> in it), it worked:
>
>     $thisgroup = FmtPageName('$Group', $pagename);
>     if ($thisgroup != 'MyPrivateGroup') {
>     $RecentChangesFmt['Main.SiteRecentChanges'] =
>       '* [[$Group.$Name]]  . . . $CurrentTime $[by] '
>         .'$AuthorLink: [=$ChangeSummary=]';
>     }
>
> I wonder if Main.AllRecentChanges is being specially treated.

Yes, there's special treatment as part of the transition to using the
$SiteGroup.

I tested the code in skin.php and it worked, however it doesn't work
in config.php.  Sorry about that, Hans.

This code should work better:

   $thisgroup = FmtPageName('$Group', $pagename);
   if ($thisgroup != 'MyPrivateGroup') {
   $RecentChangesFmt['Main.AllRecentChanges'] =
     '* [[$Group.$Name]]  . . . $CurrentTime $[by] '
       .'$AuthorLink: [=$ChangeSummary=]';
   } else { $RecentChangesFmt['Main.AllRecentChanges'] = ''; }

I tested it in config.php and skin.php and it worked both places.

Hagan




More information about the pmwiki-users mailing list