[pmwiki-users] pagelist format templates and page variables

Patrick R. Michaud pmichaud at pobox.com
Sun Feb 19 20:34:08 CST 2006


On Sun, Feb 19, 2006 at 11:44:04PM +0000, Hans wrote:
> The code is:
> 
>    $FmtPV['$PostCount'] = 'StringCount($pagename,">>messagehead<<")';
> 
>    function StringCount($pagename,$find) {
>       $page = ReadPage($pagename, READPAGE_CURRENT);
>       return substr_count($page['text'], $find);
>    }
> 
> What do I need to change?

It might need to be

    $FmtPV['$PostCount'] = 'StringCount($pn,">>messagehead<<")';

I'd be the first to admit that this is probably confusing and
ought to be changed to use $pagename instead of $pn.  (I'm not sure
how I ended up with that.)

Pm





More information about the pmwiki-users mailing list