From 9c109eb39b7ff60cf1411c2bd6c648b4c66fdbae Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Jan 2010 18:40:48 +0000 Subject: Introducing the 'single'-mode concept in the news and event modules. --- utils/modules/events.php | 60 +++++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 23 deletions(-) (limited to 'utils/modules/events.php') diff --git a/utils/modules/events.php b/utils/modules/events.php index 45ee061..5540159 100644 --- a/utils/modules/events.php +++ b/utils/modules/events.php @@ -242,35 +242,49 @@ class Events { { global $eventid; + $single = false; + $show = "all"; + $number = -1; + $str = ""; $str .= "
\n"; - if($eventid && $this->events[$eventid]) { - $str .= $this->events[$eventid]->show(); + foreach($params as $param => $value) { + switch($param) { + case "show": + $show = $value; + break; + + case "number": + $number = $value; + break; + + case "single": + $single = true; + break; + } + } + + if($single == true) { + if($eventid && $this->events[$eventid]) { + $str .= $this->events[$eventid]->show(); + } else { + $str .= "No such show!\n"; + } } 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; - } + switch($show) { + case "coming": + $str .= $this->showcoming($number); + break; + + case "old": + $str .= $this->showold($number); + break; - default: - // $str .= $this->showall(-1); - break; - } + case "all": + default: + $str .= $this->showall($number); } } -- cgit v1.2.3