[pmwiki-users] Preventing a script for a group
Ian MacGregor
lists at imacgregor.com
Sat Jul 14 21:58:26 CDT 2007
On Saturday 14 July 2007 7:19:09 pm H. Fox wrote:
> On 7/14/07, Ian MacGregor <lists at imacgregor.com> wrote:
> > I have a group called News in which I have pages for newsfeeds using
> > pmfeed.
> >
> > [...] The problem I am having is that I
> > don't know how to turn off url approvals for the News group.
> > I tried this in config.php but it didn't work:
> >
> > if ($Group != 'News') include_once('scripts/urlapprove.php');
>
> Almost! :-) Try this:
>
> $pagename = ResolvePageName($pagename);
> $group = PageVar($pagename, '$Group');
> if ($group != 'News') include_once('scripts/urlapprove.php');
>
> or this one-liner
>
> if (! preg_match('/^News($|\\/|\\.)/', $pagename))
> include_once('scripts/urlapprove.php');
Thank you :)
What I ended up doing was reading scripts/urlapprove.php and learned I could
put this in local/News.php:
<?php if (!defined('PmWiki')) exit();
$EnableUrlApprovalRequired = 0;
Do you see anything wrong with that approach? I'm still learning php.
I like the one-liner you made, but which is the better way of doing this?
Thanks for the advice,
Ian MacGregor
>
> Hagan
More information about the pmwiki-users
mailing list