[pmwiki-users] short php q.

Ben Wilson dausha at gmail.com
Fri May 4 07:32:34 CDT 2007


Have you considered using "ListPages();"? You could list all the pages
in your "special" group. That could be your matching array.

$exempt_pages = ListPages('SkinSection-');

if ((PageExists("$group.EditForm") and (!in_array($pagename, $exempt_pages))) {
    $PageEditForm = "$group.EditForm";
}

Does this help solve your problem? My syntax on using ListPages() may
be a bit off, but just grep pmwiki.php to find examples of proper use.

Ben Wilson

On 5/4/07, noskule <noskule at gmx.net> wrote:
> J. Meijer schrieb:
> > On 5/3/07,  noskule  wrote:
> >
> >
> >> could please someone giving me a hand in changing this php snipset?
> >> I should change the array on line 3 so that i could use wild cards for
> >> the listitems. In fact the page name in my installation are
> >> SkinSection-* instead of GroupHeader,GroupFooter, ...
> >>
> >> tanks in advance
> >> nos
> >>
> >
> > Hi Nos,
> >
> > It isn't clear to me what you want. Is it to change SomeGroup.GroupXxx (Xxx is Header or Footer or something else starting with an uppercase) pagenames to SomeGroup.SkinSection-Xxx?
> >
>
> > You should also consider doing none of this and redefine the default of $GroupHeaderFmt and $GroupFooterFmt to:
> >
> >   $GroupHeaderFmt = '(:include {$Group}.SkinSection-Header
> >      self=0 basepage={*$FullName}:)(:nl:)';
> >   $GroupFooterFmt = '(:nl:)(:include {$Group}.SkinSection-Header
> >      self=0 basepage={*$FullName}:)';
> >
> > instead.
> >
> > Maybe I just didn't understand it yet though..
> >
> > /jm
> >
> >
> >
> hm, guess bad post I wrote, sorry. I try to change this extension:
>      http://www.pmwiki.org/wiki/Cookbook/EditDataPages
> so that the array on line 3 covers all pagenames that start with
> "SkinSection-", so I tryed the vollowing without success:
>
>   $group = FmtPageName('$Group',$pagename);
> if ((PageExists("$group.EditForm") and
> (!in_array(FmtPageName('$Name',$pagename),
>    array($group,'EditForm',preg_match('/^SkinSection-./', $pagename))))))
>    $PageEditForm = "$group.EditForm";
>
> of course I could list all skinsections, but I've got 16 of it, so it
> would much simpler.
>
> >
> >
> >> $group = FmtPageName('$Group',$pagename);
> >> if ((PageExists("$group.EditForm")
> >> and !in_array(FmtPageName('$Name',$pagename),
> >>     array($group,'GroupHeader','GroupFooter','EditForm'))))
> >>   $PageEditForm = "$group.EditForm";
> >> ## Don't include EditForm pages in lists of "normal" pages
> >> $SearchPatterns['normal'][] = '!\.EditForm!';
> >>
> >
> >
> >
> >
> >
> > _________________________________________________________________
> > Connect to the next generation of MSN Messenger
> > http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
> >
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>


-- 
Ben Wilson
"Words are the only thing which will last forever" Churchill



More information about the pmwiki-users mailing list