Revision [16655]
This is an old revision of AncestorPage made by Sy1Ivb on 2007-05-31 10:30:13.
Tracking page modification
This action checks whether selected page has been modified since the last edition of the current page. If yes, it shows a small text about the situation. The main goal of this action is to track changes which happen on wikka english documentation when user is surfing doc's translations.
Version: 0.3
Usage
{{pwancestor page="MyPage" show="yes|no"}}
Parameters
- page: page to track.
- show: displays a notice even if tracked page wasn't modified after current page.
The code
%%(php)
<?php
(!empty($vars['page'])) ? $ancestor=$vars['page']: $ancestor="HomePage";
(!empty($vars['show'])) ? $show=$vars['show']: $show="no";
This action will be displayed only if on "show" mode.
if ($this->method
"show")
{
$ancestor_page = $this->LoadSingle("SELECT time FROM ".$this->config["table_prefix"]."pages WHERE tag='".$ancestor."' AND latest = 'Y' ORDER BY time desc LIMIT 1");
if($this->page['time'] < $ancestor_page['time'])
{
$output = "<div class=\"lastedit\">Ancestor: ".$this->Format("".$ancestor."")." has been modified since the last edition of this page!</div>";
}
elseif(( $this->page['time'] > $ancestor_page['time'] )
$output = "<div class=\"lastedit\">Ancestor: ".$this->Format("".$ancestor."")." has been modified since the last edition of this page!</div>";