[pmwiki-users] Is there a way to display the number of revisions for a page?

Patrick R. Michaud pmichaud at pobox.com
Sun Jan 30 11:06:02 CST 2005


On Sun, Jan 30, 2005 at 08:18:46AM -0800, Noel Llopis wrote:
> On Sunday 30 January 2005 02:29, Patrick R. Michaud wrote:
> >
> > Markup('{$Rev}', '{$var}',
> >   '/\\{\\$Rev\\}/e',
> >   "\$GLOBALS['PCache'][\$pagename]['rev']+0");
> >
> > I just changed the markup's name and its position to be consistent
> > with the other {$var} substitutions.
> 
> I'll be happy to add it to the Cookbook, but it's not working for me. If I 
> add the Markup as described there to config.php, and then I just place 
> {$Rev} in my template, I just get {$Rev}, not the number of revisions.

It's working for me -- see http://www.pmwiki.org/wiki/Test/RevMarkup .
The (complete) code I used is:

<?php
  Markup('{$Rev}', '{$var}',
    '/\\{\\$Rev\\}/e',
    "@\$GLOBALS['PCache'][\$pagename]['rev']+0");
?>

(The @ sign just prevents an error message that might occur when creating
a page for the first time.)

Pm



More information about the pmwiki-users mailing list