Completed
Branch master (15a86c)
by Michael
06:07
created
class/bookmark.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -48,19 +48,19 @@
 block discarded – undo
48 48
 
49 49
 class Bookmark extends ArtObject
50 50
 {
51
-    /**
52
-     * Constructor
53
-     */
54
-    function Bookmark()
55
-    {
56
-	    $this->ArtObject();
57
-        $this->table = planet_DB_prefix("bookmark");
58
-        $this->initVar("bm_id", XOBJ_DTYPE_INT, null, false);
59
-        /* user ID */
60
-        $this->initVar("bm_uid", XOBJ_DTYPE_INT, 0, true);
61
-        /* blog ID */
62
-        $this->initVar("blog_id", XOBJ_DTYPE_INT, 0, true);
63
-    }
51
+	/**
52
+	 * Constructor
53
+	 */
54
+	function Bookmark()
55
+	{
56
+		$this->ArtObject();
57
+		$this->table = planet_DB_prefix("bookmark");
58
+		$this->initVar("bm_id", XOBJ_DTYPE_INT, null, false);
59
+		/* user ID */
60
+		$this->initVar("bm_uid", XOBJ_DTYPE_INT, 0, true);
61
+		/* blog ID */
62
+		$this->initVar("blog_id", XOBJ_DTYPE_INT, 0, true);
63
+	}
64 64
 }
65 65
 endif;
66 66
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
  *
45 45
  * {@link XoopsObject} 
46 46
  **/
47
-if(!class_exists("Bookmark")):
47
+if (!class_exists("Bookmark")):
48 48
 
49 49
 class Bookmark extends ArtObject
50 50
 {
Please login to merge, or discard this patch.
counter.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28
-$article_id = empty($_GET['article'])?0:intval($_GET['article']);
29
-if(empty($article_id)) return;
30
-if(planet_getcookie("art_".$article_id)>0) return;
31
-$article_handler =& xoops_getmodulehandler('article', $xoopsModule->getVar("dirname"));
32
-$article_obj =& $article_handler->get($article_id);
28
+$article_id = empty($_GET['article']) ? 0 : intval($_GET['article']);
29
+if (empty($article_id)) return;
30
+if (planet_getcookie("art_".$article_id)>0) return;
31
+$article_handler = & xoops_getmodulehandler('article', $xoopsModule->getVar("dirname"));
32
+$article_obj = & $article_handler->get($article_id);
33 33
 $article_obj->setVar("art_views", $article_obj->getVar("art_views")+1, true);
34 34
 $article_handler->insert($article_obj, true);
35 35
 planet_setcookie("art_".$article_id, time());
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,12 @@
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28 28
 $article_id = empty($_GET['article'])?0:intval($_GET['article']);
29
-if(empty($article_id)) return;
30
-if(planet_getcookie("art_".$article_id)>0) return;
29
+if(empty($article_id)) {
30
+	return;
31
+}
32
+if(planet_getcookie("art_".$article_id)>0) {
33
+	return;
34
+}
31 35
 $article_handler =& xoops_getmodulehandler('article', $xoopsModule->getVar("dirname"));
32 36
 $article_obj =& $article_handler->get($article_id);
33 37
 $article_obj->setVar("art_views", $article_obj->getVar("art_views")+1, true);
Please login to merge, or discard this patch.
view.article.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -31,37 +31,37 @@  discard block
 block discarded – undo
31 31
  * The notification detection scripts should be removed once absolute url is used in notification_select.php
32 32
  *
33 33
  */
34
-if(preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", $_SERVER["REQUEST_URI"], $matches)){
34
+if (preg_match("/(\/comment_[^\.]*\.php\?.*=.*)/i", $_SERVER["REQUEST_URI"], $matches)) {
35 35
 	header("location: ".XOOPS_URL."/modules/".$GLOBALS["moddirname"].$matches[1]);
36 36
 	exit();
37 37
 }
38
-if(preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)){
38
+if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) {
39 39
 	include XOOPS_ROOT_PATH.'/include/notification_update.php';
40 40
 	exit();
41 41
 }
42 42
 
43
-if($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)){
43
+if ($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)) {
44 44
 	$args["article"] = @$args_num[0];
45 45
 	$args["blog"] = @$args["blog"];
46 46
 }
47 47
 
48
-$article_id = intval( empty($_GET["article"])?@$args["article"]:$_GET["article"] );
49
-$blog_id = intval( empty($_GET["blog"])?@$args["blog"]:$_GET["blog"] );
48
+$article_id = intval(empty($_GET["article"]) ? @$args["article"] : $_GET["article"]);
49
+$blog_id = intval(empty($_GET["blog"]) ? @$args["blog"] : $_GET["blog"]);
50 50
 
51
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
52
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
53
-$article_obj =& $article_handler->get($article_id);
54
-$blog_obj =& $blog_handler->get($article_obj->getVar("blog_id"));
51
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
52
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
53
+$article_obj = & $article_handler->get($article_id);
54
+$blog_obj = & $blog_handler->get($article_obj->getVar("blog_id"));
55 55
 
56 56
 // restore $_SERVER['REQUEST_URI']
57
-if(!empty($REQUEST_URI_parsed)){
57
+if (!empty($REQUEST_URI_parsed)) {
58 58
 	$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".
59
-		(empty($article_id)?"":"?article=".$article_id);
59
+		(empty($article_id) ? "" : "?article=".$article_id);
60 60
 }
61 61
 
62
-$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name"). " - " .$article_obj->getVar("art_title");
62
+$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name")." - ".$article_obj->getVar("art_title");
63 63
 $xoopsOption["template_main"] = planet_getTemplate("article");
64
-include_once( XOOPS_ROOT_PATH . "/header.php" );
64
+include_once(XOOPS_ROOT_PATH."/header.php");
65 65
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
66 66
 
67 67
 $article_data = array(
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 	"blog"=> array("id"=>$article_obj->getVar("blog_id"), "title"=>$blog_obj->getVar("blog_title"))
79 79
 	);
80 80
 
81
-if(!empty($xoopsModuleConfig["do_sibling"])){
82
-	$articles_sibling =& $article_handler->getSibling($article_obj, $blog_id);
83
-	if(!empty($articles_sibling["previous"])) {
81
+if (!empty($xoopsModuleConfig["do_sibling"])) {
82
+	$articles_sibling = & $article_handler->getSibling($article_obj, $blog_id);
83
+	if (!empty($articles_sibling["previous"])) {
84 84
 		$articles_sibling["previous"]["url"] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$articles_sibling["previous"]["id"]."/b".$blog_id;
85 85
 		$articles_sibling["previous"]["title"] = $articles_sibling["previous"]["title"];
86 86
 	}
87
-	if(!empty($articles_sibling["next"])){
87
+	if (!empty($articles_sibling["next"])) {
88 88
 		$articles_sibling["next"]["url"] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$articles_sibling["next"]["id"]."/b".$blog_id;
89 89
 		$articles_sibling["next"]["title"] = $articles_sibling["next"]["title"];
90 90
 	}
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
 $xoopsTpl -> assign("article", $article_data);
96 96
 $xoopsTpl -> assign("sibling", $articles_sibling);
97 97
 
98
-$xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
99
-if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
100
-}else{
98
+$xoopsTpl -> assign("user_level", !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1));
99
+if (empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)) {
100
+}else {
101 101
 	$xoopsTpl -> assign("canrate", 1);
102 102
 }
103 103
 
104
-if($transferbar = @include(XOOPS_ROOT_PATH."/Frameworks/transfer/bar.transfer.php")){
104
+if ($transferbar = @include(XOOPS_ROOT_PATH."/Frameworks/transfer/bar.transfer.php")) {
105 105
 	$xoopsTpl->assign('transfer', $transferbar);
106 106
 }
107 107
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 
98 98
 $xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
99 99
 if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
100
-}else{
100
+} else{
101 101
 	$xoopsTpl -> assign("canrate", 1);
102 102
 }
103 103
 
Please login to merge, or discard this patch.
search.php 3 patches
Indentation   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 $config_handler =& xoops_gethandler("config");
32 32
 $xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
33 33
 if (empty($xoopsConfigSearch["enable_search"])) {
34
-    redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php", 2, planet_constant("MD_NOACCESS"));
35
-    exit();
34
+	redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php", 2, planet_constant("MD_NOACCESS"));
35
+	exit();
36 36
 }
37 37
 
38 38
 $xoopsConfig["module_cache"][$xoopsModule->getVar("mid")] = 0;
@@ -57,41 +57,41 @@  discard block
 block discarded – undo
57 57
 $sortby = (in_array(strtolower($sortby), array("a.art_id desc", "a.art_time desc", "a.art_title", "a.blog_id", "b.blog_id", "b.blog_feed", "b.blog_title", "b.blog_time"))) ? strtolower($sortby) :  "";
58 58
 
59 59
 if ( !( empty($_POST["submit"]) && empty($_GET["term"])) ) {
60
-    $next_search["category"] = $category;
61
-    $next_search["blog"] = $blog;
62
-    $next_search["uid"] = $uid;
63
-    $next_search["andor"] = $andor;
64
-
65
-    $next_search["term"] = $term;
66
-    $query = trim($term);
67
-
68
-    if ( $andor != "EXACT" ) {
69
-        $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
70
-        $temp_queries = preg_split("/[\s,]+/", $query);
71
-        foreach ($temp_queries as $q) {
72
-            $q = trim($q);
73
-            if (strlen($q) >= $xoopsConfigSearch["keyword_min"]) {
74
-                $queries[] = $myts->addSlashes($q);
75
-            } else {
76
-                $ignored_queries[] = $myts->addSlashes($q);
77
-            }
78
-        }
79
-        if (count($queries) == 0) {
80
-            redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
81
-            exit();
82
-        }
83
-    } else {
84
-        if (strlen($query) < $xoopsConfigSearch["keyword_min"]) {
85
-            redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
86
-            exit();
87
-        }
88
-        $queries = array($myts->addSlashes($query));
89
-    }
60
+	$next_search["category"] = $category;
61
+	$next_search["blog"] = $blog;
62
+	$next_search["uid"] = $uid;
63
+	$next_search["andor"] = $andor;
64
+
65
+	$next_search["term"] = $term;
66
+	$query = trim($term);
67
+
68
+	if ( $andor != "EXACT" ) {
69
+		$ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
70
+		$temp_queries = preg_split("/[\s,]+/", $query);
71
+		foreach ($temp_queries as $q) {
72
+			$q = trim($q);
73
+			if (strlen($q) >= $xoopsConfigSearch["keyword_min"]) {
74
+				$queries[] = $myts->addSlashes($q);
75
+			} else {
76
+				$ignored_queries[] = $myts->addSlashes($q);
77
+			}
78
+		}
79
+		if (count($queries) == 0) {
80
+			redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
81
+			exit();
82
+		}
83
+	} else {
84
+		if (strlen($query) < $xoopsConfigSearch["keyword_min"]) {
85
+			redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
86
+			exit();
87
+		}
88
+		$queries = array($myts->addSlashes($query));
89
+	}
90 90
 
91
-    $next_search["sortby"] = $sortby;
92
-    $next_search["searchin"] = implode("|", $searchin);
91
+	$next_search["sortby"] = $sortby;
92
+	$next_search["searchin"] = implode("|", $searchin);
93 93
     
94
-    /* To be added: year-month 
94
+	/* To be added: year-month 
95 95
      * see view.archive.php
96 96
      */
97 97
 	if (!empty($time)) {
@@ -100,31 +100,31 @@  discard block
 block discarded – undo
100 100
 		$extra = "";
101 101
 	}
102 102
 
103
-    $results = planet_search($queries, $andor, $limit, $start, 
104
-    	$uid, $category, $blog,
105
-    	$sortby, $searchin, $extra);
103
+	$results = planet_search($queries, $andor, $limit, $start, 
104
+		$uid, $category, $blog,
105
+		$sortby, $searchin, $extra);
106 106
 
107
-    /*
107
+	/*
108 108
     if ( count($results) < 1 ) {
109 109
     	redirect_header("javascript:history.go(-1);", 2, _SR_NOMATCH);
110 110
     }
111 111
     else 
112 112
     */
113
-    {
114
-        $xoopsTpl->assign("results", $results);
115
-
116
-        if(count($next_search)>0){
117
-	        $items = array();
118
-	        foreach($next_search as $para => $val){
119
-		        if(!empty($val)) $items[] = "$para=$val";
120
-	        }
121
-	        if(count($items)>0) $paras = implode("&",$items);
122
-	        unset($next_search);
123
-	        unset($items);
124
-        }
125
-      	$search_url = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php?".$paras;
126
-
127
-      	/*
113
+	{
114
+		$xoopsTpl->assign("results", $results);
115
+
116
+		if(count($next_search)>0){
117
+			$items = array();
118
+			foreach($next_search as $para => $val){
119
+				if(!empty($val)) $items[] = "$para=$val";
120
+			}
121
+			if(count($items)>0) $paras = implode("&",$items);
122
+			unset($next_search);
123
+			unset($items);
124
+		}
125
+	  	$search_url = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php?".$paras;
126
+
127
+	  	/*
128 128
        	$next_results =& planet_search($queries, $andor, 1, $start + $limit, $uid, $category, $sortby, $searchin, $extra);
129 129
         $next_count = count($next_results);
130 130
         $has_next = false;
@@ -133,23 +133,23 @@  discard block
 block discarded – undo
133 133
         }
134 134
         if (false != $has_next)
135 135
         */
136
-        if (count($results))
137
-        {
138
-            $next = $start + $limit;
139
-            $queries = implode(",",$queries);
140
-            $search_url_next = $search_url."&start=$next";
141
-            $search_next = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT."</a>";
136
+		if (count($results))
137
+		{
138
+			$next = $start + $limit;
139
+			$queries = implode(",",$queries);
140
+			$search_url_next = $search_url."&start=$next";
141
+			$search_next = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT."</a>";
142 142
 			$xoopsTpl->assign("search_next", $search_next);
143
-        }
144
-        if ( $start > 0 ) {
145
-            $prev = $start - $limit;
146
-            $search_url_prev = $search_url."&start=$prev";
147
-            $search_prev = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS."</a>";
143
+		}
144
+		if ( $start > 0 ) {
145
+			$prev = $start - $limit;
146
+			$search_url_prev = $search_url."&start=$prev";
147
+			$search_prev = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS."</a>";
148 148
 			$xoopsTpl->assign("search_prev", $search_prev);
149
-        }
150
-    }
149
+		}
150
+	}
151 151
 
152
-    unset($results);
152
+	unset($results);
153 153
 	$search_info = _SR_KEYWORDS.": ".$myts->htmlSpecialChars($term);
154 154
 	$xoopsTpl->assign("search_info", $search_info);
155 155
 }
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 $xoopsOption["pagetype"] = "search";
29 29
 include "header.php";
30 30
 $xoopsModule->loadLanguage("main");
31
-$config_handler =& xoops_gethandler("config");
32
-$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
31
+$config_handler = & xoops_gethandler("config");
32
+$xoopsConfigSearch = & $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);
33 33
 if (empty($xoopsConfigSearch["enable_search"])) {
34 34
     redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php", 2, planet_constant("MD_NOACCESS"));
35 35
     exit();
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
46 46
 $queries = array();
47 47
 $andor = isset($_POST["andor"]) ? $_POST["andor"] : (isset($_GET["andor"]) ? $_GET["andor"] : "");
48 48
 $start = isset($_GET["start"]) ? $_GET["start"] : 0;
49
-$category = intval( isset($_POST["category"]) ? $_POST["category"] : (isset($_GET["category"]) ? $_GET["category"] : null) );
50
-$blog = intval( isset($_POST["blog"]) ? $_POST["blog"] : (isset($_GET["blog"]) ? $_GET["blog"] : null) );
51
-$uid = intval( isset($_POST["uid"]) ? $_POST["uid"] : (isset($_GET["uid"]) ? $_GET["uid"] : null) );
49
+$category = intval(isset($_POST["category"]) ? $_POST["category"] : (isset($_GET["category"]) ? $_GET["category"] : null));
50
+$blog = intval(isset($_POST["blog"]) ? $_POST["blog"] : (isset($_GET["blog"]) ? $_GET["blog"] : null));
51
+$uid = intval(isset($_POST["uid"]) ? $_POST["uid"] : (isset($_GET["uid"]) ? $_GET["uid"] : null));
52 52
 $searchin = isset($_POST["searchin"]) ? $_POST["searchin"] : (isset($_GET["searchin"]) ? explode("|", $_GET["searchin"]) : array());
53 53
 $sortby = isset($_POST["sortby"]) ? $_POST["sortby"] : (isset($_GET["sortby"]) ? $_GET["sortby"] : null);
54 54
 $term = isset($_POST["term"]) ? $_POST["term"] : (isset($_GET["term"]) ? $_GET["term"] : "");
55 55
 
56
-$andor = (in_array(strtoupper($andor), array("OR", "AND", "EXACT")))?strtoupper($andor):"OR";
57
-$sortby = (in_array(strtolower($sortby), array("a.art_id desc", "a.art_time desc", "a.art_title", "a.blog_id", "b.blog_id", "b.blog_feed", "b.blog_title", "b.blog_time"))) ? strtolower($sortby) :  "";
56
+$andor = (in_array(strtoupper($andor), array("OR", "AND", "EXACT"))) ? strtoupper($andor) : "OR";
57
+$sortby = (in_array(strtolower($sortby), array("a.art_id desc", "a.art_time desc", "a.art_title", "a.blog_id", "b.blog_id", "b.blog_feed", "b.blog_title", "b.blog_time"))) ? strtolower($sortby) : "";
58 58
 
59
-if ( !( empty($_POST["submit"]) && empty($_GET["term"])) ) {
59
+if (!(empty($_POST["submit"]) && empty($_GET["term"]))) {
60 60
     $next_search["category"] = $category;
61 61
     $next_search["blog"] = $blog;
62 62
     $next_search["uid"] = $uid;
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
     $next_search["term"] = $term;
66 66
     $query = trim($term);
67 67
 
68
-    if ( $andor != "EXACT" ) {
68
+    if ($andor != "EXACT") {
69 69
         $ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
70 70
         $temp_queries = preg_split("/[\s,]+/", $query);
71 71
         foreach ($temp_queries as $q) {
72 72
             $q = trim($q);
73
-            if (strlen($q) >= $xoopsConfigSearch["keyword_min"]) {
73
+            if (strlen($q)>=$xoopsConfigSearch["keyword_min"]) {
74 74
                 $queries[] = $myts->addSlashes($q);
75
-            } else {
75
+            }else {
76 76
                 $ignored_queries[] = $myts->addSlashes($q);
77 77
             }
78 78
         }
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
             redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
81 81
             exit();
82 82
         }
83
-    } else {
84
-        if (strlen($query) < $xoopsConfigSearch["keyword_min"]) {
83
+    }else {
84
+        if (strlen($query)<$xoopsConfigSearch["keyword_min"]) {
85 85
             redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/search.php", 2, sprintf(_SR_KEYTOOSHORT, $xoopsConfigSearch["keyword_min"]));
86 86
             exit();
87 87
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
 	if (!empty($time)) {
98 98
 		$extra = "";
99
-	}else{
99
+	}else {
100 100
 		$extra = "";
101 101
 	}
102 102
 
@@ -113,12 +113,12 @@  discard block
 block discarded – undo
113 113
     {
114 114
         $xoopsTpl->assign("results", $results);
115 115
 
116
-        if(count($next_search)>0){
116
+        if (count($next_search)>0) {
117 117
 	        $items = array();
118
-	        foreach($next_search as $para => $val){
119
-		        if(!empty($val)) $items[] = "$para=$val";
118
+	        foreach ($next_search as $para => $val) {
119
+		        if (!empty($val)) $items[] = "$para=$val";
120 120
 	        }
121
-	        if(count($items)>0) $paras = implode("&",$items);
121
+	        if (count($items)>0) $paras = implode("&", $items);
122 122
 	        unset($next_search);
123 123
 	        unset($items);
124 124
         }
@@ -135,14 +135,14 @@  discard block
 block discarded – undo
135 135
         */
136 136
         if (count($results))
137 137
         {
138
-            $next = $start + $limit;
139
-            $queries = implode(",",$queries);
138
+            $next = $start+$limit;
139
+            $queries = implode(",", $queries);
140 140
             $search_url_next = $search_url."&start=$next";
141 141
             $search_next = "<a href=\"".htmlspecialchars($search_url_next)."\">"._SR_NEXT."</a>";
142 142
 			$xoopsTpl->assign("search_next", $search_next);
143 143
         }
144
-        if ( $start > 0 ) {
145
-            $prev = $start - $limit;
144
+        if ($start>0) {
145
+            $prev = $start-$limit;
146 146
             $search_url_prev = $search_url."&start=$prev";
147 147
             $search_prev = "<a href=\"".htmlspecialchars($search_url_prev)."\">"._SR_PREVIOUS."</a>";
148 148
 			$xoopsTpl->assign("search_prev", $search_prev);
@@ -157,54 +157,54 @@  discard block
 block discarded – undo
157 157
 /* type */
158 158
 $type_select = "<select name=\"andor\">";
159 159
 $type_select .= "<option value=\"OR\"";
160
-	if("OR" == $andor) $type_select .= " selected=\"selected\"";
160
+	if ("OR" == $andor) $type_select .= " selected=\"selected\"";
161 161
 	$type_select .= ">"._SR_ANY."</option>";
162 162
 $type_select .= "<option value=\"AND\"";
163
-	if("AND" == $andor) $type_select .= " selected=\"selected\"";
163
+	if ("AND" == $andor) $type_select .= " selected=\"selected\"";
164 164
 	$type_select .= ">"._SR_ALL."</option>";
165 165
 $type_select .= "<option value=\"EXACT\"";
166
-	if("exact" == $andor) $type_select .= " selected=\"selected\"";
166
+	if ("exact" == $andor) $type_select .= " selected=\"selected\"";
167 167
 	$type_select .= ">"._SR_EXACT."</option>";
168 168
 $type_select .= "</select>";
169 169
 
170 170
 /* scope */
171 171
 $searchin_select = "";
172 172
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"title\"";
173
-	if(in_array("title", $searchin)) $searchin_select .= " checked";
173
+	if (in_array("title", $searchin)) $searchin_select .= " checked";
174 174
 	$searchin_select .= " />".planet_constant("MD_TITLE")."&nbsp;&nbsp;";
175 175
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\"";
176
-	if(in_array("text", $searchin)) $searchin_select .= " checked";
176
+	if (in_array("text", $searchin)) $searchin_select .= " checked";
177 177
 	$searchin_select .= " />".planet_constant("MD_BODY")."&nbsp;&nbsp;||&nbsp;&nbsp;";
178 178
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\"";
179
-	if(in_array("blog", $searchin)) $searchin_select .= " checked";
179
+	if (in_array("blog", $searchin)) $searchin_select .= " checked";
180 180
 	$searchin_select .= " />".planet_constant("MD_BLOG")."&nbsp;&nbsp;";
181 181
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\"";
182
-	if(in_array("feed", $searchin)) $searchin_select .= " checked";
182
+	if (in_array("feed", $searchin)) $searchin_select .= " checked";
183 183
 	$searchin_select .= " />".planet_constant("MD_FEED")."&nbsp;&nbsp;";
184 184
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\"";
185
-	if(in_array("desc", $searchin)) $searchin_select .= " checked";
185
+	if (in_array("desc", $searchin)) $searchin_select .= " checked";
186 186
 	$searchin_select .= " />".planet_constant("MD_DESC")."&nbsp;&nbsp;";
187 187
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\"";
188
-	if(empty($searchin)) $searchin_select .= " checked";
188
+	if (empty($searchin)) $searchin_select .= " checked";
189 189
 	$searchin_select .= " />"._ALL."&nbsp;&nbsp;";
190 190
 
191 191
 /* sortby */
192 192
 $sortby_select = "<select name=\"sortby\">";
193 193
 $sortby_select .= "<option value=\"\"";
194
-	if(empty($sortby)) $sortby_select .= " selected=\"selected\"";
194
+	if (empty($sortby)) $sortby_select .= " selected=\"selected\"";
195 195
 	$sortby_select .= ">"._NONE."</option>";
196 196
 $sortby_select .= "<option value=\"a.art_time\"";
197
-	if("a.art_time" == $sortby) $sortby_select .= " selected=\"selected\"";
197
+	if ("a.art_time" == $sortby) $sortby_select .= " selected=\"selected\"";
198 198
 	$sortby_select .= ">".planet_constant("MD_TIME")."</option>";
199 199
 $sortby_select .= "<option value=\"a.art_title\"";
200
-	if("a.art_title" == $sortby) $sortby_select .= " selected=\"selected\"";
200
+	if ("a.art_title" == $sortby) $sortby_select .= " selected=\"selected\"";
201 201
 	$sortby_select .= ">".planet_constant("MD_TITLE")."</option>";
202 202
 $sortby_select .= "<option value=\"\">&nbsp;&nbsp;----&nbsp;&nbsp;</option>";
203 203
 $sortby_select .= "<option value=\"a.blog_title\"";
204
-	if("a.blog_title" == $sortby) $sortby_select .= " selected=\"selected\"";
204
+	if ("a.blog_title" == $sortby) $sortby_select .= " selected=\"selected\"";
205 205
 	$sortby_select .= ">".planet_constant("MD_BLOG")."</option>";
206 206
 $sortby_select .= "<option value=\"a.blog_time\"";
207
-	if("b.blog_time" == $sortby) $sortby_select .= " selected=\"selected\"";
207
+	if ("b.blog_time" == $sortby) $sortby_select .= " selected=\"selected\"";
208 208
 	$sortby_select .= ">".planet_constant("MD_UPDATE")."</option>";
209 209
 $sortby_select .= "</select>";
210 210
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 $xoopsTpl->assign("blog", $blog);
220 220
 $xoopsTpl->assign("uid", $uid);
221 221
 
222
-if ($xoopsConfigSearch["keyword_min"] > 0) {
222
+if ($xoopsConfigSearch["keyword_min"]>0) {
223 223
 	$xoopsTpl->assign("search_rule", sprintf(_SR_KEYIGNORE, $xoopsConfigSearch["keyword_min"]));
224 224
 }
225 225
 
Please login to merge, or discard this patch.
Braces   +49 added lines, -17 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
      */
97 97
 	if (!empty($time)) {
98 98
 		$extra = "";
99
-	}else{
99
+	} else{
100 100
 		$extra = "";
101 101
 	}
102 102
 
@@ -116,9 +116,13 @@  discard block
 block discarded – undo
116 116
         if(count($next_search)>0){
117 117
 	        $items = array();
118 118
 	        foreach($next_search as $para => $val){
119
-		        if(!empty($val)) $items[] = "$para=$val";
119
+		        if(!empty($val)) {
120
+		        	$items[] = "$para=$val";
121
+		        }
122
+	        }
123
+	        if(count($items)>0) {
124
+	        	$paras = implode("&",$items);
120 125
 	        }
121
-	        if(count($items)>0) $paras = implode("&",$items);
122 126
 	        unset($next_search);
123 127
 	        unset($items);
124 128
         }
@@ -157,54 +161,82 @@  discard block
 block discarded – undo
157 161
 /* type */
158 162
 $type_select = "<select name=\"andor\">";
159 163
 $type_select .= "<option value=\"OR\"";
160
-	if("OR" == $andor) $type_select .= " selected=\"selected\"";
164
+	if("OR" == $andor) {
165
+		$type_select .= " selected=\"selected\"";
166
+	}
161 167
 	$type_select .= ">"._SR_ANY."</option>";
162 168
 $type_select .= "<option value=\"AND\"";
163
-	if("AND" == $andor) $type_select .= " selected=\"selected\"";
169
+	if("AND" == $andor) {
170
+		$type_select .= " selected=\"selected\"";
171
+	}
164 172
 	$type_select .= ">"._SR_ALL."</option>";
165 173
 $type_select .= "<option value=\"EXACT\"";
166
-	if("exact" == $andor) $type_select .= " selected=\"selected\"";
174
+	if("exact" == $andor) {
175
+		$type_select .= " selected=\"selected\"";
176
+	}
167 177
 	$type_select .= ">"._SR_EXACT."</option>";
168 178
 $type_select .= "</select>";
169 179
 
170 180
 /* scope */
171 181
 $searchin_select = "";
172 182
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"title\"";
173
-	if(in_array("title", $searchin)) $searchin_select .= " checked";
183
+	if(in_array("title", $searchin)) {
184
+		$searchin_select .= " checked";
185
+	}
174 186
 	$searchin_select .= " />".planet_constant("MD_TITLE")."&nbsp;&nbsp;";
175 187
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"text\"";
176
-	if(in_array("text", $searchin)) $searchin_select .= " checked";
188
+	if(in_array("text", $searchin)) {
189
+		$searchin_select .= " checked";
190
+	}
177 191
 	$searchin_select .= " />".planet_constant("MD_BODY")."&nbsp;&nbsp;||&nbsp;&nbsp;";
178 192
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"blog\"";
179
-	if(in_array("blog", $searchin)) $searchin_select .= " checked";
193
+	if(in_array("blog", $searchin)) {
194
+		$searchin_select .= " checked";
195
+	}
180 196
 	$searchin_select .= " />".planet_constant("MD_BLOG")."&nbsp;&nbsp;";
181 197
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"feed\"";
182
-	if(in_array("feed", $searchin)) $searchin_select .= " checked";
198
+	if(in_array("feed", $searchin)) {
199
+		$searchin_select .= " checked";
200
+	}
183 201
 	$searchin_select .= " />".planet_constant("MD_FEED")."&nbsp;&nbsp;";
184 202
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"desc\"";
185
-	if(in_array("desc", $searchin)) $searchin_select .= " checked";
203
+	if(in_array("desc", $searchin)) {
204
+		$searchin_select .= " checked";
205
+	}
186 206
 	$searchin_select .= " />".planet_constant("MD_DESC")."&nbsp;&nbsp;";
187 207
 $searchin_select .= "<input type=\"checkbox\" name=\"searchin[]\" value=\"all\"";
188
-	if(empty($searchin)) $searchin_select .= " checked";
208
+	if(empty($searchin)) {
209
+		$searchin_select .= " checked";
210
+	}
189 211
 	$searchin_select .= " />"._ALL."&nbsp;&nbsp;";
190 212
 
191 213
 /* sortby */
192 214
 $sortby_select = "<select name=\"sortby\">";
193 215
 $sortby_select .= "<option value=\"\"";
194
-	if(empty($sortby)) $sortby_select .= " selected=\"selected\"";
216
+	if(empty($sortby)) {
217
+		$sortby_select .= " selected=\"selected\"";
218
+	}
195 219
 	$sortby_select .= ">"._NONE."</option>";
196 220
 $sortby_select .= "<option value=\"a.art_time\"";
197
-	if("a.art_time" == $sortby) $sortby_select .= " selected=\"selected\"";
221
+	if("a.art_time" == $sortby) {
222
+		$sortby_select .= " selected=\"selected\"";
223
+	}
198 224
 	$sortby_select .= ">".planet_constant("MD_TIME")."</option>";
199 225
 $sortby_select .= "<option value=\"a.art_title\"";
200
-	if("a.art_title" == $sortby) $sortby_select .= " selected=\"selected\"";
226
+	if("a.art_title" == $sortby) {
227
+		$sortby_select .= " selected=\"selected\"";
228
+	}
201 229
 	$sortby_select .= ">".planet_constant("MD_TITLE")."</option>";
202 230
 $sortby_select .= "<option value=\"\">&nbsp;&nbsp;----&nbsp;&nbsp;</option>";
203 231
 $sortby_select .= "<option value=\"a.blog_title\"";
204
-	if("a.blog_title" == $sortby) $sortby_select .= " selected=\"selected\"";
232
+	if("a.blog_title" == $sortby) {
233
+		$sortby_select .= " selected=\"selected\"";
234
+	}
205 235
 	$sortby_select .= ">".planet_constant("MD_BLOG")."</option>";
206 236
 $sortby_select .= "<option value=\"a.blog_time\"";
207
-	if("b.blog_time" == $sortby) $sortby_select .= " selected=\"selected\"";
237
+	if("b.blog_time" == $sortby) {
238
+		$sortby_select .= " selected=\"selected\"";
239
+	}
208 240
 	$sortby_select .= ">".planet_constant("MD_UPDATE")."</option>";
209 241
 $sortby_select .= "</select>";
210 242
 
Please login to merge, or discard this patch.