[pmwiki-users] ZAPmarkups

The Editor editor at fast.st
Mon Apr 2 17:32:30 CDT 2007


Thanks Hans for the input...

On 4/2/07, Hans <design5 at softflow.co.uk> wrote:
> Hi Dan, I got some questions and comments about zapmarkups.php
>
> * If zapmarkups.php is installed without zap.php I get a Fatal Error:
> Call to undefined function ZAPpageshortcuts. It would be nice if this
> recipe can run without ZAP installed.

Actually it was my goal to make this a standalone recipe.  I forgot
about the call to the ZAPpageshortcuts function.  I'll fix it to
ignore that call if ZAP is not installed.

> * The count markup gives different results than Pm's pagelist
> fmt=count (PagelistCount). It may be because ZAPmarkups uses a
> hardcoded exclusion list, and so will not reflect custom exclusion
> lists as PmWiki allows. In any case Pagelistcount is more flexible and
> more accurate, so i am not sure why {(count)} is needed.

I'm not too familiar with Pagelistcount, but I think that is only for
use in pagelist templates, correct?  I use this in various situations
outside of pagelists.  For example, I use it to tell how many comments
are posted on a certain topic, or whatever.  Can Pagelistcount do
anything like that?

Also the {(count)} markup can easily add excluded pages by doing
something like {(count Snippets|HomePage)}.  I should make the default
excluded list an SDV variable or something, but generally my goal for
ZAP has to been to make it as easy to do stuff without editing config
files as possible.

> * I am not sure what "Thread" means. A ZAP term? Last page in a ZAP
> group of data pages with numeric page names?

Yes, it's for threaded forums.  It's the highest numbered page in a
group +1.  By default it starts at 1000, but can be configured.

> * {(pagelist group=Group)} does not work. And why is this markup
> needed, if all it does is to translate the normal syntax?

Very strange.  It works on my home Windows machine, but not on my
Linux server.  No idea why...  Will try to fix.  Any ideas why it's
not working?

But as for the reason, I want to be able to store things in a text
variable.  For example:

(:Snippets: {(pagelist group=Snippets.... other params)}:)

Then just type {Group.Name$:Snippets} for the list.  Of course what I
was thinking was putting entire ZAP forms into a text variable, so I
could just do {$:login} and you have an instant login form, or
whatever...  I'm thinking one day a wiki page with your 10 most common
forms (like pagelist templates)--and then perhaps even a shorted
markup like ZAP:contact and your contact form is right there at your
finger tips.  Many possibilities.

Note ZAP automatically disables (: :) and {( )} from its POST
inputs--so only someone with edit permissions can put one of these
directives into a page variable.  They can be put into a text var by
ZAP using ZAP's session input fields, but again, you must have edit
permissions to do this.

As usual it's more about capacity than anything I need right at the
moment.  I'm not even using 10% of the capabilities in ZAP--but my
goal is to make it able to do anything anyone wants with a form.

> * I am not clear how the time markup should work: I tried
> {(time&nbsp;+|+0s|%d.%m.%Y - %H:%i)} for current time formatted
> according to strftime syntax, and also {(time&nbsp;+|+0s|d.m.Y - H:i)}
> with no result. Some examples would help. The latter syntax
> (d.m.Y)(without the %) is used in Fox's {date: } var and seems a good
> shortcut within dedicated time markup.

Actually the time function is pretty smart.  The second parameter can
be skipped completely if you don't need it.  If you try it without the
&nbsp; it should work as you've done it.  You do need the %'s though
as ZAP just drops it into the strftime function.  But there are
several other options also, such as:

{(time Next Thursday|+9h|%m %d)} or {(time 03|m)} = March (useful esp with Hg),

and various other configurations.  I have put up only the most sketchy
documentation on all this markup can do.  When I get time I'll try to
add some more info.

> * Are the &nbsp; strings necessary? They feel awkward to use.

You don't need the &nbsp;. I think I put them in the recipe page just
to keep the table cell from breaking.

> * For some of these markups I wonder why the normal pmwiki
> pagevariable syntax {$VarName} is not used, as they are providing page
> variables. Like
>
> $FmtPV['$IP'] = '$_SERVER[REMOTE_ADDR]';
> $FmtPV['$Host'] = '$_SERVER[REMOTE_HOST]';
> $FmtPV['$HTTPS'] = '$_SERVER[HTTPS]';
> $FmtPV['$Browser'] = '$_SERVER[HTTP_USER_AGENT]';

Again it goes back to the idea I'm trying to avoid having to do any
more in config files than necessary.  You could do it this way with
page variables but the ZAP markup makes it automatic.  ZAP has some
good logging capabilities, so I added these for those who want to add
logging to various ZAP forms.

> The last one is actually not that useful as it returns the whole agent
> string. Normally something shorter is filtered out to give just a
> browser name and perhaps version number.

Maybe I'll take a look at it and see if I can trim off some meaningful
part of it.  Thanks for the suggestions.

Cheers,
Dan



More information about the pmwiki-users mailing list