Passed
Push — master ( 4990f6...882d2a )
by Michael
03:01
created
include/search.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
     $criteriaPost = new \CriteriaCompo();
56 56
     $criteriaPost->add(new \Criteria('p.approved', 1), 'AND'); // only active posts
57 57
 
58
-    $forum_list = [];// get forum lists just for forum names
58
+    $forum_list = []; // get forum lists just for forum names
59 59
     if (count($validForums) > 0) {
60 60
         $criteriaPermissions = new \CriteriaCompo();
61
-        $criteriaPermissions->add(new \Criteria('p.forum_id', '(' . implode(',', $validForums) . ')', 'IN'), 'AND');
62
-        $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '(' . implode(', ', $validForums) . ')', 'IN'), 'forum_name', false);
61
+        $criteriaPermissions->add(new \Criteria('p.forum_id', '('.implode(',', $validForums).')', 'IN'), 'AND');
62
+        $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '('.implode(', ', $validForums).')', 'IN'), 'forum_name', false);
63 63
     }
64 64
 
65 65
     if (is_numeric($userid) && 0 !== $userid) {
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     } elseif (is_array($userid) && count($userid) > 0) {
69 69
         $userid       = array_map('intval', $userid);
70 70
         $criteriaUser = new \CriteriaCompo();
71
-        $criteriaUser->add(new \Criteria('p.uid', '(' . implode(',', $userid) . ')', 'IN'), 'OR');
71
+        $criteriaUser->add(new \Criteria('p.uid', '('.implode(',', $userid).')', 'IN'), 'OR');
72 72
     }
73 73
 
74 74
     $count = 0;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $criteriaKeywords = new \CriteriaCompo();
81 81
         foreach ($queryarray as $queryTerm) {
82 82
             $termCriteria  = new \CriteriaCompo();
83
-            $queryTermLike = '%' . $xoopsDB->escape($queryTerm) . '%';
83
+            $queryTermLike = '%'.$xoopsDB->escape($queryTerm).'%';
84 84
             if ('title' === $searchin || 'both' === $searchin) {
85 85
                 $termCriteria->add(new \Criteria('p.subject', $queryTermLike, 'LIKE'), 'OR');
86 86
             }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $criteriaKeywords->add($termCriteria, $andor);
91 91
         }
92 92
         // add highlight keywords to post links
93
-        $highlightKey = '&keywords=' . implode(' ', $queryarray);
93
+        $highlightKey = '&keywords='.implode(' ', $queryarray);
94 94
         $highlightKey = str_replace(' ', '+', $highlightKey);
95 95
     }
96 96
     $criteria = new \CriteriaCompo();
@@ -131,14 +131,14 @@  discard block
 block discarded – undo
131 131
         $post                  = $posts[$id];
132 132
         $post_data             = $post->getPostBody();
133 133
         $ret[$i]['topic_id']   = $post->getVar('topic_id');
134
-        $ret[$i]['link']       = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post->getVar('post_id') . $highlightKey; // add highlight key
134
+        $ret[$i]['link']       = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post->getVar('post_id').$highlightKey; // add highlight key
135 135
         $ret[$i]['title']      = $post_data['subject'];
136 136
         $ret[$i]['time']       = $post_data['date'];
137 137
         $ret[$i]['forum_name'] = $myts->htmlSpecialChars($forum_list[$post->getVar('forum_id')]['forum_name']);
138
-        $ret[$i]['forum_link'] = XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $post->getVar('forum_id');
138
+        $ret[$i]['forum_link'] = XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$post->getVar('forum_id');
139 139
         $ret[$i]['post_text']  = $post_data['text'];
140 140
         $ret[$i]['uid']        = $post->getVar('uid');
141
-        $ret[$i]['poster']     = $post->getVar('uid') ? '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $ret[$i]['uid'] . '">' . $post_data['author'] . '</a>' : $post_data['author'];
141
+        $ret[$i]['poster']     = $post->getVar('uid') ? '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$ret[$i]['uid'].'">'.$post_data['author'].'</a>' : $post_data['author'];
142 142
         ++$i;
143 143
     }
144 144
 
Please login to merge, or discard this patch.
include/notification.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,42 +54,42 @@
 block discarded – undo
54 54
 
55 55
         if ('forum' === $category) {
56 56
             // Assume we have a valid forum id
57
-            $sql = 'SELECT forum_name FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' WHERE forum_id = ' . $item_id;
57
+            $sql = 'SELECT forum_name FROM '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' WHERE forum_id = '.$item_id;
58 58
             if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
59 59
                 // irmtfan full URL
60
-                redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERRORFORUM);
60
+                redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERRORFORUM);
61 61
             }
62 62
             $result_array = $GLOBALS['xoopsDB']->fetchArray($result);
63 63
             $item['name'] = $result_array['forum_name'];
64
-            $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewforum.php?forum=' . $item_id;
64
+            $item['url']  = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewforum.php?forum='.$item_id;
65 65
 
66 66
             return $item;
67 67
         }
68 68
 
69 69
         if ('thread' === $category) {
70 70
             // Assume we have a valid topid id
71
-            $sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' t, ' . $GLOBALS['xoopsDB']->prefix('newbb_forums') . ' f WHERE t.forum_id = f.forum_id AND t.topic_id = ' . $item_id . ' LIMIT 1';
71
+            $sql = 'SELECT t.topic_title,f.forum_id,f.forum_name FROM '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' t, '.$GLOBALS['xoopsDB']->prefix('newbb_forums').' f WHERE t.forum_id = f.forum_id AND t.topic_id = '.$item_id.' LIMIT 1';
72 72
             if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
73 73
                 // irmtfan full URL
74
-                redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERROROCCURED);
74
+                redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERROROCCURED);
75 75
             }
76 76
             $result_array = $GLOBALS['xoopsDB']->fetchArray($result);
77 77
             $item['name'] = $result_array['topic_title'];
78
-            $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum=' . $result_array['forum_id'] . '&topic_id=' . $item_id;
78
+            $item['url']  = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewtopic.php?forum='.$result_array['forum_id'].'&topic_id='.$item_id;
79 79
 
80 80
             return $item;
81 81
         }
82 82
 
83 83
         if ('post' === $category) {
84 84
             // Assume we have a valid post id
85
-            $sql = 'SELECT subject,topic_id,forum_id FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' WHERE post_id = ' . $item_id . ' LIMIT 1';
85
+            $sql = 'SELECT subject,topic_id,forum_id FROM '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' WHERE post_id = '.$item_id.' LIMIT 1';
86 86
             if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
87 87
                 // irmtfan full URL
88
-                redirect_header(XOOPS_URL . '/modules/' . $module->getVar('dirname') . 'index.php', 2, _MD_NEWBB_ERROROCCURED);
88
+                redirect_header(XOOPS_URL.'/modules/'.$module->getVar('dirname').'index.php', 2, _MD_NEWBB_ERROROCCURED);
89 89
             }
90 90
             $result_array = $GLOBALS['xoopsDB']->fetchArray($result);
91 91
             $item['name'] = $result_array['subject'];
92
-            $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/viewtopic.php?forum= ' . $result_array['forum_id'] . '&amp;topic_id=' . $result_array['topic_id'] . '#forumpost' . $item_id;
92
+            $item['url']  = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/viewtopic.php?forum= '.$result_array['forum_id'].'&amp;topic_id='.$result_array['topic_id'].'#forumpost'.$item_id;
93 93
 
94 94
             return $item;
95 95
         }
Please login to merge, or discard this patch.
include/functions.read.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_READ_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_READ')) {
Please login to merge, or discard this patch.
include/functions.recon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
13 13
 
14
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
14
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
15 15
 define('NEWBB_FUNCTIONS_RECON_LOADED', true);
16 16
 
17 17
 if (!defined('NEWBB_FUNCTIONS_RECON')) {
Please login to merge, or discard this patch.
include/functions.rpc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
13 13
 
14
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
14
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
15 15
 define('NEWBB_FUNCTIONS_RPC_LOADED', true);
16 16
 
17 17
 if (!defined('NEWBB_FUNCTIONS_RPC')) {
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
         } else {
33 33
             $charset = _CHARSET;
34 34
         }
35
-        header('Content-Type: text/xml; charset="' . $charset . '"');
35
+        header('Content-Type: text/xml; charset="'.$charset.'"');
36 36
         if ($error) {
37
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
37
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
38 38
             echo '<response>\n';
39 39
             echo '<error>1</error>\n';
40 40
             echo '<message>$error_message</message>\n';
41 41
             echo '</response>';
42 42
             exit();
43 43
         } else {
44
-            echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n";
44
+            echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n";
45 45
             echo '<response>\n';
46 46
             echo '<error>0</error>\n';
47 47
             echo '</response>';
Please login to merge, or discard this patch.
include/onupdate.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)
23 23
     || !$GLOBALS['xoopsUser']->IsAdmin()) {
24
-    exit('Restricted access' . PHP_EOL);
24
+    exit('Restricted access'.PHP_EOL);
25 25
 }
26 26
 
27 27
 /**
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
88 88
         if ($tables->useTable($table)) {
89 89
             $tables->alterColumn($table, $column, $attributes, $newName);
90 90
             if (!$tables->executeQueue()) {
91
-                echo '<br>' . _AM_XXXXX_UPGRADEFAILED0 . ' ' . $migrate->getLastError();
91
+                echo '<br>'._AM_XXXXX_UPGRADEFAILED0.' '.$migrate->getLastError();
92 92
             }
93 93
         }
94 94
 
95 95
         //delete old HTML templates
96 96
         if (count($configurator->templateFolders) > 0) {
97 97
             foreach ($configurator->templateFolders as $folder) {
98
-                $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder);
98
+                $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder);
99 99
                 if (is_dir($templateFolder)) {
100 100
                     $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']);
101 101
                     foreach ($templateList as $k => $v) {
102
-                        $fileInfo = new \SplFileInfo($templateFolder . $v);
102
+                        $fileInfo = new \SplFileInfo($templateFolder.$v);
103 103
                         if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) {
104
-                            if (file_exists($templateFolder . $v)) {
105
-                                unlink($templateFolder . $v);
104
+                            if (file_exists($templateFolder.$v)) {
105
+                                unlink($templateFolder.$v);
106 106
                             }
107 107
                         }
108 108
                     }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         if (count($configurator->oldFiles) > 0) {
115 115
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
116 116
             foreach (array_keys($configurator->oldFiles) as $i) {
117
-                $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]);
117
+                $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]);
118 118
                 if (is_file($tempFile)) {
119 119
                     unlink($tempFile);
120 120
                 }
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         if (count($configurator->oldFolders) > 0) {
127 127
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
128 128
             foreach (array_keys($configurator->oldFolders) as $i) {
129
-                $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
129
+                $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]);
130 130
                 /* @var $folderHandler XoopsObjectHandler */
131 131
                 $folderHandler = \XoopsFile::getHandler('folder', $tempFolder);
132 132
                 $folderHandler->delete($tempFolder);
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
 
144 144
         //  ---  COPY blank.png FILES ---------------
145 145
         if (count($configurator->copyBlankFiles) > 0) {
146
-            $file = __DIR__ . '/../assets/images/blank.png';
146
+            $file = __DIR__.'/../assets/images/blank.png';
147 147
             foreach (array_keys($configurator->copyBlankFiles) as $i) {
148
-                $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
148
+                $dest = $configurator->copyBlankFiles[$i].'/blank.png';
149 149
                 $utilityClass::copyFile($file, $dest);
150 150
             }
151 151
         }
152 152
 
153 153
         //delete .html entries from the tpl table
154
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\'';
154
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\'';
155 155
         $GLOBALS['xoopsDB']->queryF($sql);
156 156
 
157 157
         /** @var XoopsGroupPermHandler $gpermHandler */
Please login to merge, or discard this patch.
include/plugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
 // MENU handler
75 75
 /* You could remove anyone by commenting out in order to disable it */
76 76
 $customConfig['valid_menumodes'] = [
77
-    0 => _MD_NEWBB_MENU_SELECT,    // for selectbox
77
+    0 => _MD_NEWBB_MENU_SELECT, // for selectbox
78 78
     //1 => _MD_NEWBB_MENU_CLICK,    // for "click to expand"
79 79
     //2 => _MD_NEWBB_MENU_HOVER        // for "mouse hover to expand"
80 80
 ];
Please login to merge, or discard this patch.
include/plugin.dist.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,8 @@
 block discarded – undo
72 72
 // MENU handler
73 73
 /* You could remove anyone by commenting out in order to disable it */
74 74
 $valid_menumodes = [
75
-    0 => _MD_NEWBB_MENU_SELECT,    // for selectbox
76
-    1 => _MD_NEWBB_MENU_CLICK,    // for 'click to expand'
75
+    0 => _MD_NEWBB_MENU_SELECT, // for selectbox
76
+    1 => _MD_NEWBB_MENU_CLICK, // for 'click to expand'
77 77
     2 => _MD_NEWBB_MENU_HOVER        // for 'mouse hover to expand'
78 78
 ];
79 79
 
Please login to merge, or discard this patch.
include/functions.forum.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
15 15
 
16
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
16
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
17 17
 define('NEWBB_FUNCTIONS_FORUM_LOADED', true);
18 18
 
19 19
 if (!defined('NEWBB_FUNCTIONS_FORUM')) {
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
             $groups = $xoopsUser->getGroups();
41 41
         }
42 42
         sort($groups);
43
-        $groupKey = 'forumselect_' . $permission . '_' . md5(implode(',', $groups));
44
-        $forums   = $cacheHelper->cacheRead($groupKey, function () use ($categories, $permission) {
43
+        $groupKey = 'forumselect_'.$permission.'_'.md5(implode(',', $groups));
44
+        $forums   = $cacheHelper->cacheRead($groupKey, function() use ($categories, $permission) {
45 45
             /** @var Newbb\CategoryHandler $categoryHandler */
46 46
             $categoryHandler = Newbb\Helper::getInstance()->getHandler('Category');
47 47
             $categories      = $categoryHandler->getByPermission($permission, ['cat_id', 'cat_order', 'cat_title'], false);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 if ($categoryDelimiter) {
62 62
                     $box .= "<option value=0>&nbsp;</option>\n";
63 63
                 }
64
-                $box .= "<option value='" . (-1 * $key) . "'>[" . $categories[$key]['cat_title'] . "]</option>\n";
64
+                $box .= "<option value='".(-1 * $key)."'>[".$categories[$key]['cat_title']."]</option>\n";
65 65
                 if (empty($forums[$key])) {
66 66
                     continue;
67 67
                 }
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
                     if ($see && in_array($f, $value)) {
70 70
                         continue;
71 71
                     }
72
-                    $box .= "<option value='{$f}' " . (in_array($f, $value) ? ' selected' : '') . '>' . $forum['prefix'] . $forum['forum_name'] . "</option>\n";
72
+                    $box .= "<option value='{$f}' ".(in_array($f, $value) ? ' selected' : '').'>'.$forum['prefix'].$forum['forum_name']."</option>\n";
73 73
                 }
74 74
             }
75 75
         } else {
76
-            $box .= '<option value=0>' . _MD_NEWBB_NOFORUMINDB . "</option>\n";
76
+            $box .= '<option value=0>'._MD_NEWBB_NOFORUMINDB."</option>\n";
77 77
         }
78 78
         unset($forums, $categories);
79 79
 
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
      */
87 87
     function newbbMakeJumpbox($forum_id = 0)
88 88
     {
89
-        $box = '<form name="forum_jumpbox" method="get" action="' . XOOPS_URL . '/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value &lt; 1) {return false;}">';
89
+        $box = '<form name="forum_jumpbox" method="get" action="'.XOOPS_URL.'/modules/newbb/viewforum.php" onsubmit="javascript: if (document.forum_jumpbox.forum.value &lt; 1) {return false;}">';
90 90
         $box .= '<select class="select" name="forum" onchange="if (this.options[this.selectedIndex].value >0) { document.forms.forum_jumpbox.submit();}">';
91
-        $box .= '<option value=0>-- ' . _MD_NEWBB_SELFORUM . ' --</option>';
91
+        $box .= '<option value=0>-- '._MD_NEWBB_SELFORUM.' --</option>';
92 92
         $box .= newbbForumSelectBox($forum_id);
93
-        $box .= "</select> <input type='submit' class='button' value='" . _GO . "' /></form>";
93
+        $box .= "</select> <input type='submit' class='button' value='"._GO."' /></form>";
94 94
         unset($forums, $categories);
95 95
 
96 96
         return $box;
Please login to merge, or discard this patch.