Completed
Branch master (15a86c)
by Michael
06:07
created
blocks/block.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,9 @@
 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
 include XOOPS_ROOT_PATH . "/modules/".$url_arr[2]."/include/vars.php";
34 36
 include_once(XOOPS_ROOT_PATH . "/modules/".$GLOBALS["moddirname"]."/include/functions.php");
Please login to merge, or discard this patch.
language/english/main.php 1 patch
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,16 @@
 block discarded – undo
7 7
 if (!defined('XOOPS_ROOT_PATH')){ exit(); }
8 8
 
9 9
 $current_path = __FILE__;
10
-if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
10
+if ( DIRECTORY_SEPARATOR != "/" ) {
11
+	$current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
12
+}
11 13
 $url_arr = explode("/",strstr($current_path,"/modules/"));
12 14
 include XOOPS_ROOT_PATH."/modules/".$url_arr[2]."/include/vars.php";
13 15
 
14
-if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MAIN")) return; define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MAIN",1);
16
+if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MAIN")) {
17
+	return;
18
+}
19
+define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MAIN",1);
15 20
 
16 21
 
17 22
 define($GLOBALS["VAR_PREFIXU"]."_MD_INVALID","Invalid action");
Please login to merge, or discard this patch.
language/english/admin.php 1 patch
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,16 @@
 block discarded – undo
7 7
 if (!defined('XOOPS_ROOT_PATH')){ exit(); }
8 8
 
9 9
 $current_path = __FILE__;
10
-if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
10
+if ( DIRECTORY_SEPARATOR != "/" ) {
11
+	$current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
12
+}
11 13
 $url_arr = explode("/",strstr($current_path,"/modules/"));
12 14
 include XOOPS_ROOT_PATH."/modules/".$url_arr[2]."/include/vars.php";
13 15
 
14
-if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_ADMIN")) return; define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_ADMIN",1);
16
+if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_ADMIN")) {
17
+	return;
18
+}
19
+define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_ADMIN",1);
15 20
 
16 21
 define($GLOBALS["VAR_PREFIXU"]."_AM_ARTICLES", "Article Manager");
17 22
 
Please login to merge, or discard this patch.
language/english/blocks.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,15 @@
 block discarded – undo
7 7
 if (!defined('XOOPS_ROOT_PATH')){ exit(); }
8 8
 
9 9
 $current_path = __FILE__;
10
-if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
10
+if ( DIRECTORY_SEPARATOR != "/" ) {
11
+	$current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
12
+}
11 13
 $url_arr = explode("/",strstr($current_path,"/modules/"));
12 14
 include XOOPS_ROOT_PATH."/modules/".$url_arr[2]."/include/vars.php";
13 15
 
14
-if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_BLOCKS")) return; 
16
+if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_BLOCKS")) {
17
+	return;
18
+}
15 19
 define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_BLOCKS",1);
16 20
 
17 21
 define($GLOBALS["VAR_PREFIXU"]."_MB_TYPE","Type");
Please login to merge, or discard this patch.
language/english/modinfo.php 1 patch
Braces   +7 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,11 +7,16 @@
 block discarded – undo
7 7
 if (!defined('XOOPS_ROOT_PATH')){ exit(); }
8 8
 
9 9
 $current_path = __FILE__;
10
-if ( DIRECTORY_SEPARATOR != "/" ) $current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
10
+if ( DIRECTORY_SEPARATOR != "/" ) {
11
+	$current_path = str_replace( strpos( $current_path, "\\\\", 2 ) ? "\\\\" : DIRECTORY_SEPARATOR, "/", $current_path);
12
+}
11 13
 $url_arr = explode("/",strstr($current_path,"/modules/"));
12 14
 include XOOPS_ROOT_PATH."/modules/".$url_arr[2]."/include/vars.php";
13 15
 
14
-if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MODINFO")) return; define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MODINFO",1);
16
+if(defined($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MODINFO")) {
17
+	return;
18
+}
19
+define($GLOBALS["VAR_PREFIXU"]."_LANG_EN_MODINFO",1);
15 20
 
16 21
 define($GLOBALS["VAR_PREFIXU"]."_MI_NAME","Planet");
17 22
 define($GLOBALS["VAR_PREFIXU"]."_MI_DESC","Feed Planet For Xoops");
Please login to merge, or discard this patch.
update.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,9 @@  discard block
 block discarded – undo
34 34
 	$count = $blog_handler->do_update($blog);
35 35
     redirect_header(XOOPS_URL."/modules/".$GLOBALS["moddirname"]."/index.php?blog=".$blog_id, 2, sprintf(planet_constant("MD_UPDATED"), intval($count)));
36 36
 }
37
-if(planet_getcookie("upd")+30*60>time()) return;
37
+if(planet_getcookie("upd")+30*60>time()) {
38
+	return;
39
+}
38 40
 planet_setcookie("upd", time());
39 41
 $start = 0;
40 42
 @include XOOPS_CACHE_PATH."/".$xoopsModule->getVar("dirname")."_update.php";
@@ -47,9 +49,13 @@  discard block
 block discarded – undo
47 49
 	$blog_handler->do_update($blogs[$id]);
48 50
 }
49 51
 $start += count($blogs);
50
-if(count($blogs)<$xoopsModuleConfig["blogs_perupdate"]) $start = 0;
52
+if(count($blogs)<$xoopsModuleConfig["blogs_perupdate"]) {
53
+	$start = 0;
54
+}
51 55
 $fp = fopen(XOOPS_CACHE_PATH."/".$xoopsModule->getVar("dirname")."_update.php", "w");
52
-if(!$fp) return;
56
+if(!$fp) {
57
+	return;
58
+}
53 59
 fputs($fp, "<?php\n	\$start=".intval($start).";\n?>");
54 60
 fclose($fp);
55 61
 ?>
56 62
\ No newline at end of file
Please login to merge, or discard this patch.
class/article.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,9 @@
 block discarded – undo
100 100
     function getTime($format = "c")
101 101
     {
102 102
 	    $time = $this->getVar("art_time");
103
-	    if(empty($time)) $time = time();
103
+	    if(empty($time)) {
104
+	    	$time = time();
105
+	    }
104 106
 	    $time = planet_formatTimestamp($time, $format);
105 107
 		return $time;
106 108
     }
Please login to merge, or discard this patch.
class/magpie.inc.php 1 patch
Braces   +44 added lines, -73 removed lines patch added patch discarded remove patch
@@ -165,12 +165,10 @@  discard block
 block discarded – undo
165 165
             if ( $el == 'rdf' ) {
166 166
                 $this->feed_type = RSS;
167 167
                 $this->feed_version = '1.0';
168
-            }
169
-            elseif ( $el == 'rss' ) {
168
+            } elseif ( $el == 'rss' ) {
170 169
                 $this->feed_type = RSS;
171 170
                 $this->feed_version = $attrs['version'];
172
-            }
173
-            elseif ( $el == 'feed' ) {
171
+            } elseif ( $el == 'feed' ) {
174 172
                 $this->feed_type = ATOM;
175 173
                 $this->feed_version = $attrs['version'];
176 174
                 $this->inchannel = true;
@@ -181,8 +179,7 @@  discard block
 block discarded – undo
181 179
         if ( $el == 'channel' )
182 180
         {
183 181
             $this->inchannel = true;
184
-        }
185
-        elseif ($el == 'item' or $el == 'entry' )
182
+        } elseif ($el == 'item' or $el == 'entry' )
186 183
         {
187 184
             $this->initem = true;
188 185
             if ( isset($attrs['rdf:about']) ) {
@@ -198,9 +195,7 @@  discard block
 block discarded – undo
198 195
             $el == 'textinput' )
199 196
         {
200 197
             $this->intextinput = true;
201
-        }
202
-
203
-        elseif (
198
+        } elseif (
204 199
             $this->feed_type == RSS and
205 200
             $this->current_namespace == '' and
206 201
             $el == 'image' )
@@ -244,8 +239,7 @@  discard block
 block discarded – undo
244 239
             if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' )
245 240
             {
246 241
                 $link_el = 'link';
247
-            }
248
-            else {
242
+            } else {
249 243
                 $link_el = 'link_' . $attrs['rel'];
250 244
             }
251 245
 
@@ -264,8 +258,7 @@  discard block
 block discarded – undo
264 258
         if ($this->feed_type == ATOM and $this->incontent)
265 259
         {
266 260
             $this->append_content( $text );
267
-        }
268
-        else {
261
+        } else {
269 262
             $current_el = join('_', array_reverse($this->stack));
270 263
             $this->append($current_el, $text);
271 264
         }
@@ -279,37 +272,30 @@  discard block
 block discarded – undo
279 272
             $this->items[] = $this->current_item;
280 273
             $this->current_item = array();
281 274
             $this->initem = false;
282
-        }
283
-        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
275
+        } elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' )
284 276
         {
285 277
             $this->intextinput = false;
286
-        }
287
-        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
278
+        } elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' )
288 279
         {
289 280
             $this->inimage = false;
290
-        }
291
-        elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
281
+        } elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
292 282
         {
293 283
             $this->incontent = false;
294
-        }
295
-        elseif ($el == 'channel' or $el == 'feed' )
284
+        } elseif ($el == 'channel' or $el == 'feed' )
296 285
         {
297 286
             $this->inchannel = false;
298
-        }
299
-        elseif ($this->feed_type == ATOM and $this->incontent  ) {
287
+        } elseif ($this->feed_type == ATOM and $this->incontent  ) {
300 288
             // balance tags properly
301 289
             // note:  i don't think this is actually neccessary
302 290
             if ( $this->stack[0] == $el )
303 291
             {
304 292
                 $this->append_content("</$el>");
305
-            }
306
-            else {
293
+            } else {
307 294
                 $this->append_content("<$el />");
308 295
             }
309 296
 
310 297
             array_shift( $this->stack );
311
-        }
312
-        else {
298
+        } else {
313 299
             array_shift( $this->stack );
314 300
         }
315 301
 
@@ -328,8 +314,7 @@  discard block
 block discarded – undo
328 314
     function append_content($text) {
329 315
         if ( $this->initem ) {
330 316
             $this->concat( $this->current_item[ $this->incontent ], $text );
331
-        }
332
-        elseif ( $this->inchannel ) {
317
+        } elseif ( $this->inchannel ) {
333 318
             $this->concat( $this->channel[ $this->incontent ], $text );
334 319
         }
335 320
     }
@@ -344,34 +329,27 @@  discard block
 block discarded – undo
344 329
             if ( $this->initem ) {
345 330
                 $this->concat(
346 331
                     $this->current_item[ $this->current_namespace ][ $el ], $text);
347
-            }
348
-            elseif ($this->inchannel) {
332
+            } elseif ($this->inchannel) {
349 333
                 $this->concat(
350 334
                     $this->channel[ $this->current_namespace][ $el ], $text );
351
-            }
352
-            elseif ($this->intextinput) {
335
+            } elseif ($this->intextinput) {
353 336
                 $this->concat(
354 337
                     $this->textinput[ $this->current_namespace][ $el ], $text );
355
-            }
356
-            elseif ($this->inimage) {
338
+            } elseif ($this->inimage) {
357 339
                 $this->concat(
358 340
                     $this->image[ $this->current_namespace ][ $el ], $text );
359 341
             }
360
-        }
361
-        else {
342
+        } else {
362 343
             if ( $this->initem ) {
363 344
                 $this->concat(
364 345
                     $this->current_item[ $el ], $text);
365
-            }
366
-            elseif ($this->intextinput) {
346
+            } elseif ($this->intextinput) {
367 347
                 $this->concat(
368 348
                     $this->textinput[ $el ], $text );
369
-            }
370
-            elseif ($this->inimage) {
349
+            } elseif ($this->inimage) {
371 350
                 $this->concat(
372 351
                     $this->image[ $el ], $text );
373
-            }
374
-            elseif ($this->inchannel) {
352
+            } elseif ($this->inchannel) {
375 353
                 $this->concat(
376 354
                     $this->channel[ $el ], $text );
377 355
             }
@@ -385,10 +363,12 @@  discard block
 block discarded – undo
385 363
             $this->channel['description'] = $this->channel['tagline'];
386 364
             for ( $i = 0; $i < count($this->items); $i++) {
387 365
                 $item = $this->items[$i];
388
-                if ( isset($item['summary']) )
389
-                    $item['description'] = $item['summary'];
390
-                if ( isset($item['atom_content']))
391
-                    $item['content']['encoded'] = $item['atom_content'];
366
+                if ( isset($item['summary']) ) {
367
+                                    $item['description'] = $item['summary'];
368
+                }
369
+                if ( isset($item['atom_content'])) {
370
+                                    $item['content']['encoded'] = $item['atom_content'];
371
+                }
392 372
 
393 373
                 $atom_date = (isset($item['issued']) ) ? $item['issued'] : @$item['modified'];
394 374
                 if ( $atom_date ) {
@@ -400,23 +380,23 @@  discard block
 block discarded – undo
400 380
 
401 381
                 $this->items[$i] = $item;
402 382
             }
403
-        }
404
-        elseif ( $this->is_rss() ) {
383
+        } elseif ( $this->is_rss() ) {
405 384
             $this->channel['tagline'] = $this->channel['description'];
406 385
             for ( $i = 0; $i < count($this->items); $i++) {
407 386
                 $item = $this->items[$i];
408
-                if ( isset($item['description']))
409
-                    $item['summary'] = $item['description'];
410
-                if ( isset($item['content']['encoded'] ) )
411
-                    $item['atom_content'] = $item['content']['encoded'];
387
+                if ( isset($item['description'])) {
388
+                                    $item['summary'] = $item['description'];
389
+                }
390
+                if ( isset($item['content']['encoded'] ) ) {
391
+                                    $item['atom_content'] = $item['content']['encoded'];
392
+                }
412 393
 
413 394
                 if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
414 395
                     $epoch = @parse_w3cdtf($item['dc']['date']);
415 396
                     if ($epoch and $epoch > 0) {
416 397
                         $item['date_timestamp'] = $epoch;
417 398
                     }
418
-                }
419
-                elseif ( isset($item['pubdate']) ) {
399
+                } elseif ( isset($item['pubdate']) ) {
420 400
                     $epoch = @strtotime($item['pubdate']);
421 401
                     if ($epoch > 0) {
422 402
                         $item['date_timestamp'] = $epoch;
@@ -432,8 +412,7 @@  discard block
 block discarded – undo
432 412
     function is_rss () {
433 413
         if ( $this->feed_type == RSS ) {
434 414
             return $this->feed_version;
435
-        }
436
-        else {
415
+        } else {
437 416
             return false;
438 417
         }
439 418
     }
@@ -441,8 +420,7 @@  discard block
 block discarded – undo
441 420
     function is_atom() {
442 421
         if ( $this->feed_type == ATOM ) {
443 422
             return $this->feed_version;
444
-        }
445
-        else {
423
+        } else {
446 424
             return false;
447 425
         }
448 426
     }
@@ -454,8 +432,7 @@  discard block
 block discarded – undo
454 432
     function create_parser($source, $out_enc, $in_enc, $detect) {
455 433
         if ( substr(phpversion(),0,1) == 5) {
456 434
             $parser = $this->php5_create_parser($in_enc, $detect);
457
-        }
458
-        else {
435
+        } else {
459 436
             list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
460 437
         }
461 438
         if ($out_enc) {
@@ -479,8 +456,7 @@  discard block
 block discarded – undo
479 456
         // by default php5 does a fine job of detecting input encodings
480 457
         if(!$detect && $in_enc) {
481 458
             return xml_parser_create($in_enc);
482
-        }
483
-        else {
459
+        } else {
484 460
             return xml_parser_create('');
485 461
         }
486 462
     }
@@ -509,8 +485,7 @@  discard block
 block discarded – undo
509 485
             if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m', $source, $m)) {
510 486
                 $in_enc = strtoupper($m[1]);
511 487
                 $this->source_encoding = $in_enc;
512
-            }
513
-            else {
488
+            } else {
514 489
                 $in_enc = 'UTF-8';
515 490
             }
516 491
         }
@@ -555,8 +530,7 @@  discard block
 block discarded – undo
555 530
         $enc = strtoupper($enc);
556 531
         if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
557 532
             return $enc;
558
-        }
559
-        else {
533
+        } else {
560 534
             return false;
561 535
         }
562 536
     }
@@ -568,8 +542,7 @@  discard block
 block discarded – undo
568 542
         }
569 543
         if ( MAGPIE_DEBUG ) {
570 544
             trigger_error( $errormsg, $lvl);
571
-        }
572
-        else {
545
+        } else {
573 546
             error_log( $errormsg, 0);
574 547
         }
575 548
 
@@ -604,8 +577,7 @@  discard block
 block discarded – undo
604 577
 		$offset = 0;
605 578
 		if ( $match[10] == 'Z' ) {
606 579
 			# zulu time, aka GMT
607
-		}
608
-		else {
580
+		} else {
609 581
 			list( $tz_mod, $tz_hour, $tz_min ) =
610 582
 				array( $match[8], $match[9], $match[10]);
611 583
 
@@ -625,8 +597,7 @@  discard block
 block discarded – undo
625 597
 		}
626 598
 		$epoch = $epoch + $offset;
627 599
 		return $epoch;
628
-	}
629
-	else {
600
+	} else {
630 601
 		return -1;
631 602
 	}
632 603
 }
Please login to merge, or discard this patch.
class/xml.php 1 patch
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -95,7 +95,9 @@  discard block
 block discarded – undo
95 95
 
96 96
     function setVar($var, $val, $encoding = false)
97 97
     {
98
-	    if(!empty($encoding)) $val = $this->convert_encoding($val);
98
+	    if(!empty($encoding)) {
99
+	    	$val = $this->convert_encoding($val);
100
+	    }
99 101
         $this->$var = $val;
100 102
     }
101 103
     
@@ -105,7 +107,7 @@  discard block
 block discarded – undo
105 107
 		    foreach(array_keys($val) as $key){
106 108
 			    $val[$key] = $this->convert_encoding($val[$key]);
107 109
 		    }
108
-	    }else{
110
+	    } else{
109 111
 		    $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET);
110 112
 	    }
111 113
 	    return $val;
@@ -136,7 +138,9 @@  discard block
 block discarded – undo
136 138
 
137 139
     function addItems(&$items)
138 140
     {
139
-	    if(!is_array($items) || count($items)==0) return;
141
+	    if(!is_array($items) || count($items)==0) {
142
+	    	return;
143
+	    }
140 144
 	    foreach($items as $item){
141 145
 		    $this->_addItem($item);
142 146
 	    }
Please login to merge, or discard this patch.