Tracking page modification


Last edited by PivWan:
Modified links pointing to docs server
Mon, 28 Jan 2008 00:14 UTC [diff]

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

The code


<?php
/**
 * Ancestor Action
 * Displays sth is original page was modified after current one.
 *
 * @version 0.3
 * @filename: pwancestor.php
 * @author: PivWan
 * @email: pivwan@gmail.com
 * @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;
}
?>


Todo



CategoryUserContributions
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki