>>Tested with: WikkaWiki version **1.1.6.4**, in the footer only.
Example: [[www.prepare4descent.net/DescentiaPedia | DescentiaPedia]]>>=====Changes Clip in the Footer=====
ChangesClipFooter is the name of an action I included in the footer of [[www.prepare4descent.net/DescentiaPedia | DescentiaPedia]]. I made some changes from the original code(recentchanges.php) in order to work this into the footer, and to style this to match ""DescentiaPedia"". I have not tested this to see if it can be still used in a page. Nor have I tested this in any version of wikka other than 1.1.6.4. Here is the code:
%%(php;1;changesclipft.php)
LoadRecentlyChanged())
{
$curday = "";
echo $this->Format(CHANGES_CLIP_HEADING);
foreach ($pages as $i => $page)
{
if (($i < CHANGES_CLIP_QTY) || !CHANGES_CLIP_QTY)
{
list($day, $time) = explode(' ', $page['time']);
{
$dateformatted = date(CHANGES_CLIP_DATE_FORMAT, strtotime($day));
}
$timeformatted = date(CHANGES_CLIP_TIME_FORMAT, strtotime($page['time']));
$page_edited_by = $page["user"];
if (!$this->LoadUser($page_edited_by)) $page_edited_by .= " " . ($this->Format(CHANGES_CLIP_UNREG));
$body = "";
$note = "";
if (CHANGES_CLIP_SHOW_NOTE && $page['note'] != "")
{
//limit amount of characters shown
$note = " (" . $this->htmlspecialchars_ent (substr($page['note'],0,CHANGES_CLIP_NOTE_LENGTH));
{
if (strlen($page['note']) > CHANGES_CLIP_NOTE_LENGTH)
{
$note = $note . '…)';
} else {
$note = $note . ')';
}
}
} else {
if ($note = "")
{
$note = ' ' . ($this->Format(CHANGES_CLIP_NOTE_NONE)); // show a message if there is no note
}
if (CHANGES_CLIP_SHOW_BODY) //show body clip if there is no note
{
$body = " " . $this->htmlspecialchars_ent(substr($page['body'],0,CHANGES_CLIP_BODY_LENGTH)) . "...";
}
}
// show "..." if note is too long
// print entry
$pagetag = $page["tag"];
if ($this->HasAccess("read", $pagetag))
{
print''.($this->Link($pagetag, "", "", 0).$note.$body."
"." ".$dateformatted." ".$timeformatted." by: ".$this->Link($page_edited_by, "", "", 0)."
");
} else {
print''.($pagetag."
".$page[time]." " . ($this->Format(CHANGES_CLIP_READ_NONE)) . "
");
}
}
}
}
echo''. ($this->Format(CHANGES_CLIP_MORE))."";
?>
%%
----
See also:
ActionsInFooter
----
Categories:
CategoryStyle