Completed
Push — master ( 96da4e...7c5656 )
by Michael
04:52
created
include/config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
  */
21 21
 
22 22
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
23
-require_once __DIR__ . '/common.php';
23
+require_once __DIR__.'/common.php';
24 24
 
25 25
 $moduleDirName = basename(dirname(__DIR__));
26 26
 $uploadFolders = array(
27 27
     NEWBB_UPLOAD_PATH,
28
-    NEWBB_UPLOAD_PATH . '/thumbs'
28
+    NEWBB_UPLOAD_PATH.'/thumbs'
29 29
 );
30 30
 
31 31
 //$copyFiles = array(
Please login to merge, or discard this patch.
include/notification.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
21 21
 
22
-include __DIR__ . '/vars.php';
22
+include __DIR__.'/vars.php';
23 23
 //mod_loadFunctions('', $GLOBALS['moddirname']);
24 24
 
25 25
 PlanetUtility::planetParseFunction('
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
 if (!defined('planet_FUNCTIONS')):
39 39
     define('planet_FUNCTIONS', 1);
40 40
 
41
-    require XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/vars.php';
42
-    require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
43
-    require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.php';
41
+    require XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/vars.php';
42
+    require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
43
+    require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.php';
44 44
 
45 45
     /**
46 46
      * Function to display messages
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     */
70 70
     function planetParseArguments(&$args_numeric, &$args, &$args_string)
71 71
     {
72
-        $args_abb     = array(
72
+        $args_abb = array(
73 73
             'a' => 'article',
74 74
             'b' => 'blog',
75 75
             'c' => 'category',
@@ -84,24 +84,24 @@  discard block
 block discarded – undo
84 84
         if (preg_match("/[^\?]*\.php[\/|\?]([^\?]*)/i", Request::getUrl('REQUEST_URI', '', 'SERVER'), $matches)) {
85 85
             $vars = preg_split("/[\/|&]/", $matches[1]);
86 86
             $vars = array_map('trim', $vars);
87
-            if (count($vars) > 0) {
87
+            if (count($vars)>0) {
88 88
                 foreach ($vars as $var) {
89 89
                     if (is_numeric($var)) {
90 90
                         $args_numeric[] = $var;
91 91
                     } elseif (false === strpos($var, '=')) {
92 92
                         if (is_numeric(substr($var, 1))) {
93
-                            $args[$args_abb[strtolower($var{0})]] = (int)substr($var, 1);
94
-                        } else {
93
+                            $args[$args_abb[strtolower($var{0})]] = (int) substr($var, 1);
94
+                        }else {
95 95
                             $args_string[] = urldecode($var);
96 96
                         }
97
-                    } else {
97
+                    }else {
98 98
                         parse_str($var, $args);
99 99
                     }
100 100
                 }
101 101
             }
102 102
         }
103 103
 
104
-        return (count($args) + count($args_numeric) + count($args_string) == 0) ? null : true;
104
+        return (count($args)+count($args_numeric)+count($args_string) == 0) ? null : true;
105 105
     }
106 106
 
107 107
     /**
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             $pattern     = array($pattern);
125 125
             $replacement = array($replacement);
126 126
         }
127
-        if (is_array($pattern) && count($pattern) > 0) {
127
+        if (is_array($pattern) && count($pattern)>0) {
128 128
             $ii = 0;
129 129
             foreach ($pattern as $pat) {
130 130
                 if (!in_array($pat, $patterns)) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $pattern     = array($pattern);
161 161
             $replacement = array($replacement);
162 162
         }
163
-        if (is_array($pattern) && count($pattern) > 0) {
163
+        if (is_array($pattern) && count($pattern)>0) {
164 164
             $ii = 0;
165 165
             foreach ($pattern as $pat) {
166 166
                 if (!in_array($pat, $patterns)) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         if (!is_array($userid)) {
204 204
             $userid = array($userid);
205 205
         }
206
-        $users =& mod_getUnameFromIds($userid, $usereal, $linked);
206
+        $users = & mod_getUnameFromIds($userid, $usereal, $linked);
207 207
 
208 208
         return $users;
209 209
     }
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $myts       = MyTextSanitizer::getInstance();
221 221
         $link_array = preg_split("/(\r\n|\r|\n)( *)/", $text);
222 222
         $links      = array();
223
-        if (count($link_array) > 0) {
223
+        if (count($link_array)>0) {
224 224
             foreach ($link_array as $link) {
225 225
                 @list($url, $title) = array_map('trim', preg_split('/ /', $link, 2));
226 226
                 if (empty($url)) {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     function planetGetTemplate($pagename)
242 242
     {
243
-        return $GLOBALS['VAR_PREFIX'] . '_' . $pagename . '.tpl';
243
+        return $GLOBALS['VAR_PREFIX'].'_'.$pagename.'.tpl';
244 244
     }
245 245
 
246 246
     /**
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
             return false;
269 269
         }
270 270
         @list($pat, $rep) = array_map('trim', preg_split("#[\s]+#", $pattern));
271
-        $trackback_url = preg_replace('#' . $pat . '#', $rep, $article_obj->getVar('art_link'));
271
+        $trackback_url = preg_replace('#'.$pat.'#', $rep, $article_obj->getVar('art_link'));
272 272
 
273 273
         return planetTrackback($trackback_url, $article);
274 274
     }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         $title         = $article->getVar('art_title');
286 286
         $excerpt       = $article->getVar('art_content');
287
-        $blog_name     = $xoopsConfig['sitename'] . '-' . $xoopsModule->getVar('name');
287
+        $blog_name     = $xoopsConfig['sitename'].'-'.$xoopsModule->getVar('name');
288 288
         $title         = xoops_utf8_encode($title);
289 289
         $excerpt       = xoops_utf8_encode($excerpt);
290 290
         $blog_name     = xoops_utf8_encode($blog_name);
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
         $title1        = urlencode($title);
293 293
         $excerpt1      = urlencode($excerpt);
294 294
         $name1         = urlencode($blog_name);
295
-        $url           = urlencode(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' . $article->getVar('art_id'));
295
+        $url           = urlencode(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.''.$article->getVar('art_id'));
296 296
         $query_string  = "title=$title1&url=$url&blog_name=$name1&excerpt=$excerpt1&charset=$charset";
297 297
         $trackback_url = parse_url($trackback_url);
298 298
 
299
-        $http_request = 'POST ' . $trackback_url['path'] . ($trackback_url['query'] ? '?' . $trackback_url['query'] : '') . " HTTP/1.0\r\n";
300
-        $http_request .= 'Host: ' . $trackback_url['host'] . "\r\n";
301
-        $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . $charset . "\r\n";
302
-        $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n";
303
-        $http_request .= 'User-Agent: XOOPS Blogs/' . XOOPS_VERSION;
299
+        $http_request = 'POST '.$trackback_url['path'].($trackback_url['query'] ? '?'.$trackback_url['query'] : '')." HTTP/1.0\r\n";
300
+        $http_request .= 'Host: '.$trackback_url['host']."\r\n";
301
+        $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.$charset."\r\n";
302
+        $http_request .= 'Content-Length: '.strlen($query_string)."\r\n";
303
+        $http_request .= 'User-Agent: XOOPS Blogs/'.XOOPS_VERSION;
304 304
         $http_request .= "\r\n\r\n";
305 305
         $http_request .= $query_string;
306 306
         if ('' == $trackback_url['port']) {
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
         $fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4);
310 310
         @fwrite($fs, $http_request);
311 311
         if ($xoopsModuleConfig['do_debug']) {
312
-            $debug_file = XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '_trackback.log';
312
+            $debug_file = XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'_trackback.log';
313 313
             $fr         = "\n*****\nRequest:\n\n$http_request\n\nResponse:\n\n";
314 314
             $fr         .= "CHARSET:$charset\n";
315 315
             $fr         .= "NAME:$blog_name\n";
316
-            $fr         .= 'TITLE:' . $title . "\n";
316
+            $fr         .= 'TITLE:'.$title."\n";
317 317
             $fr         .= "EXCERPT:$excerpt\n\n";
318 318
             while (!@feof($fs)) {
319 319
                 $fr .= @fgets($fs, 4096);
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             if ($fp = fopen($debug_file, 'a')) {
324 324
                 fwrite($fp, $fr);
325 325
                 fclose($fp);
326
-            } else {
326
+            }else {
327 327
             }
328 328
         }
329 329
         @fclose($fs);
@@ -343,19 +343,19 @@  discard block
 block discarded – undo
343 343
                 planetGetPing($serv, $id);
344 344
             }
345 345
         }
346
-        require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php';
346
+        require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/class-IXR.php';
347 347
 
348 348
         // using a timeout of 3 seconds should be enough to cover slow servers
349 349
         $client            = new IXR_Client($server, false);
350 350
         $client->timeout   = 3;
351
-        $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION;
351
+        $client->useragent .= ' -- XOOPS Article/'.XOOPS_VERSION;
352 352
 
353 353
         // when set to true, this outputs debug messages by itself
354 354
         $client->debug = false;
355 355
 
356 356
         $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name'));
357
-        $home     = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/';
358
-        $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id;
357
+        $home     = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/';
358
+        $rss2_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php'.URL_DELIMITER.'rss2.0/'.$id;
359 359
 
360 360
         if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping
361 361
             $client->query('weblogUpdates.ping', $blogname, $home);
@@ -371,16 +371,16 @@  discard block
 block discarded – undo
371 371
     {
372 372
         $charset       = 'utf-8';
373 373
         $error_message = xoops_utf8_encode($error_message);
374
-        header('Content-Type: text/xml; charset="' . $charset . '"');
374
+        header('Content-Type: text/xml; charset="'.$charset.'"');
375 375
         if ($error) {
376
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
376
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
377 377
             echo "<response>\n";
378 378
             echo "<error>1</error>\n";
379 379
             echo "<message>$error_message</message>\n";
380 380
             echo '</response>';
381 381
             die();
382
-        } else {
383
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
382
+        }else {
383
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
384 384
             echo "<response>\n";
385 385
             echo "<error>0</error>\n";
386 386
             echo '</response>';
@@ -400,11 +400,11 @@  discard block
 block discarded – undo
400 400
         if (is_array($string)) {
401 401
             $value = array();
402 402
             foreach ($string as $key => $val) {
403
-                $value[] = $key . '|' . $val;
403
+                $value[] = $key.'|'.$val;
404 404
             }
405 405
             $string = implode(',', $value);
406 406
         }
407
-        setcookie($GLOBALS['VAR_PREFIX'] . $name, $string, (int)$expire, '/');
407
+        setcookie($GLOBALS['VAR_PREFIX'].$name, $string, (int) $expire, '/');
408 408
     }
409 409
 
410 410
     /**
@@ -414,14 +414,14 @@  discard block
 block discarded – undo
414 414
      */
415 415
     function planetGetCookie($name, $isArray = false)
416 416
     {
417
-        $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'] . $name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'] . $name] : null;
417
+        $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'].$name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'].$name] : null;
418 418
         if ($isArray) {
419 419
             $_value = $value ? explode(',', $value) : array();
420 420
             $value  = array();
421
-            if (count($_value) > 0) {
421
+            if (count($_value)>0) {
422 422
                 foreach ($_value as $string) {
423 423
                     $key         = substr($string, 0, strpos($string, '|'));
424
-                    $val         = substr($string, strpos($string, '|') + 1);
424
+                    $val         = substr($string, strpos($string, '|')+1);
425 425
                     $value[$key] = $val;
426 426
                 }
427 427
             }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     function planet_fetch_snoopy($url)
481 481
     {
482
-        require_once XOOPS_ROOT_PATH . '/class/snoopy.php';
482
+        require_once XOOPS_ROOT_PATH.'/class/snoopy.php';
483 483
         $snoopy = new Snoopy;
484 484
         $data   = '';
485 485
         if (@$snoopy->fetch($url)) {
@@ -498,10 +498,10 @@  discard block
 block discarded – undo
498 498
         if (!function_exists('curl_init')) {
499 499
             return false;
500 500
         }
501
-        $ch = curl_init();    // initialize curl handle
501
+        $ch = curl_init(); // initialize curl handle
502 502
         curl_setopt($ch, CURLOPT_URL, $url); // set url to post to
503 503
         curl_setopt($ch, CURLOPT_FAILONERROR, 1);
504
-        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects
504
+        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
505 505
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable
506 506
         curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s
507 507
         $data = curl_exec($ch); // run the whole process
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
         if ($index === false) {
544 544
             return false;
545 545
         }
546
-        $index = strlen($haystack) - strlen($needle) - $index;
546
+        $index = strlen($haystack)-strlen($needle)-$index;
547 547
 
548 548
         return $index;
549 549
     }
Please login to merge, or discard this patch.
include/comment.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
29 29
 
30
-include __DIR__ . '/vars.php';
30
+include __DIR__.'/vars.php';
31 31
 //mod_loadFunctions('', $GLOBALS['moddirname']);
32 32
 
33 33
 PlanetUtility::planetParseFunction('
Please login to merge, or discard this patch.
include/common.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,19 +22,19 @@
 block discarded – undo
22 22
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
23 23
 
24 24
 define('NEWBB_DIRNAME', basename(dirname(__DIR__)));
25
-define('NEWBB_URL', XOOPS_URL . '/modules/' . NEWBB_DIRNAME);
26
-define('NEWBB_PATH', XOOPS_ROOT_PATH . '/modules/' . NEWBB_DIRNAME);
27
-define('NEWBB_IMAGES_URL', NEWBB_URL . '/assets/images');
28
-define('NEWBB_ADMIN_URL', NEWBB_URL . '/admin');
29
-define('NEWBB_ADMIN_PATH', NEWBB_PATH . '/admin/index.php');
30
-define('NEWBB_ROOT_PATH', $GLOBALS['xoops']->path('modules/' . NEWBB_DIRNAME));
31
-define('NEWBB_AUTHOR_LOGOIMG', NEWBB_URL . '/assets/images/logo_module.png');
32
-define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash
33
-define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . NEWBB_DIRNAME); // WITHOUT Trailing slash
25
+define('NEWBB_URL', XOOPS_URL.'/modules/'.NEWBB_DIRNAME);
26
+define('NEWBB_PATH', XOOPS_ROOT_PATH.'/modules/'.NEWBB_DIRNAME);
27
+define('NEWBB_IMAGES_URL', NEWBB_URL.'/assets/images');
28
+define('NEWBB_ADMIN_URL', NEWBB_URL.'/admin');
29
+define('NEWBB_ADMIN_PATH', NEWBB_PATH.'/admin/index.php');
30
+define('NEWBB_ROOT_PATH', $GLOBALS['xoops']->path('modules/'.NEWBB_DIRNAME));
31
+define('NEWBB_AUTHOR_LOGOIMG', NEWBB_URL.'/assets/images/logo_module.png');
32
+define('NEWBB_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.NEWBB_DIRNAME); // WITHOUT Trailing slash
33
+define('NEWBB_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.NEWBB_DIRNAME); // WITHOUT Trailing slash
34 34
 
35 35
 // module information
36 36
 $mod_copyright = "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
37
-                     <img src='" . NEWBB_AUTHOR_LOGOIMG . "' alt='XOOPS Project'></a>";
37
+                     <img src='" . NEWBB_AUTHOR_LOGOIMG."' alt='XOOPS Project'></a>";
38 38
 
39 39
 xoops_loadLanguage('common', NEWBB_DIRNAME);
40 40
 
Please login to merge, or discard this patch.
include/search.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
29 29
 
30
-include __DIR__ . '/vars.php';
30
+include __DIR__.'/vars.php';
31 31
 //mod_loadFunctions('', $GLOBALS['moddirname']);
32 32
 
33 33
 PlanetUtility::planetParseFunction('
Please login to merge, or discard this patch.
view.archive.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 use Xmf\Request;
28 28
 
29
-include __DIR__ . '/header.php';
29
+include __DIR__.'/header.php';
30 30
 
31 31
 if (PlanetUtility::planetParseArguments($args_num, $args, $args_str)) {
32 32
     $args['year']  = @$args_num[0];
@@ -45,26 +45,26 @@  discard block
 block discarded – undo
45 45
 $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
46 46
 $blogHandler    = xoops_getModuleHandler('blog', $GLOBALS['moddirname']);
47 47
 
48
-$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name') . ' - ' . planet_constant('MD_ACHIVE');
48
+$xoopsOption['xoops_pagetitle'] = $xoopsModule->getVar('name').' - '.planet_constant('MD_ACHIVE');
49 49
 $xoopsOption['template_main']   = PlanetUtility::planetGetTemplate('archive');
50
-require_once XOOPS_ROOT_PATH . '/header.php';
51
-include XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/vars.php';
50
+require_once XOOPS_ROOT_PATH.'/header.php';
51
+include XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/include/vars.php';
52 52
 
53 53
 $year = empty($year) ? date('Y') : $year;
54
-if ($month < 1) {
54
+if ($month<1) {
55 55
     $month        = $day = 0;
56 56
     $page['time'] = sprintf(planet_constant('MD_TIME_Y'), $year);
57
-} elseif ($day < 1) {
57
+} elseif ($day<1) {
58 58
     $day          = 0;
59 59
     $page['time'] = sprintf(planet_constant('MD_TIME_YM'), $year, $month);
60
-} else {
60
+}else {
61 61
     $page['time'] = sprintf(planet_constant('MD_TIME_YMD'), $year, $month, $day);
62 62
 }
63 63
 $time = array('year' => $year, 'month' => $month, 'day' => $day);
64 64
 if ($xoopsUser) {
65
-    $timeoffset = ($xoopsUser->getVar('timezone_offset') - $xoopsConfig['server_TZ']) * 3600;
66
-} else {
67
-    $timeoffset = ($xoopsConfig['default_TZ'] - $xoopsConfig['server_TZ']) * 3600;
65
+    $timeoffset = ($xoopsUser->getVar('timezone_offset')-$xoopsConfig['server_TZ'])*3600;
66
+}else {
67
+    $timeoffset = ($xoopsConfig['default_TZ']-$xoopsConfig['server_TZ'])*3600;
68 68
 }
69 69
 
70 70
 $criteria = new CriteriaCompo();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 $articles = array();
88 88
 $blogs_id = array();
89 89
 foreach ($articles_obj as $id => $article) {
90
-    $articles[]                            = array(
90
+    $articles[] = array(
91 91
         'id'      => $id,
92 92
         'blog'    => array('id' => $article->getVar('blog_id'), 'title' => ''),
93 93
         'title'   => $article->getVar('art_title'),
@@ -98,20 +98,20 @@  discard block
 block discarded – undo
98 98
     $blogs_id[$article->getVar('blog_id')] = 1;
99 99
     unset($_article);
100 100
 }
101
-$criteria_blog = new Criteria('blog_id', '(' . implode(',', array_keys($blog_array)) . ')', 'IN');
101
+$criteria_blog = new Criteria('blog_id', '('.implode(',', array_keys($blog_array)).')', 'IN');
102 102
 $blogs         = $blogHandler->getList($criteria_blog);
103 103
 foreach (array_keys($articles) as $key) {
104 104
     $articles[$key]['blog']['title'] = $blogs[$articles[$key]['blog']['id']];
105 105
 }
106
-if ($blog_id > 0) {
106
+if ($blog_id>0) {
107 107
     $page['blog'] = $blogs[$blog_id];
108 108
 }
109 109
 
110
-if ($articles_count > $xoopsModuleConfig['articles_perpage']) {
111
-    include XOOPS_ROOT_PATH . '/class/pagenav.php';
112
-    $nav     = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month=' . $month . '&amp;day=' . $day . '&amp;year=' . $year . '&amp;blog=' . (int)$blog_id);
110
+if ($articles_count>$xoopsModuleConfig['articles_perpage']) {
111
+    include XOOPS_ROOT_PATH.'/class/pagenav.php';
112
+    $nav     = new XoopsPageNav($articles_count, $xoopsModuleConfig['articles_perpage'], $start, 'start', 'month='.$month.'&amp;day='.$day.'&amp;year='.$year.'&amp;blog='.(int) $blog_id);
113 113
     $pagenav = $nav->renderNav(4);
114
-} else {
114
+}else {
115 115
     $pagenav = '';
116 116
 }
117 117
 
@@ -120,43 +120,43 @@  discard block
 block discarded – undo
120 120
 $months   = null;
121 121
 if (empty($start)) {
122 122
     if ($blog_id) {
123
-        $blog_criteria = ' AND blog_id=' . $blog_id;
124
-    } else {
123
+        $blog_criteria = ' AND blog_id='.$blog_id;
124
+    }else {
125 125
         $blog_criteria = '';
126 126
     }
127 127
     // Get monthly list
128 128
     if (empty($month)) {
129
-        $sql    = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
130
-            FROM " . planet_DB_prefix('article') . "
129
+        $sql = "SELECT MONTH(FROM_UNIXTIME(art_time - $timeoffset)) AS mon, COUNT(DISTINCT art_id) AS count
130
+            FROM ".planet_DB_prefix('article')."
131 131
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
132
-            " . $blog_criteria . '
132
+            ".$blog_criteria.'
133 133
             GROUP BY mon
134 134
             ';
135 135
         $result = $xoopsDB->query($sql);
136 136
         $months = array();
137 137
         while ($myrow = $xoopsDB->fetchArray($result)) {
138 138
             $months[] = array(
139
-                'title' => planet_constant('MD_MONTH_' . (int)$myrow['mon']) . ' (' . (int)$myrow['count'] . ')',
140
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $myrow['mon'] . '/b' . $blog_id
139
+                'title' => planet_constant('MD_MONTH_'.(int) $myrow['mon']).' ('.(int) $myrow['count'].')',
140
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$myrow['mon'].'/b'.$blog_id
141 141
             );
142 142
         }
143 143
         $timenav['prev'] = array(
144
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year - 1) . '/b' . $blog_id,
145
-            'title' => sprintf(planet_constant('MD_TIME_Y'), $year - 1)
144
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year-1).'/b'.$blog_id,
145
+            'title' => sprintf(planet_constant('MD_TIME_Y'), $year-1)
146 146
         );
147
-        if ($year < date('Y')) {
147
+        if ($year<date('Y')) {
148 148
             $timenav['next'] = array(
149
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . ($year + 1) . '/b' . $blog_id,
150
-                'title' => sprintf(planet_constant('MD_TIME_Y'), $year + 1)
149
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.($year+1).'/b'.$blog_id,
150
+                'title' => sprintf(planet_constant('MD_TIME_Y'), $year+1)
151 151
             );
152 152
         }
153 153
     } // Get daily list
154 154
     elseif (empty($day)) {
155
-        $sql    = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
156
-            FROM " . planet_DB_prefix('article') . "
155
+        $sql = "SELECT DAY(FROM_UNIXTIME(art_time - $timeoffset)) AS day, COUNT(DISTINCT a.art_id) AS count
156
+            FROM ".planet_DB_prefix('article')."
157 157
             WHERE YEAR(FROM_UNIXTIME(art_time - $timeoffset)) = $year
158 158
             AND MONTH(FROM_UNIXTIME(art_time - $timeoffset)) = $month
159
-            " . $blog_criteria . '
159
+            ".$blog_criteria.'
160 160
             GROUP BY day
161 161
             ';
162 162
         $result = $xoopsDB->query($sql);
@@ -164,35 +164,35 @@  discard block
 block discarded – undo
164 164
         while ($myrow = $xoopsDB->fetchArray($result)) {
165 165
             $days[$myrow['day']]['count'] = $myrow['count'];
166 166
         }
167
-        for ($i = 1; $i <= 31; ++$i) {
167
+        for ($i = 1; $i<=31; ++$i) {
168 168
             if (!isset($days[$i])) {
169 169
                 continue;
170 170
             }
171 171
             $days[$i] = array(
172 172
                 'title' => $days[$i]['count'],
173
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $year . '/' . $month . '/' . $i . '/b' . $blog_id
173
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$year.'/'.$month.'/'.$i.'/b'.$blog_id
174 174
             );
175 175
         }
176 176
         $calendar   = planet_getCalendar($year, $month, $days);
177
-        $month_next = $month + 1;
178
-        $month_prev = $month - 1;
177
+        $month_next = $month+1;
178
+        $month_prev = $month-1;
179 179
         $_year      = $year;
180 180
         if ($month == 12) {
181 181
             $month_next = 1;
182
-            $_year      = $year + 1;
182
+            $_year      = $year+1;
183 183
         }
184 184
         if ($month == 1) {
185 185
             $month_pre = 12;
186
-            $_year     = $year - 1;
186
+            $_year     = $year-1;
187 187
         }
188 188
         $timenav['prev'] = array(
189
-            'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_prev . '/b' . $blog_id,
190
-            'title' => planet_constant('MD_MONTH_' . $month_prev)
189
+            'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_prev.'/b'.$blog_id,
190
+            'title' => planet_constant('MD_MONTH_'.$month_prev)
191 191
         );
192
-        if ($year < date('Y') || $month < date('n')) {
192
+        if ($year<date('Y') || $month<date('n')) {
193 193
             $timenav['next'] = array(
194
-                'url'   => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.archive.php' . URL_DELIMITER . '' . $_year . '/' . $month_next . '/b' . $blog_id,
195
-                'title' => planet_constant('MD_MONTH_' . $month_next)
194
+                'url'   => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.archive.php'.URL_DELIMITER.''.$_year.'/'.$month_next.'/b'.$blog_id,
195
+                'title' => planet_constant('MD_MONTH_'.$month_next)
196 196
             );
197 197
         }
198 198
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 $xoopsTpl->assign('timenav', $timenav);
213 213
 $xoopsTpl->assign('pagenav', $pagenav);
214 214
 
215
-require_once __DIR__ . '/footer.php';
215
+require_once __DIR__.'/footer.php';
216 216
 
217 217
 /**
218 218
  * @param null $year
@@ -229,24 +229,24 @@  discard block
 block discarded – undo
229 229
     ob_start();
230 230
     echo '<table id="calendar">';
231 231
     echo '<caption>';
232
-    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_' . $month));
232
+    printf(planet_constant('MD_TIME_YM'), $year, planet_constant('MD_MONTH_'.$month));
233 233
     echo '</caption>';
234 234
 
235
-    for ($i = 1; $i <= 7; ++$i) {
236
-        echo "\n\t\t<th abbr=\"" . planet_constant('MD_WEEK_' . $i) . "\" scope=\"col\" title=\"" . planet_constant('MD_WEEK_' . $i) . "\">" . planet_constant('MD_WEEK_' . $i) . '</th>';
235
+    for ($i = 1; $i<=7; ++$i) {
236
+        echo "\n\t\t<th abbr=\"".planet_constant('MD_WEEK_'.$i)."\" scope=\"col\" title=\"".planet_constant('MD_WEEK_'.$i)."\">".planet_constant('MD_WEEK_'.$i).'</th>';
237 237
     }
238 238
 
239 239
     echo '<tr>';
240 240
 
241 241
     // See how much we should pad in the beginning
242 242
     $week_begins = 1;
243
-    $pad         = planet_calendar_week_mod(date('w', $unixmonth) - $week_begins);
243
+    $pad         = planet_calendar_week_mod(date('w', $unixmonth)-$week_begins);
244 244
     if (0 != $pad) {
245
-        echo "\n\t\t" . '<td colspan="' . $pad . '">&nbsp;</td>';
245
+        echo "\n\t\t".'<td colspan="'.$pad.'">&nbsp;</td>';
246 246
     }
247 247
 
248
-    $daysinmonth = (int)date('t', $unixmonth);
249
-    for ($day = 1; $day <= $daysinmonth; ++$day) {
248
+    $daysinmonth = (int) date('t', $unixmonth);
249
+    for ($day = 1; $day<=$daysinmonth; ++$day) {
250 250
         if (isset($newrow) && $newrow) {
251 251
             echo "\n\t</tr>\n\t<tr>\n\t\t";
252 252
         }
@@ -255,26 +255,26 @@  discard block
 block discarded – undo
255 255
         echo '<td>';
256 256
 
257 257
         if (!empty($days[$day]['url'])) {
258
-            echo '<a href="' . $days[$day]['url'] . "\"";
258
+            echo '<a href="'.$days[$day]['url']."\"";
259 259
             if (!empty($days[$day]['title'])) {
260
-                echo "title=\"" . $days[$day]['title'] . "\"";
260
+                echo "title=\"".$days[$day]['title']."\"";
261 261
             }
262 262
             echo ">$day</a>";
263 263
         } elseif (!empty($days[$day]['title'])) {
264
-            echo "<acronym title=\"" . $days[$day]['title'] . "\">$day</acronym>";
265
-        } else {
264
+            echo "<acronym title=\"".$days[$day]['title']."\">$day</acronym>";
265
+        }else {
266 266
             echo $day;
267 267
         }
268 268
         echo '</td>';
269 269
 
270
-        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins)) {
270
+        if (6 == planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins)) {
271 271
             $newrow = true;
272 272
         }
273 273
     }
274 274
 
275
-    $pad = 7 - planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year)) - $week_begins);
275
+    $pad = 7-planet_calendar_week_mod(date('w', mktime(0, 0, 0, $month, $day, $year))-$week_begins);
276 276
     if ($pad != 0 && $pad != 7) {
277
-        echo "\n\t\t" . '<td class="pad" colspan="' . $pad . '">&nbsp;</td>';
277
+        echo "\n\t\t".'<td class="pad" colspan="'.$pad.'">&nbsp;</td>';
278 278
     }
279 279
 
280 280
     echo "\n\t</tr>\n\t</tbody>\n\t</table>";
@@ -293,5 +293,5 @@  discard block
 block discarded – undo
293 293
 {
294 294
     $base = 7;
295 295
 
296
-    return ($num - $base * floor($num / $base));
296
+    return ($num-$base*floor($num/$base));
297 297
 }
Please login to merge, or discard this patch.
trackback.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -26,21 +26,21 @@  discard block
 block discarded – undo
26 26
 // ------------------------------------------------------------------------ //
27 27
 use Xmf\Request;
28 28
 
29
-include __DIR__ . '/header.php';
29
+include __DIR__.'/header.php';
30 30
 
31 31
 // trackback is done by a POST
32 32
 $art_id     = explode('/', Request::getString('REQUEST_URI', '', 'SERVER'));
33
-$article_id = (int)$art_id[count($art_id) - 1];
34
-$url        = Request::getString('url', '', 'POST');//$_POST['url'];
35
-$title      = Request::getString('title', '', 'POST');//$_POST['title'];
36
-$excerpt    = Request::getString('excerpt', '', 'POST');//$_POST['excerpt'];
37
-$blog_name  = Request::getString('blog_name', '', 'POST');//$_POST['blog_name'];
38
-$charset    = trim(Request::getString('charset', '', 'POST'));//trim($_POST['charset']);
33
+$article_id = (int) $art_id[count($art_id)-1];
34
+$url        = Request::getString('url', '', 'POST'); //$_POST['url'];
35
+$title      = Request::getString('title', '', 'POST'); //$_POST['title'];
36
+$excerpt    = Request::getString('excerpt', '', 'POST'); //$_POST['excerpt'];
37
+$blog_name  = Request::getString('blog_name', '', 'POST'); //$_POST['blog_name'];
38
+$charset    = trim(Request::getString('charset', '', 'POST')); //trim($_POST['charset']);
39 39
 
40 40
 if (empty($xoopsModuleConfig['trackback_option'])) {
41 41
     PlanetUtility::planetRespondToTrackback(1, 'Trackback is closed');
42 42
 }
43
-if (!strlen($title . $url . $blog_name)) {
43
+if (!strlen($title.$url.$blog_name)) {
44 44
     PlanetUtility::planetRespondToTrackback(1, planet_constant('MD_INVALID'));
45 45
 }
46 46
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     $trackbackHandler = xoops_getModuleHandler('trackback', $GLOBALS['moddirname']);
49 49
     $criteria         = new CriteriaCompo(new Criteria('art_id', $article_id));
50 50
     $criteria->add(new Criteria('tb_url', $url));
51
-    if ($trackbackHandler->getCount($criteria) > 0) {
51
+    if ($trackbackHandler->getCount($criteria)>0) {
52 52
         PlanetUtility::planetRespondToTrackback(1, 'We already have a ping from that URI for this article.');
53 53
     }
54 54
 
@@ -56,17 +56,17 @@  discard block
 block discarded – undo
56 56
     $title     = XoopsLocal::convert_encoding($title, _CHARSET, $charset);
57 57
     $excerpt   = XoopsLocal::convert_encoding($excerpt, _CHARSET, $charset);
58 58
     $blog_name = XoopsLocal::convert_encoding($blog_name, _CHARSET, $charset);
59
-    $tb_status = (int)$xoopsModuleConfig['trackback_option'];
59
+    $tb_status = (int) $xoopsModuleConfig['trackback_option'];
60 60
 
61 61
     $com_pid    = 0;
62 62
     $com_itemid = $article_id;
63 63
     $com_rootid = 0;
64 64
     $com_title  = $title;
65 65
     $com_text   = $excerpt;
66
-    $com_text   .= "\n\n[TRACKBACK]" . _POSTEDBY . ': ';
66
+    $com_text .= "\n\n[TRACKBACK]"._POSTEDBY.': ';
67 67
     if (!empty($url)) {
68
-        $com_text .= '[url=' . $url . ']' . $blog_name . '[/url]';
69
-    } else {
68
+        $com_text .= '[url='.$url.']'.$blog_name.'[/url]';
69
+    }else {
70 70
         $com_text .= $blog_name;
71 71
     }
72 72
     $com_modid = $xoopsModule->getVar('mid');
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                 if (isset($comment_config['callbackFile'])) {
123 123
                     $callbackfile = trim($comment_config['callbackFile']);
124 124
                     if ($callbackfile != ''
125
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
126
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
125
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
126
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
127 127
                     }
128 128
                     if (!function_exists($comment_config['callback']['approve'])) {
129 129
                         $skip = true;
130 130
                     }
131
-                } else {
131
+                }else {
132 132
                     $skip = true;
133 133
                 }
134 134
             }
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
                 if (isset($comment_config['callbackFile'])) {
146 146
                     $callbackfile = trim($comment_config['callbackFile']);
147 147
                     if ($callbackfile != ''
148
-                        && file_exists(XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile)) {
149
-                        require_once XOOPS_ROOT_PATH . '/modules/' . $moddir . '/' . $callbackfile;
148
+                        && file_exists(XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile)) {
149
+                        require_once XOOPS_ROOT_PATH.'/modules/'.$moddir.'/'.$callbackfile;
150 150
                     }
151 151
                     if (!function_exists($comment_config['callback']['update'])) {
152 152
                         $skip = true;
153 153
                     }
154
-                } else {
154
+                }else {
155 155
                     $skip = true;
156 156
                 }
157 157
             }
@@ -181,16 +181,16 @@  discard block
 block discarded – undo
181 181
             $not_module   = $xoopsModule;
182 182
             if (!isset($comment_url)) {
183 183
                 $com_config  = $not_module->getInfo('comments');
184
-                $comment_url = $com_config['pageName'] . '?';
184
+                $comment_url = $com_config['pageName'].'?';
185 185
                 $comment_url .= $com_config['itemName'];
186 186
             }
187
-            $comment_tags['X_COMMENT_URL'] = XOOPS_URL . '/modules/' . $not_module->getVar('dirname') . '/' . $comment_url . '=' . $com_itemid . '&amp;com_id=' . $newcid . '&amp;com_rootid=' . $com_rootid . '&amp;com_mode=' . $com_mode . '&amp;com_order=' . $com_order . '#comment' . $newcid;
187
+            $comment_tags['X_COMMENT_URL'] = XOOPS_URL.'/modules/'.$not_module->getVar('dirname').'/'.$comment_url.'='.$com_itemid.'&amp;com_id='.$newcid.'&amp;com_rootid='.$com_rootid.'&amp;com_mode='.$com_mode.'&amp;com_order='.$com_order.'#comment'.$newcid;
188 188
             $notificationHandler           = xoops_getHandler('notification');
189 189
             $notificationHandler->triggerEvent($not_category, $not_itemid, $not_event, $comment_tags, false, $not_modid);
190 190
         }
191 191
 
192 192
         PlanetUtility::planetRespondToTrackback(0);
193
-    } else {
193
+    }else {
194 194
         PlanetUtility::planetRespondToTrackback(1, xoops_error($comment->getHtmlErrors()));
195 195
     }
196 196
 }
Please login to merge, or discard this patch.
comment_new.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,11 +24,11 @@
 block discarded – undo
24 24
 // URL: https://xoops.org                         //
25 25
 // Project: Article Project                                                 //
26 26
 // ------------------------------------------------------------------------ //
27
-include __DIR__ . '/header.php';
28
-$com_itemid = isset($_GET['com_itemid']) ? (int)$_GET['com_itemid'] : 0;
29
-if ($com_itemid > 0) {
27
+include __DIR__.'/header.php';
28
+$com_itemid = isset($_GET['com_itemid']) ? (int) $_GET['com_itemid'] : 0;
29
+if ($com_itemid>0) {
30 30
     $articleHandler = xoops_getModuleHandler('article', $GLOBALS['moddirname']);
31 31
     $article_obj    = $articleHandler->get($com_itemid);
32 32
     $com_replytitle = $article_obj->getVar('art_title');
33
-    require_once XOOPS_ROOT_PATH . '/include/comment_new.php';
33
+    require_once XOOPS_ROOT_PATH.'/include/comment_new.php';
34 34
 }
Please login to merge, or discard this patch.