Completed
Branch master (15a86c)
by Michael
06:07
created
action.article.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
50 50
 	$message = planet_constant("MD_SAVED");
51 51
 	redirect_header($redirect,2,$message);
52
-}elseif ( $op == "save" ) {
52
+} elseif ( $op == "save" ) {
53 53
 	
54 54
 	if(empty($_POST["art_content"])){
55 55
 	    redirect_header("javascript:history.go(-1);", 1, planet_constant("MD_TEXTEMPTY"));
@@ -62,20 +62,21 @@  discard block
 block discarded – undo
62 62
 	    "art_author",
63 63
 	    "art_content"
64 64
 		) as $tag){
65
-		if(@$_POST[$tag] != $article_obj->getVar($tag))
66
-    	$article_obj->setVar($tag, @$_POST[$tag]);
65
+		if(@$_POST[$tag] != $article_obj->getVar($tag)) {
66
+		    	$article_obj->setVar($tag, @$_POST[$tag]);
67
+		}
67 68
 	}
68 69
 
69 70
     $art_id_new = $article_handler->insert($article_obj);
70 71
 	if(!$article_obj->getVar("art_id")){
71 72
 		$redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php";
72 73
 	    $message = planet_constant("MD_INSERTERROR");
73
-	}else{
74
+	} else{
74 75
 	    $redirect = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.article.php".URL_DELIMITER."".$article_obj->getVar("art_id");
75 76
 	    $message = planet_constant("MD_SAVED");
76 77
     }
77 78
 	redirect_header($redirect,2,$message);
78
-}else{
79
+} else{
79 80
 	require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
80 81
 	
81 82
 	$form = new XoopsThemeForm(_EDIT, "formarticle", xoops_getenv('PHP_SELF'));
Please login to merge, or discard this patch.
view.archive.php 1 patch
Braces   +15 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 if($month<1){
53 53
 	$month = $day = 0;
54 54
 	$page["time"] = sprintf(planet_constant("MD_TIME_Y"), $year);
55
-}elseif($day<1){
55
+} elseif($day<1){
56 56
 	$day = 0;
57 57
 	$page["time"] = sprintf(planet_constant("MD_TIME_YM"), $year, $month);
58
-}else{
58
+} else{
59 59
 	$page["time"] = sprintf(planet_constant("MD_TIME_YMD"), $year, $month, $day);
60 60
 }
61 61
 $time = array("year"=>$year, "month"=>$month, "day"=>$day);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 if(empty($start)){
123 123
 	if($blog_id){
124 124
 		$blog_criteria = " AND blog_id=".$blog_id;
125
-	}else{
125
+	} else{
126 126
 		$blog_criteria = "";
127 127
 	}
128 128
 	// Get monthly list
@@ -167,7 +167,9 @@  discard block
 block discarded – undo
167 167
             $days[$myrow["day"]]["count"] = $myrow["count"];
168 168
         }
169 169
         for($i=1;$i<=31;$i++){
170
-	        if(!isset($days[$i])) continue;
170
+	        if(!isset($days[$i])) {
171
+	        	continue;
172
+	        }
171 173
 	        $days[$i] = array(
172 174
             	"title"=>$days[$i]["count"],
173 175
 				"url"=>XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/view.archive.php".URL_DELIMITER."".$year."/".$month."/".$i."/b".$blog_id
@@ -235,7 +237,9 @@  discard block
 block discarded – undo
235 237
 	// See how much we should pad in the beginning
236 238
 	$week_begins = 1;
237 239
     $pad = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
238
-    if (0 != $pad) echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
240
+    if (0 != $pad) {
241
+    	echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
242
+    }
239 243
 
240 244
     $daysinmonth = intval(date('t', $unixmonth));
241 245
     for ($day = 1; $day <= $daysinmonth; ++$day) {
@@ -248,7 +252,9 @@  discard block
 block discarded – undo
248 252
 
249 253
         if (!empty($days[$day]["url"])) {
250 254
 			echo '<a href="' . $days[$day]["url"] . "\"";
251
-			if(!empty($days[$day]["title"])) echo "title=\"".$days[$day]["title"]."\"";
255
+			if(!empty($days[$day]["title"])) {
256
+				echo "title=\"".$days[$day]["title"]."\"";
257
+			}
252 258
 			echo ">$day</a>";
253 259
         } elseif(!empty($days[$day]["title"])) {
254 260
             echo "<acronym title=\"".$days[$day]["title"]."\">$day</acronym>";
@@ -257,8 +263,9 @@  discard block
 block discarded – undo
257 263
         }
258 264
         echo '</td>';
259 265
 
260
-	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins))
261
-            $newrow = true;
266
+	if (6 == planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins)) {
267
+	            $newrow = true;
268
+	}
262 269
     }
263 270
 
264 271
     $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0 , 0, $month, $day, $year))-$week_begins);
Please login to merge, or discard this patch.
transfer.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 		$xoopsOption['output_type'] = "plain";
33 33
 		include XOOPS_ROOT_PATH."/footer.php";
34 34
 		exit();
35
-	}else{
35
+	} else{
36 36
 		$ref_parser = parse_url($_SERVER['HTTP_REFERER']);
37 37
 		$uri_parser = parse_url($_SERVER['REQUEST_URI']);
38 38
 		if(
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 			$xoopsOption['output_type'] = "plain";
47 47
 			include XOOPS_ROOT_PATH."/footer.php";
48 48
 			exit();
49
-		}else{
49
+		} else{
50 50
 			include XOOPS_ROOT_PATH."/header.php";
51 51
 			xoops_error(_NOPERM);
52 52
 			$xoopsOption['output_type'] = "plain";
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	$module_variables .=  "<input type=\"hidden\" name=\"article\" id=\"article\" value=\"{$article_id}\">";
65 65
 	include XOOPS_ROOT_PATH."/Frameworks/transfer/option.transfer.php";
66 66
 	exit();
67
-}else{
67
+} else{
68 68
 	$data = array();
69 69
     $data["id"] = $article_id;
70 70
 	$data["title"] = $article_obj->getVar("art_title");
Please login to merge, or discard this patch.
pdf.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@
 block discarded – undo
30 30
 global $pdf_data;
31 31
 if(!empty($_POST["pdf_data"])){
32 32
 	$pdf_data = unserialize(base64_decode($_POST["pdf_data"]));
33
-}elseif(!empty($pdf_data)){
33
+} elseif(!empty($pdf_data)){
34 34
 	
35
-}else{
35
+} else{
36 36
 	error_reporting(0);
37 37
 	include "header.php";
38 38
 	error_reporting(0);
Please login to merge, or discard this patch.
include/functions.php 1 patch
Braces   +50 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@  discard block
 block discarded – undo
28 28
 if (!defined('XOOPS_ROOT_PATH')){ exit(); }
29 29
 
30 30
 $current_path = __FILE__;
31
-if ( DIRECTORY_SEPARATOR != '/' ) $current_path = str_replace( strpos( $current_path, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $current_path);
31
+if ( DIRECTORY_SEPARATOR != '/' ) {
32
+	$current_path = str_replace( strpos( $current_path, '\\\\', 2 ) ? '\\\\' : DIRECTORY_SEPARATOR, '/', $current_path);
33
+}
32 34
 $url_arr = explode('/',strstr($current_path,'/modules/'));
33 35
 $GLOBALS["moddirname"] = $url_arr[2];
34 36
 
@@ -76,13 +78,13 @@  discard block
 block discarded – undo
76 78
 			foreach($vars as $var){
77 79
 				if(is_numeric($var)){
78 80
 					$args_numeric[] = $var;
79
-				}elseif(false === strpos($var, "=")){
81
+				} elseif(false === strpos($var, "=")){
80 82
 					if(is_numeric(substr($var, 1))){
81 83
 						$args[$args_abb[strtolower($var{0})]] = intval(substr($var, 1));
82
-					}else{
84
+					} else{
83 85
 						$args_string[] = urldecode($var);
84 86
 					}
85
-				}else{
87
+				} else{
86 88
 					parse_str($var, $args);
87 89
 				}
88 90
 			}
@@ -102,7 +104,9 @@  discard block
 block discarded – undo
102 104
  */
103 105
 function planet_parse_class($class_string, $pattern="", $replacement="")
104 106
 {
105
-	if(empty($class_string)) return;
107
+	if(empty($class_string)) {
108
+		return;
109
+	}
106 110
 	$patterns = array("/\[CLASS_PREFIX\]/");
107 111
 	$replacements = array(ucfirst(strtolower($GLOBALS["moddirname"])));
108 112
 	if(!empty($pattern) && !is_array($pattern) && !is_array($replacement)){
@@ -135,7 +139,9 @@  discard block
 block discarded – undo
135 139
  */
136 140
 function planet_parse_function($function_string, $pattern="", $replacement="")
137 141
 {
138
-	if(empty($function_string)) return;
142
+	if(empty($function_string)) {
143
+		return;
144
+	}
139 145
 	$patterns = array("/\[DIRNAME\]/", "/\[VAR_PREFIX\]/");
140 146
 	$replacements = array($GLOBALS["moddirname"], $GLOBALS["VAR_PREFIX"]);
141 147
 	if(!empty($pattern) && !is_array($pattern) && !is_array($replacement)){
@@ -162,7 +168,9 @@  discard block
 block discarded – undo
162 168
  */
163 169
 function planet_formatTimestamp($time, $format = "")
164 170
 {
165
-	if(empty($time)) return "";
171
+	if(empty($time)) {
172
+		return "";
173
+	}
166 174
 	return formatTimestamp($time, $format);
167 175
 }
168 176
 
@@ -172,7 +180,9 @@  discard block
 block discarded – undo
172 180
  */
173 181
 function &planet_getUnameFromId( $userid, $usereal = 0, $linked = false )
174 182
 {
175
-	if(!is_array($userid))  $userid = array($userid);
183
+	if(!is_array($userid)) {
184
+		$userid = array($userid);
185
+	}
176 186
 	$users = mod_getUnameFromIds($userid, $usereal, $linked);
177 187
 
178 188
     return $users;
@@ -191,9 +201,13 @@  discard block
 block discarded – undo
191 201
 	$myts =& MyTextSanitizer::getInstance();
192 202
 	$link_array = preg_split("/(\r\n|\r|\n)( *)/", $text);
193 203
     $links = array();
194
-    if(count($link_array)>0) foreach($link_array as $link){
204
+    if(count($link_array)>0) {
205
+    	foreach($link_array as $link){
195 206
 	    @list($url, $title) = array_map("trim",preg_split("/ /", $link, 2));
196
-	    if(empty($url)) continue;
207
+    }
208
+	    if(empty($url)) {
209
+	    	continue;
210
+	    }
197 211
 	    //if(empty($title)) $title = $url;
198 212
 	    $links[] = array("url"=>$url, "title"=>$myts->htmlSpecialChars($title));
199 213
     }
@@ -220,7 +234,9 @@  discard block
 block discarded – undo
220 234
 {
221 235
 	$blog_handler =& xoops_getmodulehandler("blog", $GLOBALS["moddirname"]);
222 236
 	$blog_obj =& $blog_handler->get($article->getVar("blog_id"));
223
-	if(!$pattern = $blog_obj->getVar("blog_trackback")) return false;
237
+	if(!$pattern = $blog_obj->getVar("blog_trackback")) {
238
+		return false;
239
+	}
224 240
 	@list($pat, $rep) = array_map("trim",preg_split("#[\s]+#", $pattern));
225 241
 	$trackback_url = preg_replace("#".$pat."#", $rep, $article_obj->getVar("art_link"));
226 242
 	return planet_trackback($trackback_url, $article);
@@ -271,7 +287,7 @@  discard block
 block discarded – undo
271 287
 		if($fp = fopen($debug_file, "a")){
272 288
 			fwrite($fp, $fr);
273 289
 			fclose($fp);
274
-		}else{
290
+		} else{
275 291
 		}
276 292
 	}
277 293
 	@fclose($fs);
@@ -301,9 +317,11 @@  discard block
 block discarded – undo
301 317
 	$home = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/";
302 318
 	$rss2_url = XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/xml.php".URL_DELIMITER."rss2.0/".$id;
303 319
 	
304
-	if ( !$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url ) ) // then try a normal ping
320
+	if ( !$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url ) ) {
321
+		// then try a normal ping
305 322
 		$client->query('weblogUpdates.ping', $blogname, $home);
306
-}
323
+	}
324
+	}
307 325
 
308 326
 /**
309 327
  * Function to respond to a trackback
@@ -350,8 +368,10 @@  discard block
 block discarded – undo
350 368
 	if($isArray) {
351 369
 		$_value = ($value)?explode(",", $value):array();
352 370
 		$value = array();
353
-		if(count($_value)>0) foreach($_value as $string){
371
+		if(count($_value)>0) {
372
+			foreach($_value as $string){
354 373
 			$key = substr($string, 0, strpos($string,"|"));
374
+		}
355 375
 			$val = substr($string, (strpos($string,"|")+1));
356 376
 			$value[$key] = $val;
357 377
 		}
@@ -379,9 +399,15 @@  discard block
 block discarded – undo
379 399
 
380 400
 function planet_remote_content($url)
381 401
 {
382
-    if($data = planet_fetch_snoopy($url)) return $data;
383
-    if($data = planet_fetch_CURL($url)) return $data;
384
-    if($data = planet_fetch_fopen($url)) return $data;
402
+    if($data = planet_fetch_snoopy($url)) {
403
+    	return $data;
404
+    }
405
+    if($data = planet_fetch_CURL($url)) {
406
+    	return $data;
407
+    }
408
+    if($data = planet_fetch_fopen($url)) {
409
+    	return $data;
410
+    }
385 411
    	return false;
386 412
 }
387 413
 
@@ -398,7 +424,9 @@  discard block
 block discarded – undo
398 424
 
399 425
 function planet_fetch_CURL($url)
400 426
 {
401
-    if (!function_exists('curl_init') ) return false;
427
+    if (!function_exists('curl_init') ) {
428
+    	return false;
429
+    }
402 430
     $ch = curl_init();    // initialize curl handle
403 431
     curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
404 432
     curl_setopt($ch, CURLOPT_FAILONERROR, 1);
@@ -412,7 +440,9 @@  discard block
 block discarded – undo
412 440
 
413 441
 function planet_fetch_fopen($url)
414 442
 {
415
-	if(!$fp = @fopen ($url, 'r')) return false;
443
+	if(!$fp = @fopen ($url, 'r')) {
444
+		return false;
445
+	}
416 446
     $data = "";
417 447
     while (!feof($fp)) {
418 448
         $data .= fgets ($fp, 1024);
Please login to merge, or discard this patch.
include/plugin.transfer.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@
 block discarded – undo
17 17
 	exit();
18 18
 }
19 19
 
20
-if(!@include_once XOOPS_ROOT_PATH."/Frameworks/transfer/transfer.php" ) return null;
20
+if(!@include_once XOOPS_ROOT_PATH."/Frameworks/transfer/transfer.php" ) {
21
+	return null;
22
+}
21 23
 
22 24
 // Specify the addons to skip for the module
23 25
 $GLOBALS["addons_skip_module"] = array("pm", "email");
Please login to merge, or discard this patch.
include/functions.ini.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	
62 62
     if(is_object($GLOBALS["xoopsModule"]) && $GLOBALS["xoopsModule"]->getVar("dirname") == $GLOBALS["moddirname"]){
63 63
 	    $moduleConfig =& $GLOBALS["xoopsModuleConfig"];
64
-    }else{
64
+    } else{
65 65
 		$module_handler = &xoops_gethandler('module');
66 66
 		$module = $module_handler->getByDirname($GLOBALS["moddirname"]);
67 67
 	
@@ -82,12 +82,14 @@  discard block
 block discarded – undo
82 82
 function planet_define_url_delimiter()
83 83
 {
84 84
 	if(defined("URL_DELIMITER")){
85
-		if(!in_array(URL_DELIMITER, array("?","/"))) die("Exit on security");
86
-	}else{
85
+		if(!in_array(URL_DELIMITER, array("?","/"))) {
86
+			die("Exit on security");
87
+		}
88
+	} else{
87 89
 		$moduleConfig = planet_load_config();
88 90
 		if(empty($moduleConfig["do_urw"])){
89 91
 			define("URL_DELIMITER", "?");
90
-		}else{
92
+		} else{
91 93
 			define("URL_DELIMITER", "/");
92 94
 		}
93 95
 	}
Please login to merge, or discard this patch.
include/vars.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27 27
  
28
-if(!defined("PLANET_INI")) define("PLANET_INI",1);
28
+if(!defined("PLANET_INI")) {
29
+	define("PLANET_INI",1);
30
+}
29 31
 
30 32
 /* 
31 33
  * The prefix for database table name prefix
Please login to merge, or discard this patch.
include/form.blog.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@
 block discarded – undo
24 24
 // URL: http://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-if (!defined("XOOPS_ROOT_PATH")) exit();
27
+if (!defined("XOOPS_ROOT_PATH")) {
28
+	exit();
29
+}
28 30
 
29 31
 require_once(XOOPS_ROOT_PATH . "/class/xoopsformloader.php");
30 32
 $category_handler =& xoops_getmodulehandler("category", $GLOBALS["moddirname"]);
Please login to merge, or discard this patch.