=====ShowRecentChangesMindMapAction===== This is the development page for the ""ShowRecentChangesMindMap"" action Please feel free to make changes or leave comments! %%(php) GetUser(); if ($user) { $filename = "recent_changes_for_".$this->GetUserName().".mm"; } // If this is the 1st pass over the page then create the mindmap XML and store it in a file if (!$_SESSION["mnprinted"] || $_SESSION["mnprinted"] == "") { $xml = "\n"; $xml .= "\n"; $xml .= "\n"; if ($pages = $this->LoadRecentlyChanged()) { $users = array(); $curday = ""; // Check for any params supplied with the action if (is_array($vars)) { foreach ($vars as $param => $value) { if ($param == 'max') {$max = $this->htmlspecialchars_ent($vars['max']);} } } $user = $this->GetUser(); // If no max was specified, use either that defined at login or default to 50 if (!$max) {$max = ( $user ? $user["changescount"] : 50);} $c = 0; foreach ($pages as $page) { $c++; if (($c <= $max) || !$max) { $pageuser = $page["user"]; $pagetag = $page["tag"]; // day header list($day, $time) = explode(" ", $page["time"]); if ($day != $curday) { $dateformatted = date("D, d M Y", strtotime($day)); if ($curday) $xml .= "\n"; $xml .= "\n"; $curday = $day; } $pagelink = $this->config["base_url"].$pagetag; $xml .= "\n"; $timeformatted = date("H:i T", strtotime($page["time"])); $xml .= "\n"; if ($pagenote = $page["note"]) { $xml .= "\n"; } else { $xml .= "\n"; } $xml .= "\n"; $xml .= "\n"; // $xml .= "\n"; if (is_array($users[$pageuser])) { $u_count = count($users[$pageuser]); $users[$pageuser][$u_count] = $pagetag; } else { $users[$pageuser][0] = $pageuser; $users[$pageuser][1] = $pagetag; } } } $xml .= "\n"; foreach ($users as $user) { $start_loop = true; foreach ($user as $user_page) { if (!$start_loop) { $xml .= "\n"; } else { $xml .= "\n"; $start_loop = false; } } $xml .= "\n"; // $xml .= "\n"; } } else { $xml .= "\n"; $xml .= "Error\n"; $xml .= "".$this->Href("show")."\n"; $xml .= "You're not allowed to access this information.\n"; $xml .= "\n"; } $xml .= "\n"; $xml .= "\n"; // If this user is a logged in user (thus a defined filename from above) if ($filename != "") { $fp = @fopen($filename, "w"); fwrite($fp, $xml); fclose($fp); } // Set the flag to say we've already done the map generation work $_SESSION["mnprinted"] = "printed"; // and reload this page $this->Redirect($this->Href()); } else { // This must then be the 2nd pass, so lets zap the flag. $_SESSION["mnprinted"] = null; // Set up a URL for the mindmap // NOTE!!! WAKKA_HOST is a *new* config variable! echo "
This page will show the ".$max." most recent changes to this Wikki

"; // Extract host info from base_url. It is assumed that wikka.php will always be the starting php file... $baseurl = $this->config["base_url"]; $pos = strpos($baseurl, "wikka.php"); if ($pos > 1) { $host = substr($baseurl, 0, $pos - 1); } else { // Force the error msg below to be shown $host = null; } if (!$host || $host == "") { echo "Could not derive hostname. Is the base_url variable in wikka.config.php defined?"; } else { $mindmap_url = $host."/".$filename; $mindmap_url = $this->cleanUrl(trim($mindmap_url)); if (is_array($vars)) { foreach ($vars as $param => $value) { if ($param == 'height') {$height = $this->htmlspecialchars_ent($vars['height']);} } } if (!$height) { $height = "500"; } $mindmap_url_fullscreen = "3rdparty/plugins/freemind/fullscreen.php?url=$mindmap_url"; $output = "\n". "\n". " \n". " \n". " \n". " \n". " \n". " \n". "\n". "
\n". "Download this mind map :: Use Freemind to edit it :: Open fullscreen
\n"; print($output); } } ?> %% ====Categories==== CategoryUserContributions