[pmwiki-users] Problem Using RyeVote in Triad Skin

Patrick R. Michaud pmichaud at pobox.com
Tue Feb 27 08:25:31 CST 2007


On Tue, Feb 27, 2007 at 09:43:31PM +1100, Kathryn Andersen wrote:
> On Tue, Feb 27, 2007 at 09:09:16AM +0000, Ian Barton wrote:
> > >> I run the latest pmwiki 2.2.0 beta.
> > > 
> > > (:input form "{$PageUrl}?action=ryevote" :)
> > > 
> > > $PageUrl isn't what it's supposed to be when called from the side bar. 
> > > I'll see if I can insert some debugging code to log what's happening.
> 
> If you're using the latest Beta, shouldn't it be
>  
> (:input form "{*$PageUrl}?action=ryevote" :)
> 
> Otherwise wouldn't it give the page url of the SideBar page?

In looking at the RyeVote script, it appears to be
the other way around -- the form has to be submitted to the
page containing the RyeVote form.  The ryevote.php code has:

    Lock(1);
    $page = RetrieveAuthPage($pagename, $auth);
    Lock(0);
    if (!$page)
    Abort("?cannot edit $pagename");

    # find all vote input forms on a wiki page
    preg_match_all("/\\(:input form.*?action=ryevote(.*?)\\(:input end:\\)/s",$page['text'], $votes);

Here, $pagename is the "global" pagename.  So, if the form
is in the Site.RightBar, then the form has to be submitted
to the Site.RightBar page (not the main page) in order for
the above to be able to parse it properly.

So, it would seem that the form

    (:input form "{$PageUrl}?action=ryevote" :)

is the correct one, so that {$PageUrl} gets the RightBar page
instead of Test.FrontPage.

So, I reverted the Test.RightBar page back to using {$PageUrl}
(hope you don't mind), but the form is still ending up with
the url for Test.FrontPage.  Perhaps you have
$EnableRelativePageVar set to zero, or perhaps there's a
problem with relative page vars in the right bar in the
triad skin.

But we should be able to avoid the issue of relative page
vars altogether by making the variable absolute, as in:

   (:input form "{Test.RightBar$PageUrl}?action=ryevote" :)

Let me know if this works.  (Even if it does, it might be good
to figure out why page vars aren't working on your site the
way they are supposed to.)

Pm



More information about the pmwiki-users mailing list