Wiki source for AncestorPage

Show raw source

=====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**>>


""{{pwancestor page="MyPage" show="yes|no"}}""

- page: page to track.
- show: displays a notice even if tracked page wasn't modified after current page.

===The code===

* Ancestor Action
* Displays sth is original page was modified after current one.
* @version 0.3
* @filename: pwancestor.php
* @author: PivWan
* @email:
* @date: 2005-06-22
* @license: GPL

(!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'] ) && ( $show == "yes" ))
$output = "<div class=\"lastedit\">Original page not modified.<br />Ancestor: ".$this->Format("[[".$ancestor."]]")." </div>";
print $output;


- Default value if no page is passed in parameter. If current page is WikkaDocumentationFR, it will link to WikkaDocumentation.

Valid XHTML :: Valid CSS: :: Powered by WikkaWiki