Passed
Push — master ( 492cc7...e5a5fc )
by Michael
45s queued 11s
created
include/functions.time.php 1 patch
Spacing   +5 added lines, -5 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') || require_once __DIR__ . '/functions.ini.php';
14
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
15 15
 define('NEWBB_FUNCTIONS_TIME_LOADED', true);
16 16
 
17 17
 if (!defined('NEWBB_FUNCTIONS_TIME')) {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         //$select_array = explode(',', $newbbConfig['since_options']);
54 54
         //$select_array = array_map('trim', $select_array);
55 55
         // irmtfan - if the array is empty do not show selection box
56
-        if (!(bool)$select_array) {
56
+        if (!(bool) $select_array) {
57 57
             $since = $newbbConfig['since_default'];
58 58
             switch ($since) {
59 59
                 case 0:
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         // irmtfan no option when no selected value
77 77
         $forum_selection_since .= '<option value="">--------</option>';
78 78
         foreach ($select_array as $since) {
79
-            $forum_selection_since .= '<option value="' . $since . '"' . (($selected == $since) ? ' selected="selected"' : '') . '>';
79
+            $forum_selection_since .= '<option value="'.$since.'"'.(($selected == $since) ? ' selected="selected"' : '').'>';
80 80
             // START irmtfan functional since 0 and 365
81 81
             switch ($since) {
82 82
                 case 0:
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
         // irmtfan bad coding
113 113
         //if ($since==1000) return 0;
114 114
         if ($since > 0) {
115
-            return (int)$since * 24 * 3600;
115
+            return (int) $since * 24 * 3600;
116 116
         } else {
117
-            return (int)abs($since) * 3600;
117
+            return (int) abs($since) * 3600;
118 118
         }
119 119
     }
120 120
 }
Please login to merge, or discard this patch.
include/functions.user.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@  discard block
 block discarded – undo
62 62
     if (is_numeric($user) && -1 == $user) {
63 63
         $user = $GLOBALS['xoopsUser'];
64 64
     }
65
-    if (!is_object($user) && (int)$user < 1) {
65
+    if (!is_object($user) && (int) $user < 1) {
66 66
         return false;
67 67
     }
68
-    $uid = is_object($user) ? $user->getVar('uid') : (int)$user;
68
+    $uid = is_object($user) ? $user->getVar('uid') : (int) $user;
69 69
 
70 70
     if (!$mid) {
71 71
         if (is_object($xoopsModule) && 'newbb' === $xoopsModule->getVar('dirname', 'n')) {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 function newbbIsModerator(&$forum, $user = -1)
105 105
 {
106 106
     if (!is_object($forum)) {
107
-        $forum_id = (int)$forum;
107
+        $forum_id = (int) $forum;
108 108
         if (0 == $forum_id) {
109 109
             return false;
110 110
         }
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
     if (is_numeric($user) && -1 == $user) {
116 116
         $user = $GLOBALS['xoopsUser'];
117 117
     }
118
-    if (!is_object($user) && (int)$user < 1) {
118
+    if (!is_object($user) && (int) $user < 1) {
119 119
         return false;
120 120
     }
121
-    $uid = is_object($user) ? $user->getVar('uid', 'n') : (int)$user;
121
+    $uid = is_object($user) ? $user->getVar('uid', 'n') : (int) $user;
122 122
 
123 123
     return in_array($uid, $forum->getVar('forum_moderator'), true);
124 124
 }
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
         return true;
147 147
     }
148 148
 
149
-    $cache_id = is_object($forum) ? $forum->getVar('forum_id', 'n') : (int)$forum;
149
+    $cache_id = is_object($forum) ? $forum->getVar('forum_id', 'n') : (int) $forum;
150 150
     if (!isset($_cachedModerators[$cache_id])) {
151 151
         if (!is_object($forum)) {
152 152
             $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
153
-            $forum        = $forumHandler->get((int)$forum);
153
+            $forum        = $forumHandler->get((int) $forum);
154 154
         }
155 155
         $_cachedModerators[$cache_id] = $forum->getVar('forum_moderator');
156 156
     }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
     $xoopsGroupPermHandler = xoops_getHandler('groupperm');
179 179
     $xoopsGroupPermTable   = $xoopsGroupPermHandler->table;
180 180
 
181
-    if (!(bool)$uid) {
181
+    if (!(bool) $uid) {
182 182
         return $module_administrators;
183 183
     }
184 184
     $mid = $xoopsModule->getVar('mid');
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
            . implode(', ', array_map('intval', $uid))
194 194
            . ')'
195 195
            . "    AND p.gperm_modid = '1' AND p.gperm_name = 'module_admin' AND p.gperm_itemid = '"
196
-           . (int)$mid
196
+           . (int) $mid
197 197
            . "'"
198 198
            . ' GROUP BY l.uid';
199 199
 
@@ -218,11 +218,11 @@  discard block
 block discarded – undo
218 218
 {
219 219
     $forum_moderators = [];
220 220
 
221
-    if (!(bool)$uid) {
221
+    if (!(bool) $uid) {
222 222
         return $forum_moderators;
223 223
     }
224 224
 
225
-    $sql = 'SELECT forum_moderator FROM ' . $GLOBALS['xoopsDB']->prefix('newbb_forums');
225
+    $sql = 'SELECT forum_moderator FROM '.$GLOBALS['xoopsDB']->prefix('newbb_forums');
226 226
     if ($result = $GLOBALS['xoopsDB']->query($sql)) {
227 227
         while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
228 228
             if (empty($myrow['forum_moderator'])) {
Please login to merge, or discard this patch.
include/config.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,25 +35,25 @@  discard block
 block discarded – undo
35 35
 {
36 36
     $moduleDirName      = basename(dirname(__DIR__));
37 37
     $moduleDirNameUpper = strtoupper($moduleDirName);
38
-    return (object)[
39
-        'name'           => strtoupper($moduleDirName) . ' Module Configurator',
38
+    return (object) [
39
+        'name'           => strtoupper($moduleDirName).' Module Configurator',
40 40
         'paths'          => [
41 41
             'dirname'    => $moduleDirName,
42
-            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
43
-            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
44
-            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
45
-            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
46
-            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
42
+            'admin'      => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin',
43
+            'modPath'    => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName,
44
+            'modUrl'     => XOOPS_URL.'/modules/'.$moduleDirName,
45
+            'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
46
+            'uploadUrl'  => XOOPS_UPLOAD_URL.'/'.$moduleDirName,
47 47
         ],
48 48
         'uploadFolders'  => [
49
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
50
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
49
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
50
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs',
51 51
 
52 52
             //XOOPS_UPLOAD_PATH . '/flags'
53 53
         ],
54 54
         'copyBlankFiles' => [
55
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
56
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/thumbs',
55
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
56
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/thumbs',
57 57
             //XOOPS_UPLOAD_PATH . '/flags'
58 58
         ],
59 59
 
@@ -110,6 +110,6 @@  discard block
 block discarded – undo
110 110
         ],
111 111
 
112 112
         'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
113
-                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
113
+                     <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>',
114 114
     ];
115 115
 }
Please login to merge, or discard this patch.
admin/admin_report.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 use Xmf\Request;
33 33
 
34
-require_once __DIR__ . '/admin_header.php';
34
+require_once __DIR__.'/admin_header.php';
35 35
 require_once $GLOBALS['xoops']->path('class/pagenav.php');
36 36
 
37 37
 $op    = Request::getCmd('op', 'default');
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         //        $report_ids = Request::getInt('report_id', 0, 'POST'); //$_POST['report_id'];
53 53
         // irmtfan add error redirect header
54 54
         if (0 === count($report_ids)) {
55
-            redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
55
+            redirect_header("admin_report.php?item={$item}".(empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
56 56
         }
57 57
         $report_memos = Request::getArray('report_memo', [], 'POST'); // isset($_POST['report_memo']) ? $_POST['report_memo'] : array();
58 58
         foreach ($report_ids as $rid => $value) {
@@ -65,14 +65,14 @@  discard block
 block discarded – undo
65 65
             $reportHandler->insert($reportObject);
66 66
         }
67 67
         // irmtfan add message
68
-        redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTSAVE);
68
+        redirect_header("admin_report.php?item={$item}".(empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTSAVE);
69 69
         break;
70 70
 
71 71
     case 'delete':
72
-        $report_ids = Request::getArray('report_id', [], 'POST');// $_POST['report_id'];
72
+        $report_ids = Request::getArray('report_id', [], 'POST'); // $_POST['report_id'];
73 73
         // irmtfan add error redirect header
74 74
         if (0 === count($report_ids)) {
75
-            redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
75
+            redirect_header("admin_report.php?item={$item}".(empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTNOTSELECT);
76 76
         }
77 77
         foreach ($report_ids as $rid => $value) {
78 78
             if (!$value) {
@@ -83,13 +83,13 @@  discard block
 block discarded – undo
83 83
             }
84 84
         }
85 85
         // irmtfan add message
86
-        redirect_header("admin_report.php?item={$item}" . (empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTDELETE);
86
+        redirect_header("admin_report.php?item={$item}".(empty($start) ? '' : "&start={$start}"), 1, _AM_NEWBB_REPORTDELETE);
87 87
         break;
88 88
 
89 89
     case 'default':
90 90
     default:
91 91
         require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
92
-        require_once  dirname(__DIR__) . '/include/functions.user.php';
92
+        require_once  dirname(__DIR__).'/include/functions.user.php';
93 93
 
94 94
         if ('processed' !== $item) {
95 95
             $process_result = 0;
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
         $adminObject->addItemButton($title_other, $item_other, $icon = 'add');
113 113
         $adminObject->displayButton('left');
114 114
         echo _AM_NEWBB_REPORTADMIN_HELP;
115
-        echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr><td class='odd'>";
116
-        echo '<form action="' . xoops_getenv('PHP_SELF') . '" method="post">';
115
+        echo "<table width='100%' border='0' cellspacing='1' class='outer'>"."<tr><td class='odd'>";
116
+        echo '<form action="'.xoops_getenv('PHP_SELF').'" method="post">';
117 117
         echo "<table border='0' cellpadding='4' cellspacing='1' width='100%' class='outer'>";
118 118
         echo "<tr align='center'>";
119
-        echo "<th class='bg3' width='80%'>" . _AM_NEWBB_REPORTTITLE . '</th>';
120
-        echo "<th class='bg3' width='10%'>" . $extra . '</th>';
119
+        echo "<th class='bg3' width='80%'>"._AM_NEWBB_REPORTTITLE.'</th>';
120
+        echo "<th class='bg3' width='10%'>".$extra.'</th>';
121 121
         echo '</tr>';
122 122
 
123 123
         $reports = $reportHandler->getAllReports('report_id', 'ASC', $limit, $start, $process_result);
@@ -135,43 +135,43 @@  discard block
 block discarded – undo
135 135
                          . '&amp;viewmode=thread" target="checkreport">'
136 136
                          . $myts->htmlSpecialChars($report['subject'])
137 137
                          . '</a>';
138
-            $checkbox  = '<input type="checkbox" name="report_id[' . $report['report_id'] . ']" value="1" checked />';
138
+            $checkbox = '<input type="checkbox" name="report_id['.$report['report_id'].']" value="1" checked />';
139 139
             if ('processed' !== $item) {
140
-                $memo = '<input type="text" name="report_memo[' . $report['report_id'] . ']" maxlength="255" size="80" />';
140
+                $memo = '<input type="text" name="report_memo['.$report['report_id'].']" maxlength="255" size="80" />';
141 141
             } else {
142 142
                 $memo = $myts->htmlSpecialChars($report['report_memo']);
143 143
             }
144 144
             echo "<tr class='odd' align='left'>";
145
-            echo '<td>' . _AM_NEWBB_REPORTPOST . ': ' . $post_link . '</td>';
146
-            echo "<td align='center'>" . $report['report_id'] . '</td>';
145
+            echo '<td>'._AM_NEWBB_REPORTPOST.': '.$post_link.'</td>';
146
+            echo "<td align='center'>".$report['report_id'].'</td>';
147 147
             echo '</tr>';
148 148
             echo "<tr class='odd' align='left'>";
149
-            echo '<td>' . _AM_NEWBB_REPORTTEXT . ': ' . $myts->htmlSpecialChars($report['report_text']) . '</td>';
150
-            $uid           = (int)$report['reporter_uid'];
149
+            echo '<td>'._AM_NEWBB_REPORTTEXT.': '.$myts->htmlSpecialChars($report['report_text']).'</td>';
150
+            $uid           = (int) $report['reporter_uid'];
151 151
             $reporter_name = newbbGetUnameFromId($uid, $GLOBALS['xoopsModuleConfig']['show_realname']);
152
-            $reporter      = !empty($uid) ? "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $uid . "'>" . $reporter_name . '</a><br>' : '';
153
-            echo "<td align='center'>" . $reporter . $report['reporter_ip'] . '</td>';
152
+            $reporter      = !empty($uid) ? "<a href='".XOOPS_URL.'/userinfo.php?uid='.$uid."'>".$reporter_name.'</a><br>' : '';
153
+            echo "<td align='center'>".$reporter.$report['reporter_ip'].'</td>';
154 154
             echo '</tr>';
155 155
             echo "<tr class='odd' align='left'>";
156
-            echo '<td>' . _AM_NEWBB_REPORTMEMO . ': ' . $memo . '</td>';
157
-            echo "<td align='center' >" . $checkbox . '</td>';
156
+            echo '<td>'._AM_NEWBB_REPORTMEMO.': '.$memo.'</td>';
157
+            echo "<td align='center' >".$checkbox.'</td>';
158 158
             echo '</tr>';
159 159
             echo "<tr colspan='2'><td height='2'></td></tr>";
160 160
         }
161 161
         $buttons = '';
162 162
         if ('processed' !== $item) {
163
-            $submit  = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit');
164
-            $buttons .= $submit->render() . ' ';
163
+            $submit = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit');
164
+            $buttons .= $submit->render().' ';
165 165
         }
166 166
         $delete  = new \XoopsFormButton('', 'delete', _DELETE, 'submit');
167
-        $buttons .= $delete->render() . ' ';
167
+        $buttons .= $delete->render().' ';
168 168
         $cancel  = new \XoopsFormButton('', 'cancel', _CANCEL, 'reset');
169 169
         $buttons .= $cancel->render();
170 170
         echo "<tr colspan='2'><td align='center'>{$buttons}</td></tr>";
171 171
         $hidden = new \XoopsFormHidden('start', $start);
172 172
         echo $hidden->render();
173 173
         $hidden = new \XoopsFormHidden('item', $item);
174
-        echo $hidden->render() . '</form>';
174
+        echo $hidden->render().'</form>';
175 175
 
176 176
         echo '</table>';
177 177
         echo '</td></tr></table>';
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
             $limit,
181 181
             $start,
182 182
             'start',
183
-            'item=' . $item
183
+            'item='.$item
184 184
         );
185 185
         echo $nav->renderNav(4);
186 186
         echo '<fieldset>';
187
-        echo '<legend>&nbsp;' . _MI_NEWBB_ADMENU_REPORT . '&nbsp;</legend>';
187
+        echo '<legend>&nbsp;'._MI_NEWBB_ADMENU_REPORT.'&nbsp;</legend>';
188 188
         echo _AM_NEWBB_HELP_REPORT_TAB;
189 189
         echo '</fieldset>';
190 190
         break;
191 191
 }
192
-require_once __DIR__ . '/admin_footer.php';
192
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/index.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 
32 32
 use XoopsModules\Newbb;
33 33
 
34
-require_once __DIR__ . '/admin_header.php';
34
+require_once __DIR__.'/admin_header.php';
35 35
 //require_once  dirname(__DIR__) . '/class/Utility.php';
36
-require_once  dirname(__DIR__) . '/include/functions.stats.php';
36
+require_once  dirname(__DIR__).'/include/functions.stats.php';
37 37
 
38
-$attach_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/');
39
-$thumb_path  = $attach_path . 'thumbs/';
38
+$attach_path = $GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/');
39
+$thumb_path  = $attach_path.'thumbs/';
40 40
 $folder      = [$attach_path, $thumb_path];
41 41
 
42 42
 /** @var Xmf\Module\Admin $adminObject */
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
     $imageLibs = [];
76 76
     unset($output, $status);
77 77
     if (1 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
78
-        $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'] . '/';
79
-        @exec($path . 'convert -version', $output, $status);
78
+        $path = empty($GLOBALS['xoopsModuleConfig']['path_magick']) ? '' : $GLOBALS['xoopsModuleConfig']['path_magick'].'/';
79
+        @exec($path.'convert -version', $output, $status);
80 80
         if (empty($status) && !empty($output) && preg_match("/imagemagick[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
81 81
             $imageLibs['imagemagick'] = $matches[0];
82 82
         }
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
         unset($output, $status);
85 85
     }
86 86
     if (2 == $GLOBALS['xoopsModuleConfig']['image_lib'] || 0 == $GLOBALS['xoopsModuleConfig']['image_lib']) {
87
-        $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'] . '/';
88
-        @exec($path . 'jpegtopnm -version 2>&1', $output, $status);
87
+        $path = empty($GLOBALS['xoopsModuleConfig']['path_netpbm']) ? '' : $GLOBALS['xoopsModuleConfig']['path_netpbm'].'/';
88
+        @exec($path.'jpegtopnm -version 2>&1', $output, $status);
89 89
         if (empty($status) && !empty($output) && preg_match("/netpbm[ \t]+([0-9\.]+)/i", $output[0], $matches)) {
90 90
             $imageLibs['netpbm'] = $matches[0];
91 91
         }
@@ -127,30 +127,30 @@  discard block
 block discarded – undo
127 127
 $adminObject->addInfoBox(_AM_NEWBB_PREFERENCES);
128 128
 // START irmtfan better poll module display link and version - check if xoops poll module is available
129 129
 if ($isOK) {
130
-    $pollLink = _AM_NEWBB_AVAILABLE . ': ';
131
-    $pollLink .= '<a href="' . XOOPS_URL . '/modules/' . $xoopspoll->getVar('dirname') . '/admin/index.php"';
132
-    $pollLink .= ' alt="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
133
-    $pollLink .= ' title="' . $xoopspoll->getVar('name') . ' ' . _VERSION . ' (' . $xoopspoll->getInfo('version') . ') "';
134
-    $pollLink .= '>' . '(' . $xoopspoll->getVar('name') . ')</a>';
130
+    $pollLink = _AM_NEWBB_AVAILABLE.': ';
131
+    $pollLink .= '<a href="'.XOOPS_URL.'/modules/'.$xoopspoll->getVar('dirname').'/admin/index.php"';
132
+    $pollLink .= ' alt="'.$xoopspoll->getVar('name').' '._VERSION.' ('.$xoopspoll->getInfo('version').') "';
133
+    $pollLink .= ' title="'.$xoopspoll->getVar('name').' '._VERSION.' ('.$xoopspoll->getInfo('version').') "';
134
+    $pollLink .= '>'.'('.$xoopspoll->getVar('name').')</a>';
135 135
 } else {
136 136
     $pollLink = _AM_NEWBB_NOTAVAILABLE;
137 137
 }
138
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE . ': %s', $pollLink));
138
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_POLLMODULE.': %s', $pollLink));
139 139
 // END irmtfan better poll module display link and version - check if xoops poll module is available
140
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_IMAGEMAGICK . ' %s', array_key_exists('imagemagick', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['imagemagick'] : _AM_NEWBB_NOTAVAILABLE));
141
-$adminObject->addInfoBoxLine(sprintf('NetPBM' . ': %s', array_key_exists('netpbm', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['netpbm'] : _AM_NEWBB_NOTAVAILABLE));
142
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_GDLIB . ' %s', array_key_exists('gd', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['gd'] : _AM_NEWBB_NOTAVAILABLE));
143
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_UPLOAD . ' %s', $uploadlimit));
144
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_INDEX_PDF_PAGE . '', ''));
140
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_IMAGEMAGICK.' %s', array_key_exists('imagemagick', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['imagemagick'] : _AM_NEWBB_NOTAVAILABLE));
141
+$adminObject->addInfoBoxLine(sprintf('NetPBM'.': %s', array_key_exists('netpbm', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['netpbm'] : _AM_NEWBB_NOTAVAILABLE));
142
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_GDLIB.' %s', array_key_exists('gd', $imageLibs) ? _AM_NEWBB_AUTODETECTED . $imageLibs['gd'] : _AM_NEWBB_NOTAVAILABLE));
143
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_UPLOAD.' %s', $uploadlimit));
144
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_INDEX_PDF_PAGE.'', ''));
145 145
 
146 146
 $adminObject->addInfoBox(_AM_NEWBB_BOARDSUMMARY);
147
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALTOPICS . ': %s', getTotalTopics()));
148
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALPOSTS . ': %s', getTotalPosts()));
149
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALVIEWS . ': %s', getTotalViews()));
147
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALTOPICS.': %s', getTotalTopics()));
148
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALPOSTS.': %s', getTotalPosts()));
149
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_TOTALVIEWS.': %s', getTotalViews()));
150 150
 
151 151
 $adminObject->addInfoBox(_AM_NEWBB_REPORT);
152
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PENDING . ': %s', $reportHandler->getCount(new \Criteria('report_result', 0))));
153
-$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PROCESSED . ': %s', $reportHandler->getCount(new \Criteria('report_result', 1))));
152
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PENDING.': %s', $reportHandler->getCount(new \Criteria('report_result', 0))));
153
+$adminObject->addInfoBoxLine(sprintf(_AM_NEWBB_REPORT_PROCESSED.': %s', $reportHandler->getCount(new \Criteria('report_result', 1))));
154 154
 
155 155
 $_ufolders = $newbb_config->uploadFolders;
156 156
 foreach ($_ufolders as $wert) { 
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 $adminObject->displayNavigation(basename(__FILE__));
163 163
 $adminObject->displayIndex();
164 164
 
165
-require_once __DIR__ . '/admin_footer.php';
165
+require_once __DIR__.'/admin_footer.php';
166 166
 
167 167
 $cacheHelper = Newbb\Utility::cleanCache();
168 168
 //$cacheHelper = new \Xmf\Module\Helper\Cache('newbb');
@@ -180,13 +180,13 @@  discard block
 block discarded – undo
180 180
         switch (substr($sizeAsString, -1)) {
181 181
             case 'M':
182 182
             case 'm':
183
-                return (int)$sizeAsString * 1048576;
183
+                return (int) $sizeAsString * 1048576;
184 184
             case 'K':
185 185
             case 'k':
186
-                return (int)$sizeAsString * 1024;
186
+                return (int) $sizeAsString * 1024;
187 187
             case 'G':
188 188
             case 'g':
189
-                return (int)$sizeAsString * 1073741824;
189
+                return (int) $sizeAsString * 1073741824;
190 190
             default:
191 191
                 return $sizeAsString;
192 192
         }
@@ -194,6 +194,6 @@  discard block
 block discarded – undo
194 194
         $base   = log($sizeAsString) / log(1024);
195 195
         $suffix = ['', 'KB', 'MB', 'GB', 'TB'];
196 196
 
197
-        return round(1024 ** ($base - floor($base))) . ' ' . $suffix[(int)floor($base)];
197
+        return round(1024 ** ($base - floor($base))).' '.$suffix[(int) floor($base)];
198 198
     }
199 199
 }
Please login to merge, or discard this patch.
votepolls.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 use Xmf\Request;
29 29
 use XoopsModules\Xoopspoll;
30 30
 
31
-require_once __DIR__ . '/header.php';
31
+require_once __DIR__.'/header.php';
32 32
 $poll_id  = Request::getInt('poll_id', Request::getInt('poll_id', 0, 'POST'), 'GET');
33 33
 $topic_id = Request::getInt('topic_id', Request::getInt('topic_id', 0, 'POST'), 'GET');
34 34
 $forum    = Request::getInt('forum', Request::getInt('forum', 0, 'POST'), 'GET');
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 if (!Request::getInt('option_id', 0, 'POST')) {
44 44
     // irmtfan - add error message - simple url
45
-    redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_NOOPTION);
45
+    redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_NOOPTION);
46 46
 }
47 47
 // poll module
48 48
 $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $pollObject = $xpPollHandler->get($poll_id); // will create poll if poll_id = 0 exist
61 61
         // old xoopspoll or umfrage or any clone from them
62 62
     } else {
63
-        require_once $GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/include/constants.php');
63
+        require_once $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/include/constants.php');
64 64
         $classPoll  = $topicObject->loadOldPoll();
65 65
         $pollObject = new $classPoll($poll_id); // will create poll if poll_id = 0 exist
66 66
     }
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
     if (is_object($pollObject)) {
76 76
         if ($pollObject->getVar('multiple')) {
77 77
             $optionId = Request::getInt('option_id', 0, 'POST');
78
-            $optionId = (array)$optionId; // type cast to make sure it's an array
78
+            $optionId = (array) $optionId; // type cast to make sure it's an array
79 79
             $optionId = array_map('intval', $optionId); // make sure values are integers
80 80
         } else {
81 81
             $optionId = Request::getInt('option_id', 0, 'POST');
82 82
         }
83 83
         if (!$pollObject->hasExpired()) {
84
-            $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_MUSTLOGIN');
84
+            $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_MUSTLOGIN');
85 85
             //@todo:: add $url to all redirects
86 86
             //            $url = $GLOBALS['xoops']->buildUrl("index.php", array('poll_id' => $poll_id));
87 87
             if ($pollObject->isAllowedToVote()) {
@@ -95,13 +95,13 @@  discard block
 block discarded – undo
95 95
                             echo $pollObject->getHtmlErrors();
96 96
                             exit();
97 97
                         }
98
-                        $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_THANKSFORVOTE');
98
+                        $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_THANKSFORVOTE');
99 99
                     } else {
100 100
                         /* there was a problem registering the vote */
101
-                        redirect_header($GLOBALS['xoops']->buildUrl('index.php', ['poll_id' => $poll_id]), $classConstants::REDIRECT_DELAY_MEDIUM, constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE_ERROR'));
101
+                        redirect_header($GLOBALS['xoops']->buildUrl('index.php', ['poll_id' => $poll_id]), $classConstants::REDIRECT_DELAY_MEDIUM, constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE_ERROR'));
102 102
                     }
103 103
                 } else {
104
-                    $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ALREADYVOTED');
104
+                    $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_ALREADYVOTED');
105 105
                 }
106 106
                 /* set anon user vote (and the time they voted) */
107 107
                 if (!is_object($GLOBALS['xoopsUser'])) {
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
                     $classPollUtility::setVoteCookie($poll_id, $voteTime, 0);
112 112
                 }
113 113
             } else {
114
-                $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_CANNOTVOTE');
114
+                $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_CANNOTVOTE');
115 115
             }
116 116
         } else {
117 117
             /* poll has expired so just show the results */
118
-            $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . 'SORRYEXPIRED');
118
+            $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'SORRYEXPIRED');
119 119
         }
120 120
     } else {
121
-        $msg = constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_ERROR_INVALID_POLLID');
121
+        $msg = constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_ERROR_INVALID_POLLID');
122 122
     }
123 123
     if (null !== $url) {
124 124
         redirect_header($url, $classConstants::REDIRECT_DELAY_MEDIUM, $msg);
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     }
128 128
     // old xoopspoll or umfrage or any clone from them
129 129
 } else {
130
-    $classLog = $classPoll . 'Log';
130
+    $classLog = $classPoll.'Log';
131 131
     if (is_object($GLOBALS['xoopsUser'])) {
132 132
         if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $GLOBALS['xoopsUser']->getVar('uid'))) {
133 133
             $msg = _PL_ALREADYVOTED;
Please login to merge, or discard this patch.
report.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 use Xmf\Request;
33 33
 
34
-require_once __DIR__ . '/header.php';
34
+require_once __DIR__.'/header.php';
35 35
 
36 36
 $GPC = '_GET';
37 37
 if (Request::getString('submit', '', 'POST')) {
@@ -39,12 +39,12 @@  discard block
 block discarded – undo
39 39
 }
40 40
 
41 41
 foreach (['post_id', 'order', 'forum', 'topic_id'] as $getint) {
42
-    ${$getint} = (int)(@${$GPC}[$getint]);
42
+    ${$getint} = (int) (@${$GPC}[$getint]);
43 43
 }
44 44
 $viewmode = (isset(${$GPC}['viewmode']) && 'flat' !== ${$GPC}['viewmode']) ? 'thread' : 'flat';
45 45
 
46 46
 if (empty($post_id)) {
47
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORPOST);
47
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_ERRORPOST);
48 48
 }
49 49
 
50 50
 if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) {
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 $submit_button = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit');
140 140
 $cancel_button = new \XoopsFormButton('', 'cancel', _MD_NEWBB_CANCELPOST, 'button');
141 141
 $extra         = "viewtopic.php?forum=$forum&amp;topic_id=$topic_id&amp;post_id=$post_id&amp;order=$order&amp;viewmode=$viewmode";
142
-$cancel_button->setExtra("onclick='location=\"" . $extra . "\"'");
142
+$cancel_button->setExtra("onclick='location=\"".$extra."\"'");
143 143
 $button_tray->addElement($submit_button);
144 144
 $button_tray->addElement($cancel_button);
145 145
 $report_form->addElement($button_tray);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
 $r_subject = $postObject->getVar('subject', 'E');
149 149
 if ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $postObject->getVar('post_karma') > 0) {
150
-    $r_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $postObject->getVar('post_karma')) . '</div>';
150
+    $r_message = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, '***', $postObject->getVar('post_karma')).'</div>';
151 151
 } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $postObject->getVar('require_reply')) {
152 152
     $r_message = _MD_NEWBB_REPLY_REQUIREMENT;
153 153
 } else {
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
     $poster_name = $postObject->getVar('poster_name');
162 162
     $r_name      = empty($poster_name) ? $GLOBALS['xoopsConfig']['anonymous'] : $myts->htmlSpecialChars($poster_name);
163 163
 }
164
-$r_content = _MD_NEWBB_SUBJECTC . ' ' . $r_subject . '<br>';
165
-$r_content .= _MD_NEWBB_BY . ' ' . $r_name . ' ' . _MD_NEWBB_ON . ' ' . $r_date . '<br><br>';
164
+$r_content = _MD_NEWBB_SUBJECTC.' '.$r_subject.'<br>';
165
+$r_content .= _MD_NEWBB_BY.' '.$r_name.' '._MD_NEWBB_ON.' '.$r_date.'<br><br>';
166 166
 $r_content .= $r_message;
167 167
 
168
-echo "<br><table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>" . $r_subject . '</td></tr>';
169
-echo '<tr><td><br>' . $r_content . '<br></td></tr></table>';
168
+echo "<br><table cellpadding='4' cellspacing='1' width='98%' class='outer'><tr><td class='head'>".$r_subject.'</td></tr>';
169
+echo '<tr><td><br>'.$r_content.'<br></td></tr></table>';
170 170
 
171 171
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
rss.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 
32 32
 use Xmf\Request;
33 33
 
34
-require_once __DIR__ . '/header.php';
34
+require_once __DIR__.'/header.php';
35 35
 require_once $GLOBALS['xoops']->path('class/template.php');
36 36
 require_once $GLOBALS['xoops']->path('modules/newbb/include/functions.rpc.php');
37 37
 
38 38
 if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
39
-    require_once __DIR__ . '/seo_url.php';
39
+    require_once __DIR__.'/seo_url.php';
40 40
 }
41 41
 /* for seo */
42 42
 
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     $validForums = array_intersect($forums, $validForums);
60 60
 } elseif ($category > 0) {
61 61
     $crit_top = new \CriteriaCompo(new \Criteria('cat_id', $category));
62
-    $crit_top->add(new \Criteria('forum_id', '(' . implode(', ', $validForums) . ')', 'IN'));
62
+    $crit_top->add(new \Criteria('forum_id', '('.implode(', ', $validForums).')', 'IN'));
63 63
     $forums_top  = $forumHandler->getIds($crit_top);
64 64
     $validForums = array_intersect($forums_top, $validForums);
65 65
 }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $forumSet = implode(',', $validForums);
72 72
 
73 73
 $charset = 'UTF-8';
74
-header('Content-Type:text/xml; charset=' . $charset);
74
+header('Content-Type:text/xml; charset='.$charset);
75 75
 
76 76
 $tpl                 = new \XoopsTpl();
77 77
 $tpl->caching        = 2;
@@ -84,25 +84,25 @@  discard block
 block discarded – undo
84 84
 $xoopsCachedTemplateId = "newbbb_rss_$forumSet";
85 85
 $compile_id            = null;
86 86
 if (!$tpl->is_cached('db:newbb_rss.tpl', $xoopsCachedTemplateId, $compile_id)) {
87
-    require_once __DIR__ . '/include/functions.time.php';
87
+    require_once __DIR__.'/include/functions.time.php';
88 88
 
89 89
     //    /** @var Newbb\XmlrssHandler $xmlrssHandler */
90 90
     //    $xmlrssHandler = Newbb\Helper::getInstance()->getHandler('Xmlrss');
91 91
     $rss = $xmlrssHandler->create();
92 92
 
93
-    $rss->setVarRss('channel_title', $GLOBALS['xoopsConfig']['sitename'] . ' :: ' . _MD_NEWBB_FORUM);
94
-    $rss->channel_link = XOOPS_URL . '/';
95
-    $rss->setVarRss('channel_desc', $GLOBALS['xoopsConfig']['slogan'] . ' :: ' . $xoopsModule->getInfo('description'));
93
+    $rss->setVarRss('channel_title', $GLOBALS['xoopsConfig']['sitename'].' :: '._MD_NEWBB_FORUM);
94
+    $rss->channel_link = XOOPS_URL.'/';
95
+    $rss->setVarRss('channel_desc', $GLOBALS['xoopsConfig']['slogan'].' :: '.$xoopsModule->getInfo('description'));
96 96
     $rss->setVarRss('channel_lastbuild', formatTimestamp(time(), 'rss'));
97 97
     $rss->channel_webmaster = $GLOBALS['xoopsConfig']['adminmail'];
98 98
     $rss->channel_editor    = $GLOBALS['xoopsConfig']['adminmail'];
99 99
     $rss->setVarRss('channel_category', $xoopsModule->getVar('name'));
100
-    $rss->channel_generator = 'NewBB ' . $xoopsModule->getInfo('version');
100
+    $rss->channel_generator = 'NewBB '.$xoopsModule->getInfo('version');
101 101
     $rss->channel_language  = _LANGCODE;
102 102
     $rss->xml_encoding      = $charset;
103
-    $rss->image_url         = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('image');
103
+    $rss->image_url         = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/'.$xoopsModule->getInfo('image');
104 104
 
105
-    $dimension = @getimagesize($GLOBALS['xoops']->path('modules/' . $xoopsModule->getVar('dirname') . '/' . $xoopsModule->getInfo('image')));
105
+    $dimension = @getimagesize($GLOBALS['xoops']->path('modules/'.$xoopsModule->getVar('dirname').'/'.$xoopsModule->getInfo('image')));
106 106
     if (empty($dimension[0])) {
107 107
         $width = 88;
108 108
     } else {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     $rss->max_items            = $GLOBALS['xoopsModuleConfig']['rss_maxitems'];
120 120
     $rss->max_item_description = $GLOBALS['xoopsModuleConfig']['rss_maxdescription'];
121 121
 
122
-    $forumCriteria = ' AND t.forum_id IN (' . implode(',', $validForums) . ')';
122
+    $forumCriteria = ' AND t.forum_id IN ('.implode(',', $validForums).')';
123 123
     unset($validForums);
124 124
     $approveCriteria = ' AND t.approved = 1 AND p.approved = 1';
125 125
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
              . $forumCriteria
146 146
              . $approveCriteria
147 147
              . ' ORDER BY p.post_id DESC';
148
-    $limit = (int)($GLOBALS['xoopsModuleConfig']['rss_maxitems'] * 1.5);
148
+    $limit = (int) ($GLOBALS['xoopsModuleConfig']['rss_maxitems'] * 1.5);
149 149
     if (!$result = $GLOBALS['xoopsDB']->query($query, $limit)) {
150 150
         newbbTrackbackResponse(1, _MD_NEWBB_ERROR);
151 151
         //xoops_error($GLOBALS['xoopsDB']->error());
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
     if (count($types) > 0) {
170 170
         //        /** @var Newbb\TypeHandler $typeHandler */
171 171
         //        $typeHandler = Newbb\Helper::getInstance()->getHandler('Type');
172
-        $type_list = $typeHandler->getList(new \Criteria('type_id', '(' . implode(', ', array_keys($types)) . ')', 'IN'));
172
+        $type_list = $typeHandler->getList(new \Criteria('type_id', '('.implode(', ', array_keys($types)).')', 'IN'));
173 173
     }
174 174
 
175 175
     foreach ($rows as $topic) {
@@ -184,16 +184,16 @@  discard block
 block discarded – undo
184 184
         } else {
185 185
             $topic['uname'] = $topic['poster_name'] ? $myts->htmlSpecialChars($topic['poster_name']) : $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']);
186 186
         }
187
-        $description            = $topic['forum_name'] . '::';
188
-        $topic['topic_subject'] = empty($type_list[$topic['type_id']]) ? '' : '[' . $type_list[$topic['type_id']] . '] ';
189
-        $description            .= $topic['topic_subject'] . $topic['topic_title'] . "<br>\n";
187
+        $description            = $topic['forum_name'].'::';
188
+        $topic['topic_subject'] = empty($type_list[$topic['type_id']]) ? '' : '['.$type_list[$topic['type_id']].'] ';
189
+        $description            .= $topic['topic_subject'].$topic['topic_title']."<br>\n";
190 190
         $description            .= $myts->displayTarea($topic['post_text'], $topic['dohtml'], $topic['dosmiley'], $topic['doxcode'], $topic['dobr']);
191
-        $label                  = _MD_NEWBB_BY . ' ' . $topic['uname'];
191
+        $label                  = _MD_NEWBB_BY.' '.$topic['uname'];
192 192
         $time                   = formatTimestamp($topic['post_time'], 'rss');
193
-        $link                   = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $topic['post_id'] . '';
193
+        $link                   = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$topic['post_id'].'';
194 194
         if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
195
-            $link   = XOOPS_URL . '/' . REAL_MODULE_NAME . '/viewtopic.php?post_id=' . $topic['post_id'] . '';
196
-            $oldurl = '<a href=\'' . $link . '\'>';
195
+            $link   = XOOPS_URL.'/'.REAL_MODULE_NAME.'/viewtopic.php?post_id='.$topic['post_id'].'';
196
+            $oldurl = '<a href=\''.$link.'\'>';
197 197
             $newurl = seo_urls($oldurl);
198 198
             $newurl = str_replace('<a href=\'', '', $newurl);
199 199
             $newurl = str_replace('\'>', '', $newurl);
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 use Xmf\Request;
13 13
 use XoopsModules\Newbb;
14 14
 
15
-require_once __DIR__ . '/header.php';
15
+require_once __DIR__.'/header.php';
16 16
 
17 17
 /* deal with marks */
18 18
 if (Request::getInt('mark_read', 0)) {
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
         $markvalue  = 0;
24 24
         $markresult = _MD_NEWBB_MARK_UNREAD;
25 25
     }
26
-    require_once __DIR__ . '/include/functions.read.php';
26
+    require_once __DIR__.'/include/functions.read.php';
27 27
     newbbSetReadForum($markvalue);
28
-    $url = XOOPS_URL . '/modules/newbb/index.php';
29
-    redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED . ' ' . $markresult);
28
+    $url = XOOPS_URL.'/modules/newbb/index.php';
29
+    redirect_header($url, 2, _MD_NEWBB_ALL_FORUM_MARKED.' '.$markresult);
30 30
 }
31 31
 
32
-$viewcat = Request::getInt('cat', 0, 'GET');//TODO mb check if this is GET or POST?
32
+$viewcat = Request::getInt('cat', 0, 'GET'); //TODO mb check if this is GET or POST?
33 33
 ///** @var Newbb\CategoryHandler $categoryHandler */
34 34
 //$categoryHandler = Newbb\Helper::getInstance()->getHandler('Category');
35 35
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $categories[$viewcat] = $categoryObject->getValues();
45 45
     }
46 46
     $forum_index_title = sprintf(_MD_NEWBB_FORUMINDEX, htmlspecialchars($GLOBALS['xoopsConfig']['sitename'], ENT_QUOTES));
47
-    $xoops_pagetitle   = $categoryObject->getVar('cat_title') . ' [' . $xoopsModule->getVar('name') . ']';
47
+    $xoops_pagetitle   = $categoryObject->getVar('cat_title').' ['.$xoopsModule->getVar('name').']';
48 48
 }
49 49
 
50 50
 if (0 === count($categories)) {
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 //$xoopsOption['xoops_module_header'] = $xoops_module_header;
58 58
 // irmtfan include header.php after defining $xoopsOption['template_main']
59 59
 require_once $GLOBALS['xoops']->path('header.php');
60
-require_once __DIR__ . '/include/functions.render.php';
60
+require_once __DIR__.'/include/functions.render.php';
61 61
 /* rss feed */
62 62
 // irmtfan new method
63 63
 if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) {
64 64
     $xoopsTpl->assign('xoops_module_header', '
65
-    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" />
65
+    <link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/rss.php" />
66 66
     ' . @$xoopsTpl->get_template_vars('xoops_module_header'));
67 67
 }
68 68
 $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle);
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 
90 90
 if (!empty($forums_allowed)) {
91 91
     $crit_top = new \CriteriaCompo(new \Criteria('parent_forum', 0));
92
-    $crit_top->add(new \Criteria('cat_id', '(' . implode(', ', array_keys($categories)) . ')', 'IN'));
93
-    $crit_top->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN'));
92
+    $crit_top->add(new \Criteria('cat_id', '('.implode(', ', array_keys($categories)).')', 'IN'));
93
+    $crit_top->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN'));
94 94
     $forums_top = $forumHandler->getIds($crit_top);
95 95
 }
96 96
 
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 if ('hidden' === $GLOBALS['xoopsModuleConfig']['subforum_display'] || 0 === count($forums_top)) {
99 99
     $forums_sub = [];
100 100
 } else {
101
-    $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '(' . implode(', ', $forums_top) . ')', 'IN'));
102
-    $crit_sub->add(new \Criteria('forum_id', '(' . implode(', ', $forums_allowed) . ')', 'IN'));
101
+    $crit_sub = new \CriteriaCompo(new \Criteria('parent_forum', '('.implode(', ', $forums_top).')', 'IN'));
102
+    $crit_sub->add(new \Criteria('forum_id', '('.implode(', ', $forums_allowed).')', 'IN'));
103 103
     $forums_sub = $forumHandler->getIds($crit_sub);
104 104
 }
105 105
 
@@ -111,17 +111,17 @@  discard block
 block discarded – undo
111 111
 $newposts         = 0;
112 112
 $deleteposts      = 0;
113 113
 if (0 !== count($forums_available)) {
114
-    $crit_forum = new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN');
114
+    $crit_forum = new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN');
115 115
     $crit_forum->setSort('cat_id ASC, parent_forum ASC, forum_order');
116 116
     $crit_forum->setOrder('ASC');
117 117
     $forums       = $forumHandler->getAll($crit_forum, null, false);
118 118
     $newtopics    = $forumHandler->getTopicCount($forums, 0, 'pending');
119 119
     $deletetopics = $forumHandler->getTopicCount($forums, 0, 'deleted');
120 120
     $forums_array = $forumHandler->display($forums, $GLOBALS['xoopsModuleConfig']['length_title_index'], $GLOBALS['xoopsModuleConfig']['count_subforum']);
121
-    $crit         = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN'));
121
+    $crit         = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN'));
122 122
     $crit->add(new \Criteria('approved', '-1'));
123 123
     $deleteposts = $postHandler->getCount($crit);
124
-    $crit        = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $forums_available) . ')', 'IN'));
124
+    $crit        = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $forums_available).')', 'IN'));
125 125
     $crit->add(new \Criteria('approved', '0'));
126 126
     $newposts = $postHandler->getCount($crit);
127 127
 }
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
     $forums = [];
169 169
     $onecat = $categories[$id];
170 170
 
171
-    $cat_element_id = 'cat_' . $onecat['cat_id'];
171
+    $cat_element_id = 'cat_'.$onecat['cat_id'];
172 172
     $expand         = (count($toggles) > 0) ? (in_array($cat_element_id, $toggles) ? false : true) : true;
173 173
     // START irmtfan to improve newbbDisplayImage
174 174
     if ($expand) {
175
-        $cat_display      = 'block';        //irmtfan move semicolon
175
+        $cat_display      = 'block'; //irmtfan move semicolon
176 176
         $cat_icon_display = 'minus';
177 177
         $cat_alt          = _MD_NEWBB_HIDE;
178 178
     } else {
179
-        $cat_display      = 'none';        //irmtfan move semicolon
179
+        $cat_display      = 'none'; //irmtfan move semicolon
180 180
         $cat_icon_display = 'plus';
181 181
         $cat_alt          = _MD_NEWBB_SEE;
182 182
     }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
     $cat_image = '';
200 200
     $cat_image = $onecat['cat_image'];
201 201
     if ('' !== $cat_image && 'blank.gif' !== $cat_image && $cat_image) {
202
-        $cat_image = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/assets/images/category/' . $cat_image;
202
+        $cat_image = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/assets/images/category/'.$cat_image;
203 203
     }
204 204
     $category_array[] = [
205 205
         'cat_id'           => $onecat['cat_id'],
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
         //        /** @var Newbb\UserstatsHandler $userstatsHandler */
232 232
         //        $userstatsHandler         = Newbb\Helper::getInstance()->getHandler('Userstats');
233 233
         $userstats_row            = $userstatsHandler->getStats($GLOBALS['xoopsUser']->getVar('uid'));
234
-        $userstats['topics']      = sprintf(_MD_NEWBB_USER_TOPICS, (int)(@$userstats_row['user_topics']));
235
-        $userstats['posts']       = sprintf(_MD_NEWBB_USER_POSTS, (int)(@$userstats_row['user_posts']));
236
-        $userstats['digests']     = sprintf(_MD_NEWBB_USER_DIGESTS, (int)(@$userstats_row['user_digests']));
234
+        $userstats['topics']      = sprintf(_MD_NEWBB_USER_TOPICS, (int) (@$userstats_row['user_topics']));
235
+        $userstats['posts']       = sprintf(_MD_NEWBB_USER_POSTS, (int) (@$userstats_row['user_posts']));
236
+        $userstats['digests']     = sprintf(_MD_NEWBB_USER_DIGESTS, (int) (@$userstats_row['user_digests']));
237 237
         $userstats['currenttime'] = sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 's')); // irmtfan should be removed because it is for anon users too
238 238
         $userstats['lastvisit']   = sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 's')); // irmtfan should be removed because it is for anon users too
239 239
         $userstats['lastpost']    = empty($userstats_row['user_lastpost']) ? _MD_NEWBB_USER_NOLASTPOST : sprintf(_MD_NEWBB_USER_LASTPOST, formatTimestamp($userstats_row['user_lastpost'], 's'));
@@ -250,15 +250,15 @@  discard block
 block discarded – undo
250 250
 $stats = $statsHandler->getStats(array_merge([0], $forums_available));
251 251
 $xoopsTpl->assign_by_ref('stats', $stats);
252 252
 $xoopsTpl->assign('subforum_display', $GLOBALS['xoopsModuleConfig']['subforum_display']);
253
-$xoopsTpl->assign('mark_read', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=1');
254
-$xoopsTpl->assign('mark_unread', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=2');
253
+$xoopsTpl->assign('mark_read', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/index.php?mark_read=1');
254
+$xoopsTpl->assign('mark_unread', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/index.php?mark_read=2');
255 255
 
256
-$xoopsTpl->assign('all_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=all');
257
-$xoopsTpl->assign('post_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewpost.php?status=all');
258
-$xoopsTpl->assign('newpost_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewpost.php?status=new');
259
-$xoopsTpl->assign('digest_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=digest');
260
-$xoopsTpl->assign('unreplied_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=unreplied');
261
-$xoopsTpl->assign('unread_link', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/list.topic.php?status=unread');
256
+$xoopsTpl->assign('all_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=all');
257
+$xoopsTpl->assign('post_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewpost.php?status=all');
258
+$xoopsTpl->assign('newpost_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewpost.php?status=new');
259
+$xoopsTpl->assign('digest_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=digest');
260
+$xoopsTpl->assign('unreplied_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=unreplied');
261
+$xoopsTpl->assign('unread_link', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/list.topic.php?status=unread');
262 262
 $xoopsTpl->assign('menumode', $menumode);
263 263
 $xoopsTpl->assign('menumode_other', $menumode_other);
264 264
 
@@ -286,5 +286,5 @@  discard block
 block discarded – undo
286 286
                   ]);
287 287
 
288 288
 // irmtfan move to footer.php
289
-require_once __DIR__ . '/footer.php';
289
+require_once __DIR__.'/footer.php';
290 290
 require_once $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.