Completed
Branch master (15a86c)
by Michael
06:07
created
index.php 1 patch
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -26,46 +26,46 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28 28
 
29
-if(preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)){
29
+if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) {
30 30
 	include XOOPS_ROOT_PATH.'/include/notification_update.php';
31 31
 	exit();
32 32
 }
33 33
 
34
-if($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)){
34
+if ($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)) {
35 35
 	$args["start"] = @$args_num[0];
36 36
 	$args["sort"] = @$args_str[0];
37 37
 }
38 38
 
39 39
 /* Start */
40
-$start = intval( empty($_GET["start"])?@$args["start"]:$_GET["start"] );
40
+$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
41 41
 /* Specified Category */
42
-$category_id = intval( empty($_GET["category"])?@$args["category"]:$_GET["category"] );
42
+$category_id = intval(empty($_GET["category"]) ? @$args["category"] : $_GET["category"]);
43 43
 /* Specified Blog */
44
-$blog_id = intval( empty($_GET["blog"])?@$args["blog"]:$_GET["blog"] );
44
+$blog_id = intval(empty($_GET["blog"]) ? @$args["blog"] : $_GET["blog"]);
45 45
 /* Specified Bookmar(Favorite) UID */
46
-$uid = intval( empty($_GET["uid"])?@$args["uid"]:$_GET["uid"] );
46
+$uid = intval(empty($_GET["uid"]) ? @$args["uid"] : $_GET["uid"]);
47 47
 /* Sort by term */
48
-$sort = empty($_GET["sort"])?@$args["sort"]:$_GET["sort"];
48
+$sort = empty($_GET["sort"]) ? @$args["sort"] : $_GET["sort"];
49 49
 /* Display as list */
50
-$list = intval( empty($_GET["list"])?@$args["list"]:$_GET["list"] );
50
+$list = intval(empty($_GET["list"]) ? @$args["list"] : $_GET["list"]);
51 51
 
52 52
 // restore $_SERVER['REQUEST_URI']
53
-if(!empty($REQUEST_URI_parsed)){
53
+if (!empty($REQUEST_URI_parsed)) {
54 54
 	$args_REQUEST_URI = array();
55
-	$_args =array("start", "sort", "uid", "list");
56
-	foreach($_args as $arg){
57
-		if(!empty(${$arg})){
58
-			$args_REQUEST_URI[] = $arg ."=". ${$arg};
55
+	$_args = array("start", "sort", "uid", "list");
56
+	foreach ($_args as $arg) {
57
+		if (!empty(${$arg})) {
58
+			$args_REQUEST_URI[] = $arg."=".${$arg};
59 59
 		}
60 60
 	}
61
-	if(!empty($blog_id)){
62
-		$args_REQUEST_URI[] = "blog=". $blog_id;
61
+	if (!empty($blog_id)) {
62
+		$args_REQUEST_URI[] = "blog=".$blog_id;
63 63
 	}
64
-	if(!empty($category_id)){
65
-		$args_REQUEST_URI[] = "category=". $category_id;
64
+	if (!empty($category_id)) {
65
+		$args_REQUEST_URI[] = "category=".$category_id;
66 66
 	}
67 67
 	$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".
68
-		(empty($args_REQUEST_URI)?"":"?".implode("&",$args_REQUEST_URI));
68
+		(empty($args_REQUEST_URI) ? "" : "?".implode("&", $args_REQUEST_URI));
69 69
 }
70 70
 
71 71
 $xoopsOption["template_main"] = planet_getTemplate("index");
@@ -76,20 +76,20 @@  discard block
 block discarded – undo
76 76
 	';
77 77
 
78 78
 $xoopsOption["xoops_module_header"] = $xoops_module_header;
79
-include_once( XOOPS_ROOT_PATH . "/header.php" );
79
+include_once(XOOPS_ROOT_PATH."/header.php");
80 80
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
81 81
 
82 82
 // Following part will not be executed after cache
83
-$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
84
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
85
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
83
+$category_handler = & xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
84
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
85
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
86 86
 
87
-$limit = empty($list)? $xoopsModuleConfig["articles_perpage"] : $xoopsModuleConfig["list_perpage"];
87
+$limit = empty($list) ? $xoopsModuleConfig["articles_perpage"] : $xoopsModuleConfig["list_perpage"];
88 88
 $query_type = "";
89 89
 $criteria = new CriteriaCompo();
90 90
 $article_prefix = "";
91 91
 /* Specific category */
92
-if($category_id >0){
92
+if ($category_id>0) {
93 93
 	$category_obj = $category_handler->get($category_id);
94 94
 	$criteria->add(new Criteria("bc.cat_id", $category_id));
95 95
 	$uid = 0;
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
 	$article_prefix = "a.";
100 100
 }
101 101
 /* Specific blog */	
102
-if($blog_id>0){
103
-	$blog_obj =& $blog_handler->get($blog_id);
104
-	if($blog_obj->getVar("blog_status") || 
105
-		(is_object($xoopsUser) && $xoopsUser->getVar("uid")== $blog_obj->getVar("blog_submitter"))
106
-		){
102
+if ($blog_id>0) {
103
+	$blog_obj = & $blog_handler->get($blog_id);
104
+	if ($blog_obj->getVar("blog_status") || 
105
+		(is_object($xoopsUser) && $xoopsUser->getVar("uid") == $blog_obj->getVar("blog_submitter"))
106
+		) {
107 107
 		$criteria->add(new Criteria("blog_id", $blog_id));
108 108
 		$category_id = 0;
109 109
 		$uid = 0;
110
-		$bookmark_handler =& xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
110
+		$bookmark_handler = & xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
111 111
 		$blog_data = array(
112 112
 			"id"=>$blog_id,
113 113
 			"title"=>$blog_obj->getVar("blog_title"),
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	$article_prefix = "";
127 127
 }
128 128
 /* User bookmarks(favorites) */
129
-if($uid >0){
129
+if ($uid>0) {
130 130
 	$criteria->add(new Criteria("bm.bm_uid", $uid));
131 131
 	$category_id = 0;
132 132
 	$blog_id = 0;
133
-	$bookmark_handler =& xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
133
+	$bookmark_handler = & xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
134 134
 	$user_data = array(
135 135
 		"uid"=>$uid, 
136 136
 		"name"=>XoopsUser::getUnameFromID($uid),
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 
143 143
 /* Sort */
144 144
 $order = "DESC";
145
-$sort = empty($sort)?"time":$sort;
146
-switch($sort){
145
+$sort = empty($sort) ? "time" : $sort;
146
+switch ($sort) {
147 147
 	case "views":
148 148
 		$sortby = $article_prefix."art_views";
149 149
 		break;
@@ -163,25 +163,25 @@  discard block
 block discarded – undo
163 163
 $criteria->setStart($start);
164 164
 $criteria->setLimit($limit);
165 165
 
166
-$tags = empty($list)?"":array($article_prefix."art_title", $article_prefix."blog_id", $article_prefix."art_time");
167
-switch($query_type){
166
+$tags = empty($list) ? "" : array($article_prefix."art_title", $article_prefix."blog_id", $article_prefix."art_time");
167
+switch ($query_type) {
168 168
 case "category":
169
-	$articles_obj =& $article_handler->getByCategory($criteria, $tags);
169
+	$articles_obj = & $article_handler->getByCategory($criteria, $tags);
170 170
 	$count_article = $article_handler->getCountByCategory($criteria);
171 171
 	break;
172 172
 case "bookmark":
173
-	$articles_obj =& $article_handler->getByBookmark($criteria, $tags);
173
+	$articles_obj = & $article_handler->getByBookmark($criteria, $tags);
174 174
 	$count_article = $article_handler->getCountByBookmark($criteria);
175 175
 	break;
176 176
 default:
177
-	$articles_obj =& $article_handler->getAll($criteria, $tags);
177
+	$articles_obj = & $article_handler->getAll($criteria, $tags);
178 178
 	$count_article = $article_handler->getCount($criteria);
179 179
 	break;
180 180
 }
181 181
 
182
-if(!empty($blog_data)){
182
+if (!empty($blog_data)) {
183 183
 	$blogs[$blog_data["id"]] = $blog_data["title"];
184
-}else{
184
+}else {
185 185
 	$blog_array = array();
186 186
 	foreach (array_keys($articles_obj) as $id) {
187 187
 		$blog_array[$articles_obj[$id]->getVar("blog_id")] = 1;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 		"time" => $articles_obj[$id]->getTime(),
200 200
 		"blog"=> array("id"=>$articles_obj[$id]->getVar("blog_id"), "title"=>$blogs[$articles_obj[$id]->getVar("blog_id")])
201 201
 		);
202
-	if(empty($list)){
202
+	if (empty($list)) {
203 203
 		$_article = array_merge($_article, array(
204 204
 			"author" => $articles_obj[$id]->getVar("art_author"),
205 205
 			"views"=> $articles_obj[$id]->getVar("art_views"),
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 			"rates"=> $articles_obj[$id]->getVar("art_rates")
209 209
 			)
210 210
 		);
211
-		if(!empty($xoopsModuleConfig["display_summary"])){
211
+		if (!empty($xoopsModuleConfig["display_summary"])) {
212 212
 			$_article["content"] = $articles_obj[$id]->getSummary();
213
-		}else{
213
+		}else {
214 214
 			$_article["content"] = $articles_obj[$id]->getVar("art_content");
215 215
 		}
216 216
 	}
@@ -219,46 +219,46 @@  discard block
 block discarded – undo
219 219
 }
220 220
 unset($articles_obj);
221 221
 
222
-if ( $count_article > $limit) {
222
+if ($count_article>$limit) {
223 223
 	include(XOOPS_ROOT_PATH."/class/pagenav.php");
224 224
 	$start_link = array();
225
-	if($sort) $start_link[] = "sort=".$sort;
226
-	if($category_id) $start_link[] = "category=".$category_id;
227
-	if($blog_id) $start_link[] = "blog=".$blog_id;
228
-	if($list) $start_link[] = "list=".$list;
225
+	if ($sort) $start_link[] = "sort=".$sort;
226
+	if ($category_id) $start_link[] = "category=".$category_id;
227
+	if ($blog_id) $start_link[] = "blog=".$blog_id;
228
+	if ($list) $start_link[] = "list=".$list;
229 229
 	$nav = new XoopsPageNav($count_article, $limit, $start, "start", implode("&", $start_link));
230 230
 	$pagenav = $nav->renderNav(4);
231
-} else {
231
+}else {
232 232
 	$pagenav = "";
233 233
 }
234 234
 
235
-$xoopsTpl -> assign("xoops_module_header", $xoops_module_header );
236
-$xoopsTpl -> assign("dirname", $GLOBALS["moddirname"] );
235
+$xoopsTpl -> assign("xoops_module_header", $xoops_module_header);
236
+$xoopsTpl -> assign("dirname", $GLOBALS["moddirname"]);
237 237
 
238
-if($category_id || $blog_id || $uid){
238
+if ($category_id || $blog_id || $uid) {
239 239
 	$xoopsTpl -> assign("link_index", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php\" title=\"".planet_constant("MD_INDEX")."\" target=\"_self\">".planet_constant("MD_INDEX")."</a>");
240 240
 }
241 241
 
242 242
 $link_switch = "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".
243
-	(empty($category_id)?"":"/c".$category_id).
244
-	(empty($uid)?"":"/u".$uid).
245
-	(empty($blog_id)?"":"/b".$blog_id).
246
-	(empty($list)?"/l1":"").
247
-	"\" title=\"".(empty($list)?planet_constant("MD_LISTVIEW"):planet_constant("MD_FULLVIEW"))."\">".(empty($list)?planet_constant("MD_LISTVIEW"):planet_constant("MD_FULLVIEW"))."</a>";
243
+	(empty($category_id) ? "" : "/c".$category_id).
244
+	(empty($uid) ? "" : "/u".$uid).
245
+	(empty($blog_id) ? "" : "/b".$blog_id).
246
+	(empty($list) ? "/l1" : "").
247
+	"\" title=\"".(empty($list) ? planet_constant("MD_LISTVIEW") : planet_constant("MD_FULLVIEW"))."\">".(empty($list) ? planet_constant("MD_LISTVIEW") : planet_constant("MD_FULLVIEW"))."</a>";
248 248
 $xoopsTpl -> assign("link_switch", $link_switch);
249 249
 
250 250
 $link_blogs = "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php".
251
-	(empty($category_id)?"":"/c".$category_id).
252
-	(empty($uid)?"":"/u".$uid).
251
+	(empty($category_id) ? "" : "/c".$category_id).
252
+	(empty($uid) ? "" : "/u".$uid).
253 253
 	"\" title=\"".planet_constant("MD_BLOGS")."\">".planet_constant("MD_BLOGS").
254 254
 	"</a>";
255 255
 $xoopsTpl -> assign("link_blogs", $link_blogs);
256 256
 
257
-if(empty($uid) && is_object($xoopsUser)){
257
+if (empty($uid) && is_object($xoopsUser)) {
258 258
 	$xoopsTpl -> assign("link_bookmark", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."u".$xoopsUser->getVar("uid")."\" title=\"".planet_constant("MD_BOOKMARKS")."\" target=\"_self\">".planet_constant("MD_BOOKMARKS")."</a>");
259 259
 }
260 260
 
261
-if($xoopsModuleConfig["newblog_submit"]==1 || is_object($xoopsUser)){
261
+if ($xoopsModuleConfig["newblog_submit"] == 1 || is_object($xoopsUser)) {
262 262
 	$xoopsTpl -> assign("link_submit", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/action.blog.php\" title=\""._SUBMIT."\" target=\"_blank\">"._SUBMIT."</a>");
263 263
 }
264 264
 
@@ -270,21 +270,21 @@  discard block
 block discarded – undo
270 270
 $xoopsTpl -> assign("pagenav", $pagenav);
271 271
 $xoopsTpl -> assign("is_list", !empty($list));
272 272
 
273
-$xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
274
-if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
275
-}elseif($blog_id>0){
273
+$xoopsTpl -> assign("user_level", !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1));
274
+if (empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)) {
275
+}elseif ($blog_id>0) {
276 276
 	$xoopsTpl -> assign("canrate", 1);
277 277
 }
278 278
 
279 279
 $sort_link = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".
280
-	(empty($category_id)?"":"/c".$category_id).
281
-	(empty($uid)?"":"/u".$uid).
282
-	(empty($blog_id)?"":"/b".$blog_id).
283
-	(empty($list)?"":"/l1");
280
+	(empty($category_id) ? "" : "/c".$category_id).
281
+	(empty($uid) ? "" : "/u".$uid).
282
+	(empty($blog_id) ? "" : "/b".$blog_id).
283
+	(empty($list) ? "" : "/l1");
284 284
 $valid_sorts = array("views"=>planet_constant("MD_VIEWS"), "rating"=>planet_constant("MD_RATING"), "time"=>planet_constant("MD_TIME"), "default"=>planet_constant("MD_DEFAULT"));
285 285
 $sortlinks = array();
286
-foreach($valid_sorts as $val=>$name){
287
-	if($val == $sort) continue;
286
+foreach ($valid_sorts as $val=>$name) {
287
+	if ($val == $sort) continue;
288 288
 	$sortlinks[] = "<a href=\"".$sort_link."/".$val."\">".$name."</a>";
289 289
 }
290 290
 $xoopsTpl -> assign("link_sort", implode(" | ", $sortlinks));
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 $xoopsTpl->assign('do_pseudocron', $xoopsModuleConfig["do_pseudocron"]);
294 294
 
295 295
 // for notification
296
-if(!empty($blog_id)){
296
+if (!empty($blog_id)) {
297 297
 	//$_SERVER['REQUEST_URI'] = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
298 298
 	$_GET["blog"] = $blog_id;
299 299
 }
Please login to merge, or discard this patch.
action.blog.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -27,51 +27,51 @@  discard block
 block discarded – undo
27 27
 
28 28
 include "header.php";
29 29
 
30
-$op = !empty($_POST["op"])?$_POST["op"]:(!empty($_GET["op"])?$_GET["op"]:"");
31
-$blog_id = !empty($_POST["blog"])?$_POST["blog"]:(!empty($_GET["blog"])?$_GET["blog"]:0);
32
-$blog_id = is_array($blog_id)?array_map("intval", $blog_id):intval($blog_id);
30
+$op = !empty($_POST["op"]) ? $_POST["op"] : (!empty($_GET["op"]) ? $_GET["op"] : "");
31
+$blog_id = !empty($_POST["blog"]) ? $_POST["blog"] : (!empty($_GET["blog"]) ? $_GET["blog"] : 0);
32
+$blog_id = is_array($blog_id) ? array_map("intval", $blog_id) : intval($blog_id);
33 33
 
34
-if(empty($xoopsModuleConfig["newblog_submit"]) && (!is_object($xoopsUser) || !$xoopsUser->isAdmin())){
34
+if (empty($xoopsModuleConfig["newblog_submit"]) && (!is_object($xoopsUser) || !$xoopsUser->isAdmin())) {
35 35
         redirect_header("index.php", 2, _NOPERM);
36 36
 }
37 37
 
38
-if($op=="save" && !empty($_POST["fetch"])){
39
-	$op="edit";
38
+if ($op == "save" && !empty($_POST["fetch"])) {
39
+	$op = "edit";
40 40
 }
41 41
 
42
-if($op=="save" && !$GLOBALS['xoopsSecurity']->check()){
42
+if ($op == "save" && !$GLOBALS['xoopsSecurity']->check()) {
43 43
     redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_INVALID").": security check failed");
44 44
     exit();
45 45
 }
46 46
 include XOOPS_ROOT_PATH."/header.php";
47 47
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
48 48
 
49
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
50
-$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
49
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
50
+$category_handler = & xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
51 51
 
52
-switch($op){
52
+switch ($op) {
53 53
 	/* save a single blog */
54 54
 	case "save":
55 55
 		
56 56
         if ($blog_id) {
57
-            $blog_obj =& $blog_handler->get($blog_id);
58
-			if($xoopsUser->isAdmin()){
57
+            $blog_obj = & $blog_handler->get($blog_id);
58
+			if ($xoopsUser->isAdmin()) {
59 59
         		$blog_obj->setVar('blog_status', @$_POST["blog_status"]);
60 60
 			}        	
61
-        } else {
62
-	        if($blog_exists = $blog_handler->getCount(new Criteria("blog_feed", $myts->addSlashes( trim($_POST['blog_feed']) )))){
61
+        }else {
62
+	        if ($blog_exists = $blog_handler->getCount(new Criteria("blog_feed", $myts->addSlashes(trim($_POST['blog_feed']))))) {
63 63
 		        redirect_header("index.php", 2, planet_constant("MD_BLOGEXISTS"));
64 64
 		        exit();
65 65
 	        }
66 66
 	        
67
-            $blog_obj =& $blog_handler->create();
68
-        	$blog_obj->setVar('blog_submitter', is_object($xoopsUser)?$xoopsUser->getVar("uid"):planet_getIP(true));
67
+            $blog_obj = & $blog_handler->create();
68
+        	$blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar("uid") : planet_getIP(true));
69 69
         	
70
-			switch($xoopsModuleConfig["newblog_submit"]){
70
+			switch ($xoopsModuleConfig["newblog_submit"]) {
71 71
 			case 2:
72
-				if(!is_object($xoopsUser)){
72
+				if (!is_object($xoopsUser)) {
73 73
 					$status = 0;
74
-				}else{
74
+				}else {
75 75
 					$status = 1;
76 76
 				}
77 77
 				break;
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 				break;
82 82
 			case 1:
83 83
 			default:
84
-				if(!is_object($xoopsUser) || !$xoopsUser->isAdmin()){
84
+				if (!is_object($xoopsUser) || !$xoopsUser->isAdmin()) {
85 85
 					$status = 0;
86
-				}else{
86
+				}else {
87 87
 					$status = 1;
88 88
 				}
89 89
 				break;
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
         $blog_obj->setVar('blog_language', $_POST['blog_language']);
101 101
         $blog_obj->setVar('blog_charset', $_POST['blog_charset']);
102 102
         $blog_obj->setVar('blog_trackback', $_POST['blog_trackback']);
103
-        if($blog_obj->isNew()){
104
-        	$blog_obj->setVar('blog_submitter', is_object($xoopsUser)?$xoopsUser->getVar("uid"):planet_getIP(true));
103
+        if ($blog_obj->isNew()) {
104
+        	$blog_obj->setVar('blog_submitter', is_object($xoopsUser) ? $xoopsUser->getVar("uid") : planet_getIP(true));
105 105
     	}
106 106
 
107 107
         if (!$blog_handler->insert($blog_obj)) {
108
-        }elseif(!empty($_POST["categories"])){
108
+        }elseif (!empty($_POST["categories"])) {
109 109
 	    	$blog_id = $blog_obj->getVar("blog_id");
110
-			if(in_array(0, $_POST["categories"])) $_POST["categories"] = array();
110
+			if (in_array(0, $_POST["categories"])) $_POST["categories"] = array();
111 111
 			$blog_handler->setCategories($blog_id, $_POST["categories"]);
112 112
         }
113 113
         $message = planet_constant("MD_DBUPDATED");
@@ -117,28 +117,28 @@  discard block
 block discarded – undo
117 117
     /* edit a single blog */
118 118
 	case "edit":
119 119
 	default:
120
-        if(!empty($_POST["fetch"])){
121
-        	$blog_obj =& $blog_handler->fetch($_POST["blog_feed"]);
120
+        if (!empty($_POST["fetch"])) {
121
+        	$blog_obj = & $blog_handler->fetch($_POST["blog_feed"]);
122 122
         	$blog_obj->setVar("blog_id", $blog_id);	        
123
-        }else{
124
-        	$blog_obj =& $blog_handler->get($blog_id);
123
+        }else {
124
+        	$blog_obj = & $blog_handler->get($blog_id);
125 125
         }
126
-	    $categories = isset($_POST["categories"])?$_POST["categories"]:array();	    
127
-		if(in_array("-1", $categories)) $categories = array();
128
-        if(empty($categories) && $blog_id>0){
126
+	    $categories = isset($_POST["categories"]) ? $_POST["categories"] : array();	    
127
+		if (in_array("-1", $categories)) $categories = array();
128
+        if (empty($categories) && $blog_id>0) {
129 129
 	        $crit = new Criteria("bc.blog_id", $blog_id);
130 130
 	    	$categories = array_keys($category_handler->getByBlog($crit));
131 131
         }
132
-        if(empty($categories)) $categories = array(0=>_NONE);
132
+        if (empty($categories)) $categories = array(0=>_NONE);
133 133
        
134
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
134
+        echo "<fieldset><legend style='font-weight: bold; color: #900;'>"._EDIT."</legend>";
135 135
         echo"<br />";
136
-        if(empty($blog_id) && $blog_obj->getVar("blog_feed")){
136
+        if (empty($blog_id) && $blog_obj->getVar("blog_feed")) {
137 137
 	        $criteria = new Criteria("blog_feed", $blog_obj->getVar("blog_feed"));
138
-	        $blogs_obj =& $blog_handler->getList($criteria);
139
-	        if(count($blogs_obj)>0){
138
+	        $blogs_obj = & $blog_handler->getList($criteria);
139
+	        if (count($blogs_obj)>0) {
140 140
 		        echo "<div class=\"errorMsg\">".planet_constant("MD_BLOGEXISTS");
141
-		        foreach(array_keys($blogs_obj) as $bid){
141
+		        foreach (array_keys($blogs_obj) as $bid) {
142 142
 			        echo "<br /><a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$bid."\" target=\"_blank\">".$blogs_obj[$bid]."</a>";
143 143
 		        }
144 144
 		        echo "</div>";
Please login to merge, or discard this patch.
trackback.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -39,21 +39,21 @@  discard block
 block discarded – undo
39 39
 if (empty($xoopsModuleConfig['trackback_option'])) {
40 40
 	planet_trackback_response(1, 'Trackback is closed');
41 41
 }
42
-if( !strlen( $title.$url.$blog_name ) ) {
42
+if (!strlen($title.$url.$blog_name)) {
43 43
 	planet_trackback_response(1, planet_constant("MD_INVALID"));
44 44
 }
45 45
 
46 46
 
47
-if ( !empty($article_id) && !empty($url)) {
47
+if (!empty($article_id) && !empty($url)) {
48 48
 	
49
-	$trackback_handler =& xoops_getmodulehandler("trackback", $GLOBALS["moddirname"]);
49
+	$trackback_handler = & xoops_getmodulehandler("trackback", $GLOBALS["moddirname"]);
50 50
 	$criteria = new CriteriaCompo(new Criteria('art_id', $article_id));
51 51
 	$criteria->add(new Criteria('tb_url', $url));
52
-	if($trackback_handler->getCount($criteria)>0){
52
+	if ($trackback_handler->getCount($criteria)>0) {
53 53
 		planet_trackback_response(1, 'We already have a ping from that URI for this article.');
54 54
 	}
55 55
 
56
-	$charset = (empty($charset))?'utf-8':$charset;
56
+	$charset = (empty($charset)) ? 'utf-8' : $charset;
57 57
 	$title = XoopsLocal::convert_encoding($title, _CHARSET, $charset);
58 58
 	$excerpt = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset);
59 59
 	$blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset);
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
 	$com_title = $title;
66 66
 	$com_text = $excerpt;
67 67
 	$com_text .= "\n\n[TRACKBACK]"._POSTEDBY.": ";
68
-	if(!empty($url)){
68
+	if (!empty($url)) {
69 69
 		$com_text .= "[url=".$url."]".$blog_name."[/url]";
70
-	}else{
70
+	}else {
71 71
 		$com_text .= $blog_name;
72 72
 	}
73 73
 	$com_modid = $xoopsModule->getVar("mid");
74 74
 	
75
-	$comment_handler =& xoops_gethandler('comment');
75
+	$comment_handler = & xoops_gethandler('comment');
76 76
 	$comment = $comment_handler->create();
77 77
 	$comment->setVar('com_created', time());
78 78
 	$comment->setVar('com_pid', $com_pid);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					if (!function_exists($comment_config['callback']['approve'])) {
128 128
 						$skip = true;
129 129
 					}
130
-				} else {
130
+				}else {
131 131
 					$skip = true;
132 132
 				}
133 133
 			}
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 					if (!function_exists($comment_config['callback']['update'])) {
149 149
 						$skip = true;
150 150
 					}
151
-				} else {
151
+				}else {
152 152
 					$skip = true;
153 153
 				}
154 154
 			}
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
 		// trigger notification event if necessary
167 167
 		if ($notify_event) {
168 168
 			$not_modid = $com_modid;
169
-			include_once XOOPS_ROOT_PATH . '/include/notification_functions.php';
170
-			$not_catinfo =& notificationCommentCategoryInfo($not_modid);
169
+			include_once XOOPS_ROOT_PATH.'/include/notification_functions.php';
170
+			$not_catinfo = & notificationCommentCategoryInfo($not_modid);
171 171
 			$not_category = $not_catinfo['name'];
172 172
 			$not_itemid = $com_itemid;
173 173
 			$not_event = $notify_event;
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
 			// point to a viewable page (i.e. not the system administration
176 176
 			// module).
177 177
 			$comment_tags = array();
178
-			$not_module =& $xoopsModule;
178
+			$not_module = & $xoopsModule;
179 179
 			if (!isset($comment_url)) {
180
-				$com_config =& $not_module->getInfo('comments');
181
-				$comment_url = $com_config['pageName'] . '?';
180
+				$com_config = & $not_module->getInfo('comments');
181
+				$comment_url = $com_config['pageName'].'?';
182 182
 				$comment_url .= $com_config['itemName'];
183 183
 			}
184
-			$comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' .$comment_url . '=' . $com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid;
185
-			$notification_handler =& xoops_gethandler('notification');
186
-			$notification_handler->triggerEvent ($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
184
+			$comment_tags['X_COMMENT_URL'] = XOOPS_URL.'/modules/'.$not_module->getVar('dirname').'/'.$comment_url.'='.$com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid;
185
+			$notification_handler = & xoops_gethandler('notification');
186
+			$notification_handler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
187 187
 		}
188 188
 
189 189
 		planet_trackback_response(0);
190
-	} else {
190
+	}else {
191 191
 		planet_trackback_response(1, xoops_error($comment->getHtmlErrors()));
192 192
 	}
193 193
 }
Please login to merge, or discard this patch.
xoops_version.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28
-if (!defined('XOOPS_ROOT_PATH')){ exit(); }
28
+if (!defined('XOOPS_ROOT_PATH')) { exit(); }
29 29
 
30 30
 include dirname(__FILE__)."/include/vars.php";
31 31
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 $modversion["pages"][3] = array("url"=>"view.article.php", "name"=>planet_constant("MI_PAGE_ARTICLE"));
87 87
 $modversion["pages"][4] = array("url"=>"view.archive.php", "name"=>planet_constant("MI_PAGE_ARCHIVE"));
88 88
 $modversion["pages"][5] = array("url"=>"view.list.php", "name"=>planet_constant("MI_PAGE_LIST"));
89
-$modversion["sub"][1]	= array("name" => planet_constant("MI_SUBMIT"), "url"=>"action.blog.php");
89
+$modversion["sub"][1] = array("name" => planet_constant("MI_SUBMIT"), "url"=>"action.blog.php");
90 90
 
91 91
 // Use smarty
92 92
 $modversion["use_smarty"] = 1;
@@ -97,17 +97,17 @@  discard block
 block discarded – undo
97 97
 /**
98 98
 * Templates
99 99
 */
100
-$modversion['templates'][] = array( "file" => $GLOBALS["VAR_PREFIX"]."_index.html", "description"=>"");
101
-$modversion['templates'][] = array( "file" => $GLOBALS["VAR_PREFIX"]."_article.html", "description"=>"");
102
-$modversion['templates'][] = array( "file" => $GLOBALS["VAR_PREFIX"]."_archive.html", "description"=>"");
103
-$modversion['templates'][] = array( "file" => $GLOBALS["VAR_PREFIX"]."_blogs.html", "description"=>"");
104
-$modversion['templates'][] = array( "file" => $GLOBALS["VAR_PREFIX"]."_search.html", "description"=>"");
100
+$modversion['templates'][] = array("file" => $GLOBALS["VAR_PREFIX"]."_index.html", "description"=>"");
101
+$modversion['templates'][] = array("file" => $GLOBALS["VAR_PREFIX"]."_article.html", "description"=>"");
102
+$modversion['templates'][] = array("file" => $GLOBALS["VAR_PREFIX"]."_archive.html", "description"=>"");
103
+$modversion['templates'][] = array("file" => $GLOBALS["VAR_PREFIX"]."_blogs.html", "description"=>"");
104
+$modversion['templates'][] = array("file" => $GLOBALS["VAR_PREFIX"]."_search.html", "description"=>"");
105 105
 
106 106
 //module css
107 107
 $modversion['css'] = 'templates/style.css';
108 108
 
109 109
 // Blocks
110
-$i=0;
110
+$i = 0;
111 111
 
112 112
 $i++;
113 113
 $modversion["blocks"][$i]["file"] = "block.php";
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 $modversion["notification"]["lookup_file"] = "include/notification.inc.php";
310 310
 $modversion["notification"]["lookup_func"] = $GLOBALS["VAR_PREFIX"]."_notify_iteminfo";
311 311
 
312
-$i=0;
312
+$i = 0;
313 313
 $i++;
314 314
 $modversion["notification"]["category"][$i]["name"] = "global";
315 315
 $modversion["notification"]["category"][$i]["title"] = planet_constant("MI_GLOBAL_NOTIFY");
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
 $modversion["notification"]["category"][$i]["item_name"] = "article";
334 334
 $modversion["notification"]["category"][$i]["allow_bookmark"] = 1;
335 335
 
336
-$i=0;
336
+$i = 0;
337 337
 $i++;
338 338
 $modversion["notification"]["event"][$i]["name"] = "blog_submit";
339 339
 $modversion["notification"]["event"][$i]["category"] = "global";
Please login to merge, or discard this patch.
view.blogs.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -26,26 +26,26 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28 28
 
29
-if(preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)){
29
+if (preg_match("/\/notification_update\.php/i", $_SERVER['REQUEST_URI'], $matches)) {
30 30
 	include XOOPS_ROOT_PATH.'/include/notification_update.php';
31 31
 	exit();
32 32
 }
33 33
 
34
-if($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)){
34
+if ($REQUEST_URI_parsed = planet_parse_args($args_num, $args, $args_str)) {
35 35
 	$args["start"] = @$args_num[0];
36 36
 	$args["sort"] = @$args_str[0];
37 37
 }
38 38
 
39 39
 /* Start */
40
-$start = intval( empty($_GET["start"])?@$args["start"]:$_GET["start"] );
40
+$start = intval(empty($_GET["start"]) ? @$args["start"] : $_GET["start"]);
41 41
 /* Specified Category */
42
-$category_id = intval( empty($_GET["category"])?@$args["category"]:$_GET["category"] );
42
+$category_id = intval(empty($_GET["category"]) ? @$args["category"] : $_GET["category"]);
43 43
 /* Specified Bookmar(Favorite) UID */
44
-$uid = intval( empty($_GET["uid"])?@$args["uid"]:$_GET["uid"] );
44
+$uid = intval(empty($_GET["uid"]) ? @$args["uid"] : $_GET["uid"]);
45 45
 /* Sort by term */
46
-$sort = empty($_GET["sort"])?@$args["sort"]:$_GET["sort"];
46
+$sort = empty($_GET["sort"]) ? @$args["sort"] : $_GET["sort"];
47 47
 /* Display as list */
48
-$list = intval( empty($_GET["list"])?@$args["list"]:$_GET["list"] );
48
+$list = intval(empty($_GET["list"]) ? @$args["list"] : $_GET["list"]);
49 49
 /*
50 50
 // restore $_SERVER['REQUEST_URI']
51 51
 if(!empty($REQUEST_URI_parsed)){
@@ -64,37 +64,37 @@  discard block
 block discarded – undo
64 64
 }
65 65
 */
66 66
 
67
-$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name"). " - " . planet_constant("MD_BLOGS");
67
+$xoopsOption["xoops_pagetitle"] = $xoopsModule->getVar("name")." - ".planet_constant("MD_BLOGS");
68 68
 $xoopsOption["template_main"] = planet_getTemplate("blogs");
69
-include_once( XOOPS_ROOT_PATH . "/header.php" );
69
+include_once(XOOPS_ROOT_PATH."/header.php");
70 70
 include XOOPS_ROOT_PATH."/modules/".$xoopsModule->getVar("dirname")."/include/vars.php";
71 71
 
72 72
 // Following part will not be executed after cache
73
-$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
74
-$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
73
+$category_handler = & xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
74
+$blog_handler = & xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
75 75
 
76
-$limit = empty($list)? $xoopsModuleConfig["articles_perpage"] : $xoopsModuleConfig["list_perpage"];
76
+$limit = empty($list) ? $xoopsModuleConfig["articles_perpage"] : $xoopsModuleConfig["list_perpage"];
77 77
 
78 78
 $query_type = "";
79 79
 $criteria = new CriteriaCompo();
80 80
 $blog_prefix = "";
81 81
 /* Specific category */
82
-if($category_id >0){
82
+if ($category_id>0) {
83 83
 	$category_obj = $category_handler->get($category_id);
84 84
 	$criteria->add(new Criteria("bc.cat_id", $category_id));
85 85
 	$uid = 0;
86 86
 	$blog_id = 0;
87
-	$category_data = array( "id" => $category_id, "title" => $category_obj->getVar("cat_title") );
87
+	$category_data = array("id" => $category_id, "title" => $category_obj->getVar("cat_title"));
88 88
 	$query_type = "category";
89 89
 	$blog_prefix = "b.";
90 90
 }
91 91
 
92 92
 /* User bookmarks(favorites) */
93
-if($uid >0){
93
+if ($uid>0) {
94 94
 	$criteria->add(new Criteria("bm.bm_uid", $uid));
95 95
 	$category_id = 0;
96 96
 	$blog_id = 0;
97
-	$bookmark_handler =& xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
97
+	$bookmark_handler = & xoops_getmodulehandler("bookmark", $GLOBALS["moddirname"]);
98 98
 	$user_data = array(
99 99
 		"uid"	=> $uid, 
100 100
 		"name"	=> XoopsUser::getUnameFromID($uid),
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 /* Sort */
110 110
 $order = "DESC";
111 111
 $sort = empty($sort) ? "default" : $sort;
112
-switch($sort){
112
+switch ($sort) {
113 113
 	case "marks":
114 114
 		$sortby = $blog_prefix."blog_marks";
115 115
 		break;
@@ -131,17 +131,17 @@  discard block
 block discarded – undo
131 131
 $criteria->setLimit($limit);
132 132
 
133 133
 $tags = empty($list) ? "" : array($blog_prefix."blog_title", $blog_prefix."blog_time");
134
-switch($query_type){
134
+switch ($query_type) {
135 135
 case "category":
136
-	$blogs_obj =& $blog_handler->getByCategory($criteria, $tags);
136
+	$blogs_obj = & $blog_handler->getByCategory($criteria, $tags);
137 137
 	$count_blog = $blog_handler->getCountByCategory($criteria);
138 138
 	break;
139 139
 case "bookmark":
140
-	$blogs_obj =& $blog_handler->getByBookmark($criteria, $tags);
140
+	$blogs_obj = & $blog_handler->getByBookmark($criteria, $tags);
141 141
 	$count_blog = $blog_handler->getCountByBookmark($criteria);
142 142
 	break;
143 143
 default:
144
-	$blogs_obj =& $blog_handler->getAll($criteria, $tags);
144
+	$blogs_obj = & $blog_handler->getAll($criteria, $tags);
145 145
 	$count_blog = $blog_handler->getCount($criteria);
146 146
 	break;
147 147
 }
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 		"title"	=> $blogs_obj[$id]->getVar("blog_title"),
155 155
 		"time"	=> $blogs_obj[$id]->getTime()
156 156
 		);
157
-	if(empty($list)){
157
+	if (empty($list)) {
158 158
 	$_blog = array_merge($_blog, array(
159 159
 		"image"	=> $blogs_obj[$id]->getImage(),
160 160
 		"feed"	=> $blogs_obj[$id]->getVar("blog_feed"),
@@ -171,43 +171,43 @@  discard block
 block discarded – undo
171 171
 }
172 172
 unset($blogs_obj);
173 173
 
174
-if ( $count_blog > $limit) {
174
+if ($count_blog>$limit) {
175 175
 	include(XOOPS_ROOT_PATH."/class/pagenav.php");
176 176
 	$start_link = array();
177
-	if($sort) $start_link[] = "sort=".$sort;
178
-	if($category_id) $start_link[] = "category=".$category_id;
179
-	if($list) $start_link[] = "list=".$list;
177
+	if ($sort) $start_link[] = "sort=".$sort;
178
+	if ($category_id) $start_link[] = "category=".$category_id;
179
+	if ($list) $start_link[] = "list=".$list;
180 180
 	$nav = new XoopsPageNav($count_blog, $limit, $start, "start", implode("&amp;", $start_link));
181 181
 	$pagenav = $nav->renderNav(4);
182
-} else {
182
+}else {
183 183
 	$pagenav = "";
184 184
 }
185 185
 
186
-$xoopsTpl -> assign("xoops_pagetitle", $xoopsOption["xoops_pagetitle"] );
186
+$xoopsTpl -> assign("xoops_pagetitle", $xoopsOption["xoops_pagetitle"]);
187 187
 $xoopsTpl -> assign("link_home", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php\" title=\"".planet_constant("MD_HOME")."\" target=\"_self\">".planet_constant("MD_HOME")."</a>");
188 188
 
189
-if($category_id || $uid){
189
+if ($category_id || $uid) {
190 190
 	$xoopsTpl -> assign("link_index", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php\" title=\"".planet_constant("MD_INDEX")."\" target=\"_self\">".planet_constant("MD_INDEX")."</a>");
191 191
 
192 192
 	$link_articles = "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".
193
-		(empty($category_id)?"":"/c".$category_id).
194
-		(empty($uid)?"":"/u".$uid).
193
+		(empty($category_id) ? "" : "/c".$category_id).
194
+		(empty($uid) ? "" : "/u".$uid).
195 195
 		"\" title=\"".planet_constant("MD_ARTICLES")."\">".planet_constant("MD_ARTICLES")."</a>";
196 196
 	$xoopsTpl -> assign("link_articles", $link_articles);
197 197
 }
198 198
 
199 199
 $link_switch = "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php".
200
-	(empty($category_id)?"":"/c".$category_id).
201
-	(empty($uid)?"":"/u".$uid).
202
-	(empty($list)?"/l1":"").
203
-	"\" title=\"".(empty($list)?planet_constant("MD_LISTVIEW"):planet_constant("MD_FULLVIEW"))."\">".(empty($list)?planet_constant("MD_LISTVIEW"):planet_constant("MD_FULLVIEW"))."</a>";
200
+	(empty($category_id) ? "" : "/c".$category_id).
201
+	(empty($uid) ? "" : "/u".$uid).
202
+	(empty($list) ? "/l1" : "").
203
+	"\" title=\"".(empty($list) ? planet_constant("MD_LISTVIEW") : planet_constant("MD_FULLVIEW"))."\">".(empty($list) ? planet_constant("MD_LISTVIEW") : planet_constant("MD_FULLVIEW"))."</a>";
204 204
 $xoopsTpl -> assign("link_switch", $link_switch);
205 205
 
206
-if(empty($uid) && is_object($xoopsUser)){
206
+if (empty($uid) && is_object($xoopsUser)) {
207 207
 	$xoopsTpl -> assign("link_bookmark", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php".URL_DELIMITER."u".$xoopsUser->getVar("uid")."\" title=\"".planet_constant("MD_BOOKMARKS")."\" target=\"_self\">".planet_constant("MD_BOOKMARKS")."</a>");
208 208
 }
209 209
 
210
-if($xoopsModuleConfig["newblog_submit"]==1 || is_object($xoopsUser)){
210
+if ($xoopsModuleConfig["newblog_submit"] == 1 || is_object($xoopsUser)) {
211 211
 	$xoopsTpl -> assign("link_submit", "<a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/action.blog.php\" title=\""._SUBMIT."\" target=\"_blank\">"._SUBMIT."</a>");
212 212
 }
213 213
 
@@ -219,23 +219,23 @@  discard block
 block discarded – undo
219 219
 $xoopsTpl -> assign("count_blog", $count_blog);
220 220
 $xoopsTpl -> assign("is_list", !empty($list));
221 221
 
222
-$xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
223
-if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
224
-}elseif(!$list){
222
+$xoopsTpl -> assign("user_level", !is_object($xoopsUser) ? 0 : ($xoopsUser->isAdmin() ? 2 : 1));
223
+if (empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)) {
224
+}elseif (!$list) {
225 225
 	$xoopsTpl -> assign("canrate", 1);
226 226
 }
227 227
 
228
-$sort_link = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php" . URL_DELIMITER;
228
+$sort_link = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php".URL_DELIMITER;
229 229
 $vars = array();
230
-if(!empty($category_id)) $vars[] = "c".$category_id;
231
-if(!empty($uid)) $vars[] = "u".$uid;
232
-if(!empty($list)) $vars[] = "li";
233
-if(!empty($vars)) $sort_link .= implode("/", $vars)."/";
230
+if (!empty($category_id)) $vars[] = "c".$category_id;
231
+if (!empty($uid)) $vars[] = "u".$uid;
232
+if (!empty($list)) $vars[] = "li";
233
+if (!empty($vars)) $sort_link .= implode("/", $vars)."/";
234 234
 $sortlinks = array();
235
-$valid_sorts = array( "marks" => planet_constant("MD_BOOKMARKS"), "rating" => planet_constant("MD_RATING"), "time" => planet_constant("MD_TIME"), "default" => planet_constant("MD_DEFAULT") );
236
-foreach($valid_sorts as $val => $name){
237
-	if($val == $sort) continue;
238
-	$sortlinks[] = "<a href=\"".$sort_link. $val."\">".$name."</a>";
235
+$valid_sorts = array("marks" => planet_constant("MD_BOOKMARKS"), "rating" => planet_constant("MD_RATING"), "time" => planet_constant("MD_TIME"), "default" => planet_constant("MD_DEFAULT"));
236
+foreach ($valid_sorts as $val => $name) {
237
+	if ($val == $sort) continue;
238
+	$sortlinks[] = "<a href=\"".$sort_link.$val."\">".$name."</a>";
239 239
 }
240 240
 $xoopsTpl -> assign("link_sort", implode(" | ", $sortlinks));
241 241
 
Please login to merge, or discard this patch.
comment_new.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 include "header.php";
28 28
 $com_itemid = isset($_GET['com_itemid']) ? intval($_GET['com_itemid']) : 0;
29
-if ($com_itemid > 0) {
30
-	$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
31
-	$article_obj =& $article_handler->get($com_itemid);
29
+if ($com_itemid>0) {
30
+	$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
31
+	$article_obj = & $article_handler->get($com_itemid);
32 32
 	$com_replytitle = $article_obj->getVar("art_title");
33 33
 	include_once XOOPS_ROOT_PATH.'/include/comment_new.php';
34 34
 }
Please login to merge, or discard this patch.
print.php 1 patch
Spacing   +20 added lines, -22 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 include 'header.php';
30 30
 error_reporting(0);
31 31
 
32
-if(empty($_POST["print_data"])){
32
+if (empty($_POST["print_data"])) {
33 33
 
34
-if(planet_parse_args($args_num, $args, $args_str)){
34
+if (planet_parse_args($args_num, $args, $args_str)) {
35 35
 	$args["article"] = @$args_num[0];
36 36
 }
37 37
 
38
-$article_id = intval( empty($_GET["article"])?@$args["article"]:$_GET["article"] );
38
+$article_id = intval(empty($_GET["article"]) ? @$args["article"] : $_GET["article"]);
39 39
 
40
-$article_handler =& xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
41
-$article_obj =& $article_handler->get($article_id);
40
+$article_handler = & xoops_getmodulehandler("article", $GLOBALS["moddirname"]);
41
+$article_obj = & $article_handler->get($article_id);
42 42
 
43 43
 $article_data = array();
44 44
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 $article_data["time"] = $article_obj->getTime("l");
55 55
 
56 56
 // summary
57
-$article_data["summary"] =& $article_obj->getSummary();
57
+$article_data["summary"] = & $article_obj->getSummary();
58 58
 
59 59
 // text of page
60 60
 $article_data["text"] = $article_obj->getVar("art_content");
@@ -64,24 +64,24 @@  discard block
 block discarded – undo
64 64
 $print_data["date"] = $article_data["time"];
65 65
 $print_data["summary"] = empty($article_data["summary"]) ? "" : planet_constant("MD_SUMMARY").": ".$article_data["summary"];
66 66
 $print_data["content"] = $article_data["text"];
67
-$print_data["url"] = XOOPS_URL."/modules/" . $xoopsModule->getVar("dirname") . "/view.article.php".URL_DELIMITER."c".$category_id."/".$article_id."/p".$page;
67
+$print_data["url"] = XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/view.article.php".URL_DELIMITER."c".$category_id."/".$article_id."/p".$page;
68 68
 
69
-}else{
69
+}else {
70 70
 	$print_data = unserialize(base64_decode($_POST["print_data"]));
71 71
 }
72 72
 
73
-$print_data["image"] = XOOPS_URL . "/modules/" . $xoopsModule->getVar("dirname") . "/" . $xoopsModule->getInfo( 'image' );
74
-$print_data["module"] = $xoopsModule->getVar( 'name' )." V".$xoopsModule->getInfo( 'version' );
73
+$print_data["image"] = XOOPS_URL."/modules/".$xoopsModule->getVar("dirname")."/".$xoopsModule->getInfo('image');
74
+$print_data["module"] = $xoopsModule->getVar('name')." V".$xoopsModule->getInfo('version');
75 75
 
76 76
 	header('Content-Type: text/html; charset='._CHARSET); 
77 77
 	echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
78 78
     echo "<html>\n<head>\n";
79
-    echo "<title>" . $xoopsConfig['sitename'] . "</title>\n";
80
-    echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n";
81
-    echo "<meta name='AUTHOR' content='" . $myts->htmlspecialchars($xoopsConfig['sitename']) . "' />\n";
82
-    echo "<meta name='COPYRIGHT' content='Copyright (c) ".date('Y')." by " . $xoopsConfig['sitename'] . "' />\n";
83
-    echo "<meta name='DESCRIPTION' content='" . $myts->htmlspecialchars($xoopsConfig['slogan']) . "' />\n";
84
-    echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n";
79
+    echo "<title>".$xoopsConfig['sitename']."</title>\n";
80
+    echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."' />\n";
81
+    echo "<meta name='AUTHOR' content='".$myts->htmlspecialchars($xoopsConfig['sitename'])."' />\n";
82
+    echo "<meta name='COPYRIGHT' content='Copyright (c) ".date('Y')." by ".$xoopsConfig['sitename']."' />\n";
83
+    echo "<meta name='DESCRIPTION' content='".$myts->htmlspecialchars($xoopsConfig['slogan'])."' />\n";
84
+    echo "<meta name='GENERATOR' content='".XOOPS_VERSION."' />\n";
85 85
     echo "<style type='text/css'>
86 86
 			body {
87 87
 				color:#000000;
@@ -100,16 +100,14 @@  discard block
 block discarded – undo
100 100
     echo "<body style='background-color:#ffffff; color:#000000; font-family: Arial' onload='window.print()'>\n".
101 101
  		 "<div style='float:center; width: 750px; border: 1px solid #000; padding: 20px;'>\n".
102 102
 			"<div style='text-align: center; display: block; margin: 0 0 6px 0; padding: 5px;'>\n".
103
-			"<img src='" . $print_data["image"] . "' border='0' alt='".$print_data["module"]."' />\n".
103
+			"<img src='".$print_data["image"]."' border='0' alt='".$print_data["module"]."' />\n".
104 104
 			"<h2>".$print_data["title"]."</h2>\n".
105 105
 			"</div>\n".
106 106
 			"<div style='margin-top: 12px; margin-bottom: 12px; border-top: 2px solid #ccc;'></div>\n";
107
-	echo	( empty($print_data["author"]) ? "" : 
108
-			"<div>" .planet_constant("MD_AUTHOR").": ".$print_data["author"]."</div>\n"
107
+	echo	(empty($print_data["author"]) ? "" : "<div>".planet_constant("MD_AUTHOR").": ".$print_data["author"]."</div>\n"
109 108
 			).
110
-			"<div>" .planet_constant("MD_DATE").": ".$print_data["date"]."</div>\n".
111
-			( empty($article_data["summary"]) ? "" : 
112
-			"<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n".
109
+			"<div>".planet_constant("MD_DATE").": ".$print_data["date"]."</div>\n".
110
+			(empty($article_data["summary"]) ? "" : "<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n".
113 111
 			"<div>".$print_data["summary"]."</div>\n"
114 112
 			).
115 113
 			"<div style='margin-top: 12px; margin-bottom: 12px; border-top: 1px solid #ccc;'></div>\n".
Please login to merge, or discard this patch.
admin/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
  */
20 20
 
21 21
 
22
-require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/include/cp_header.php';
23
-include_once dirname(__FILE__) . '/admin_header.php';
22
+require_once dirname(dirname(dirname(dirname(__FILE__)))).'/include/cp_header.php';
23
+include_once dirname(__FILE__).'/admin_header.php';
24 24
 
25 25
 xoops_cp_header();
26 26
 
Please login to merge, or discard this patch.
admin/menu.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -25,50 +25,50 @@  discard block
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
 
28
-if (!defined('XOOPS_ROOT_PATH')){ exit(); }
28
+if (!defined('XOOPS_ROOT_PATH')) { exit(); }
29 29
 
30 30
 
31 31
 defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
32 32
 
33 33
 $path = dirname(dirname(dirname(dirname(__FILE__))));
34
-include_once $path . '/mainfile.php';
34
+include_once $path.'/mainfile.php';
35 35
 
36 36
 $dirname         = basename(dirname(dirname(__FILE__)));
37 37
 $module_handler  = xoops_gethandler('module');
38 38
 $module          = $module_handler->getByDirname($dirname);
39 39
 $pathIcon32      = $module->getInfo('icons32');
40 40
 $pathModuleAdmin = $module->getInfo('dirmoduleadmin');
41
-$pathLanguage    = $path . $pathModuleAdmin;
41
+$pathLanguage    = $path.$pathModuleAdmin;
42 42
 
43 43
 
44
-if (!file_exists($fileinc = $pathLanguage . '/language/' . $GLOBALS['xoopsConfig']['language'] . '/' . 'main.php')) {
45
-    $fileinc = $pathLanguage . '/language/english/main.php';
44
+if (!file_exists($fileinc = $pathLanguage.'/language/'.$GLOBALS['xoopsConfig']['language'].'/'.'main.php')) {
45
+    $fileinc = $pathLanguage.'/language/english/main.php';
46 46
 }
47 47
 
48 48
 include_once $fileinc;
49 49
 
50 50
 $adminmenu = array();
51
-$i=0;
51
+$i = 0;
52 52
 $adminmenu[$i]["title"] = _AM_MODULEADMIN_HOME;
53 53
 $adminmenu[$i]['link'] = "admin/index.php";
54
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/home.png';
54
+$adminmenu[$i]["icon"]  = $pathIcon32.'/home.png';
55 55
 $i++;
56 56
 $adminmenu[$i]['title'] = planet_constant("MI_ADMENU_INDEX");
57 57
 $adminmenu[$i]['link'] = "admin/main.php";
58
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/manage.png';
58
+$adminmenu[$i]["icon"]  = $pathIcon32.'/manage.png';
59 59
 
60 60
 $i++;
61 61
 $adminmenu[$i]['title'] = planet_constant("MI_ADMENU_CATEGORY");
62 62
 $adminmenu[$i]['link'] = "admin/admin.category.php";
63
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/category.png';
63
+$adminmenu[$i]["icon"]  = $pathIcon32.'/category.png';
64 64
 $i++;
65 65
 $adminmenu[$i]['title'] = planet_constant("MI_ADMENU_BLOG");
66 66
 $adminmenu[$i]['link'] = "admin/admin.blog.php";
67
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/translations.png';
67
+$adminmenu[$i]["icon"]  = $pathIcon32.'/translations.png';
68 68
 $i++;
69 69
 $adminmenu[$i]['title'] = planet_constant("MI_ADMENU_ARTICLE");
70 70
 $adminmenu[$i]['link'] = "admin/admin.article.php";
71
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/content.png';
71
+$adminmenu[$i]["icon"]  = $pathIcon32.'/content.png';
72 72
 //$i++;
73 73
 //$adminmenu[$i]['title'] = planet_constant("MI_ADMENU_BLOCK");
74 74
 //$adminmenu[$i]['link'] = "admin/admin.block.php";
@@ -76,4 +76,4 @@  discard block
 block discarded – undo
76 76
 $i++;
77 77
 $adminmenu[$i]['title'] = _AM_MODULEADMIN_ABOUT;
78 78
 $adminmenu[$i]["link"]  = "admin/about.php";
79
-$adminmenu[$i]["icon"]  = $pathIcon32 . '/about.png';
79
+$adminmenu[$i]["icon"]  = $pathIcon32.'/about.png';
Please login to merge, or discard this patch.