Completed
Branch master (15a86c)
by Michael
06:07
created
index.php 2 patches
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -165,18 +165,18 @@
 block discarded – undo
165 165
 
166 166
 $tags = empty($list)?"":array($article_prefix."art_title", $article_prefix."blog_id", $article_prefix."art_time");
167 167
 switch($query_type){
168
-case "category":
169
-	$articles_obj =& $article_handler->getByCategory($criteria, $tags);
170
-	$count_article = $article_handler->getCountByCategory($criteria);
171
-	break;
172
-case "bookmark":
173
-	$articles_obj =& $article_handler->getByBookmark($criteria, $tags);
174
-	$count_article = $article_handler->getCountByBookmark($criteria);
175
-	break;
176
-default:
177
-	$articles_obj =& $article_handler->getAll($criteria, $tags);
178
-	$count_article = $article_handler->getCount($criteria);
179
-	break;
168
+	case "category":
169
+		$articles_obj =& $article_handler->getByCategory($criteria, $tags);
170
+		$count_article = $article_handler->getCountByCategory($criteria);
171
+		break;
172
+	case "bookmark":
173
+		$articles_obj =& $article_handler->getByBookmark($criteria, $tags);
174
+		$count_article = $article_handler->getCountByBookmark($criteria);
175
+		break;
176
+	default:
177
+		$articles_obj =& $article_handler->getAll($criteria, $tags);
178
+		$count_article = $article_handler->getCount($criteria);
179
+		break;
180 180
 }
181 181
 
182 182
 if(!empty($blog_data)){
Please login to merge, or discard this 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 2 patches
Switch Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -68,25 +68,25 @@
 block discarded – undo
68 68
         	$blog_obj->setVar('blog_submitter', is_object($xoopsUser)?$xoopsUser->getVar("uid"):planet_getIP(true));
69 69
         	
70 70
 			switch($xoopsModuleConfig["newblog_submit"]){
71
-			case 2:
72
-				if(!is_object($xoopsUser)){
73
-					$status = 0;
74
-				}else{
71
+				case 2:
72
+					if(!is_object($xoopsUser)){
73
+						$status = 0;
74
+					}else{
75
+						$status = 1;
76
+					}
77
+					break;
78
+				case 0:
79
+				case 3:
75 80
 					$status = 1;
76
-				}
77
-				break;
78
-			case 0:
79
-			case 3:
80
-				$status = 1;
81
-				break;
82
-			case 1:
83
-			default:
84
-				if(!is_object($xoopsUser) || !$xoopsUser->isAdmin()){
85
-					$status = 0;
86
-				}else{
87
-					$status = 1;
88
-				}
89
-				break;
81
+					break;
82
+				case 1:
83
+				default:
84
+					if(!is_object($xoopsUser) || !$xoopsUser->isAdmin()){
85
+						$status = 0;
86
+					}else{
87
+						$status = 1;
88
+					}
89
+					break;
90 90
 			}
91 91
 			
92 92
         	$blog_obj->setVar('blog_status', $status);
Please login to merge, or discard this 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 2 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -80,17 +80,17 @@
 block discarded – undo
80 80
 	$comment->setVar('com_rootid', $com_rootid);
81 81
 	$comment->setVar('com_ip', xoops_getenv('REMOTE_ADDR'));
82 82
 	switch ($tb_status) {
83
-	case 2:
84
-		$comment->setVar('com_status', 2);
85
-		$call_approvefunc = true;
86
-		$call_updatefunc = true;
87
-		$notify_event = 'comment';
88
-		break;
89
-	case 1:
90
-	default:
91
-		$comment->setVar('com_status', 1);
92
-		$notify_event = 'comment_submit';
93
-		break;
83
+		case 2:
84
+			$comment->setVar('com_status', 2);
85
+			$call_approvefunc = true;
86
+			$call_updatefunc = true;
87
+			$notify_event = 'comment';
88
+			break;
89
+		case 1:
90
+		default:
91
+			$comment->setVar('com_status', 1);
92
+			$notify_event = 'comment_submit';
93
+			break;
94 94
 	}
95 95
 	$comment->setVar('com_uid', 0);
96 96
 	$com_title = xoops_trim($com_title);
Please login to merge, or discard this 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 2 patches
Switch Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -132,18 +132,18 @@
 block discarded – undo
132 132
 
133 133
 $tags = empty($list) ? "" : array($blog_prefix."blog_title", $blog_prefix."blog_time");
134 134
 switch($query_type){
135
-case "category":
136
-	$blogs_obj =& $blog_handler->getByCategory($criteria, $tags);
137
-	$count_blog = $blog_handler->getCountByCategory($criteria);
138
-	break;
139
-case "bookmark":
140
-	$blogs_obj =& $blog_handler->getByBookmark($criteria, $tags);
141
-	$count_blog = $blog_handler->getCountByBookmark($criteria);
142
-	break;
143
-default:
144
-	$blogs_obj =& $blog_handler->getAll($criteria, $tags);
145
-	$count_blog = $blog_handler->getCount($criteria);
146
-	break;
135
+	case "category":
136
+		$blogs_obj =& $blog_handler->getByCategory($criteria, $tags);
137
+		$count_blog = $blog_handler->getCountByCategory($criteria);
138
+		break;
139
+	case "bookmark":
140
+		$blogs_obj =& $blog_handler->getByBookmark($criteria, $tags);
141
+		$count_blog = $blog_handler->getCountByBookmark($criteria);
142
+		break;
143
+	default:
144
+		$blogs_obj =& $blog_handler->getAll($criteria, $tags);
145
+		$count_blog = $blog_handler->getCount($criteria);
146
+		break;
147 147
 }
148 148
 
149 149
 /* Objects to array */
Please login to merge, or discard this 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 2 patches
Switch Indentation   +279 added lines, -279 removed lines patch added patch discarded remove patch
@@ -55,316 +55,316 @@
 block discarded – undo
55 55
 
56 56
 switch($op){
57 57
 	/* save a single blog */
58
-	case "save":
58
+		case "save":
59 59
 		
60
-        if ($blog_id) {
61
-            $blog_obj =& $blog_handler->get($blog_id);
62
-        } else {
63
-	        if($blog_exists = $blog_handler->getCount(new Criteria("blog_feed", $_POST['blog_feed']))){
64
-		        redirect_header("admin.blog.php", 2, planet_constant("AM_BLOGEXISTS"));
65
-		        exit();
66
-	        }
67
-            $blog_obj =& $blog_handler->create();
68
-        	$blog_obj->setVar('blog_submitter', $xoopsUser->getVar("uid"));
69
-        }
60
+        	if ($blog_id) {
61
+            	$blog_obj =& $blog_handler->get($blog_id);
62
+        	} else {
63
+	        	if($blog_exists = $blog_handler->getCount(new Criteria("blog_feed", $_POST['blog_feed']))){
64
+		        	redirect_header("admin.blog.php", 2, planet_constant("AM_BLOGEXISTS"));
65
+		        	exit();
66
+	        	}
67
+            	$blog_obj =& $blog_handler->create();
68
+        		$blog_obj->setVar('blog_submitter', $xoopsUser->getVar("uid"));
69
+        	}
70 70
 
71
-        $blog_obj->setVar('blog_title', $_POST['blog_title']);
72
-        $blog_obj->setVar('blog_desc', $_POST['blog_desc']);
73
-        $blog_obj->setVar('blog_image', $_POST['blog_image']);
74
-        $blog_obj->setVar('blog_feed', $_POST['blog_feed']);
75
-        $blog_obj->setVar('blog_link', $_POST['blog_link']);
76
-        $blog_obj->setVar('blog_language', $_POST['blog_language']);
77
-        $blog_obj->setVar('blog_charset', $_POST['blog_charset']);
78
-        $blog_obj->setVar('blog_trackback', $_POST['blog_trackback']);
79
-        $blog_obj->setVar('blog_status', $_POST['blog_status']);
71
+        	$blog_obj->setVar('blog_title', $_POST['blog_title']);
72
+        	$blog_obj->setVar('blog_desc', $_POST['blog_desc']);
73
+        	$blog_obj->setVar('blog_image', $_POST['blog_image']);
74
+        	$blog_obj->setVar('blog_feed', $_POST['blog_feed']);
75
+        	$blog_obj->setVar('blog_link', $_POST['blog_link']);
76
+        	$blog_obj->setVar('blog_language', $_POST['blog_language']);
77
+        	$blog_obj->setVar('blog_charset', $_POST['blog_charset']);
78
+        	$blog_obj->setVar('blog_trackback', $_POST['blog_trackback']);
79
+        	$blog_obj->setVar('blog_status', $_POST['blog_status']);
80 80
 
81
-        if (!$blog_handler->insert($blog_obj)) {
82
-        }elseif(!empty($_POST["categories"])){
83
-	    	$blog_id = $blog_obj->getVar("blog_id");
84
-			if(in_array(0, $_POST["categories"])) $_POST["categories"] = array();
85
-			$blog_handler->setCategories($blog_id, $_POST["categories"]);
86
-        }
87
-        $message = planet_constant("AM_DBUPDATED");
88
-        redirect_header("admin.blog.php", 2, $message);
89
-        exit();	
81
+        	if (!$blog_handler->insert($blog_obj)) {
82
+        	}elseif(!empty($_POST["categories"])){
83
+	    		$blog_id = $blog_obj->getVar("blog_id");
84
+				if(in_array(0, $_POST["categories"])) $_POST["categories"] = array();
85
+				$blog_handler->setCategories($blog_id, $_POST["categories"]);
86
+        	}
87
+        	$message = planet_constant("AM_DBUPDATED");
88
+        	redirect_header("admin.blog.php", 2, $message);
89
+        	exit();	
90 90
     
91
-    /* fetch and add a list of blogs to a category */
92
-	case "add":
93
-		$links = planet_parseLinks($_POST["links"]);
94
-		$blogs = array();
95
-		foreach($links as $link){
96
-	        if($blog_exist = $blog_handler->getCount(new Criteria("blog_feed", $link["url"]))) continue;
97
-			$blog_obj =& $blog_handler->fetch($link["url"]);
98
-			if(!empty($link["title"])) $blog_obj->setVar("blog_title", $link["title"]);
99
-			$blog_handler->insert($blog_obj);
100
-			$blogs[] = $blog_obj->getVar("blog_id");
101
-	        unset($blog_obj);
102
-		}
103
-		if(!empty($_POST["categories"])){
104
-			$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
105
-			foreach($_POST["categories"] as $cat_id){
106
-				$category_handler->addBlogs($cat_id, $blogs);
91
+    	/* fetch and add a list of blogs to a category */
92
+		case "add":
93
+			$links = planet_parseLinks($_POST["links"]);
94
+			$blogs = array();
95
+			foreach($links as $link){
96
+	        	if($blog_exist = $blog_handler->getCount(new Criteria("blog_feed", $link["url"]))) continue;
97
+				$blog_obj =& $blog_handler->fetch($link["url"]);
98
+				if(!empty($link["title"])) $blog_obj->setVar("blog_title", $link["title"]);
99
+				$blog_handler->insert($blog_obj);
100
+				$blogs[] = $blog_obj->getVar("blog_id");
101
+	        	unset($blog_obj);
107 102
 			}
108
-		}
109
-        $message = planet_constant("AM_DBUPDATED");
110
-        redirect_header("admin.blog.php", 2, $message);
111
-        exit();
103
+			if(!empty($_POST["categories"])){
104
+				$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
105
+				foreach($_POST["categories"] as $cat_id){
106
+					$category_handler->addBlogs($cat_id, $blogs);
107
+				}
108
+			}
109
+        	$message = planet_constant("AM_DBUPDATED");
110
+        	redirect_header("admin.blog.php", 2, $message);
111
+        	exit();
112 112
     
113
-    /* update a list of blogs */
114
-	case "update":
115
-		foreach($blog_id as $bid){
116
-	        $blog_obj =& $blog_handler->fetch($bid);
117
-	        if (!$blog_handler->insert($blog_obj)) {
118
-	        }
119
-	        unset($blog_obj);
120
-        }
121
-        $message = planet_constant("AM_DBUPDATED");
122
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
123
-        exit();
113
+    	/* update a list of blogs */
114
+		case "update":
115
+			foreach($blog_id as $bid){
116
+	        	$blog_obj =& $blog_handler->fetch($bid);
117
+	        	if (!$blog_handler->insert($blog_obj)) {
118
+	        	}
119
+	        	unset($blog_obj);
120
+        	}
121
+        	$message = planet_constant("AM_DBUPDATED");
122
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
123
+        	exit();
124 124
     
125
-    /* add a list of blogs to a category */
126
-	case "register":
127
-		if(!empty($_POST["category_dest"])){
128
-			if(!is_array($blog_id)) $blog_id = array($blog_id);
129
-			$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
130
-			$category_handler->addBlogs($_POST["category_dest"], $blog_id);
131
-		}
132
-        $message = planet_constant("AM_DBUPDATED");
133
-        redirect_header("admin.blog.php?category=".$_POST["category_dest"]."&amp;start=".$start, 2, $message);
134
-        exit();
125
+    	/* add a list of blogs to a category */
126
+		case "register":
127
+			if(!empty($_POST["category_dest"])){
128
+				if(!is_array($blog_id)) $blog_id = array($blog_id);
129
+				$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
130
+				$category_handler->addBlogs($_POST["category_dest"], $blog_id);
131
+			}
132
+        	$message = planet_constant("AM_DBUPDATED");
133
+        	redirect_header("admin.blog.php?category=".$_POST["category_dest"]."&amp;start=".$start, 2, $message);
134
+        	exit();
135 135
     
136
-    /* remove a list of blogs from a category */
137
-	case "remove":
138
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
139
-		if(!empty($category_id)){
140
-			$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
141
-			$category_handler->removeBlogs($category_id, $blog_id);
142
-		}
143
-        $message = planet_constant("AM_DBUPDATED");
144
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
145
-        exit();
136
+    	/* remove a list of blogs from a category */
137
+		case "remove":
138
+			if(!is_array($blog_id)) $blog_id = array($blog_id);
139
+			if(!empty($category_id)){
140
+				$category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
141
+				$category_handler->removeBlogs($category_id, $blog_id);
142
+			}
143
+        	$message = planet_constant("AM_DBUPDATED");
144
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
145
+        	exit();
146 146
         
147
-    /* delete a single blog or a list blogs */
148
-	case "del":
149
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
150
-		foreach($blog_id as $bid){
151
-	        $blog_obj =& $blog_handler->get($bid);
152
-	        if (!$blog_handler->delete($blog_obj, true)) {
153
-	        }
154
-	        unset($blog_obj);
155
-        }
156
-        $message = planet_constant("AM_DBUPDATED");
157
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
158
-        exit();	
147
+    	/* delete a single blog or a list blogs */
148
+		case "del":
149
+			if(!is_array($blog_id)) $blog_id = array($blog_id);
150
+			foreach($blog_id as $bid){
151
+	        	$blog_obj =& $blog_handler->get($bid);
152
+	        	if (!$blog_handler->delete($blog_obj, true)) {
153
+	        	}
154
+	        	unset($blog_obj);
155
+        	}
156
+        	$message = planet_constant("AM_DBUPDATED");
157
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
158
+        	exit();	
159 159
         
160
-    /* empty a single blog or a list blogs */
161
-	case "empty":
162
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
163
-		foreach($blog_id as $bid){
164
-	        $blog_obj =& $blog_handler->get($bid);
165
-	        if (!$blog_handler->do_empty($blog_obj)) {
166
-	        }
167
-        }
168
-        $message = planet_constant("AM_DBUPDATED");
169
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
170
-        exit();	
160
+    	/* empty a single blog or a list blogs */
161
+		case "empty":
162
+			if(!is_array($blog_id)) $blog_id = array($blog_id);
163
+			foreach($blog_id as $bid){
164
+	        	$blog_obj =& $blog_handler->get($bid);
165
+	        	if (!$blog_handler->do_empty($blog_obj)) {
166
+	        	}
167
+        	}
168
+        	$message = planet_constant("AM_DBUPDATED");
169
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
170
+        	exit();	
171 171
         
172
-    /* approve a single blog or a list blogs */
173
-	case "approve":
174
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
175
-		$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
176
-		$blog_handler->updateAll("blog_status", 1, $criteria, true);
177
-        $message = planet_constant("AM_DBUPDATED");
178
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
179
-        exit();
172
+    	/* approve a single blog or a list blogs */
173
+		case "approve":
174
+			if(!is_array($blog_id)) $blog_id = array($blog_id);
175
+			$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
176
+			$blog_handler->updateAll("blog_status", 1, $criteria, true);
177
+        	$message = planet_constant("AM_DBUPDATED");
178
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
179
+        	exit();
180 180
         
181
-    /* mark a single blog or a list blogs as featured */
182
-	case "feature":
183
-		if(!is_array($blog_id)) $blog_id = array($blog_id);
184
-		$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
185
-		$blog_handler->updateAll("blog_status", 2, $criteria, true);
186
-        $message = planet_constant("AM_DBUPDATED");
187
-        redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
188
-        exit();	
181
+    	/* mark a single blog or a list blogs as featured */
182
+		case "feature":
183
+			if(!is_array($blog_id)) $blog_id = array($blog_id);
184
+			$criteria = new Criteria("blog_id", "(".implode(",", $blog_id).")", "IN");
185
+			$blog_handler->updateAll("blog_status", 2, $criteria, true);
186
+        	$message = planet_constant("AM_DBUPDATED");
187
+        	redirect_header("admin.blog.php?category=".$category_id."&amp;start=".$start, 2, $message);
188
+        	exit();	
189 189
         
190
-    /* edit a single blog */
191
-	case "edit":
192
-        if(!empty($_POST["fetch"])){
193
-        	$blog_obj =& $blog_handler->fetch($_POST["blog_feed"]);
194
-        	$blog_obj->setVar("blog_id", $blog_id);	        
195
-        }else{
196
-        	$blog_obj =& $blog_handler->get($blog_id);
197
-        }
198
-	    $categories = @$_POST["categories"];
199
-        if(empty($categories) && $blog_id>0){
200
-	        $crit = new Criteria("bc.blog_id", $blog_id);
201
-	    	$categories = array_keys($category_handler->getByBlog($crit));
202
-        }
203
-        if(empty($categories)) $categories = array(0=>_NONE);
190
+    	/* edit a single blog */
191
+		case "edit":
192
+        	if(!empty($_POST["fetch"])){
193
+        		$blog_obj =& $blog_handler->fetch($_POST["blog_feed"]);
194
+        		$blog_obj->setVar("blog_id", $blog_id);	        
195
+        	}else{
196
+        		$blog_obj =& $blog_handler->get($blog_id);
197
+        	}
198
+	    	$categories = @$_POST["categories"];
199
+        	if(empty($categories) && $blog_id>0){
200
+	        	$crit = new Criteria("bc.blog_id", $blog_id);
201
+	    		$categories = array_keys($category_handler->getByBlog($crit));
202
+        	}
203
+        	if(empty($categories)) $categories = array(0=>_NONE);
204 204
         
205
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
206
-        echo"<br />";
207
-        if(empty($blog_id) && $blog_obj->getVar("blog_feed")){
208
-	        $criteria = new Criteria("blog_feed", $blog_obj->getVar("blog_feed"));
209
-	        $blogs_obj =& $blog_handler->getList($criteria);
210
-	        if(count($blogs_obj)>0){
211
-		        echo "<div class=\"errorMsg\">".planet_constant("AM_BLOGEXISTS");
212
-		        foreach(array_keys($blogs_obj) as $bid){
213
-			        echo "<br /><a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$bid."\" target=\"_blank\">".$blogs_obj[$bid]."</a>";
214
-		        }
215
-		        echo "</div>";
216
-	        }
217
-	        unset($blogs_obj, $criteria);
218
-        }
219
-        include XOOPS_ROOT_PATH."/modules/".$GLOBALS["moddirname"]."/include/form.blog.php";
220
-        echo "</fieldset>";
221
-        break;
205
+        	echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _EDIT . "</legend>";
206
+        	echo"<br />";
207
+        	if(empty($blog_id) && $blog_obj->getVar("blog_feed")){
208
+	        	$criteria = new Criteria("blog_feed", $blog_obj->getVar("blog_feed"));
209
+	        	$blogs_obj =& $blog_handler->getList($criteria);
210
+	        	if(count($blogs_obj)>0){
211
+		        	echo "<div class=\"errorMsg\">".planet_constant("AM_BLOGEXISTS");
212
+		        	foreach(array_keys($blogs_obj) as $bid){
213
+			        	echo "<br /><a href=\"".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$bid."\" target=\"_blank\">".$blogs_obj[$bid]."</a>";
214
+		        	}
215
+		        	echo "</div>";
216
+	        	}
217
+	        	unset($blogs_obj, $criteria);
218
+        	}
219
+        	include XOOPS_ROOT_PATH."/modules/".$GLOBALS["moddirname"]."/include/form.blog.php";
220
+        	echo "</fieldset>";
221
+        	break;
222 222
         
223
-	default:
223
+		default:
224 224
 
225
-		$crit = new Criteria("1", 1);
226
-		$crit->setSort("cat_order");
227
-		$crit->setOrder("ASC");
228
-		$categories = $category_handler->getList($crit);
225
+			$crit = new Criteria("1", 1);
226
+			$crit->setSort("cat_order");
227
+			$crit->setOrder("ASC");
228
+			$categories = $category_handler->getList($crit);
229 229
 		
230
-		// Display category option form
231
-		$opform = new XoopsSimpleForm('', 'opform', 'admin.blog.php', "get");
232
-		$op_select = new XoopsFormSelect("", 'category', $category_id);
233
-		$op_select->setExtra('onchange="document.forms.opform.submit()"');
234
-		$options = array("0"=>_ALL, "-1"=>planet_constant("MD_ACTIVE"), "-2"=>planet_constant("MD_FEATURED"), "-3"=>planet_constant("MD_PENDING"));
235
-		foreach(array_keys($categories) as $key){
236
-			$options[$key] = $categories[$key];
237
-		}
238
-		$op_select->addOptionArray($options);
239
-		$opform->addElement($op_select);
240
-		$opform->display();
230
+			// Display category option form
231
+			$opform = new XoopsSimpleForm('', 'opform', 'admin.blog.php', "get");
232
+			$op_select = new XoopsFormSelect("", 'category', $category_id);
233
+			$op_select->setExtra('onchange="document.forms.opform.submit()"');
234
+			$options = array("0"=>_ALL, "-1"=>planet_constant("MD_ACTIVE"), "-2"=>planet_constant("MD_FEATURED"), "-3"=>planet_constant("MD_PENDING"));
235
+			foreach(array_keys($categories) as $key){
236
+				$options[$key] = $categories[$key];
237
+			}
238
+			$op_select->addOptionArray($options);
239
+			$opform->addElement($op_select);
240
+			$opform->display();
241 241
 	
242
-		if($category_id>0){
243
-			$criteria = new CriteriaCompo(new Criteria("b.blog_status", 0, ">"));
244
-			$criteria->add(new Criteria("bc.cat_id", $category_id)) ;
245
-			$blog_count = $blog_handler->getCountByCategory($criteria);
246
-			$criteria->setStart($start);
247
-			$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
248
-			$blog_objs =& $blog_handler->getByCategory($criteria);
249
-		}else{
250
-			/* All active blogs */
251
-			if($category_id==0){
252
-				$criteria = new Criteria("1", 1) ;
242
+			if($category_id>0){
243
+				$criteria = new CriteriaCompo(new Criteria("b.blog_status", 0, ">"));
244
+				$criteria->add(new Criteria("bc.cat_id", $category_id)) ;
245
+				$blog_count = $blog_handler->getCountByCategory($criteria);
253 246
 				$criteria->setStart($start);
254 247
 				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
255
-			/* Active blogs */
256
-			}elseif($category_id == -1){
257
-				$criteria = new Criteria("blog_status", 1);
258
-				$criteria->setStart($start);
259
-				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
260
-			/* Featured blogs */
261
-			}elseif($category_id == -2){
262
-				$criteria = new Criteria("blog_status", 2);
263
-				$criteria->setStart($start);
264
-				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
265
-			/* Pending blogs */
248
+				$blog_objs =& $blog_handler->getByCategory($criteria);
266 249
 			}else{
267
-				$criteria = new Criteria("blog_status", 0);
268
-				$criteria->setStart($start);
269
-				$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
250
+				/* All active blogs */
251
+				if($category_id==0){
252
+					$criteria = new Criteria("1", 1) ;
253
+					$criteria->setStart($start);
254
+					$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
255
+				/* Active blogs */
256
+				}elseif($category_id == -1){
257
+					$criteria = new Criteria("blog_status", 1);
258
+					$criteria->setStart($start);
259
+					$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
260
+				/* Featured blogs */
261
+				}elseif($category_id == -2){
262
+					$criteria = new Criteria("blog_status", 2);
263
+					$criteria->setStart($start);
264
+					$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
265
+				/* Pending blogs */
266
+				}else{
267
+					$criteria = new Criteria("blog_status", 0);
268
+					$criteria->setStart($start);
269
+					$criteria->setLimit($xoopsModuleConfig["list_perpage"]);
270
+				}
271
+				$blog_count = $blog_handler->getCount($criteria);
272
+				$blog_objs =& $blog_handler->getAll($criteria);
270 273
 			}
271
-			$blog_count = $blog_handler->getCount($criteria);
272
-			$blog_objs =& $blog_handler->getAll($criteria);
273
-		}
274 274
 		
275
-        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant("AM_LIST") . "</legend>";
276
-        echo "<br style=\"clear:both\" />";
275
+        	echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . planet_constant("AM_LIST") . "</legend>";
276
+        	echo "<br style=\"clear:both\" />";
277 277
 
278
-        echo "<form name='list' id='list' method='post' action='".xoops_getenv("PHP_SELF")."'>";
279
-        echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
280
-        echo "<tr align='center'>";
281
-        echo "<th class='bg3' width='5%'><input name='blog_check' id='blog_check' value='1' type='checkbox'  onclick=\"xoopsCheckAll('list', 'blog_check');\" /></td>";
282
-        echo "<th class='bg3'>" . planet_constant("AM_TITLE") . "</td>";
283
-        echo "<th class='bg3' width='5%'>" . planet_constant("AM_STATUS") . "</td>";
284
-        echo "<th class='bg3' width='40%'>" . planet_constant("AM_FEED") . "</td>";
285
-//        echo "<th class='bg3' width='5%'>" . _EDIT . "</td>";
286
-//        echo "<th class='bg3' width='5%'>" . _DELETE . "</td>";
287
-        echo "<th class='bg3' width='10%'>" . planet_constant("AM_ACTIONS") . "</td>";
288
-        echo "</tr>";
278
+        	echo "<form name='list' id='list' method='post' action='".xoops_getenv("PHP_SELF")."'>";
279
+        	echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
280
+        	echo "<tr align='center'>";
281
+        	echo "<th class='bg3' width='5%'><input name='blog_check' id='blog_check' value='1' type='checkbox'  onclick=\"xoopsCheckAll('list', 'blog_check');\" /></td>";
282
+        	echo "<th class='bg3'>" . planet_constant("AM_TITLE") . "</td>";
283
+        	echo "<th class='bg3' width='5%'>" . planet_constant("AM_STATUS") . "</td>";
284
+        	echo "<th class='bg3' width='40%'>" . planet_constant("AM_FEED") . "</td>";
285
+	//        echo "<th class='bg3' width='5%'>" . _EDIT . "</td>";
286
+	//        echo "<th class='bg3' width='5%'>" . _DELETE . "</td>";
287
+        	echo "<th class='bg3' width='10%'>" . planet_constant("AM_ACTIONS") . "</td>";
288
+        	echo "</tr>";
289 289
         
290
-        $status = array("0"=>planet_constant("MD_PENDING"), "1"=>planet_constant("MD_ACTIVE"), "2"=>planet_constant("MD_FEATURED"));
291
-		foreach(array_keys($blog_objs) as $bid){
292
-            echo "<tr class='odd' align='left'>";
293
-            echo "<td align='center'><input name='blog[]' value='".$bid."' type='checkbox' /></td>";
294
-            echo "<td><a href='".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$bid."'>".$blog_objs[$bid]->getVar("blog_title")."</a></td>";
295
-            echo "<td align='center'>".$status[$blog_objs[$bid]->getVar("blog_status")]."</td>";
296
-            echo "<td>".$blog_objs[$bid]->getVar("blog_feed")."</td>";
297
-            echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=".$bid. "' title='"._EDIT."'><img src='".  $pathIcon16 ."/edit.png '". "alt='" . _EDIT . " title='" ._EDIT." </a>
290
+        	$status = array("0"=>planet_constant("MD_PENDING"), "1"=>planet_constant("MD_ACTIVE"), "2"=>planet_constant("MD_FEATURED"));
291
+			foreach(array_keys($blog_objs) as $bid){
292
+            	echo "<tr class='odd' align='left'>";
293
+            	echo "<td align='center'><input name='blog[]' value='".$bid."' type='checkbox' /></td>";
294
+            	echo "<td><a href='".XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php".URL_DELIMITER."b".$bid."'>".$blog_objs[$bid]->getVar("blog_title")."</a></td>";
295
+            	echo "<td align='center'>".$status[$blog_objs[$bid]->getVar("blog_status")]."</td>";
296
+            	echo "<td>".$blog_objs[$bid]->getVar("blog_feed")."</td>";
297
+            	echo "<td align='center'><a href='admin.blog.php?op=edit&amp;blog=".$bid. "' title='"._EDIT."'><img src='".  $pathIcon16 ."/edit.png '". "alt='" . _EDIT . " title='" ._EDIT." </a>
298 298
                       <a href='admin.blog.php?op=del&amp;blog=".$bid.  "' title='"._DELETE."'><img src='". $pathIcon16 ."/delete.png '"." alt='" . _EDIT . " title='"._DELETE." </a>&nbsp;
299 299
                       <a href='admin.blog.php?op=empty&amp;blog=".$bid."' title='".planet_constant("MD_EMPTY_BLOG")."'><img src='". $pathIcon16 ."/empty.png '"." alt='" . _EDIT . " title='".planet_constant("MD_EMPTY_BLOG")."</a></td>";
300 300
 
301
-            echo "</tr>";			
302
-		}
303
-        echo "<tr class='even' align='center'>";
304
-        echo "<td colspan='7'>";
305
-		echo "<select name='op' onChange='if(this.options[this.selectedIndex].value==\"register\"){setVisible(\"catdiv\");}else{setHidden(\"catdiv\");}'>";
306
-		echo "<option value=''>"._SELECT."</option>";
307
-		echo "<option value='del'>"._DELETE."</option>";
308
-		echo "<option value='empty'>".planet_constant("MD_EMPTY_BLOG")."</option>";
309
-		echo "<option value='register'>".planet_constant("AM_REGISTER")."</option>";
310
-		if($category_id > 0){
311
-			echo "<option value='remove'>".planet_constant("AM_REMOVE")."</option>";
312
-		}
313
-		echo "<option value='approve'>".planet_constant("AM_APPROVE")."</option>";
314
-		echo "<option value='feature'>".planet_constant("AM_FEATURE")."</option>";
315
-		echo "<option value='update'>".planet_constant("AM_UPDATE")."</option>";
316
-		echo "</select>";
317
-        echo "<div id='catdiv' style='visibility:hidden;display:inline;'>";
318
-		echo "<select name='category_dest'>";
319
-		echo "<option value=''>"._SELECT."</option>";
320
-		foreach($categories as $cid=>$name){
321
-			echo "<option value='".$cid."'>".$name."</option>";
322
-		}
323
-		echo "</select>";
324
-        echo "</div>";
325
-        echo "<input name='start' value='".$start."' type='hidden' />";
326
-        echo "<input name='category' value='".$category_id."' type='hidden' />";
327
-        echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
328
-        echo "<input name='' value='"._CANCEL."' type='reset' />";
329
-        echo "</td>";
330
-        echo "</tr>";
331
-        if($blog_count>$xoopsModuleConfig["list_perpage"]){
332
-			include(XOOPS_ROOT_PATH."/class/pagenav.php");
333
-			$nav = new XoopsPageNav($blog_count, $xoopsModuleConfig["list_perpage"], $start, "start", "category=".$category_id);
334
-			$pagenav = $nav->renderNav(4);
335
-			echo "<tr align='right'><td colspan='6'>".$pagenav."</td></tr>";
336
-        }
337
-        echo "</table></form>";
338
-        echo "</fieldset><br style='clear:both;'>";
301
+            	echo "</tr>";			
302
+			}
303
+        	echo "<tr class='even' align='center'>";
304
+        	echo "<td colspan='7'>";
305
+			echo "<select name='op' onChange='if(this.options[this.selectedIndex].value==\"register\"){setVisible(\"catdiv\");}else{setHidden(\"catdiv\");}'>";
306
+			echo "<option value=''>"._SELECT."</option>";
307
+			echo "<option value='del'>"._DELETE."</option>";
308
+			echo "<option value='empty'>".planet_constant("MD_EMPTY_BLOG")."</option>";
309
+			echo "<option value='register'>".planet_constant("AM_REGISTER")."</option>";
310
+			if($category_id > 0){
311
+				echo "<option value='remove'>".planet_constant("AM_REMOVE")."</option>";
312
+			}
313
+			echo "<option value='approve'>".planet_constant("AM_APPROVE")."</option>";
314
+			echo "<option value='feature'>".planet_constant("AM_FEATURE")."</option>";
315
+			echo "<option value='update'>".planet_constant("AM_UPDATE")."</option>";
316
+			echo "</select>";
317
+        	echo "<div id='catdiv' style='visibility:hidden;display:inline;'>";
318
+			echo "<select name='category_dest'>";
319
+			echo "<option value=''>"._SELECT."</option>";
320
+			foreach($categories as $cid=>$name){
321
+				echo "<option value='".$cid."'>".$name."</option>";
322
+			}
323
+			echo "</select>";
324
+        	echo "</div>";
325
+        	echo "<input name='start' value='".$start."' type='hidden' />";
326
+        	echo "<input name='category' value='".$category_id."' type='hidden' />";
327
+        	echo "<input name='submit' value='"._SUBMIT."' type='submit' />";
328
+        	echo "<input name='' value='"._CANCEL."' type='reset' />";
329
+        	echo "</td>";
330
+        	echo "</tr>";
331
+        	if($blog_count>$xoopsModuleConfig["list_perpage"]){
332
+				include(XOOPS_ROOT_PATH."/class/pagenav.php");
333
+				$nav = new XoopsPageNav($blog_count, $xoopsModuleConfig["list_perpage"], $start, "start", "category=".$category_id);
334
+				$pagenav = $nav->renderNav(4);
335
+				echo "<tr align='right'><td colspan='6'>".$pagenav."</td></tr>";
336
+        	}
337
+        	echo "</table></form>";
338
+        	echo "</fieldset><br style='clear:both;'>";
339 339
         
340
-        if(empty($start) && empty($category_id)){
341
-	        $form = new XoopsThemeForm(_ADD, "edit", xoops_getenv('PHP_SELF'));
342
-		    $form->addElement(new XoopsFormText(planet_constant("AM_FEED"), 'blog_feed', 50, 255), true);
343
-		    $form->addElement(new XoopsFormHidden('op', 'edit'));
344
-		    $button_tray = new XoopsFormElementTray('', '');
345
-		    $butt_save = new XoopsFormButton('', 'fetch', _SUBMIT, 'submit');
346
-		    $button_tray->addElement($butt_save);
347
-	        $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
348
-	        $button_tray->addElement($butt_cancel);
349
-		    $form->addElement($button_tray);
340
+        	if(empty($start) && empty($category_id)){
341
+	        	$form = new XoopsThemeForm(_ADD, "edit", xoops_getenv('PHP_SELF'));
342
+		    	$form->addElement(new XoopsFormText(planet_constant("AM_FEED"), 'blog_feed', 50, 255), true);
343
+		    	$form->addElement(new XoopsFormHidden('op', 'edit'));
344
+		    	$button_tray = new XoopsFormElementTray('', '');
345
+		    	$butt_save = new XoopsFormButton('', 'fetch', _SUBMIT, 'submit');
346
+		    	$button_tray->addElement($butt_save);
347
+	        	$butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
348
+	        	$button_tray->addElement($butt_cancel);
349
+		    	$form->addElement($button_tray);
350 350
 		    
351
-	        $form_add = new XoopsThemeForm(_ADD, "add", xoops_getenv('PHP_SELF'));
352
-			$form_add->addElement(new XoopsFormTextArea(planet_constant("AM_FEED"), "links"));
353
-		    $form_add->addElement(new XoopsFormHidden('op', 'add'));
354
-		    $button_tray = new XoopsFormElementTray('', '');
355
-		    $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
356
-		    $button_tray->addElement($butt_save);
357
-	        $butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
358
-	        $button_tray->addElement($butt_cancel);
359
-		    $form_add->addElement($button_tray);
351
+	        	$form_add = new XoopsThemeForm(_ADD, "add", xoops_getenv('PHP_SELF'));
352
+				$form_add->addElement(new XoopsFormTextArea(planet_constant("AM_FEED"), "links"));
353
+		    	$form_add->addElement(new XoopsFormHidden('op', 'add'));
354
+		    	$button_tray = new XoopsFormElementTray('', '');
355
+		    	$butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit');
356
+		    	$button_tray->addElement($butt_save);
357
+	        	$butt_cancel = new XoopsFormButton('', '', _CANCEL, 'reset');
358
+	        	$button_tray->addElement($butt_cancel);
359
+		    	$form_add->addElement($button_tray);
360 360
 	        
361
-	        echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . "</legend>";
362
-	        echo"<br />";
363
-	        $form->display();
364
-	        $form_add->display();
365
-	        echo "</fieldset>";
366
-        }
367
-        break;		
361
+	        	echo "<fieldset><legend style='font-weight: bold; color: #900;'>" . _ADD . "</legend>";
362
+	        	echo"<br />";
363
+	        	$form->display();
364
+	        	$form_add->display();
365
+	        	echo "</fieldset>";
366
+        	}
367
+        	break;		
368 368
 }
369 369
 
370 370
 xoops_cp_footer();
Please login to merge, or discard this 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.