From 74fd2508e253967dbff5e368dd19ae6f6e16fcbf Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Jan 2010 16:18:33 +0000 Subject: Initial implementation of cross-linking. --- utils/modules/events.php | 62 +++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 22 deletions(-) (limited to 'utils/modules/events.php') diff --git a/utils/modules/events.php b/utils/modules/events.php index 63fb080..45ee061 100644 --- a/utils/modules/events.php +++ b/utils/modules/events.php @@ -26,15 +26,17 @@ class Event { public function show() { - global $ICONS_DIR; + global $ICONS_DIR, $EVENT_PAGE; $icons = new Icons($ICONS_DIR."/"); $icon = $icons->icons[$this->flyer]; $content = Markdown(htmlspecialchars_decode($this->description)); $str = "
\n"; - $str .= "
" . - htmlspecialchars_decode($this->title, ENT_QUOTES) . "
\n"; + $str .= " \n"; $str .= "
" . date("D M jS Y", $this->time) . "
\n"; $str .= "
" . $content . "
\n"; if($this->flyer) { @@ -238,28 +240,44 @@ class Events { public function run($params) { - foreach($params as $param => $value) { - switch($param) { - case "show": - switch($value) { - case "coming": - return $this->showcoming(-1); + global $eventid; + + $str = ""; + + $str .= "
\n"; + + if($eventid && $this->events[$eventid]) { + $str .= $this->events[$eventid]->show(); + } else { + foreach($params as $param => $value) { + switch($param) { + case "show": + switch($value) { + case "coming": + $str .= $this->showcoming(-1); + break; + + case "old": + $str .= $this->showold(-1); + break; + + case "all": + default: + $str .= $this->showall(-1); + break; + } + + default: + // $str .= $this->showall(-1); break; + } + } + } - case "old": - return $this->showold(-1); - break; + $str .= "
\n"; - case "all": - default: - return $this->showall(-1); - } - - default: - return $this->showall(-1); - } - } - } + return $str; + } public function showall($number) { -- cgit v1.2.3