[pmwiki-devel] Pmwiki bug in SideBars (Pm?)

The Editor editor at fast.st
Sun Nov 26 07:28:06 CST 2006


Just a note to all--I was able to get this working as planned (by a
little work around which sets the session variable in the local config
for the page and then passes the identifying id to the page in the
sidebar as a page variable).  You can see it working at ZAP.  The
button and/or jumpmenu in the sidebar use this. Pretty nifty!  It's
also designed so you can set the key and/or lockpattern in the main
body of a page with a (:zapkey:) directive.  Seems to be working
great!

Thanks again Pm!

Two questions however:  First, from what you are saying, I should have
the same problem with any pages in my skin, such as my Main.Top,
Main.Header, and Main.Footer pages.  But it wouldn't affect the
groupheader and groupfooter pages as they are processed with the page.
 Is that correct?

Second, I'd like to be able to pass a name into the function somehow
so I could have more than one of these keys created.  Right now I just
use the {$zapkey} page variable, meaning I can only have one.  I'd
like to pass a name of some sort to it--but never could get the syntax
right. Or for a better example, I have a function which returns the
number of pages in a group with the {$groupcount} variable.  But it
would be much better to have it something like {$groupcount-Group1}
{$groupcount-Group2} etc.  I could'n't get the syntax right for this
either.

Can someone help suggest the right way to reword this code to allow this...

function ZAPget($d) {
   global $WorkDir, $FmtPV, $GET;
   ...snip...
   if ($d != "") {
      $dd = ZAPfixpage(trim($d));
      $dd = substr($dd, strpos($dd, ".") + 1);  //at this point $dd is
the group name
      $c = ZAPthread($dd);  //this function sets $c to number of pages in group
      $FmtPV['$groupcount'] = "'" . $c . "'";  //here's the line I'd
like to change.
      }
   return;
   }

If I could get help with this, I could fix the zap key directive the
same way.  Thanks in advance.

Cheers,
Caveman



More information about the pmwiki-devel mailing list