diff options
Diffstat (limited to 'utils/modules')
| -rw-r--r-- | utils/modules/config.php | 2 | ||||
| -rw-r--r-- | utils/modules/discography.php | 3 | ||||
| -rw-r--r-- | utils/modules/events.php | 2 | ||||
| -rw-r--r-- | utils/modules/gallery.php | 10 | ||||
| -rw-r--r-- | utils/modules/guestbook.php | 2 | ||||
| -rw-r--r-- | utils/modules/links.php | 2 | ||||
| -rw-r--r-- | utils/modules/news.php | 32 | ||||
| -rw-r--r-- | utils/modules/pages.php | 2 | 
8 files changed, 39 insertions, 16 deletions
diff --git a/utils/modules/config.php b/utils/modules/config.php index 4afb264..d25961a 100644 --- a/utils/modules/config.php +++ b/utils/modules/config.php @@ -1,6 +1,8 @@  <?php  /* -*- Mode: php; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +global $UTIL_DIR; +  include_once($UTIL_DIR . "/convert.php");  class Config { diff --git a/utils/modules/discography.php b/utils/modules/discography.php index fe5a353..4781eda 100644 --- a/utils/modules/discography.php +++ b/utils/modules/discography.php @@ -213,11 +213,14 @@ class Discography {    {  		global $GLOBALS; +  		$str = "<div class=\"discography\">\n";  		$lyrics = $GLOBALS["lyrics"];  		$number = $GLOBALS["track"]; +		//foreach($params as $param => $value) {} +  		if($lyrics && $number) {  			if($this->discs) {  				foreach($this->discs as $disc) { diff --git a/utils/modules/events.php b/utils/modules/events.php index d8631ec..9fdf0b8 100644 --- a/utils/modules/events.php +++ b/utils/modules/events.php @@ -237,7 +237,7 @@ class Events {    public function run($params)    { -    foreach($params as $param) { +    foreach($params as $param => $value) {        switch($param) {        case "coming":  				return $this->showcoming(-1); diff --git a/utils/modules/gallery.php b/utils/modules/gallery.php index 6b2f384..4c7edc5 100644 --- a/utils/modules/gallery.php +++ b/utils/modules/gallery.php @@ -378,18 +378,18 @@ class Gallery {  		$str = "";  		$str .= "\n<span class=\"gallery\">\n"; -    foreach($params as $param) { +    foreach($params as $param => $value) {        switch($param) { +			case "random": +				$str .= $this->showRandomPhoto(); +				break; +  			default:  				if($p != "" && $a != "") $str .= $this->showPhoto($a, $p);  				else if($a != "" &&  $this->albums[$a] && $p == "")  					$str .= $this->albums[$a]->show("  ", $this->maxwidth_icon, $this->maxheight_icon);  				else $str .= $this->showAlbums();  				break; - -			case "random": -				$str .= $this->showRandomPhoto(); -				break;        }      }  		$str .= "</span>\n"; diff --git a/utils/modules/guestbook.php b/utils/modules/guestbook.php index 2d5db8a..200322d 100644 --- a/utils/modules/guestbook.php +++ b/utils/modules/guestbook.php @@ -328,7 +328,7 @@ class Guestbook {  		$showeditor = false;  		$showposts = 0; -    foreach($params as $param) { +    foreach($params as $param => $value) {  			switch($param) {  			case "editor":  				$showeditor = true; diff --git a/utils/modules/links.php b/utils/modules/links.php index cf0cfed..ba68122 100644 --- a/utils/modules/links.php +++ b/utils/modules/links.php @@ -96,7 +96,7 @@ class Links {  		$groupid = "all"; -		foreach($params as $param) { +		foreach($params as $param => $value) {  			if(!$param) continue;        switch($param) {        case "all": diff --git a/utils/modules/news.php b/utils/modules/news.php index 75cb748..4d00b24 100644 --- a/utils/modules/news.php +++ b/utils/modules/news.php @@ -272,14 +272,32 @@ class News {    public function run($params)    { -    global $show; +		$str = ""; + +		$module = "all"; +		$number = -1; + +		foreach($params as $param => $value) { +			switch($param) { +			case "show": +				$module = $value; +				break; + +			case "number": +				$number = $value; +				break; + +			case "all": +			default: +				$module = "all"; +			  $number = -1; +				break; +			} +		} -    switch($params) { -    default: -      if($show == "all") return $this->show(-1, "all"); -      else return $this->show(3, "main"); -      break; -    } +		$str .= $this->show($number, $module); + +		return $str;    }    public function show($number, $category) diff --git a/utils/modules/pages.php b/utils/modules/pages.php index d3ee0aa..16d6759 100644 --- a/utils/modules/pages.php +++ b/utils/modules/pages.php @@ -24,7 +24,7 @@ class Page {      $str = Markdown($this->content); -    if(preg_match_all("/\[\[([\?,a-zA-Z0-9_]+)\]\]/", $str, $res)) { +    if(preg_match_all("/\[\[([\?,a-zA-Z0-9_=]+)\]\]/", $str, $res)) {        $modulecodes = array_unique($res[1]);        foreach($modulecodes as $modulecode) {  | 
