[pmwiki-devel] PmWiki request

The Editor editor at fast.st
Tue Dec 12 19:51:48 CST 2006

On 12/12/06, Crisses <crisses at kinhost.org> wrote:
> On Dec 12, 2006, at 9:24 AM, The Editor wrote:
> >> Seems to me that
> >>
> >>  (:if exists parameter:)(:input hidden action:)(:if:)
> >>
> >> is only few characters longer but more consistent.  Plus you
> >> get complex expressions for free.
> >
> > Actually this is not equivalent to what I'm wanting to do at all.
> > (This was also Hans misunderstanding I believe).  What I want to do
> > rather is perform certain ZAP functions AFTER the form submits based
> > on the values entered.  It has nothing to do with markup.  So for a
> > more basic example I might add these lines to a form (May need to
> > change the syntax...):
> >
> > (:input text newpage :)
> > (:input ifexists "newpage|warn:Page already exists":)
> Here is my current ZAP dilemma:
> One way to stop robots from sending you emails is to add a hidden
> field to a form that a spider might fill in (such as "subject" or
> "message") expecting that it's part of the email.  However, I don't
> WANT any emails with that hidden field filled out -- if that field
> has a value, throw out the email.  Stinks from an accessibility point
> of view...but...
> I'm able to custom program this.  But I don't WANT to.  And this is
> one dilemma ZAP should be able to handle IN the form.  Add a
> conditional that evaluates AFTER the form is submitted -- if the
> field contains contents DO NOT send me the email.
> I'm still working on understanding ZAP, and the form does not work,
> but this is the situation that ZAP can handle without me writing
> custom code every time I want to do something with a form.
> I am only enabling ZAP on the specific pages using it, and it does
> not seem to interfere with PmWiki.
> I wrote up a page, still in progress a bit, about writing up a
> Business Directory input system in ZAP. http://pmwiki.org/wiki/
> Cookbook/ZAPBusinessDirectory  I'm still waiting for Dan/Caveman to
> make more comments on the page but right now my recipe works on a
> live site, the directory looks fine, and all that ZAP does in that
> recipe is write data pages so I can use PageLists to recall the
> data.  ZAP is not displaying the data later, just PmWiki is.
> Crisses

Actually this is the request that got me working on redoing the
conditionals in ZAP, because while it had some limited capabilities
before it couldn't really handle something as simple as checking to
see if a field was blank.  With the new approach it will be more
doable.  Probably something like:

(:input hidden if "{equal {emailsubject} ''|warn|Quit Spamming Me!":)

or more likely

(:zaplock field=if value="{equal {emailsubject} ''|warn|Quit Spamming
Me!" key={$key}:)

This says basically if the value of field emailsubject is equal to ''
(two apostrophes), then stop the form and give the error message "Quit
Spamming Me!"

I think I have the code written for the conditional, but haven't been
able to test it as I'm also redoing the security system to accommodate
Ben's request and simplify the code as per Pm's suggestion.  The
changes will make the code simpler, and the syntax more intuitive, but
it's a fairly big overhaul...  I hope it will be available within a
day or two, and I apologize for not being able to be so quick on all
the support stuff while I try to get this done...  But if its going to
change in a day or two, I might as well not confuse you by telling you
how to do things the old way. I'll be more free when this update is
behind me.

My apologies for the poor syntax in ZAP, and my appreciation to those
who have offered suggestions for improving it.  I also want to
apologize for the lack of documentation.  It's not very helpful to say
zap can do this and that when there's not clear enough explanations to
help even really good coders figure out how.  I'm hoping some of the
changes ahead will make things a bit more intuitive.


More information about the pmwiki-devel mailing list