Revision [16788]

This is an old revision of RecentChangesAction made by XfuCei on 2007-05-31 10:48:27.

 

Development page for the Recentchanges action


The action which is (with wikka 1.1.6.0) named "recentchanges" is in fact a "recently changed" action (as stated on ImprovedRecentChanges by JavaWoman)

Last edited by XfuCei
Thu, 31 May 2007 10:48 UTC [diff]


To make a real recentchanges action, I have just copied the code from the "recently changed" action and made the necessary (small) modification.


The code

don't forget to rename the old recentchanges.php into recentlychanged.php first!

actions/recentchanges.php
%%(php;1)
<?php

if ($user = $this->GetUser()) {
$max = $user["changescount"];
} else {
$max = 50;
}

if ($pages = $this->LoadRecentChanges($max))
{
$curday = ; print('

page["tag"]).'" >XML

\n'); //.$this->href("recentchanges.xml", $this->page["tag"])."\">

foreach ($pages as $i => $page)
{
day header
list($day, $time) = explode(" ", $page["time"]);
if ($day != $curday)
{
$dateformatted = date("D, d M Y", strtotime($day));

if ($curday) print("</span><br />\n");
print("<strong>$dateformatted:</strong><br />\n<span class=\"recentchanges\">");
$curday = $day;
}

$timeformatted = date("H:i T", strtotime($page["time"]));
$page_edited_by = $page["user"];
if (!$this->LoadUser($page_edited_by)) $page_edited_by .= " (unregistered user)";

print entry
if ($page["note"]) $note=" <span class=\"pagenote\">[".$page["note"]."]</span>"; else $note ="";
$pagetag = $page["tag"];
if ($this->HasAccess("read", $pagetag)) {
print("
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki