Completed
Branch master (15a86c)
by Michael
06:07
created
index.php 1 patch
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.
action.blog.php 1 patch
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.
trackback.php 1 patch
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.
view.blogs.php 1 patch
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.
admin/admin.blog.php 1 patch
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."&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."&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"]."&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"]."&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."&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."&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."&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."&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."&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."&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."&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."&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."&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."&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.