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)
To make a real recentchanges action, I have just copied the code from the "recently changed" action and made the necessary (small) modification.
- LoadRecentChanges now only loads part of the pages (see first item on WikkaOptimization, thanks to DotMg)
- the limit of pages to load is now set before loading the pages
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"]).'" >
\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("