Passed
Push — master ( 4990f6...882d2a )
by Michael
03:01
created
class/Common/Configurator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
  *
21 21
  */
22 22
 
23
-require_once __DIR__ . '/../../include/common.php';
23
+require_once __DIR__.'/../../include/common.php';
24 24
 
25 25
 /**
26 26
  * Class Configurator
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $moduleDirName = basename(dirname(__DIR__));
46 46
         $capsDirName   = strtoupper($moduleDirName);
47 47
 
48
-        require_once __DIR__ . '/../../include/config.php';
48
+        require_once __DIR__.'/../../include/config.php';
49 49
         $config = getConfig();
50 50
 
51 51
         $this->name            = $config->name;
Please login to merge, or discard this patch.
class/StatsHandler.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
14 14
 
15
-defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__ . '/functions.ini.php';
15
+defined('NEWBB_FUNCTIONS_INI') || require_once __DIR__.'/functions.ini.php';
16 16
 
17 17
 define('NEWBB_STATS_TYPE_TOPIC', 1);
18 18
 define('NEWBB_STATS_TYPE_POST', 2);
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             return false;
79 79
         }
80 80
 
81
-        $sql    = "    UPDATE {$this->table}"
81
+        $sql = "    UPDATE {$this->table}"
82 82
                   . '    SET stats_value = CASE '
83 83
                   . "                    WHEN time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format)  THEN stats_value + '{$increment}' "
84 84
                   . "                    ELSE '{$increment}' "
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $result = $this->db->queryF($sql);
91 91
         $rows   = $this->db->getAffectedRows();
92 92
         if (0 == $rows) {
93
-            $sql    = "    INSERT INTO {$this->table}"
93
+            $sql = "    INSERT INTO {$this->table}"
94 94
                       . '        (`stats_id`, `stats_value`, `stats_type`, `stats_period`, `time_update`, `time_format`) '
95 95
                       . '    VALUES '
96 96
                       . "        ('0', '{$increment}', '{$type}', '"
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         foreach ($periods as $period) {
148 148
             $_periods[] = array_search($period, $this->param['period']);
149 149
         }
150
-        $sql    = '    SELECT stats_id, stats_value, stats_type, stats_period '
150
+        $sql = '    SELECT stats_id, stats_value, stats_type, stats_period '
151 151
                   . "    FROM {$this->table} "
152 152
                   . '    WHERE '
153 153
                   . "        ( time_format = '' OR DATE_FORMAT(time_update, time_format) = DATE_FORMAT(NOW(), time_format) ) "
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
                                         . implode(', ', array_map('intval', $ids))
157 157
                                         . ')')
158 158
                   . '        '
159
-                  . (empty($_types) ? '' : 'AND stats_type IN (' . implode(', ', $_types) . ')')
159
+                  . (empty($_types) ? '' : 'AND stats_type IN ('.implode(', ', $_types).')')
160 160
                   . '        '
161
-                  . (empty($_periods) ? '' : 'AND stats_period IN (' . implode(', ', $_periods) . ')');
161
+                  . (empty($_periods) ? '' : 'AND stats_period IN ('.implode(', ', $_periods).')');
162 162
         $result = $this->db->query($sql);
163 163
 
164 164
         while (false !== ($row = $this->db->fetchArray($result))) {
@@ -170,36 +170,36 @@  discard block
 block discarded – undo
170 170
 
171 171
     public function reset()
172 172
     {
173
-        $this->db->queryF('TRUNCATE TABLE ' . $this->table);
173
+        $this->db->queryF('TRUNCATE TABLE '.$this->table);
174 174
         $now        = time();
175 175
         $time_start = [
176 176
             'day'   => '%Y%j',
177 177
             'week'  => '%Y%u',
178 178
             'month' => '%Y%m'
179 179
         ];
180
-        $counts     = [];
180
+        $counts = [];
181 181
 
182
-        $sql = '    SELECT forum_id' . '    FROM ' . $this->db->prefix('newbb_forums');
182
+        $sql = '    SELECT forum_id'.'    FROM '.$this->db->prefix('newbb_forums');
183 183
         $ret = $this->db->query($sql);
184 184
         while (false !== (list($forum_id) = $this->db->fetchRow($ret))) {
185
-            $sql    = '    SELECT COUNT(*), SUM(topic_views)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND forum_id = {$forum_id}";
185
+            $sql    = '    SELECT COUNT(*), SUM(topic_views)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND forum_id = {$forum_id}";
186 186
             $result = $this->db->query($sql);
187 187
             list($topics, $views) = $this->db->fetchRow($result);
188 188
             $this->update($forum_id, 'topic', $topics);
189 189
             $this->update($forum_id, 'view', $views);
190 190
 
191
-            $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}";
191
+            $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}";
192 192
             $result = $this->db->query($sql);
193 193
             list($digests) = $this->db->fetchRow($result);
194 194
             $this->update($forum_id, 'digest', $digests);
195 195
 
196
-            $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_posts') . "    WHERE approved=1 AND forum_id = {$forum_id}";
196
+            $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_posts')."    WHERE approved=1 AND forum_id = {$forum_id}";
197 197
             $result = $this->db->query($sql);
198 198
             list($posts) = $this->db->fetchRow($result);
199 199
             $this->update($forum_id, 'post', $posts);
200 200
 
201 201
             foreach ($time_start as $period => $format) {
202
-                $sql    = '    SELECT COUNT(*), SUM(topic_views)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
202
+                $sql    = '    SELECT COUNT(*), SUM(topic_views)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(topic_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
203 203
                 $result = $this->db->query($sql);
204 204
                 list($topics, $views) = $this->db->fetchRow($result);
205 205
                 $views = empty($views) ? 0 : $views; // null check
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 @$counts['topic'][$period] += $topics;
223 223
                 @$counts['view'][$period] += $views;
224 224
 
225
-                $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_topics') . "    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
225
+                $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_topics')."    WHERE approved=1 AND topic_digest >0 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(digest_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
226 226
                 $result = $this->db->query($sql);
227 227
                 list($digests) = $this->db->fetchRow($result);
228 228
                 $this->db->queryF("    INSERT INTO {$this->table}"
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                                   . "', NOW(), '{$format}')");
236 236
                 @$counts['digest'][$period] += $digests;
237 237
 
238
-                $sql    = '    SELECT COUNT(*)' . '    FROM ' . $this->db->prefix('newbb_posts') . "    WHERE approved=1 AND forum_id = {$forum_id}" . "        AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
238
+                $sql    = '    SELECT COUNT(*)'.'    FROM '.$this->db->prefix('newbb_posts')."    WHERE approved=1 AND forum_id = {$forum_id}"."        AND FROM_UNIXTIME(post_time, '{$format}') >= FROM_UNIXTIME({$now}, '{$format}')";
239 239
                 $result = $this->db->query($sql);
240 240
                 list($posts) = $this->db->fetchRow($result);
241 241
                 $this->db->queryF("    INSERT INTO {$this->table}"
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             }
251 251
         }
252 252
 
253
-        $this->db->queryF("    DELETE FROM {$this->table}" . "    WHERE stats_id = '0' AND stats_period <> " . array_search('total', $this->param['period'], true));
253
+        $this->db->queryF("    DELETE FROM {$this->table}"."    WHERE stats_id = '0' AND stats_period <> ".array_search('total', $this->param['period'], true));
254 254
         foreach ($time_start as $period => $format) {
255 255
             foreach (array_keys($counts) as $type) {
256 256
                 $this->db->queryF("    INSERT INTO {$this->table}"
Please login to merge, or discard this patch.
class/ForumHandler.php 1 patch
Spacing   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
             return $_cachedForums;
101 101
         }
102 102
 
103
-        $criteria = new \CriteriaCompo(new \Criteria('forum_id', '(' . implode(', ', $valid_ids) . ')', 'IN'));
103
+        $criteria = new \CriteriaCompo(new \Criteria('forum_id', '('.implode(', ', $valid_ids).')', 'IN'));
104 104
         if (is_numeric($cat) && $cat > 0) {
105 105
             $criteria->add(new \Criteria('cat_id', (int)$cat));
106 106
         } elseif (is_array($cat) && count($cat) > 0) {
107
-            $criteria->add(new \Criteria('cat_id', '(' . implode(', ', $cat) . ')', 'IN'));
107
+            $criteria->add(new \Criteria('cat_id', '('.implode(', ', $cat).')', 'IN'));
108 108
         }
109 109
         $criteria->setSort('forum_order');
110 110
         $criteria->setOrder('ASC');
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
         $topic_lastread = newbbGetCookie('LT', true);
182 182
         $criteria_forum = '';
183 183
         if (is_object($forum)) {
184
-            $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id');
184
+            $criteria_forum = ' AND t.forum_id = '.$forum->getVar('forum_id');
185 185
             $hot_threshold  = $forum->getVar('hot_threshold');
186 186
         } else {
187 187
             $hot_threshold = 10;
188 188
             if (is_array($forum) && count($forum) > 0) {
189
-                $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')';
189
+                $criteria_forum = ' AND t.forum_id IN ('.implode(',', array_keys($forum)).')';
190 190
             } elseif (!empty($forum)) {
191
-                $criteria_forum = ' AND t.forum_id =' . (int)$forum;
191
+                $criteria_forum = ' AND t.forum_id ='.(int)$forum;
192 192
             }
193 193
         }
194 194
 
195
-        $criteria_post    = $startdate ? ' p.post_time > ' . $startdate : ' 1 = 1 ';
195
+        $criteria_post    = $startdate ? ' p.post_time > '.$startdate : ' 1 = 1 ';
196 196
         $criteria_topic   = empty($type) ? '' : " AND t.type_id={$type}";
197 197
         $criteria_extra   = '';
198 198
         $criteria_approve = ' AND t.approved = 1';
199 199
         $post_on          = ' p.post_id = t.topic_last_post_id';
200
-        $leftjoin         = ' LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.post_id = t.topic_last_post_id';
200
+        $leftjoin         = ' LEFT JOIN '.$this->db->prefix('newbb_posts').' p ON p.post_id = t.topic_last_post_id';
201 201
         $sort_array       = [];
202 202
         switch ($status) {
203 203
             case 'digest':
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                     // START irmtfan use read_uid to find the unread posts when the user is logged in
215 215
                     $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
216 216
                     if (!empty($read_uid)) {
217
-                        $leftjoin      .= ' LEFT JOIN ' . $this->db->prefix('newbb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' ';
217
+                        $leftjoin      .= ' LEFT JOIN '.$this->db->prefix('newbb_reads_topic').' r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' ';
218 218
                         $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)';
219 219
                     } else {
220 220
                     }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 } elseif (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) {
223 223
                     // START irmtfan fix read_mode = 1 bugs - for all users (member and anon)
224 224
                     if ($time_criterion = max($GLOBALS['last_visit'], $startdate)) {
225
-                        $criteria_post  = ' p.post_time > ' . $time_criterion; // for all users
225
+                        $criteria_post  = ' p.post_time > '.$time_criterion; // for all users
226 226
                         $topics         = [];
227 227
                         $topic_lastread = newbbGetCookie('LT', true);
228 228
                         if (count($topic_lastread) > 0) {
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
                             }
234 234
                         }
235 235
                         if (count($topics) > 0) {
236
-                            $criteria_extra = ' AND t.topic_id NOT IN (' . implode(',', $topics) . ')';
236
+                            $criteria_extra = ' AND t.topic_id NOT IN ('.implode(',', $topics).')';
237 237
                         }
238 238
                     }
239 239
                     // END irmtfan fix read_mode = 1 bugs - for all users (member and anon)
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
                 break;
242 242
             case 'pending':
243 243
                 $post_on          = ' p.topic_id = t.topic_id';
244
-                $criteria_post    .= ' AND p.pid = 0';
244
+                $criteria_post .= ' AND p.pid = 0';
245 245
                 $criteria_approve = ' AND t.approved = 0';
246 246
                 break;
247 247
 
@@ -255,31 +255,31 @@  discard block
 block discarded – undo
255 255
 
256 256
             default:
257 257
                 if ($startdate > 0) {
258
-                    $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)';
258
+                    $criteria_post = ' (p.post_time > '.$startdate.' OR t.topic_sticky=1)';
259 259
                 }
260 260
                 $sort_array[] = 't.topic_sticky DESC';
261 261
                 break;
262 262
         }
263 263
 
264
-        $select = 't.*, ' . ' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid';
265
-        $from   = $this->db->prefix('newbb_topics') . ' t ' . $leftjoin;
266
-        $where  = $criteria_post . $criteria_topic . $criteria_forum . $criteria_extra . $criteria_approve;
264
+        $select = 't.*, '.' p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid';
265
+        $from   = $this->db->prefix('newbb_topics').' t '.$leftjoin;
266
+        $where  = $criteria_post.$criteria_topic.$criteria_forum.$criteria_extra.$criteria_approve;
267 267
 
268 268
         if ($excerpt) {
269 269
             $select .= ', p.post_karma, p.require_reply, pt.post_text';
270
-            $from   .= ' LEFT JOIN ' . $this->db->prefix('newbb_posts_text') . ' pt ON pt.post_id = t.topic_last_post_id';
270
+            $from   .= ' LEFT JOIN '.$this->db->prefix('newbb_posts_text').' pt ON pt.post_id = t.topic_last_post_id';
271 271
         }
272 272
         if ('u.uname' === $sort) {
273 273
             $sort = 't.topic_poster';
274 274
         }
275 275
 
276
-        $sort_array[] = trim($sort . ' ' . $order);
276
+        $sort_array[] = trim($sort.' '.$order);
277 277
         $sortby       = implode(', ', array_filter($sort_array));
278 278
         if (empty($sortby)) {
279 279
             $sortby = 't.topic_last_post_id DESC';
280 280
         }
281 281
 
282
-        $sql = 'SELECT ' . $select . ' FROM ' . $from . ' WHERE ' . $where . ' ORDER BY ' . $sortby;
282
+        $sql = 'SELECT '.$select.' FROM '.$from.' WHERE '.$where.' ORDER BY '.$sortby;
283 283
 
284 284
         if (!$result = $this->db->query($sql, $GLOBALS['xoopsModuleConfig']['topics_per_page'], $start)) {
285 285
             redirect_header('index.php', 2, _MD_NEWBB_ERROROCCURED);
@@ -304,16 +304,16 @@  discard block
 block discarded – undo
304 304
 
305 305
             if ($myrow['topic_haspoll']) {
306 306
                 if ($myrow['topic_sticky']) {
307
-                    $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY) . '<br>' . newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL);
307
+                    $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY).'<br>'.newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL);
308 308
                 } else {
309 309
                     $topic_icon = newbbDisplayImage('poll', _MD_NEWBB_TOPICHASPOLL);
310 310
                 }
311 311
             } elseif ($myrow['topic_sticky']) {
312 312
                 $topic_icon = newbbDisplayImage('topic_sticky', _MD_NEWBB_TOPICSTICKY);
313 313
             } elseif (!empty($myrow['icon'])) {
314
-                $topic_icon = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />';
314
+                $topic_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon']).'" alt="" />';
315 315
             } else {
316
-                $topic_icon = '<img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
316
+                $topic_icon = '<img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
317 317
             }
318 318
 
319 319
             // ------------------------------------------------------
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             if ($rating < 1) {
324 324
                 $rating_img = newbbDisplayImage('blank');
325 325
             } else {
326
-                $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating));
326
+                $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating));
327 327
             }
328 328
             // ------------------------------------------------------
329 329
             // topic_page_jump
@@ -332,28 +332,28 @@  discard block
 block discarded – undo
332 332
             $totalpages           = ceil(($myrow['topic_replies'] + 1) / $GLOBALS['xoopsModuleConfig']['posts_per_page']);
333 333
             if ($totalpages > 1) {
334 334
                 $topic_page_jump .= '&nbsp;&nbsp;';
335
-                $append          = false;
335
+                $append = false;
336 336
                 for ($i = 1; $i <= $totalpages; ++$i) {
337 337
                     if ($i > 3 && $i < $totalpages) {
338 338
                         if (!$append) {
339 339
                             $topic_page_jump .= '...';
340
-                            $append          = true;
340
+                            $append = true;
341 341
                         }
342 342
                     } else {
343
-                        $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;start=' . (($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']) . '">' . $i . '</a>]';
343
+                        $topic_page_jump .= '[<a href="'.XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;start='.(($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']).'">'.$i.'</a>]';
344 344
                         // irmtfan remove here and move
345 345
                         //$topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?post_id=" . $myrow['post_id'] . "&amp;start=" . (($i - 1) * $GLOBALS['xoopsModuleConfig']['posts_per_page']) . "'>" . newbbDisplayImage('lastposticon',_MD_NEWBB_GOTOLASTPOST) . '</a>';
346 346
                     }
347 347
                 }
348 348
             }
349 349
             // irmtfan - move here for both topics with and without pages
350
-            $topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $myrow['post_id'] . "'>" . newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>';
350
+            $topic_page_jump_icon = "<a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$myrow['post_id']."'>".newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST).'</a>';
351 351
 
352 352
             // ------------------------------------------------------
353 353
             // => topic array
354 354
             $forum_link = '';
355 355
             if (!empty($viewAllForums[$myrow['forum_id']])) {
356
-                $forum_link = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $myrow['forum_id'] . '">' . $viewAllForums[$myrow['forum_id']]['forum_name'] . '</a>';
356
+                $forum_link = '<a href="'.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$myrow['forum_id'].'">'.$viewAllForums[$myrow['forum_id']]['forum_name'].'</a>';
357 357
             }
358 358
 
359 359
             $topic_title = $myts->htmlSpecialChars($myrow['topic_title']);
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
             //$topic_title = '<span style="color:'.$typen[$myrow["type_id"]]["type_color"].'">['.$typen[$myrow["type_id"]]["type_name"].']</span> '.$topic_title.'';
363 363
             //}
364 364
             if ($myrow['topic_digest']) {
365
-                $topic_title = "<span class='digest'>" . $topic_title . '</span>';
365
+                $topic_title = "<span class='digest'>".$topic_title.'</span>';
366 366
             }
367 367
 
368 368
             if (0 == $excerpt) {
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
                 //'type_text'                 => $topic_prefix,/*irmtfan remove here and move to for loop*/
382 382
                 'topic_title'          => $topic_title,
383 383
                 //'topic_link'                => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'],
384
-                'topic_link'           => 'viewtopic.php?topic_id=' . $myrow['topic_id'],
384
+                'topic_link'           => 'viewtopic.php?topic_id='.$myrow['topic_id'],
385 385
                 'rating_img'           => $rating_img,
386 386
                 'topic_page_jump'      => $topic_page_jump,
387 387
                 'topic_page_jump_icon' => $topic_page_jump_icon,
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
         } // irmtfan end for loop
457 457
         // END irmtfan move to a for loop
458 458
         if (count($topics) > 0) {
459
-            $sql = ' SELECT DISTINCT topic_id FROM ' . $this->db->prefix('newbb_posts') . " WHERE attachment != ''" . ' AND topic_id IN (' . implode(',', array_keys($topics)) . ')';
459
+            $sql = ' SELECT DISTINCT topic_id FROM '.$this->db->prefix('newbb_posts')." WHERE attachment != ''".' AND topic_id IN ('.implode(',', array_keys($topics)).')';
460 460
             if ($result = $this->db->query($sql)) {
461 461
                 while (false !== (list($topic_id) = $this->db->fetchRow($result))) {
462
-                    $topics[$topic_id]['attachment'] = '&nbsp;' . newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT);
462
+                    $topics[$topic_id]['attachment'] = '&nbsp;'.newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT);
463 463
                 }
464 464
             }
465 465
         }
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
 
480 480
         $criteria_extra   = '';
481 481
         $criteria_approve = ' AND t.approved = 1'; // any others?
482
-        $leftjoin         = ' LEFT JOIN ' . $this->db->prefix('newbb_posts') . ' p ON p.post_id = t.topic_last_post_id';
483
-        $criteria_post    = ' p.post_time > ' . $startdate;
482
+        $leftjoin         = ' LEFT JOIN '.$this->db->prefix('newbb_posts').' p ON p.post_id = t.topic_last_post_id';
483
+        $criteria_post    = ' p.post_time > '.$startdate;
484 484
         switch ($type) {
485 485
             case 'digest':
486 486
                 $criteria_extra = ' AND topic_digest = 1';
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 
496 496
                     $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
497 497
                     if (!empty($read_uid)) {
498
-                        $leftjoin      .= ' LEFT JOIN ' . $this->db->prefix('newbb_reads_topic') . ' r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' ';
498
+                        $leftjoin      .= ' LEFT JOIN '.$this->db->prefix('newbb_reads_topic').' r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' ';
499 499
                         $criteria_post .= ' AND (r.read_id IS NULL OR r.post_id < t.topic_last_post_id)';
500 500
                     } else {
501 501
                     }
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                 } elseif (1 == $GLOBALS['xoopsModuleConfig']['read_mode']) {
504 504
                     // START irmtfan fix read_mode = 1 bugs - for all users (member and anon)
505 505
                     if ($time_criterion = max($GLOBALS['last_visit'], $startdate)) {
506
-                        $criteria_post  = ' p.post_time > ' . $time_criterion; // for all users
506
+                        $criteria_post  = ' p.post_time > '.$time_criterion; // for all users
507 507
                         $topics         = [];
508 508
                         $topic_lastread = newbbGetCookie('LT', true);
509 509
                         if (count($topic_lastread) > 0) {
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
                             }
515 515
                         }
516 516
                         if (count($topics) > 0) {
517
-                            $criteria_extra = ' AND t.topic_id NOT IN (' . implode(',', $topics) . ')';
517
+                            $criteria_extra = ' AND t.topic_id NOT IN ('.implode(',', $topics).')';
518 518
                         }
519 519
                     }
520 520
                     // END irmtfan fix read_mode = 1 bugs - for all users (member and anon)
@@ -529,22 +529,22 @@  discard block
 block discarded – undo
529 529
             case 'all':
530 530
                 break;
531 531
             default:
532
-                $criteria_post = ' (p.post_time > ' . $startdate . ' OR t.topic_sticky=1)';
532
+                $criteria_post = ' (p.post_time > '.$startdate.' OR t.topic_sticky=1)';
533 533
                 break;
534 534
         }
535 535
         $criteria_forum = '';
536 536
         if (is_object($forum)) {
537
-            $criteria_forum = ' AND t.forum_id = ' . $forum->getVar('forum_id');
537
+            $criteria_forum = ' AND t.forum_id = '.$forum->getVar('forum_id');
538 538
         } else {
539 539
             if (is_array($forum) && count($forum) > 0) {
540
-                $criteria_forum = ' AND t.forum_id IN (' . implode(',', array_keys($forum)) . ')';
540
+                $criteria_forum = ' AND t.forum_id IN ('.implode(',', array_keys($forum)).')';
541 541
             } elseif (!empty($forum)) {
542
-                $criteria_forum = ' AND t.forum_id =' . (int)$forum;
542
+                $criteria_forum = ' AND t.forum_id ='.(int)$forum;
543 543
             }
544 544
         }
545 545
 
546
-        $sql = 'SELECT COUNT(*) AS count FROM ' . $this->db->prefix('newbb_topics') . ' t ' . $leftjoin;
547
-        $sql .= ' WHERE ' . $criteria_post . $criteria_forum . $criteria_extra . $criteria_approve;
546
+        $sql = 'SELECT COUNT(*) AS count FROM '.$this->db->prefix('newbb_topics').' t '.$leftjoin;
547
+        $sql .= ' WHERE '.$criteria_post.$criteria_forum.$criteria_extra.$criteria_approve;
548 548
         if (!$result = $this->db->query($sql)) {
549 549
             //xoops_error($this->db->error().'<br>'.$sql);
550 550
             return null;
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             return true;
573 573
         }
574 574
 
575
-        require_once __DIR__ . '/../include/functions.user.php';
575
+        require_once __DIR__.'/../include/functions.user.php';
576 576
         if (newbbIsAdmin($forum)) {
577 577
             return true;
578 578
         }
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
                     "        OR parent_forum = forum_id";
674 674
         */
675 675
         $criteria = new \CriteriaCompo();
676
-        $criteria->add(new \Criteria('parent_forum', '(' . implode(', ', $forum_ids) . ')', 'NOT IN'), 'AND');
676
+        $criteria->add(new \Criteria('parent_forum', '('.implode(', ', $forum_ids).')', 'NOT IN'), 'AND');
677 677
         $criteria->add(new \Criteria('parent_forum', '`forum_id`', '='), 'OR');
678 678
         $b1 = $this->updateAll('parent_forum', 0, $criteria, true);
679 679
         // check cat_id orphan forums
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
             return false;
684 684
         }
685 685
         $criteria = new \CriteriaCompo();
686
-        $criteria->add(new \Criteria('cat_id', '(' . implode(', ', $cat_ids) . ')', 'NOT IN'), 'AND');
686
+        $criteria->add(new \Criteria('cat_id', '('.implode(', ', $cat_ids).')', 'NOT IN'), 'AND');
687 687
         $b2 = $this->updateAll('cat_id', $cat_ids[0], $criteria, true);
688 688
 
689 689
         return ($b1 && $b2);
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
         if (!$object->getVar('forum_id')) {
718 718
             return false;
719 719
         }
720
-        $sql = 'SELECT MAX(post_id) AS last_post, COUNT(*) AS total FROM ' . $this->db->prefix('newbb_posts') . ' AS p LEFT JOIN  ' . $this->db->prefix('newbb_topics') . ' AS t ON p.topic_id=t.topic_id WHERE p.approved=1 AND t.approved=1 AND p.forum_id = ' . $object->getVar('forum_id');
720
+        $sql = 'SELECT MAX(post_id) AS last_post, COUNT(*) AS total FROM '.$this->db->prefix('newbb_posts').' AS p LEFT JOIN  '.$this->db->prefix('newbb_topics').' AS t ON p.topic_id=t.topic_id WHERE p.approved=1 AND t.approved=1 AND p.forum_id = '.$object->getVar('forum_id');
721 721
 
722 722
         if ($result = $this->db->query($sql)) {
723 723
             $last_post = 0;
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
             }
735 735
         }
736 736
 
737
-        $sql = 'SELECT COUNT(*) AS total FROM ' . $this->db->prefix('newbb_topics') . ' WHERE approved=1 AND forum_id = ' . $object->getVar('forum_id');
737
+        $sql = 'SELECT COUNT(*) AS total FROM '.$this->db->prefix('newbb_topics').' WHERE approved=1 AND forum_id = '.$object->getVar('forum_id');
738 738
         if ($result = $this->db->query($sql)) {
739 739
             if ($row = $this->db->fetchArray($result)) {
740 740
                 if ($object->getVar('forum_topics') !== $row['total']) {
@@ -776,7 +776,7 @@  discard block
 block discarded – undo
776 776
         if (!$forums_id) {
777 777
             return $stats;
778 778
         }
779
-        $sql = '    SELECT forum_posts AS posts, forum_topics AS topics, forum_id AS id' . '    FROM ' . $this->table . '    WHERE forum_id IN (' . implode(', ', $forums_id) . ')';
779
+        $sql = '    SELECT forum_posts AS posts, forum_topics AS topics, forum_id AS id'.'    FROM '.$this->table.'    WHERE forum_id IN ('.implode(', ', $forums_id).')';
780 780
         if (!$result = $this->db->query($sql)) {
781 781
             return $stats;
782 782
         }
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
             if (!empty($length_title_index)) {
822 822
                 $tags_post[] = 'subject';
823 823
             }
824
-            $posts = $postHandler->getAll(new \Criteria('post_id', '(' . implode(', ', $posts) . ')', 'IN'), $tags_post, false);
824
+            $posts = $postHandler->getAll(new \Criteria('post_id', '('.implode(', ', $posts).')', 'IN'), $tags_post, false);
825 825
         }
826 826
 
827 827
         // Get topic/post stats per forum
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
         $topics = [];
837 837
 
838 838
         foreach (array_keys($forums) as $id) {
839
-            $forum =& $forums[$id];
839
+            $forum = & $forums[$id];
840 840
 
841 841
             if (!$forum['forum_last_post_id']) {
842 842
                 continue;
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
         $name_anonymous = $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']);
869 869
 
870 870
         foreach (array_keys($forums) as $id) {
871
-            $forum =& $forums[$id];
871
+            $forum = & $forums[$id];
872 872
 
873 873
             $_forum_data                 = [];
874 874
             $_forum_data['forum_order']  = $forum['forum_order'];
@@ -891,7 +891,7 @@  discard block
 block discarded – undo
891 891
 
892 892
             // irmtfan change if/endif to if{} method
893 893
             if ($post_id = $forum['forum_last_post_id']) {
894
-                $post                               =& $posts[$post_id];
894
+                $post                               = & $posts[$post_id];
895 895
                 $_forum_data['forum_lastpost_id']   = $post_id;
896 896
                 $_forum_data['forum_lastpost_time'] = newbbFormatTimestamp($post['post_time']);
897 897
                 if (!empty($users_linked[$post['uid']])) {
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
         }
948 948
         $forumsObject = $this->getByPermission($cat_id, $perm_string, $tags);
949 949
 
950
-        require_once __DIR__ . '/tree.php';
950
+        require_once __DIR__.'/tree.php';
951 951
         $forums_structured = [];
952 952
         foreach (array_keys($forumsObject) as $key) {
953 953
             $forums_structured[$forumsObject[$key]->getVar('cat_id')][$key] = $forumsObject[$key];
@@ -983,10 +983,10 @@  discard block
 block discarded – undo
983 983
         }
984 984
         $forumsObject = $this->getByPermission($cat_id, $perm_string, $tags);
985 985
 
986
-        require_once __DIR__ . '/tree.php';
986
+        require_once __DIR__.'/tree.php';
987 987
         $forums_structured = [];
988 988
         foreach (array_keys($forumsObject) as $key) {
989
-            $forumObject                                             =& $forumsObject[$key];
989
+            $forumObject                                             = & $forumsObject[$key];
990 990
             $forums_structured[$forumObject->getVar('cat_id')][$key] = $forumsObject[$key];
991 991
         }
992 992
         foreach (array_keys($forums_structured) as $cid) {
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
         if (!$parents = newbbGetParentForum($object->getVar('forum_id'))) {
1014 1014
             return $ret;
1015 1015
         }
1016
-        $parents_list = $this->getList(new \Criteria('forum_id', '(' . implode(', ', $parents) . ')', 'IN'));
1016
+        $parents_list = $this->getList(new \Criteria('forum_id', '('.implode(', ', $parents).')', 'IN'));
1017 1017
         foreach ($parents as $key => $id) {
1018 1018
             $ret[] = ['forum_id' => $id, 'forum_name' => $parents_list[$id]];
1019 1019
         }
Please login to merge, or discard this patch.
class/Topic.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     // irmtfan add LAST_INSERT_ID to enhance the mysql performances
54 54
     public function incrementCounter()
55 55
     {
56
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_topics') . ' SET topic_views = LAST_INSERT_ID(topic_views + 1) WHERE topic_id =' . $this->getVar('topic_id');
56
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_topics').' SET topic_views = LAST_INSERT_ID(topic_views + 1) WHERE topic_id ='.$this->getVar('topic_id');
57 57
         $GLOBALS['xoopsDB']->queryF($sql);
58 58
     }
59 59
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             return $topic_title;
75 75
         }
76 76
 
77
-        require_once __DIR__ . '/../include/functions.topic.php';
77
+        require_once __DIR__.'/../include/functions.topic.php';
78 78
 
79 79
         return getTopicTitle($topic_title, $typeObject->getVar('type_name'), $typeObject->getVar('type_color'));
80 80
     }
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
             /** @var \XoopsPoll $poll */
155 155
             $poll = new $classPoll($poll_id);
156 156
             if (false !== $poll->delete()) {
157
-                $classOption = $classPoll . 'Option';
157
+                $classOption = $classPoll.'Option';
158 158
                 $classOption::deleteByPollId($poll->getVar('poll_id'));
159
-                $classLog = $classPoll . 'Log';
159
+                $classLog = $classPoll.'Log';
160 160
                 $classLog::deleteByPollId($poll->getVar('poll_id'));
161 161
                 xoops_comment_delete($GLOBALS['xoopsModule']->getVar('mid'), $poll->getVar('poll_id'));
162 162
             }
Please login to merge, or discard this patch.
class/OnlineHandler.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
17 17
 
18
-require_once __DIR__ . '/../include/functions.config.php';
18
+require_once __DIR__.'/../include/functions.config.php';
19 19
 
20 20
 /**
21 21
  * Class OnlineHandler
@@ -96,8 +96,8 @@  discard block
 block discarded – undo
96 96
      */
97 97
     public function render(\Smarty $xoopsTpl)
98 98
     {
99
-        require_once __DIR__ . '/../include/functions.render.php';
100
-        require_once __DIR__ . '/../include/functions.user.php';
99
+        require_once __DIR__.'/../include/functions.render.php';
100
+        require_once __DIR__.'/../include/functions.user.php';
101 101
         $criteria = null;
102 102
         if ($this->topic_id) {
103 103
             $criteria = new \Criteria('online_topic', $this->topic_id);
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             }
117 117
             $users_id[]                             = $users[$i]['online_uid'];
118 118
             $users_online[$users[$i]['online_uid']] = [
119
-                'link'  => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'],
119
+                'link'  => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'],
120 120
                 'uname' => $users[$i]['online_uname']
121 121
             ];
122 122
             ++$num_user;
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function showOnline()
157 157
     {
158
-        require_once __DIR__ . '/../include/functions.render.php';
159
-        require_once __DIR__ . '/../include/functions.user.php';
158
+        require_once __DIR__.'/../include/functions.render.php';
159
+        require_once __DIR__.'/../include/functions.user.php';
160 160
         $criteria = null;
161 161
         if ($this->topic_id) {
162 162
             $criteria = new \Criteria('online_topic', $this->topic_id);
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             }
176 176
             $users_id[]                             = $users[$i]['online_uid'];
177 177
             $users_online[$users[$i]['online_uid']] = [
178
-                'link'  => XOOPS_URL . '/userinfo.php?uid=' . $users[$i]['online_uid'],
178
+                'link'  => XOOPS_URL.'/userinfo.php?uid='.$users[$i]['online_uid'],
179 179
                 'uname' => $users[$i]['online_uname']
180 180
             ];
181 181
             ++$num_user;
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
 
230 230
         $uid = (int)$uid;
231 231
         if ($uid > 0) {
232
-            $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid;
232
+            $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid;
233 233
         } else {
234
-            $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_uid=' . $uid . " AND online_ip='" . $ip . "'";
234
+            $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online').' WHERE online_uid='.$uid." AND online_ip='".$ip."'";
235 235
         }
236 236
         list($count) = $this->db->fetchRow($this->db->queryF($sql));
237 237
         if ($count > 0) {
238
-            $sql = 'UPDATE ' . $this->db->prefix('newbb_online') . " SET online_updated= '" . $time . "', online_forum = '" . $forum_id . "', online_topic = '" . $topic_id . "' WHERE online_uid = " . $uid;
238
+            $sql = 'UPDATE '.$this->db->prefix('newbb_online')." SET online_updated= '".$time."', online_forum = '".$forum_id."', online_topic = '".$topic_id."' WHERE online_uid = ".$uid;
239 239
             if (0 == $uid) {
240
-                $sql .= " AND online_ip='" . $ip . "'";
240
+                $sql .= " AND online_ip='".$ip."'";
241 241
             }
242 242
         } else {
243 243
             $sql = sprintf('INSERT INTO `%s` (online_uid, online_uname, online_updated, online_ip, online_forum, online_topic) VALUES (%u, %s, %u, %s, %u, %u)', $this->db->prefix('newbb_online'), $uid, $this->db->quote($uname), $time, $this->db->quote($ip), $forum_id, $topic_id);
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
     public function gc($expire)
284 284
     {
285 285
         global $xoopsModule;
286
-        $sql = 'DELETE FROM ' . $this->db->prefix('newbb_online') . ' WHERE online_updated < ' . (time() - (int)$expire);
286
+        $sql = 'DELETE FROM '.$this->db->prefix('newbb_online').' WHERE online_updated < '.(time() - (int)$expire);
287 287
         $this->db->queryF($sql);
288 288
 
289 289
         $xoops_onlineHandler = xoops_getHandler('online');
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
     {
301 301
         $ret   = [];
302 302
         $limit = $start = 0;
303
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('newbb_online');
303
+        $sql   = 'SELECT * FROM '.$this->db->prefix('newbb_online');
304 304
         if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
305
-            $sql   .= ' ' . $criteria->renderWhere();
305
+            $sql .= ' '.$criteria->renderWhere();
306 306
             $limit = $criteria->getLimit();
307 307
             $start = $criteria->getStart();
308 308
         }
@@ -333,9 +333,9 @@  discard block
 block discarded – undo
333 333
         if (!empty($this->user_ids)) {
334 334
             $online_users = $this->user_ids;
335 335
         } else {
336
-            $sql = 'SELECT online_uid FROM ' . $this->db->prefix('newbb_online');
336
+            $sql = 'SELECT online_uid FROM '.$this->db->prefix('newbb_online');
337 337
             if (!empty($uids)) {
338
-                $sql .= ' WHERE online_uid IN (' . implode(', ', array_map('intval', $uids)) . ')';
338
+                $sql .= ' WHERE online_uid IN ('.implode(', ', array_map('intval', $uids)).')';
339 339
             }
340 340
 
341 341
             $result = $this->db->query($sql);
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
      */
364 364
     public function getCount(\CriteriaElement $criteria = null)
365 365
     {
366
-        $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_online');
366
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_online');
367 367
         if (is_object($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
368
-            $sql .= ' ' . $criteria->renderWhere();
368
+            $sql .= ' '.$criteria->renderWhere();
369 369
         }
370 370
         if (!$result = $this->db->query($sql)) {
371 371
             return false;
Please login to merge, or discard this patch.
class/ReadForumHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
 use XoopsModules\Newbb;
34 34
 
35
-require_once __DIR__ . '/read.php';
35
+require_once __DIR__.'/read.php';
36 36
 
37 37
 /**
38 38
  * A handler for read/unread handling
Please login to merge, or discard this patch.
class/TopicRenderer.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
                     // START irmtfan use read_uid to find the unread posts when the user is logged in
235 235
                     $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
236 236
                     if (!empty($read_uid)) {
237
-                        $this->query['join'][]  = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_reads_topic') . ' AS r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' ';
237
+                        $this->query['join'][]  = 'LEFT JOIN '.$this->handler->db->prefix('newbb_reads_topic').' AS r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' ';
238 238
                         $this->query['where'][] = 'r.post_id = t.topic_last_post_id';
239 239
                     } else {
240 240
                     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                     if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) {
247 247
                         $readmode1query = '';
248 248
                         if ($lastvisit > $startdate) {
249
-                            $readmode1query = 'p.post_time < ' . $lastvisit;
249
+                            $readmode1query = 'p.post_time < '.$lastvisit;
250 250
                         }
251 251
                         $topics         = [];
252 252
                         $topic_lastread = newbbGetCookie('LT', true);
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
                             }
259 259
                         }
260 260
                         if (count($topics) > 0) {
261
-                            $topicquery = ' t.topic_id IN (' . implode(',', $topics) . ')';
261
+                            $topicquery = ' t.topic_id IN ('.implode(',', $topics).')';
262 262
                             // because it should be OR
263
-                            $readmode1query = !empty($readmode1query) ? '(' . $readmode1query . ' OR ' . $topicquery . ')' : $topicquery;
263
+                            $readmode1query = !empty($readmode1query) ? '('.$readmode1query.' OR '.$topicquery.')' : $topicquery;
264 264
                         }
265 265
                         $this->query['where'][] = $readmode1query;
266 266
                     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                     // START irmtfan use read_uid to find the unread posts when the user is logged in
277 277
                     $read_uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
278 278
                     if (!empty($read_uid)) {
279
-                        $this->query['join'][]  = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_reads_topic') . ' AS r ON r.read_item = t.topic_id AND r.uid = ' . $read_uid . ' ';
279
+                        $this->query['join'][]  = 'LEFT JOIN '.$this->handler->db->prefix('newbb_reads_topic').' AS r ON r.read_item = t.topic_id AND r.uid = '.$read_uid.' ';
280 280
                         $this->query['where'][] = '(r.read_id IS NULL OR r.post_id < t.topic_last_post_id)';
281 281
                     } else {
282 282
                     }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
                     $startdate = !empty($this->vars['since']) ? (time() - newbbGetSinceTime($this->vars['since'])) : 0;
288 288
                     if ($lastvisit = max($GLOBALS['last_visit'], $startdate)) {
289 289
                         if ($lastvisit > $startdate) {
290
-                            $this->query['where'][] = 'p.post_time > ' . $lastvisit;
290
+                            $this->query['where'][] = 'p.post_time > '.$lastvisit;
291 291
                         }
292 292
                         $topics         = [];
293 293
                         $topic_lastread = newbbGetCookie('LT', true);
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                             }
300 300
                         }
301 301
                         if (count($topics) > 0) {
302
-                            $this->query['where'][] = ' t.topic_id NOT IN (' . implode(',', $topics) . ')';
302
+                            $this->query['where'][] = ' t.topic_id NOT IN ('.implode(',', $topics).')';
303 303
                         }
304 304
                     }
305 305
                     // END irmtfan fix read_mode = 1 bugs - for all users (member and anon)
@@ -358,20 +358,20 @@  discard block
 block discarded – undo
358 358
                     //} elseif (count($accessForums) === 1) {
359 359
                     //$this->query["where"][] = "t.forum_id = " . $accessForums[0];
360 360
                 } else {
361
-                    $this->query['where'][] = 't.forum_id IN ( ' . implode(', ', $accessForums) . ' )';
361
+                    $this->query['where'][] = 't.forum_id IN ( '.implode(', ', $accessForums).' )';
362 362
                 }
363 363
                 break;
364 364
 
365 365
             case 'uid': // irmtfan add multi topic poster
366 366
                 if (-1 !== $val) {
367 367
                     $val                    = implode(',', array_map('intval', explode(',', $val)));
368
-                    $this->query['where'][] = 't.topic_poster IN ( ' . $val . ' )';
368
+                    $this->query['where'][] = 't.topic_poster IN ( '.$val.' )';
369 369
                 }
370 370
                 break;
371 371
             case 'lastposter': // irmtfan add multi lastposter
372 372
                 if (-1 !== $val) {
373 373
                     $val                    = implode(',', array_map('intval', explode(',', $val)));
374
-                    $this->query['where'][] = 'p.uid IN ( ' . $val . ' )';
374
+                    $this->query['where'][] = 'p.uid IN ( '.$val.' )';
375 375
                 }
376 376
                 break;
377 377
 
@@ -385,17 +385,17 @@  discard block
 block discarded – undo
385 385
                     }
386 386
                     // irmtfan digest_time | to accept multiple status
387 387
                     if (in_array('digest', explode(',', $this->vars['status'], true))) {
388
-                        $this->query['where'][] = 't.digest_time > ' . $startdate;
388
+                        $this->query['where'][] = 't.digest_time > '.$startdate;
389 389
                     }
390 390
                     // irmtfan - should be >= instead of =
391
-                    $this->query['where'][] = 'p.post_time >= ' . $startdate;
391
+                    $this->query['where'][] = 'p.post_time >= '.$startdate;
392 392
                     // END irmtfan if unread && read_mode = 1 and last_visit > startdate do not add where query
393 393
                 }
394 394
                 break;
395 395
 
396 396
             case 'type':
397 397
                 if (!empty($val)) {
398
-                    $this->query['where'][] = 't.type_id = ' . $val;
398
+                    $this->query['where'][] = 't.type_id = '.$val;
399 399
                 }
400 400
                 break;
401 401
 
@@ -414,9 +414,9 @@  discard block
 block discarded – undo
414 414
 
415 415
             case 'sort':
416 416
                 if ($sort = $this->getSort($val, 'sort')) {
417
-                    $this->query['sort'][] = $sort . (empty($this->vars['order']) ? ' DESC' : ' ASC');
417
+                    $this->query['sort'][] = $sort.(empty($this->vars['order']) ? ' DESC' : ' ASC');
418 418
                 } else { // irmtfan if sort is not in the list
419
-                    $this->query['sort'][] = 't.topic_last_post_id' . (empty($this->vars['order']) ? ' DESC' : ' ASC');
419
+                    $this->query['sort'][] = 't.topic_last_post_id'.(empty($this->vars['order']) ? ' DESC' : ' ASC');
420 420
                 }
421 421
                 break;
422 422
 
@@ -487,23 +487,23 @@  discard block
 block discarded – undo
487 487
                 'title' => _MD_NEWBB_VIEWS,
488 488
                 'sort'  => 't.topic_views'
489 489
             ],
490
-            'lastpost'        => [ // irmtfan show topic_page_jump_icon smarty
490
+            'lastpost'        => [// irmtfan show topic_page_jump_icon smarty
491 491
                                    'title' => _MD_NEWBB_LASTPOST,
492 492
                                    /*irmtfan _MD_NEWBB_DATE to _MD_NEWBB_LASTPOSTTIME again change to _MD_LASTPOST*/
493 493
                                    'sort'  => 't.topic_last_post_id'
494 494
             ],
495 495
             // START irmtfan add more sorts
496
-            'lastposttime'    => [ // irmtfan same as lastpost
496
+            'lastposttime'    => [// irmtfan same as lastpost
497 497
                                    'title' => _MD_NEWBB_LASTPOSTTIME,
498 498
                                    'sort'  => 't.topic_last_post_id'
499 499
             ],
500
-            'lastposter'      => [ // irmtfan
500
+            'lastposter'      => [// irmtfan
501 501
                                    'title' => _MD_NEWBB_POSTER,
502
-                                   'sort'  => 'p.uid',// poster uid
502
+                                   'sort'  => 'p.uid', // poster uid
503 503
             ],
504
-            'lastpostmsgicon' => [ // irmtfan
504
+            'lastpostmsgicon' => [// irmtfan
505 505
                                    'title' => _MD_NEWBB_MESSAGEICON,
506
-                                   'sort'  => 'p.icon',// post message icon
506
+                                   'sort'  => 'p.icon', // post message icon
507 507
             ],
508 508
             'ratings'         => [
509 509
                 'title' => _MD_NEWBB_RATINGS,
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                 'sort'  => 't.poll_id'
535 535
             ]
536 536
         ];
537
-        $types   = $this->getTypes();
537
+        $types = $this->getTypes();
538 538
         if (!empty($types)) {
539 539
             $headers['type'] = [
540 540
                 'title' => _MD_NEWBB_TYPE,
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         // additional headers - important: those cannot be in sort anyway
578 578
         $headers = array_merge($headersSort, [
579 579
             'attachment' => _MD_NEWBB_TOPICSHASATT, // show attachment smarty
580
-            'read'       => _MD_NEWBB_MARK_UNREAD . '|' . _MD_NEWBB_MARK_READ, // read/unread show topic_folder smarty
580
+            'read'       => _MD_NEWBB_MARK_UNREAD.'|'._MD_NEWBB_MARK_READ, // read/unread show topic_folder smarty
581 581
             'pagenav'    => _MD_NEWBB_PAGENAV_DISPLAY, // show topic_page_jump smarty - sort by topic_replies?
582 582
         ]);
583 583
 
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      */
594 594
     public function getStatus($type = null, $status = null)
595 595
     {
596
-        $links       = [
596
+        $links = [
597 597
             //""            => "", /* irmtfan remove empty array */
598 598
             'all'       => _ALL,
599 599
             'digest'    => _MD_NEWBB_DIGEST,
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
 
622 622
         // all status, for admin
623 623
         if ($type > 1) {
624
-            $links = array_merge($links, $links_admin);// irmtfan to accept multiple status
624
+            $links = array_merge($links, $links_admin); // irmtfan to accept multiple status
625 625
         }
626 626
 
627 627
         return $this->getFromKeys($links, $status); // irmtfan to accept multiple status
@@ -635,10 +635,10 @@  discard block
 block discarded – undo
635 635
     {
636 636
         $selection         = ['action' => $this->page];
637 637
         $selection['vars'] = $this->vars;
638
-        require_once __DIR__ . '/../include/functions.forum.php';
638
+        require_once __DIR__.'/../include/functions.forum.php';
639 639
         $forum_selected     = empty($this->vars['forum']) ? null : explode('|', @$this->vars['forum']);
640 640
         $selection['forum'] = '<select name="forum[]" multiple="multiple">';
641
-        $selection['forum'] .= '<option value="0">' . _MD_NEWBB_ALL . '</option>';
641
+        $selection['forum'] .= '<option value="0">'._MD_NEWBB_ALL.'</option>';
642 642
         $selection['forum'] .= newbbForumSelectBox($forum_selected);
643 643
         $selection['forum'] .= '</select>';
644 644
 
@@ -649,13 +649,13 @@  discard block
 block discarded – undo
649 649
             throw new \RuntimeException('$sorts must be an array.');
650 650
         }
651 651
         foreach ($sorts as $sort => $title) {
652
-            $selection['sort'] .= "<option value='" . $sort . "' " . (($sort == $sort_selected) ? " selected='selected'" : '') . '>' . $title . '</option>';
652
+            $selection['sort'] .= "<option value='".$sort."' ".(($sort == $sort_selected) ? " selected='selected'" : '').'>'.$title.'</option>';
653 653
         }
654 654
         $selection['sort'] .= '</select>';
655 655
 
656 656
         $selection['order'] = "<select name='order'>";
657
-        $selection['order'] .= "<option value='0' " . (empty($this->vars['order']) ? " selected='selected'" : '') . '>' . _DESCENDING . '</option>';
658
-        $selection['order'] .= "<option value='1' " . (!empty($this->vars['order']) ? " selected='selected'" : '') . '>' . _ASCENDING . '</option>';
657
+        $selection['order'] .= "<option value='0' ".(empty($this->vars['order']) ? " selected='selected'" : '').'>'._DESCENDING.'</option>';
658
+        $selection['order'] .= "<option value='1' ".(!empty($this->vars['order']) ? " selected='selected'" : '').'>'._ASCENDING.'</option>';
659 659
         $selection['order'] .= '</select>';
660 660
 
661 661
         $since              = isset($this->vars['since']) ? $this->vars['since'] : $this->config['since_default'];
@@ -698,10 +698,10 @@  discard block
 block discarded – undo
698 698
         foreach ($headers as $header => $title) {
699 699
             $_args = ["sort={$header}"];
700 700
             if (@$this->vars['sort'] == $header) {
701
-                $_args[] = 'order=' . ((@$this->vars['order'] + 1) % 2);
701
+                $_args[] = 'order='.((@$this->vars['order'] + 1) % 2);
702 702
             }
703 703
             $headers_data[$header]['title'] = $title;
704
-            $headers_data[$header]['link']  = $this->page . '?' . implode('&amp;', array_merge($args, $_args));
704
+            $headers_data[$header]['link']  = $this->page.'?'.implode('&amp;', array_merge($args, $_args));
705 705
         }
706 706
         $xoopsTpl->assign_by_ref('headers', $headers_data);
707 707
     }
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
         foreach ($links as $link => $title) {
726 726
             $_args                  = ["status={$link}"];
727 727
             $status[$link]['title'] = $title;
728
-            $status[$link]['link']  = $this->page . '?' . implode('&amp;', array_merge($args, $_args));
728
+            $status[$link]['link']  = $this->page.'?'.implode('&amp;', array_merge($args, $_args));
729 729
         }
730 730
         $xoopsTpl->assign_by_ref('filters', $status);
731 731
     }
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
         foreach ($types as $id => $type) {
774 774
             $_args                = ["type={$id}"];
775 775
             $status[$id]['title'] = $type['type_name'];
776
-            $status[$id]['link']  = $this->page . '?' . implode('&amp;', array_merge($args, $_args));
776
+            $status[$id]['link']  = $this->page.'?'.implode('&amp;', array_merge($args, $_args));
777 777
         }
778 778
         $xoopsTpl->assign_by_ref('types', $status);
779 779
     }
@@ -796,7 +796,7 @@  discard block
 block discarded – undo
796 796
         $status          = [];
797 797
         $status['title'] = implode(',', $this->getStatus($this->userlevel, $this->vars['status'])); // irmtfan to accept multiple status
798 798
         //$status['link'] = $this->page.(empty($this->vars['status']) ? '' : '?status='.$this->vars['status']);
799
-        $status['link'] = $this->page . (empty($args) ? '' : '?' . implode('&amp;', $args));
799
+        $status['link'] = $this->page.(empty($args) ? '' : '?'.implode('&amp;', $args));
800 800
 
801 801
         $xoopsTpl->assign_by_ref('current', $status);
802 802
     }
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
             require_once $GLOBALS['xoops']->path('class/pagenav.php');
819 819
             $nav = new \XoopsPageNav($count_topic, $this->config['topics_per_page'], @$this->vars['start'], 'start', implode('&amp;', $args));
820 820
             if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
821
-                $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')) . ' /' . $nav->url;
821
+                $nav->url = formatURL(Request::getString('SERVER_NAME', '', 'SERVER')).' /'.$nav->url;
822 822
             }
823 823
             if ('select' === $this->config['pagenav_display']) {
824 824
                 $navi = $nav->renderSelect();
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
         // topic fields
851 851
         $selects[] = 'COUNT(*)';
852 852
 
853
-        $froms[]  = $this->handler->db->prefix('newbb_topics') . ' AS t ';
854
-        $joins[]  = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts') . ' AS p ON p.post_id = t.topic_last_post_id';
853
+        $froms[]  = $this->handler->db->prefix('newbb_topics').' AS t ';
854
+        $joins[]  = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts').' AS p ON p.post_id = t.topic_last_post_id';
855 855
         $wheres[] = '1 = 1';
856 856
 
857
-        $sql = '    SELECT ' . implode(', ', $selects) . '     FROM ' . implode(', ', $froms) . '        ' . implode(' ', $joins) . (!empty($this->query['join']) ? '        ' . implode(' ', $this->query['join']) : '') . // irmtfan bug fix: Undefined index: join when post_excerpt = 0
858
-               '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']);
857
+        $sql = '    SELECT '.implode(', ', $selects).'     FROM '.implode(', ', $froms).'        '.implode(' ', $joins).(!empty($this->query['join']) ? '        '.implode(' ', $this->query['join']) : '').// irmtfan bug fix: Undefined index: join when post_excerpt = 0
858
+               '     WHERE '.implode(' AND ', $wheres).'        AND '.@implode(' AND ', @$this->query['where']);
859 859
 
860 860
         if (!$result = $this->handler->db->query($sql)) {
861 861
             return 0;
@@ -896,18 +896,18 @@  discard block
 block discarded – undo
896 896
         // post fields
897 897
         $selects[] = 'p.post_time as last_post_time, p.poster_name as last_poster_name, p.icon, p.post_id, p.uid';
898 898
 
899
-        $froms[]  = $this->handler->db->prefix('newbb_topics') . ' AS t ';
900
-        $joins[]  = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts') . ' AS p ON p.post_id = t.topic_last_post_id';
899
+        $froms[]  = $this->handler->db->prefix('newbb_topics').' AS t ';
900
+        $joins[]  = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts').' AS p ON p.post_id = t.topic_last_post_id';
901 901
         $wheres[] = '1 = 1';
902 902
 
903 903
         if (!empty($this->config['post_excerpt'])) {
904 904
             $selects[]             = 'p.post_karma, p.require_reply, pt.post_text';
905
-            $this->query['join'][] = 'LEFT JOIN ' . $this->handler->db->prefix('newbb_posts_text') . ' AS pt ON pt.post_id = t.topic_last_post_id';
905
+            $this->query['join'][] = 'LEFT JOIN '.$this->handler->db->prefix('newbb_posts_text').' AS pt ON pt.post_id = t.topic_last_post_id';
906 906
         }
907 907
         //if (empty($this->query["sort"])) $this->query["sort"][] = 't.topic_last_post_id DESC'; // irmtfan commented no need
908 908
 
909
-        $sql = '    SELECT ' . implode(', ', $selects) . '     FROM ' . implode(', ', $froms) . '        ' . implode(' ', $joins) . (!empty($this->query['join']) ? '        ' . implode(' ', $this->query['join']) : '') . // irmtfan bug fix: Undefined index join when post_excerpt = 0
910
-               '     WHERE ' . implode(' AND ', $wheres) . '        AND ' . @implode(' AND ', @$this->query['where']) . '     ORDER BY ' . implode(', ', $this->query['sort']);
909
+        $sql = '    SELECT '.implode(', ', $selects).'     FROM '.implode(', ', $froms).'        '.implode(' ', $joins).(!empty($this->query['join']) ? '        '.implode(' ', $this->query['join']) : '').// irmtfan bug fix: Undefined index join when post_excerpt = 0
910
+               '     WHERE '.implode(' AND ', $wheres).'        AND '.@implode(' AND ', @$this->query['where']).'     ORDER BY '.implode(', ', $this->query['sort']);
911 911
 
912 912
         if (!$result = $this->handler->db->query($sql, $this->config['topics_per_page'], @$this->vars['start'])) {
913 913
             if (is_object($xoopsTpl)) {
@@ -919,11 +919,11 @@  discard block
 block discarded – undo
919 919
             return $ret;
920 920
         }
921 921
 
922
-        require_once __DIR__ . '/../include/functions.render.php';
923
-        require_once __DIR__ . '/../include/functions.session.php';
924
-        require_once __DIR__ . '/../include/functions.time.php';
925
-        require_once __DIR__ . '/../include/functions.read.php';
926
-        require_once __DIR__ . '/../include/functions.topic.php';
922
+        require_once __DIR__.'/../include/functions.render.php';
923
+        require_once __DIR__.'/../include/functions.session.php';
924
+        require_once __DIR__.'/../include/functions.time.php';
925
+        require_once __DIR__.'/../include/functions.read.php';
926
+        require_once __DIR__.'/../include/functions.topic.php';
927 927
 
928 928
         $sticky    = 0;
929 929
         $topics    = [];
@@ -942,9 +942,9 @@  discard block
 block discarded – undo
942 942
             // START irmtfan remove topic_icon hardcode smarty
943 943
             // topic_icon: just regular topic_icon
944 944
             if (!empty($myrow['icon'])) {
945
-                $topic_icon = '<img align="middle" src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($myrow['icon']) . '" alt="" />';
945
+                $topic_icon = '<img align="middle" src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon']).'" alt="" />';
946 946
             } else {
947
-                $topic_icon = '<img align="middle" src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" />';
947
+                $topic_icon = '<img align="middle" src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" />';
948 948
             }
949 949
             // END irmtfan remove topic_icon hardcode smarty
950 950
 
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
             if ($rating < 1) {
956 956
                 $rating_img = newbbDisplayImage('blank');
957 957
             } else {
958
-                $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating));
958
+                $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating));
959 959
             }
960 960
 
961 961
             // ------------------------------------------------------
@@ -965,22 +965,22 @@  discard block
 block discarded – undo
965 965
             $totalpages           = ceil(($myrow['topic_replies'] + 1) / $this->config['posts_per_page']);
966 966
             if ($totalpages > 1) {
967 967
                 $topic_page_jump .= '&nbsp;&nbsp;';
968
-                $append          = false;
968
+                $append = false;
969 969
                 for ($i = 1; $i <= $totalpages; ++$i) {
970 970
                     if ($i > 3 && $i < $totalpages) {
971 971
                         if (!$append) {
972 972
                             $topic_page_jump .= '...';
973
-                            $append          = true;
973
+                            $append = true;
974 974
                         }
975 975
                     } else {
976
-                        $topic_page_jump .= '[<a href="' . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] . '&amp;start=' . (($i - 1) * $this->config['posts_per_page']) . '">' . $i . '</a>]';
976
+                        $topic_page_jump .= '[<a href="'.XOOPS_URL.'/modules/newbb/viewtopic.php?topic_id='.$myrow['topic_id'].'&amp;start='.(($i - 1) * $this->config['posts_per_page']).'">'.$i.'</a>]';
977 977
                         // irmtfan remove here and move
978 978
                         //$topic_page_jump_icon = "<a href='" . XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id=" . $myrow['topic_id'] . "&amp;start=" . (($i - 1) * $this->config['posts_per_page']) . "" . "'>" . newbbDisplayImage('document',_MD_NEWBB_GOTOLASTPOST) . '</a>';
979 979
                     }
980 980
                 }
981 981
             }
982 982
             // irmtfan - move here for both topics with and without pages - change topic_id to post_id
983
-            $topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $myrow['topic_last_post_id'] . '' . "'>" . newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>';
983
+            $topic_page_jump_icon = "<a href='".XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$myrow['topic_last_post_id'].''."'>".newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST).'</a>';
984 984
 
985 985
             // ------------------------------------------------------
986 986
             // => topic array
@@ -1012,7 +1012,7 @@  discard block
 block discarded – undo
1012 1012
                 'topic_title_excerpt'    => $topic_title_excerpt,
1013 1013
                 //irmtfan use topic_title_excerpt
1014 1014
                 //'topic_link'    => XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'], // . '&amp;forum=' . $myrow['forum_id'], // irmtfan comment
1015
-                'topic_link'             => 'viewtopic.php?topic_id=' . $myrow['topic_id'],
1015
+                'topic_link'             => 'viewtopic.php?topic_id='.$myrow['topic_id'],
1016 1016
                 // irmtfan remove hardcode link
1017 1017
                 'rating_img'             => $rating_img,
1018 1018
                 'votes'                  => $myrow['votes'],
@@ -1071,14 +1071,14 @@  discard block
 block discarded – undo
1071 1071
         $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
1072 1072
 
1073 1073
         if (count($forums) > 0) {
1074
-            $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '(' . implode(', ', array_keys($forums)) . ')', 'IN'), ['forum_name', 'hot_threshold'], false);
1074
+            $forum_list = $forumHandler->getAll(new \Criteria('forum_id', '('.implode(', ', array_keys($forums)).')', 'IN'), ['forum_name', 'hot_threshold'], false);
1075 1075
         } else {
1076 1076
             $forum_list = $forumHandler->getAll();
1077 1077
         }
1078 1078
 
1079 1079
         foreach (array_keys($topics) as $id) {
1080 1080
             $topics[$id]['topic_read']       = empty($topic_isRead[$id]) ? 0 : 1; // add topic-read/topic-new smarty variable
1081
-            $topics[$id]['topic_forum_link'] = '<a href="' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $topics[$id]['topic_forum'] . '">' . $forum_list[$topics[$id]['topic_forum']]['forum_name'] . '</a>';
1081
+            $topics[$id]['topic_forum_link'] = '<a href="'.XOOPS_URL.'/modules/newbb/viewforum.php?forum='.$topics[$id]['topic_forum'].'">'.$forum_list[$topics[$id]['topic_forum']]['forum_name'].'</a>';
1082 1082
 
1083 1083
             //irmtfan use topic_title_excerpt -- add else
1084 1084
             if (!empty($topics[$id]['type_id']) && isset($type_list[$topics[$id]['type_id']])) {
@@ -1112,14 +1112,14 @@  discard block
 block discarded – undo
1112 1112
             $topics[$id]['topic_folder'] = newbbDisplayImage($topic_folder, $topic_folder_text);
1113 1113
             // END irmtfan - add topic_folder_text for alt
1114 1114
 
1115
-            unset($topics[$id]['topic_poster_name'], $topics[$id]['topic_last_poster_name']);// irmtfan remove $topics[$id]["stats"] because it is not exist now
1115
+            unset($topics[$id]['topic_poster_name'], $topics[$id]['topic_last_poster_name']); // irmtfan remove $topics[$id]["stats"] because it is not exist now
1116 1116
         }
1117 1117
 
1118 1118
         if (count($topics) > 0) {
1119
-            $sql = ' SELECT DISTINCT topic_id FROM ' . $this->handler->db->prefix('newbb_posts') . " WHERE attachment != ''" . ' AND topic_id IN (' . implode(',', array_keys($topics)) . ')';
1119
+            $sql = ' SELECT DISTINCT topic_id FROM '.$this->handler->db->prefix('newbb_posts')." WHERE attachment != ''".' AND topic_id IN ('.implode(',', array_keys($topics)).')';
1120 1120
             if ($result = $this->handler->db->query($sql)) {
1121 1121
                 while (false !== (list($topic_id) = $this->handler->db->fetchRow($result))) {
1122
-                    $topics[$topic_id]['attachment'] = '&nbsp;' . newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT);
1122
+                    $topics[$topic_id]['attachment'] = '&nbsp;'.newbbDisplayImage('attachment', _MD_NEWBB_TOPICSHASATT);
1123 1123
                 }
1124 1124
             }
1125 1125
         }
Please login to merge, or discard this patch.
polls.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 // rewrite by irmtfan and zyspec to accept xoopspoll 1.4 and all old xoopspoll and umfrage versions and all clones
23 23
 
24
-require_once __DIR__ . '/header.php';
24
+require_once __DIR__.'/header.php';
25 25
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
26 26
 require_once $GLOBALS['xoops']->path('class/xoopslists.php');
27 27
 require_once $GLOBALS['xoops']->path('class/xoopsblock.php');
@@ -54,18 +54,18 @@  discard block
 block discarded – undo
54 54
 if (is_object($topicObject)) {
55 55
     $forum_id = $topicObject->getVar('forum_id');
56 56
 } else {
57
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_POLLMODULE_ERROR . ': ' . _MD_NEWBB_FORUMNOEXIST);
57
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_POLLMODULE_ERROR.': '._MD_NEWBB_FORUMNOEXIST);
58 58
 }
59 59
 // forum access permission
60 60
 /** @var Newbb\ForumHandler $forumHandler */
61 61
 $forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
62 62
 $forumObject  = $forumHandler->get($forum_id);
63 63
 if (!$forumHandler->getPermission($forumObject)) {
64
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
64
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_NORIGHTTOACCESS);
65 65
 }
66 66
 // topic view permission
67 67
 if (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view')) {
68
-    redirect_header('viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
68
+    redirect_header('viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
69 69
 }
70 70
 // poll module
71 71
 $pollModuleHandler = $moduleHandler->getByDirname($GLOBALS['xoopsModuleConfig']['poll_module']);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $pollObject = $xpPollHandler->get($poll_id); // will create poll if poll_id = 0 exist
83 83
         // old xoopspoll or umfrage or any clone from them
84 84
     } else {
85
-        include $GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/include/constants.php');
85
+        include $GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/include/constants.php');
86 86
         $classPoll  = $topicObject->loadOldPoll();
87 87
         $pollObject = new $classPoll($poll_id); // will create poll if poll_id = 0 exist
88 88
     }
@@ -112,11 +112,11 @@  discard block
 block discarded – undo
112 112
     case 'add':
113 113
         // new xoopspoll module
114 114
         if ($pollModuleHandler->getVar('version') >= 140) {
115
-            echo '<h4>' . _MD_NEWBB_POLL_CREATNEWPOLL . "</h4>\n";
115
+            echo '<h4>'._MD_NEWBB_POLL_CREATNEWPOLL."</h4>\n";
116 116
             $pollObject->renderForm(Request::getString('PHP_SELF', '', 'SERVER'), 'post', ['topic_id' => $topic_id]);
117 117
         // old xoopspoll or umfrage or any clone from them
118 118
         } else {
119
-            $classOption  = $classPoll . 'Option';
119
+            $classOption  = $classPoll.'Option';
120 120
             $poll_form    = new \XoopsThemeForm(_MD_NEWBB_POLL_CREATNEWPOLL, 'poll_form', 'polls.php', 'post', true);
121 121
             $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, is_object($GLOBALS['xoopsUser']) ? ("<a href='"
122 122
                                                                                                           . XOOPS_URL
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             $poll_form->addElement($desc_tarea);
133 133
             $currenttime = formatTimestamp(time(), 'Y-m-d H:i:s');
134 134
             $endtime     = formatTimestamp(time() + 604800, 'Y-m-d H:i:s');
135
-            $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, $currenttime) . '</small>', 'end_time', 30, 19, $endtime);
135
+            $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, $currenttime).'</small>', 'end_time', 30, 19, $endtime);
136 136
             $poll_form->addElement($expire_text);
137 137
 
138 138
             $weight_text = new \XoopsFormText(_MD_NEWBB_POLL_DISPLAYORDER, 'weight', 6, 5, 0);
@@ -145,14 +145,14 @@  discard block
 block discarded – undo
145 145
             $poll_form->addElement($notify_yn);
146 146
 
147 147
             $option_tray    = new \XoopsFormElementTray(_MD_NEWBB_POLL_POLLOPTIONS, '');
148
-            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars/'));
148
+            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars/'));
149 149
             for ($i = 0; $i < 10; ++$i) {
150 150
                 $current_bar = ('blank.gif' !== current($barcolor_array)) ? current($barcolor_array) : next($barcolor_array);
151 151
                 $option_text = new \XoopsFormText('', 'option_text[]', 50, 255);
152 152
                 $option_tray->addElement($option_text);
153 153
                 $color_select = new \XoopsFormSelect('', "option_color[{$i}]", $current_bar);
154 154
                 $color_select->addOptionArray($barcolor_array);
155
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/" . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars", "", "' . XOOPS_URL . "\")'");
155
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/".$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars", "", "'.XOOPS_URL."\")'");
156 156
                 $color_label = new \XoopsFormLabel('', "<img src='"
157 157
                                                       . XOOPS_URL
158 158
                                                       . '/modules/'
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
175 175
             $poll_form->addElement(new \XoopsFormHidden('user_id', is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0));
176 176
             $poll_form->addElement(new \XoopsFormButtonTray('poll_submit', _SUBMIT, 'submit'));
177
-            echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . '</h4>';
177
+            echo '<h4>'._MD_NEWBB_POLL_POLLCONF.'</h4>';
178 178
             $poll_form->display();
179 179
         }
180 180
         break; // op: add
@@ -182,13 +182,13 @@  discard block
 block discarded – undo
182 182
     case 'edit':
183 183
         // new xoopspoll module
184 184
         if ($pollModuleHandler->getVar('version') >= 140) {
185
-            echo '<h4>' . _MD_NEWBB_POLL_EDITPOLL . "</h4>\n";
185
+            echo '<h4>'._MD_NEWBB_POLL_EDITPOLL."</h4>\n";
186 186
             $pollObject->renderForm(Request::getString('PHP_SELF', '', 'SERVER'), 'post', ['topic_id' => $topic_id]);
187 187
         // old xoopspoll or umfrage or any clone from them
188 188
         } else {
189
-            $classOption  = $classPoll . 'Option';
189
+            $classOption  = $classPoll.'Option';
190 190
             $poll_form    = new \XoopsThemeForm(_MD_NEWBB_POLL_EDITPOLL, 'poll_form', 'polls.php', 'post', true);
191
-            $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $pollObject->getVar('user_id') . "'>" . newbbGetUnameFromId($pollObject->getVar('user_id'), $GLOBALS['xoopsModuleConfig']['show_realname']) . '</a>');
191
+            $author_label = new \XoopsFormLabel(_MD_NEWBB_POLL_AUTHOR, "<a href='".XOOPS_URL.'/userinfo.php?uid='.$pollObject->getVar('user_id')."'>".newbbGetUnameFromId($pollObject->getVar('user_id'), $GLOBALS['xoopsModuleConfig']['show_realname']).'</a>');
192 192
             $poll_form->addElement($author_label);
193 193
             $question_text = new \XoopsFormText(_MD_NEWBB_POLL_POLLQUESTION, 'question', 50, 255, $pollObject->getVar('question', 'E'));
194 194
             $poll_form->addElement($question_text);
@@ -196,13 +196,13 @@  discard block
 block discarded – undo
196 196
             $poll_form->addElement($desc_tarea);
197 197
             $date = formatTimestamp($pollObject->getVar('end_time'), 'Y-m-d H:i:s'); // important "Y-m-d H:i:s" use in jdf function
198 198
             if (!$pollObject->hasExpired()) {
199
-                $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')) . '</small>', 'end_time', 20, 19, $date);
199
+                $expire_text = new \XoopsFormText(_MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')).'</small>', 'end_time', 20, 19, $date);
200 200
                 $poll_form->addElement($expire_text);
201 201
             } else {
202 202
                 // irmtfan full URL - add topic_id
203 203
                 $restart_label = new \XoopsFormLabel(
204 204
                     _MD_NEWBB_POLL_EXPIRATION,
205
-                                                    sprintf(_MD_NEWBB_POLL_EXPIREDAT, $date) . "<br><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=restart&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>" . _MD_NEWBB_POLL_RESTART . '</a>'
205
+                                                    sprintf(_MD_NEWBB_POLL_EXPIREDAT, $date)."<br><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=restart&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>"._MD_NEWBB_POLL_RESTART.'</a>'
206 206
                 );
207 207
                 $poll_form->addElement($restart_label);
208 208
             }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $poll_form->addElement($weight_text);
211 211
             $multi_yn = new \XoopsFormRadioYN(_MD_NEWBB_POLL_ALLOWMULTI, 'multiple', $pollObject->getVar('multiple'));
212 212
             $poll_form->addElement($multi_yn);
213
-            $options_arr  =& $classOption::getAllByPollId($poll_id);
213
+            $options_arr  = & $classOption::getAllByPollId($poll_id);
214 214
             $notify_value = 1;
215 215
             if (0 !== $pollObject->getVar('mail_status')) {
216 216
                 $notify_value = 0;
@@ -226,9 +226,9 @@  discard block
 block discarded – undo
226 226
                 $option_tray->addElement(new \XoopsFormHidden('option_id[]', $option->getVar('option_id')));
227 227
                 $color_select = new \XoopsFormSelect('', 'option_color[{$i}]', $option->getVar('option_color'));
228 228
                 $color_select->addOptionArray($barcolor_array);
229
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[" . $i . "]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'");
229
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[".$i."]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
230 230
                 $color_label = new \XoopsFormLabel('', "<img src='"
231
-                                                      . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/" . $option->getVar('option_color', 'E'))
231
+                                                      . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/".$option->getVar('option_color', 'E'))
232 232
                                                       . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' class='alignbottom' width='30' height='15' alt='' /><br>");
233 233
                 $option_tray->addElement($color_select);
234 234
                 $option_tray->addElement($color_label);
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                 ++$i;
237 237
             }
238 238
             // irmtfan full URL
239
-            $more_label = new \XoopsFormLabel('', "<br><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/polls.php?op=addmore&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>" . _MD_NEWBB_POLL_ADDMORE . '</a>');
239
+            $more_label = new \XoopsFormLabel('', "<br><a href='".XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/polls.php?op=addmore&amp;poll_id={$poll_id}&amp;topic_id={$topic_id}'>"._MD_NEWBB_POLL_ADDMORE.'</a>');
240 240
             $option_tray->addElement($more_label);
241 241
             $poll_form->addElement($option_tray);
242 242
             $poll_form->addElement(new \XoopsFormHidden('op', 'update'));
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
245 245
             $poll_form->addElement(new \XoopsFormButtonTray('poll_submit', _SUBMIT, 'submit'));
246 246
 
247
-            echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
247
+            echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
248 248
             $poll_form->display();
249 249
         }
250 250
         break; // op: edit
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             $option_empty = true;
263 263
             if (!Request::getString('option_text', '', 'POST')) {
264 264
                 // irmtfan - issue with javascript:history.go(-1)
265
-                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
265
+                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
266 266
             }
267 267
             $option_text = Request::getArray('option_text', '', 'POST');
268 268
             foreach ($option_text as $optxt) {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
             }
274 274
             if ($option_empty) {
275 275
                 // irmtfan - issue with javascript:history.go(-1)
276
-                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
276
+                redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
277 277
             }
278 278
             $pollObject->setVar('question', Request::getString('question', '', 'POST'));
279 279
             $pollObject->setVar('description', Request::getString('description', '', 'POST'));
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             }
305 305
             $i            = 0;
306 306
             $option_color = Request::getArray('option_color', null, 'POST');
307
-            $classOption  = $classPoll . 'Option';
307
+            $classOption  = $classPoll.'Option';
308 308
             foreach ($option_text as $optxt) {
309 309
                 $optxt = trim($optxt);
310 310
                 /** @var XoopspollOption $optionObject */
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             } else {
332 332
                 redirect_header("viewtopic.php?topic_id={$topic_id}", 2, _MD_NEWBB_POLL_DBUPDATED);
333 333
             }
334
-            break;// op: save
334
+            break; // op: save
335 335
         }
336 336
     // no break
337 337
     case 'update':
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         $option_string = is_array($option_text) ? implode('', $option_text) : $option_text;
345 345
         $option_string = trim($option_string);
346 346
         if ('' === $option_string) {
347
-            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
347
+            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
348 348
         }
349 349
 
350 350
         // new xoopspoll module
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
             /** @var \XoopspollLogHandler $xpLogHandler */
355 355
             $xpLogHandler = Xoopspoll\Helper::getInstance()->getHandler('Log');
356 356
             //            $classRequest = ucfirst($GLOBALS['xoopsModuleConfig']["poll_module"]) . "Request";
357
-            $classConstants   = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Constants';
357
+            $classConstants   = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Constants';
358 358
             $notify           = Request::getInt('notify', $classConstants::NOTIFICATION_ENABLED, 'POST');
359 359
             $currentTimestamp = time();
360 360
             //$xuEndTimestamp   = method_exists('XoopsLocal', 'strtotime') ? XoopsLocal::strtotime(Request::getString('xu_end_time', null, 'POST'))
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
             $i            = 0;
464 464
             $option_id    = Request::getArray('option_id', null, 'POST');
465 465
             $option_color = Request::getArray('option_color', null, 'POST');
466
-            $classOption  = $classPoll . 'Option';
467
-            $classLog     = $classPoll . 'Log';
466
+            $classOption  = $classPoll.'Option';
467
+            $classLog     = $classPoll.'Log';
468 468
             foreach ($option_id as $opid) {
469 469
                 $optionObject    = new $classOption($opid);
470 470
                 $option_text[$i] = trim($option_text[$i]);
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
         } else {
496 496
             redirect_header("viewtopic.php?topic_id={$topic_id}", 2, _MD_NEWBB_POLL_DBUPDATED);
497 497
         }
498
-        break;// op: save | update
498
+        break; // op: save | update
499 499
 
500 500
     case 'addmore':
501 501
         $question = $pollObject->getVar('question');
@@ -509,14 +509,14 @@  discard block
 block discarded – undo
509 509
         // old xoopspoll or umfrage or any clone from them
510 510
         } else {
511 511
             $option_tray    = new \XoopsFormElementTray(_MD_NEWBB_POLL_POLLOPTIONS, '');
512
-            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/assets/images/colorbars/'));
512
+            $barcolor_array = \XoopsLists::getImgListAsArray($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/assets/images/colorbars/'));
513 513
             for ($i = 0; $i < 10; ++$i) {
514 514
                 $current_bar = ('blank.gif' !== current($barcolor_array)) ? current($barcolor_array) : next($barcolor_array);
515 515
                 $option_text = new \XoopsFormText('', 'option_text[]', 50, 255);
516 516
                 $option_tray->addElement($option_text);
517 517
                 $color_select = new \XoopsFormSelect('', "option_color[{$i}]", $current_bar);
518 518
                 $color_select->addOptionArray($barcolor_array);
519
-                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"" . XOOPS_URL . "\")'");
519
+                $color_select->setExtra("onchange='showImgSelected(\"option_color_image[{$i}]\", \"option_color[{$i}]\", \"modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars\", \"\", \"".XOOPS_URL."\")'");
520 520
                 $color_label = new \XoopsFormLabel('', "<img src='"
521 521
                                                       . $GLOBALS['xoops']->url("modules/{$GLOBALS['xoopsModuleConfig']['poll_module']}/assets/images/colorbars/{$current_bar}")
522 522
                                                       . "' name='option_color_image[{$i}]' id='option_color_image[{$i}]' class='alignbottom' width='30' height='15' alt='' /><br>");
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
         $poll_form->addElement(new \XoopsFormHidden('topic_id', $topic_id));
535 535
         $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
536 536
 
537
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
537
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
538 538
         $poll_form->display();
539 539
         break;
540 540
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
         $option_string = trim($option_string);
550 550
         if ('' === $option_string) {
551 551
             // irmtfan - issue with javascript:history.go(-1)
552
-            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED . ': ' . _MD_NEWBB_POLL_POLLOPTIONS . ' !');
552
+            redirect_header(Request::getString('HTTP_REFERER', '', 'SERVER'), 2, _MD_NEWBB_ERROROCCURED.': '._MD_NEWBB_POLL_POLLOPTIONS.' !');
553 553
         }
554 554
         $i            = 0;
555 555
         $option_color = Request::getArray('option_color', null, 'POST');
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                     $xpOptHandler->insert($optionObject);
567 567
                 // old xoopspoll or umfrage or any clone from them
568 568
                 } else {
569
-                    $classOption  = $classPoll . 'Option';
569
+                    $classOption  = $classPoll.'Option';
570 570
                     $optionObject = new $classOption();
571 571
                     $optionObject->setVar('option_text', $optxt);
572 572
                     $optionObject->setVar('poll_id', $poll_id);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         break;
585 585
 
586 586
     case 'delete':
587
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
587
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
588 588
         xoops_confirm(['op' => 'delete_ok', 'topic_id' => $topic_id, 'poll_id' => $poll_id], 'polls.php', sprintf(_MD_NEWBB_POLL_RUSUREDEL, $pollObject->getVar('question')));
589 589
         break;
590 590
 
@@ -608,8 +608,8 @@  discard block
 block discarded – undo
608 608
             // old xoopspoll or umfrage or any clone from them
609 609
         } else {
610 610
             $status      = $pollObject->delete();
611
-            $classOption = $classPoll . 'Option';
612
-            $classLog    = $classPoll . 'Log';
611
+            $classOption = $classPoll.'Option';
612
+            $classLog    = $classPoll.'Log';
613 613
             if (false !== $status) {
614 614
                 $classOption::deleteByPollId($poll_id);
615 615
                 $classLog::deleteByPollId($poll_id);
@@ -636,13 +636,13 @@  discard block
 block discarded – undo
636 636
             xoops_error($msg);
637 637
             break;
638 638
         }
639
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
639
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
640 640
         break;
641 641
 
642 642
     case 'restart':
643 643
         // new xoopspoll module
644 644
         if ($pollModuleHandler->getVar('version') >= 140) {
645
-            $classConstants        = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Constants';
645
+            $classConstants        = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Constants';
646 646
             $default_poll_duration = $classConstants::DEFAULT_POLL_DURATION;
647 647
         // old xoopspoll or umfrage or any clone from them
648 648
         } else {
@@ -650,10 +650,10 @@  discard block
 block discarded – undo
650 650
         }
651 651
         $poll_form   = new \XoopsThemeForm(_MD_NEWBB_POLL_RESTARTPOLL, 'poll_form', 'polls.php', 'post', true);
652 652
         $expire_text = new \XoopsFormText(
653
-            _MD_NEWBB_POLL_EXPIRATION . '<br><small>' . _MD_NEWBB_POLL_FORMAT . '<br>' . sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')) . '<br>' . sprintf(
653
+            _MD_NEWBB_POLL_EXPIRATION.'<br><small>'._MD_NEWBB_POLL_FORMAT.'<br>'.sprintf(_MD_NEWBB_POLL_CURRENTTIME, formatTimestamp(time(), 'Y-m-d H:i:s')).'<br>'.sprintf(
654 654
             _MD_NEWBB_POLL_EXPIREDAT,
655 655
                                                                                                                                                                                                                      formatTimestamp($pollObject->getVar('end_time'), 'Y-m-d H:i:s')
656
-        ) . '</small>',
656
+        ).'</small>',
657 657
                                          'end_time',
658 658
             20,
659 659
             19,
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
         $poll_form->addElement(new \XoopsFormHidden('poll_id', $poll_id));
668 668
         $poll_form->addElement(new \XoopsFormButton('', 'poll_submit', _MD_NEWBB_POLL_RESTART, 'submit'));
669 669
 
670
-        echo '<h4>' . _MD_NEWBB_POLL_POLLCONF . "</h4>\n";
670
+        echo '<h4>'._MD_NEWBB_POLL_POLLCONF."</h4>\n";
671 671
         $poll_form->display();
672 672
         break;
673 673
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 
680 680
         // new xoopspoll module
681 681
         if ($pollModuleHandler->getVar('version') >= 140) {
682
-            $classConstants        = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Constants';
682
+            $classConstants        = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Constants';
683 683
             $default_poll_duration = $classConstants::DEFAULT_POLL_DURATION;
684 684
             $poll_not_mailed       = $classConstants::POLL_NOT_MAILED;
685 685
             $poll_mailed           = $classConstants::POLL_MAILED;
@@ -729,8 +729,8 @@  discard block
 block discarded – undo
729 729
                 exit();
730 730
             }
731 731
             if (Request::getInt('reset', 0, 'POST')) { // reset all logs
732
-                $classOption = $classPoll . 'Option';
733
-                $classLog    = $classPoll . 'Log';
732
+                $classOption = $classPoll.'Option';
733
+                $classLog    = $classPoll.'Log';
734 734
                 $classLog::deleteByPollId($poll_id);
735 735
                 $classOption::resetCountByPollId($poll_id);
736 736
                 $pollObject->updateCount();
@@ -739,7 +739,7 @@  discard block
 block discarded – undo
739 739
         require_once $GLOBALS['xoops']->path('class/template.php');
740 740
         xoops_template_clear_module_cache($xoopsModule->getVar('mid'));
741 741
         xoops_template_clear_module_cache($pollModuleHandler->getVar('mid'));
742
-        redirect_header(XOOPS_URL . "/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
742
+        redirect_header(XOOPS_URL."/modules/newbb/viewtopic.php?topic_id={$topic_id}", 1, _MD_NEWBB_POLL_DBUPDATED);
743 743
         break;
744 744
 
745 745
     case 'log':
@@ -754,5 +754,5 @@  discard block
 block discarded – undo
754 754
 } // switch
755 755
 
756 756
 // irmtfan move to footer.php
757
-require_once __DIR__ . '/footer.php';
757
+require_once __DIR__.'/footer.php';
758 758
 include $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
index.php 1 patch
Spacing   +28 added lines, -28 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'],
@@ -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
 include $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.