==== Wikka Mod 031 ==== Type: Feature Addition ---- ===Credit:=== **[[http://web.archive.org/web/20040603201849/http://www.wakkawiki.com/NickK | NickK]]** -- Credit for the idea. http://wakka.netdome.biz/WakkaChangelog **[[JsnX | Jason Tourtelotte]]** -- Credit for the coding. ---- Don't link to pages that the viewing user is not allowed to read in PageIndex and RecentChanges. **actions/pageindex.php** %%(php) 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("
\n"); print("$firstChar
\n"); $curChar = $firstChar; } if ($this->HasAccess("read", $page["tag"])) { print($this->Link($page["tag"])); } else { print($page["tag"]); } if ($page['owner'] != '') { if ($this->UserName() == $page['owner']) print(" . . . . one of your pages."); else { if ($this->HasAccess("read", $page["owner"])) { print(" . . . . Owner: ".$this->Format($page['owner'])); } else { print(" . . . . Owner: ".$page['owner']); } } } print("
\n"); } } } else { print("No pages found."); } ?> %% **actions/recentchanges.php** %%(php) LoadRecentlyChanged()) { print("

href("", "xml/recentchanges_".preg_replace("/[^a-zA-Z0-9]/", "", strtolower($this->GetConfigValue("wakka_name"))).".xml")."\">href("", "images/xml.png")."\" width=\"36\" height=\"14\" alt=\"XML\" />

\n"); if ($user = $this->GetUser()) { $max = $user["changescount"]; } else { $max = 50; } foreach ($pages as $i => $page) { if (($i < $max) || !$max) { // day header list($day, $time) = explode(" ", $page["time"]); if ($day != $curday) { if ($curday) print("

\n"); print("

$day:

\n

"); $curday = $day; } // print entry if ($page[note]) $note=" [".$page["note"]."]"; else $note =""; if ($this->HasAccess("read", $page["tag"])) { if ($this->HasAccess("read", $page["user"])) { print("(".$page["time"].")(".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."⇒".$this->Format($page["user"])." ".$note."
"); } else { print("(".$page["time"].")(".$this->Link($page["tag"], "revisions", "history", 0).") ".$this->Link($page["tag"], "", "", 0)."⇒".$page["user"]." ".$note."
"); } } else { if ($this->HasAccess("read", $page["user"])) { print("(".$page["time"].")(history) ".$page["tag"]."⇒".$this->Format($page["user"])." ".$note."
"); } else { print("(".$page["time"].")(history) ".$page["tag"]."⇒".$page["user"]." ".$note."
"); } } } } print "

\n"; } ?> %%