Wiki source for Mod016fPageIndexWithOwner


Show raw source

==== Wikka Mod 016 ====
Type: Feature Addition
----
===Credit:===
**[[http://web.archive.org/web/20040811012509/http://www.wakkawiki.com/ErusUmbrae | ErusUmbrae]]**
[[http://web.archive.org/web/20040625202443/http://www.wakkawiki.com/WakkaIndex3 | WakkaIndex3 @ WakkaWiki]]
----

This is not the exact code that Umbrae contributed. It's a modified version of pageindex from 0.1.3-dev with a small bit inserted:
%%(php)
if ($page['owner'] != '')
{
if ($this->UserName() == $page['owner'])
print(" . . . . one of your pages.");
else
print(" . . . . Owner: ".$this->Format($page['owner']));
}
print("<br />\n");
%%


Here is the whole file.
actions/pageindex.php
%%(php)

<?php

if ($pages = $this->LoadAllPages())
{
foreach ($pages as $page)
{
if (!preg_match("/^Comment/", $page["tag"])) {
$firstChar = strtoupper($page["tag"][0]);
if (!preg_match("/[A-Z,a-z]/", $firstChar)) {
$firstChar = "#";
}

if ($firstChar != $curChar) {
if ($curChar) print("<br />\n");
print("<strong>$firstChar</strong><br />\n");
$curChar = $firstChar;
}

print($this->Link($page["tag"]));
if ($page['owner'] != '')
{
if ($this->UserName() == $page['owner'])
print(" . . . . <i>one of your pages.</i>");
else
print(" . . . . <i>Owner: ".$this->Format($page['owner'])."</i>");
}

print("<br />\n");
}
}
}
else
{
print("<em>No pages found.</em>");
}

?>

%%
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki