[pmwiki-users] zap multiple if's

noskule noskule at gmx.net
Tue Dec 4 11:44:29 CST 2007


oky, I did try both ways, also different orders of if_X and datapage_X,
but zap simply drops the secound datapage definition. This happens only
in combination with the if statement. Is anyone able to fix this?

On the same way we could change the $SiteGroup Variable to
$SiteAdminGroup and upload it to the Cookbook. So zap would be up to
date. I uploaded my version on the Cockbook:Zap. It would be great if
someone with programming skill far from search-replace could take a look
at it.


The Editor schrieb:
> 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