[pmwiki-users] Using page text variable with the search action

Dominique Faure dominique.faure at gmail.com
Fri Mar 28 10:16:36 CDT 2008


On Fri, Mar 28, 2008 at 1:38 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca> wrote:
> Ok, so what I did was to add this handler to my local stuff:
>
> -------------------------------------------------------------
> SDV($HandleActions['pagelist'], 'HandlePageList');
> function HandlePageList($pagename)
> {
>  global $PageStartFmt, $PageEndFmt, $SortField;
>
>  foreach ($_GET as $key => $value)
>    $getstr .= $key."=".$value." ";
>
>  $result = FmtPageList('$MatchList', $pagename, array('o' => $getstr));
>
>  SDV($HandlePageListFmt,array(&$PageStartFmt, MarkupToHTML($pagename, $result), &$PageEndFmt));
>  PrintFmt($pagename, $HandlePageListFmt);
>  return;
> }
> -------------------------------------------------------------
>
> So now I can control pagelist from the URL like this:
>
> /index.php?n=Equipements.accueil&action=pagelist&group=equipements&fmt=Template%23listbytype&$:Type="GPS"
>
> Pierre
>
> >-----Message d'origine-----
> >De : pmwiki-users-bounces at pmichaud.com
> >[mailto:pmwiki-users-bounces at pmichaud.com] De la part de Pierre Racine
> >Envoyé : 27 mars 2008 14:33
> >À : pmwiki-users at pmichaud.com
> >Objet : [pmwiki-users] Using page text variable with the search action
>
>
>
> >
> >Hi,
> >
> >I would like to build URLs for searching pages having page text
> >variables defined to a certain value. I expected something like:
> >
> >/index.php?n=Equipements.accueil&action=search&$:Type=GPS
> >
> >to return a page of pages having the variable "Type" defined to "GPS" -
> >using (:Type: GPS :) - but this does not seems to work.
> >
> >I guess the "$:" part of the URL is messing this up.
> >
> >Any idea?
> >
> >Pierre
> >

May be you should use the urldecode() function as in:

 foreach ($_GET as $key => $value)
   $getstr .= $key."=".urldecode($value)." ";

This way, you could replace "$:" in urls by "%24%3A" as in:

/index.php?n=Equipements.accueil&action=pagelist&group=equipements&fmt=Template%23listbytype&%24%3AType="GPS"

--
Dominique



More information about the pmwiki-users mailing list