summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authordeva <deva>2010-01-28 18:40:48 +0000
committerdeva <deva>2010-01-28 18:40:48 +0000
commit9c109eb39b7ff60cf1411c2bd6c648b4c66fdbae (patch)
treed7da9eb18654f530b6d2e63ff6dfb76bce5e5eed /utils
parent74fd2508e253967dbff5e368dd19ae6f6e16fcbf (diff)
Introducing the 'single'-mode concept in the news and event modules.
Diffstat (limited to 'utils')
-rw-r--r--utils/modules/events.php60
-rw-r--r--utils/modules/news.php19
2 files changed, 48 insertions, 31 deletions
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 .= "<div class=\"events\">\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 .= "<strong>No such show!</strong>\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);
}
}
diff --git a/utils/modules/news.php b/utils/modules/news.php
index 4fe8b44..6cab087 100644
--- a/utils/modules/news.php
+++ b/utils/modules/news.php
@@ -282,6 +282,7 @@ class News {
$module = "all";
$number = -1;
+ $single = false;
foreach($params as $param => $value) {
switch($param) {
@@ -293,17 +294,19 @@ class News {
$number = $value;
break;
- case "all":
- default:
- $module = "all";
- $number = -1;
+ case "single":
+ $single = true;
break;
}
}
-
- if($newsid && $this->news[$newsid]) {
- // $str .= $this->show($number, $module);
- $str .= $this->news[$newsid]->show();
+
+ if($single) {
+ if($newsid && $this->news[$newsid]) {
+ // $str .= $this->show($number, $module);
+ $str .= $this->news[$newsid]->show();
+ } else {
+ $str .= "<strong>No such news entry!</strong>\n";
+ }
} else {
$str .= $this->show($number, $module);
}