[pmwiki-users] Bug: $LastModified page variable picking up last but one modification date/time not current one

stevecrisp at gmail.com stevecrisp at gmail.com
Fri Jul 17 01:06:51 CDT 2009


Petko,

This worked great, thank you for your help :-)

--Steve.

2009/7/15 Petko Yotov <5ko at 5ko.fr>

> On Wednesday 15 July 2009 16:17:50 stevecrisp at gmail.com wrote:
> > Spotted an issue with the $LastModified page variable picking up last but
> > one modification date/time not current.  This is only the case when used
> in
> > (:description:) markup in conjection with hover/tooltip text.  Let me
> > explain my set-up....
> >
> > PmWiki latest 2.2.0
> >
> > Added tooltips to Wiki page links. Tooltip is taken from the text within
> > the (:description:) markup for each page it links to. This is what was
> > added to the local/config.php file:
> >
> > $LinkPageExistsFmt = "<a class='wikilink' title='{\$Description}'
> > href='\$LinkUrl'>\$LinkText</a>";
> ...
> > (:description My Page 2 - last modified on {$LastModified} by
> > {$LastModifiedBy} :)
>
> This happens because the $Description variable is evaluated as text before
> the
> page is saved to a file, not when it is requested. And before the page is
> saved, the $LastModified and $LastModifiedBy variables contain the previous
> timestamp and the previous author.
>
> If you set the part "last modified on {$LastModified} by {$LastModifiedBy}"
> in
> the title= attribute of the link, it should work :
>
> $LinkPageExistsFmt="<a class='wikilink' title='{\$Description} - last
> modified
> on {\$LastModified} by {\$LastModifiedBy}'
> href='\$LinkUrl'>\$LinkText</a>";
>
> (:description My Page 2:)
>
> Note that having apostrophes in your description may break your link titles
> and produce invalid HTML. You can fix this by adding to config.php :
>
>  $FmtPV['$Description'] = 'htmlspecialchars(@$page["description"],
>    ENT_QUOTES)';
>
> Petko
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090717/6428a5da/attachment.html 


More information about the pmwiki-users mailing list