[pmwiki-users] zap multiple if's

The Editor editor at fast.st
Tue Dec 4 10:04:15 CST 2007


On Dec 4, 2007 10:07 AM, Benoit Dutilleul
<benoit.dutilleul at googlemail.com> wrote:
> 2007/12/4, noskule <noskule at gmx.net>:
>
> > hi list
> > I use zap for a comment's and want to add a honeypot mechanism:
> >
> > I have to save data in 2 pages, which is working fine:
> >
> > (:zap datapage_1="{*$FullName}"  CommentForm:)
> > (:zap savedata_1="timelastaction,countcomments,Status"  CommentForm:)
> >
> > (:zap datapage_2="{*$FullName}-Comment-{countcomments}" CommentForm:)
> > (:zap
> >
> savedata_2="pagetype,timecreated,Livecycle,Title,Text,AuthorName,AuthorContact"
> > CommentForm:)
> >
> >
> >
> > know the same with the honepot mechanism, here only savedata_2 works but
> > not savedata_1. Does anyone see what's wrong?
> >
> > (:zap datapage_1="{*$FullName}"  CommentForm:)
> > (:zap if=" equal {Comment} '' ?
> > savedata_1=timelastaction,countcomments,Status"  CommentForm:)
> >
> > (:zap datapage_2="{*$FullName}-Comment-{countcomments}" CommentForm:)
> > (:zap if=" equal {Comment} '' ?
> >
> savedata_2=pagetype,timecreated,Livecycle,Title,Text,AuthorName,AuthorContact"
> > CommentForm:)
> >
> > thanks for any hints nos
> >
> > _______________________________________________
>
> Hello noskule,
>
> If you use several zap "if" entries, you need to identify them with an
> integer (e.g. if1, if2, etc).
> Please correct this and let me know whether that works.
> Kind regards,
>
> Benoit


There may also be a problem with the order of processing...  That is
when the first if is triggered, savedata_1 will get tacked onto the
end of the ZAParray, rather than at that point in the processing.
Meaning it will use the latter datapage, if I'm not mistaken.  You
might try adding:

(:zap datapage_1="{*$FullName}"  CommentForm:)
(:zap if_1=" equal {Comment} '' ?
savedata_1=timelastaction,countcomments,Status"  CommentForm:)
(:zap savedata_1 '':) // a blank value, a place holder
(:zap datapage_2="{*$FullName}-Comment-{countcomments}" CommentForm:)
(:zap if_2=" equal {Comment} '' ?
savedata_2=pagetype,timecreated,Livecycle,Title,Text,AuthorName,AuthorContact"
CommentForm:)

Not sure if this is needed or not, but you could try it both ways and see...

Cheers
Dan



More information about the pmwiki-users mailing list