=====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('

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

\n'); //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("
\n"); print("$dateformatted:
\n"); $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=" [".$page["note"]."]"; else $note =""; $pagetag = $page["tag"]; if ($this->HasAccess("read", $pagetag)) { print("    (".$this->Link($pagetag, "revisions", $timeformatted, 0, 1, "View recent revisions list for ".$pagetag).") [".$this->Link($pagetag, "history", "history", 0, 1, "View edit history of ".$pagetag)."] -  ".$this->Link($pagetag, "", "", 0)." ⇒ $page_edited_by ".$note."
"); } else { print("    ($timeformatted) [history] -  ".$page["tag"]." ⇒ $page_edited_by ".$note."
"); } } print "
\n"; $wikipingserver = $this->config["wikiping_server"]; if ($wikipingserver) { $wikipingserver_url_parsed = parse_url($wikipingserver); $wikipingserver_host = $wikipingserver_url_parsed["host"]; echo "

[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