Completed
Branch master (15a86c)
by Michael
06:07
created
index.php 1 patch
Braces   +18 added lines, -8 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 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;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		);
211 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
 	}
@@ -222,10 +222,18 @@  discard block
 block discarded – undo
222 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) {
226
+		$start_link[] = "sort=".$sort;
227
+	}
228
+	if($category_id) {
229
+		$start_link[] = "category=".$category_id;
230
+	}
231
+	if($blog_id) {
232
+		$start_link[] = "blog=".$blog_id;
233
+	}
234
+	if($list) {
235
+		$start_link[] = "list=".$list;
236
+	}
229 237
 	$nav = new XoopsPageNav($count_article, $limit, $start, "start", implode("&", $start_link));
230 238
 	$pagenav = $nav->renderNav(4);
231 239
 } else {
@@ -272,7 +280,7 @@  discard block
 block discarded – undo
272 280
 
273 281
 $xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
274 282
 if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
275
-}elseif($blog_id>0){
283
+} elseif($blog_id>0){
276 284
 	$xoopsTpl -> assign("canrate", 1);
277 285
 }
278 286
 
@@ -284,7 +292,9 @@  discard block
 block discarded – undo
284 292
 $valid_sorts = array("views"=>planet_constant("MD_VIEWS"), "rating"=>planet_constant("MD_RATING"), "time"=>planet_constant("MD_TIME"), "default"=>planet_constant("MD_DEFAULT"));
285 293
 $sortlinks = array();
286 294
 foreach($valid_sorts as $val=>$name){
287
-	if($val == $sort) continue;
295
+	if($val == $sort) {
296
+		continue;
297
+	}
288 298
 	$sortlinks[] = "<a href=\"".$sort_link."/".$val."\">".$name."</a>";
289 299
 }
290 300
 $xoopsTpl -> assign("link_sort", implode(" | ", $sortlinks));
Please login to merge, or discard this patch.
action.blog.php 1 patch
Braces   +13 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 			case 2:
72 72
 				if(!is_object($xoopsUser)){
73 73
 					$status = 0;
74
-				}else{
74
+				} else{
75 75
 					$status = 1;
76 76
 				}
77 77
 				break;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			default:
84 84
 				if(!is_object($xoopsUser) || !$xoopsUser->isAdmin()){
85 85
 					$status = 0;
86
-				}else{
86
+				} else{
87 87
 					$status = 1;
88 88
 				}
89 89
 				break;
@@ -105,9 +105,11 @@  discard block
 block discarded – undo
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"])) {
111
+				$_POST["categories"] = array();
112
+			}
111 113
 			$blog_handler->setCategories($blog_id, $_POST["categories"]);
112 114
         }
113 115
         $message = planet_constant("MD_DBUPDATED");
@@ -120,16 +122,20 @@  discard block
 block discarded – undo
120 122
         if(!empty($_POST["fetch"])){
121 123
         	$blog_obj =& $blog_handler->fetch($_POST["blog_feed"]);
122 124
         	$blog_obj->setVar("blog_id", $blog_id);	        
123
-        }else{
125
+        } else{
124 126
         	$blog_obj =& $blog_handler->get($blog_id);
125 127
         }
126 128
 	    $categories = isset($_POST["categories"])?$_POST["categories"]:array();	    
127
-		if(in_array("-1", $categories)) $categories = array();
129
+		if(in_array("-1", $categories)) {
130
+			$categories = array();
131
+		}
128 132
         if(empty($categories) && $blog_id>0){
129 133
 	        $crit = new Criteria("bc.blog_id", $blog_id);
130 134
 	    	$categories = array_keys($category_handler->getByBlog($crit));
131 135
         }
132
-        if(empty($categories)) $categories = array(0=>_NONE);
136
+        if(empty($categories)) {
137
+        	$categories = array(0=>_NONE);
138
+        }
133 139
        
134 140
         echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
135 141
         echo"<br />";
Please login to merge, or discard this patch.
trackback.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
 	$com_text .= "\n\n[TRACKBACK]"._POSTEDBY.": ";
68 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");
Please login to merge, or discard this patch.
view.blogs.php 1 patch
Braces   +25 added lines, -9 removed lines patch added patch discarded remove patch
@@ -174,9 +174,15 @@  discard block
 block discarded – undo
174 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) {
178
+		$start_link[] = "sort=".$sort;
179
+	}
180
+	if($category_id) {
181
+		$start_link[] = "category=".$category_id;
182
+	}
183
+	if($list) {
184
+		$start_link[] = "list=".$list;
185
+	}
180 186
 	$nav = new XoopsPageNav($count_blog, $limit, $start, "start", implode("&amp;", $start_link));
181 187
 	$pagenav = $nav->renderNav(4);
182 188
 } else {
@@ -221,20 +227,30 @@  discard block
 block discarded – undo
221 227
 
222 228
 $xoopsTpl -> assign("user_level", !is_object($xoopsUser)?0:($xoopsUser->isAdmin()?2:1));
223 229
 if(empty($xoopsModuleConfig["anonymous_rate"]) && !is_object($xoopsUser)){
224
-}elseif(!$list){
230
+} elseif(!$list){
225 231
 	$xoopsTpl -> assign("canrate", 1);
226 232
 }
227 233
 
228 234
 $sort_link = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.blogs.php" . URL_DELIMITER;
229 235
 $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)."/";
236
+if(!empty($category_id)) {
237
+	$vars[] = "c".$category_id;
238
+}
239
+if(!empty($uid)) {
240
+	$vars[] = "u".$uid;
241
+}
242
+if(!empty($list)) {
243
+	$vars[] = "li";
244
+}
245
+if(!empty($vars)) {
246
+	$sort_link .= implode("/", $vars)."/";
247
+}
234 248
 $sortlinks = array();
235 249
 $valid_sorts = array( "marks" => planet_constant("MD_BOOKMARKS"), "rating" => planet_constant("MD_RATING"), "time" => planet_constant("MD_TIME"), "default" => planet_constant("MD_DEFAULT") );
236 250
 foreach($valid_sorts as $val => $name){
237
-	if($val == $sort) continue;
251
+	if($val == $sort) {
252
+		continue;
253
+	}
238 254
 	$sortlinks[] = "<a href=\"".$sort_link. $val."\">".$name."</a>";
239 255
 }
240 256
 $xoopsTpl -> assign("link_sort", implode(" | ", $sortlinks));
Please login to merge, or discard this patch.
print.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
 $print_data["content"] = $article_data["text"];
67 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
 
Please login to merge, or discard this patch.
admin/main.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -104,7 +104,9 @@
 block discarded – undo
104 104
 echo "<label>" . planet_constant("AM_TOTAL_CATEGORIES") .":</label><text>". $category_count;
105 105
 echo "</text><br />";
106 106
 echo "<label>" . planet_constant("AM_TOTAL_BLOGS") .":</label><text>". $blog_count;
107
-if($blog_count_pending>0) echo " (<font color=\"red\">". $blog_count_pending."</font>)";
107
+if($blog_count_pending>0) {
108
+	echo " (<font color=\"red\">". $blog_count_pending."</font>)";
109
+}
108 110
 echo "</text><br />";
109 111
 echo "<label>" . planet_constant("AM_TOTAL_ARTICLES") .":</label><text>".$article_count;
110 112
 echo "</text><br />";
Please login to merge, or discard this patch.
admin/admin.blog.php 1 patch
Braces   +36 added lines, -16 removed lines patch added patch discarded remove patch
@@ -79,9 +79,11 @@  discard block
 block discarded – undo
79 79
         $blog_obj->setVar('blog_status', $_POST['blog_status']);
80 80
 
81 81
         if (!$blog_handler->insert($blog_obj)) {
82
-        }elseif(!empty($_POST["categories"])){
82
+        } elseif(!empty($_POST["categories"])){
83 83
 	    	$blog_id = $blog_obj->getVar("blog_id");
84
-			if(in_array(0, $_POST["categories"])) $_POST["categories"] = array();
84
+			if(in_array(0, $_POST["categories"])) {
85
+				$_POST["categories"] = array();
86
+			}
85 87
 			$blog_handler->setCategories($blog_id, $_POST["categories"]);
86 88
         }
87 89
         $message = planet_constant("AM_DBUPDATED");
@@ -93,9 +95,13 @@  discard block
 block discarded – undo
93 95
 		$links = planet_parseLinks($_POST["links"]);
94 96
 		$blogs = array();
95 97
 		foreach($links as $link){
96
-	        if($blog_exist = $blog_handler->getCount(new Criteria("blog_feed", $link["url"]))) continue;
98
+	        if($blog_exist = $blog_handler->getCount(new Criteria("blog_feed", $link["url"]))) {
99
+	        	continue;
100
+	        }
97 101
 			$blog_obj =& $blog_handler->fetch($link["url"]);
98
-			if(!empty($link["title"])) $blog_obj->setVar("blog_title", $link["title"]);
102
+			if(!empty($link["title"])) {
103
+				$blog_obj->setVar("blog_title", $link["title"]);
104
+			}
99 105
 			$blog_handler->insert($blog_obj);
100 106
 			$blogs[] = $blog_obj->getVar("blog_id");
101 107
 	        unset($blog_obj);
@@ -125,7 +131,9 @@  discard block
 block discarded – undo
125 131
     /* add a list of blogs to a category */
126 132
 	case "register":
127 133
 		if(!empty($_POST["category_dest"])){
128
-			if(!is_array($blog_id)) $blog_id = array($blog_id);
134
+			if(!is_array($blog_id)) {
135
+				$blog_id = array($blog_id);
136
+			}
129 137
 			$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
130 138
 			$category_handler->addBlogs($_POST["category_dest"], $blog_id);
131 139
 		}
@@ -135,7 +143,9 @@  discard block
 block discarded – undo
135 143
     
136 144
     /* remove a list of blogs from a category */
137 145
 	case "remove":
138
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
146
+		if(!is_array($blog_id)) {
147
+			$blog_id = array($blog_id);
148
+		}
139 149
 		if(!empty($category_id)){
140 150
 			$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
141 151
 			$category_handler->removeBlogs($category_id, $blog_id);
@@ -146,7 +156,9 @@  discard block
 block discarded – undo
146 156
         
147 157
     /* delete a single blog or a list blogs */
148 158
 	case "del":
149
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
159
+		if(!is_array($blog_id)) {
160
+			$blog_id = array($blog_id);
161
+		}
150 162
 		foreach($blog_id as $bid){
151 163
 	        $blog_obj =& $blog_handler->get($bid);
152 164
 	        if (!$blog_handler->delete($blog_obj, true)) {
@@ -159,7 +171,9 @@  discard block
 block discarded – undo
159 171
         
160 172
     /* empty a single blog or a list blogs */
161 173
 	case "empty":
162
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
174
+		if(!is_array($blog_id)) {
175
+			$blog_id = array($blog_id);
176
+		}
163 177
 		foreach($blog_id as $bid){
164 178
 	        $blog_obj =& $blog_handler->get($bid);
165 179
 	        if (!$blog_handler->do_empty($blog_obj)) {
@@ -171,7 +185,9 @@  discard block
 block discarded – undo
171 185
         
172 186
     /* approve a single blog or a list blogs */
173 187
 	case "approve":
174
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
188
+		if(!is_array($blog_id)) {
189
+			$blog_id = array($blog_id);
190
+		}
175 191
 		$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
176 192
 		$blog_handler->updateAll("blog_status", 1, $criteria, true);
177 193
         $message = planet_constant("AM_DBUPDATED");
@@ -180,7 +196,9 @@  discard block
 block discarded – undo
180 196
         
181 197
     /* mark a single blog or a list blogs as featured */
182 198
 	case "feature":
183
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
199
+		if(!is_array($blog_id)) {
200
+			$blog_id = array($blog_id);
201
+		}
184 202
 		$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
185 203
 		$blog_handler->updateAll("blog_status", 2, $criteria, true);
186 204
         $message = planet_constant("AM_DBUPDATED");
@@ -192,7 +210,7 @@  discard block
 block discarded – undo
192 210
         if(!empty($_POST["fetch"])){
193 211
         	$blog_obj =& $blog_handler->fetch($_POST["blog_feed"]);
194 212
         	$blog_obj->setVar("blog_id", $blog_id);	        
195
-        }else{
213
+        } else{
196 214
         	$blog_obj =& $blog_handler->get($blog_id);
197 215
         }
198 216
 	    $categories = @$_POST["categories"];
@@ -200,7 +218,9 @@  discard block
 block discarded – undo
200 218
 	        $crit = new Criteria("bc.blog_id", $blog_id);
201 219
 	    	$categories = array_keys($category_handler->getByBlog($crit));
202 220
         }
203
-        if(empty($categories)) $categories = array(0=>_NONE);
221
+        if(empty($categories)) {
222
+        	$categories = array(0=>_NONE);
223
+        }
204 224
         
205 225
         echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
206 226
         echo"<br />";
@@ -246,24 +266,24 @@  discard block
 block discarded – undo
246 266
 			$criteria->setStart($start);
247 267
 			$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
248 268
 			$blog_objs =& $blog_handler->getByCategory($criteria);
249
-		}else{
269
+		} else{
250 270
 			/* All active blogs */
251 271
 			if($category_id==0){
252 272
 				$criteria = new Criteria("1", 1) ;
253 273
 				$criteria->setStart($start);
254 274
 				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
255 275
 			/* Active blogs */
256
-			}elseif($category_id == -1){
276
+			} elseif($category_id == -1){
257 277
 				$criteria = new Criteria("blog_status", 1);
258 278
 				$criteria->setStart($start);
259 279
 				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
260 280
 			/* Featured blogs */
261
-			}elseif($category_id == -2){
281
+			} elseif($category_id == -2){
262 282
 				$criteria = new Criteria("blog_status", 2);
263 283
 				$criteria->setStart($start);
264 284
 				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
265 285
 			/* Pending blogs */
266
-			}else{
286
+			} else{
267 287
 				$criteria = new Criteria("blog_status", 0);
268 288
 				$criteria->setStart($start);
269 289
 				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
Please login to merge, or discard this patch.
admin/admin.category.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,14 +53,16 @@
 block discarded – undo
53 53
 
54 54
         if (!$category_handler->insert($category_obj)) {
55 55
         	$message = planet_constant("AM_ERROR");
56
-        }else{
56
+        } else{
57 57
         	$message = planet_constant("AM_DBUPDATED");
58 58
     	}
59 59
         redirect_header("admin.category.php", 2, $message);
60 60
         exit();	
61 61
         
62 62
 	case "del":
63
-		if(!is_array($cat_id)) $cat_id = array($cat_id);
63
+		if(!is_array($cat_id)) {
64
+			$cat_id = array($cat_id);
65
+		}
64 66
 		foreach($cat_id as $cid){
65 67
 	        $category_obj =& $category_handler->get($cid);
66 68
 	        if (!$category_handler->delete($category_obj)) {
Please login to merge, or discard this patch.
admin/admin.article.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 		}
52 52
 	}
53 53
 	$article_count_expire = $article_handler->getCount($criteria);
54
-}else{
54
+} else{
55 55
 	$article_count_expire = 0;
56 56
 }
57 57
 $article_count = $article_handler->getCount();
Please login to merge, or discard this patch.