=====Development page for the Recentchanges action=====
>>**See also**
[[Docs:RecentChangesActionInfo | Documentation page]]
>>''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)''
{{lastedit}}
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)
GetUser()) {
$max = $user["changescount"];
} else {
$max = 50;
}
if ($pages = $this->LoadRecentChanges($max))
{
$curday = "";
print('
[WikiPing enabled: Changes on this wiki are broadcast to http://$wikipingserver_host]";
}
}
?>
%%
addition to ##wikka.php## (right behind ""LoadRecentlyChanged()"")
%%(php)
function LoadRecentChanges($max=50)
{
if ($pages = $this->LoadAll("select tag, time, user, note from ".$this->config["table_prefix"]."pages order by time desc limit ".$max))
{
foreach ($pages as $page)
{
$this->CachePage($page);
}
return $pages;
}
}
%%
----
CategoryDevelopmentActions CategoryDevelopmentCore