Passed
Push — master ( 882d2a...8f67b7 )
by Michael
03:09
created
newtopic.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,17 +11,17 @@  discard block
 block discarded – undo
11 11
 
12 12
 use Xmf\Request;
13 13
 
14
-require_once __DIR__ . '/header.php';
14
+require_once __DIR__.'/header.php';
15 15
 
16 16
 if (!$forum = Request::getString('forum', '', 'GET')) {
17
-    redirect_header(XOOPS_URL . '/index.php', 2, _MD_NEWBB_ERRORFORUM);
17
+    redirect_header(XOOPS_URL.'/index.php', 2, _MD_NEWBB_ERRORFORUM);
18 18
 }
19 19
 
20 20
 ///** @var Newbb\ForumHandler $forumHandler */
21 21
 //$forumHandler = Newbb\Helper::getInstance()->getHandler('Forum');
22 22
 $forumObject = $forumHandler->get($forum);
23 23
 if (!$forumHandler->getPermission($forumObject)) {
24
-    redirect_header(XOOPS_URL . '/index.php', 2, _NOPERM);
24
+    redirect_header(XOOPS_URL.'/index.php', 2, _NOPERM);
25 25
 }
26 26
 
27 27
 ///** @var Newbb\TopicHandler $topicHandler */
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
     $query_array = [];
37 37
     foreach ($query_vars as $var) {
38 38
         if (Request::getString($var, '', 'GET')) {
39
-            $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET');
39
+            $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET');
40 40
         }
41 41
     }
42 42
     $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5);
43 43
     unset($query_array);
44
-    redirect_header(XOOPS_URL . "/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST);
44
+    redirect_header(XOOPS_URL."/modules/newbb/viewforum.php?{$page_query}", 2, _MD_NEWBB_NORIGHTTOPOST);
45 45
 }
46 46
 
47 47
 if ($GLOBALS['xoopsModuleConfig']['wol_enabled']) {
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 $attachsig     = (is_object($GLOBALS['xoopsUser']) && $GLOBALS['xoopsUser']->getVar('attachsig')) ? 1 : 0;
71 71
 $post_id       = 0;
72 72
 $topic_id      = 0;
73
-include __DIR__ . '/include/form.post.php';
73
+include __DIR__.'/include/form.post.php';
74 74
 
75
-require_once __DIR__ . '/footer.php';
75
+require_once __DIR__.'/footer.php';
76 76
 include $GLOBALS['xoops']->path('footer.php');
Please login to merge, or discard this patch.
viewtopic.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 use XoopsModules\Newbb;
35 35
 use XoopsModules\Xoopspoll;
36 36
 
37
-require_once __DIR__ . '/header.php';
37
+require_once __DIR__.'/header.php';
38 38
 $xoopsLogger->startTime('newBB_viewtopic');
39
-require_once __DIR__ . '/include/functions.read.php';
40
-require_once __DIR__ . '/include/functions.render.php';
39
+require_once __DIR__.'/include/functions.read.php';
40
+require_once __DIR__.'/include/functions.render.php';
41 41
 xoops_loadLanguage('user');
42 42
 
43 43
 /*Build the page query*/
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 $query_array = [];
46 46
 foreach ($query_vars as $var) {
47 47
     if (Request::getString($var, '', 'GET')) {
48
-        $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET');
48
+        $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET');
49 49
     }
50 50
 }
51 51
 $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 }
74 74
 
75 75
 if (!$topic_id && !$post_id) {
76
-    $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}";
76
+    $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}";
77 77
     redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC);
78 78
 }
79 79
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 }
91 91
 
92 92
 if (!is_object($topicObject) || !$topic_id = $topicObject->getVar('topic_id')) {
93
-    $redirect = empty($forum_id) ? XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php' : XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/viewforum.php?forum={$forum_id}";
93
+    $redirect = empty($forum_id) ? XOOPS_URL . '/modules/'.$xoopsModule->getVar('dirname').'/index.php' : XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/viewforum.php?forum={$forum_id}";
94 94
     redirect_header($redirect, 2, _MD_NEWBB_ERRORTOPIC);
95 95
 }
96 96
 $forum_id = $topicObject->getVar('forum_id');
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
 if ((!$isAdmin && $topicObject->getVar('approved') < 0) || (!$forumHandler->getPermission($forumObject))
104 104
     || (!$topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'view'))) {
105
-    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewforum.php?forum=' . $forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
105
+    redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewforum.php?forum='.$forum_id, 2, _MD_NEWBB_NORIGHTTOVIEW);
106 106
 }
107 107
 
108 108
 // START irmtfan - find if topic is read or unread - for all users (member and anon)
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         // hack jump to last post read if post_id is empty - is there any better way?
129 129
         if (empty($post_id) && $topic_is_unread
130 130
             && !empty($GLOBALS['xoopsModuleConfig']['jump_to_topic_last_post_read_enabled'])) {
131
-            header('Location: ' . Request::getString('REQUEST_URI', '', 'SERVER') . '&post_id=' . $topic_last_post_time_or_id_read);
131
+            header('Location: '.Request::getString('REQUEST_URI', '', 'SERVER').'&post_id='.$topic_last_post_time_or_id_read);
132 132
         }
133 133
     }
134 134
 }
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 // irmtfan new method
168 168
 if (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) {
169 169
     $xoopsTpl->assign('xoops_module_header', '
170
-    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" />
170
+    <link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name').'-'.$forumObject->getVar('forum_name').'" href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/rss.php?f='.$forumObject->getVar('forum_id').'" />
171 171
     ' . @$xoopsTpl->get_template_vars('xoops_module_header'));
172 172
 }
173 173
 
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
         'collapse' => $iconHandler->getImageSource('more')
196 196
     ];
197 197
     if (1 == $infobox['show']) {
198
-        $infobox['style'] = 'none';        //irmtfan move semicolon
198
+        $infobox['style'] = 'none'; //irmtfan move semicolon
199 199
         $infobox['alt']   = _MD_NEWBB_SEEUSERDATA;
200 200
         $infobox['src']   = 'more';
201 201
     } else {
202
-        $infobox['style'] = 'block';        //irmtfan move semicolon
202
+        $infobox['style'] = 'block'; //irmtfan move semicolon
203 203
         $infobox['alt']   = _MD_NEWBB_HIDEUSERDATA;
204 204
         $infobox['src']   = 'less';
205 205
     }
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 // END irmtfan improve infobox
210 210
 
211 211
 $xoopsTpl->assign([
212
-                      'topic_title'    => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?topic_id=' . $topic_id . '">' . $topicObject->getFullTitle() . '</a>',
212
+                      'topic_title'    => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?topic_id='.$topic_id.'">'.$topicObject->getFullTitle().'</a>',
213 213
                       'forum_name'     => $forumObject->getVar('forum_name'),
214 214
                       'lang_nexttopic' => _MD_NEWBB_NEXTTOPIC,
215 215
                       'lang_prevtopic' => _MD_NEWBB_PREVTOPIC,
@@ -231,20 +231,20 @@  discard block
 block discarded – undo
231 231
 $t_reply = newbbDisplayImage('t_reply', _MD_NEWBB_REPLY);
232 232
 // irmtfan show topic status if show reg is 0 and revise forum_post_or_register
233 233
 if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'post')) {
234
-    $xoopsTpl->assign('forum_post', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/newtopic.php?forum=' . $forum_id . '"> ' . $t_new . '</a>');
234
+    $xoopsTpl->assign('forum_post', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/newtopic.php?forum='.$forum_id.'"> '.$t_new.'</a>');
235 235
 } else {
236 236
     if ($topicObject->getVar('topic_status')) {
237 237
         $xoopsTpl->assign('topic_lock', _MD_NEWBB_TOPICLOCKED);
238 238
     }
239 239
     if (!is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['show_reg'])) {
240
-        $xoopsTpl->assign('forum_register', '<a href="' . XOOPS_URL . '/user.php?xoops_redirect=' . htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5) . '">' . _MD_NEWBB_REGTOPOST . '</a>');
240
+        $xoopsTpl->assign('forum_register', '<a href="'.XOOPS_URL.'/user.php?xoops_redirect='.htmlspecialchars($xoopsRequestUri, ENT_QUOTES | ENT_HTML5).'">'._MD_NEWBB_REGTOPOST.'</a>');
241 241
     }
242 242
 }
243 243
 // irmtfan for backward compatibility assign forum_post_or_register smarty again.
244
-$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock'));
244
+$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post').@$xoopsTpl->get_template_vars('forum_register').@$xoopsTpl->get_template_vars('topic_lock'));
245 245
 
246 246
 if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) {
247
-    $xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>');
247
+    $xoopsTpl->assign('forum_reply', '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/reply.php?topic_id='.$topic_id.'"> '.$t_reply.'</a>');
248 248
 }
249 249
 
250 250
 $poster_array  = [];
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
     /** @var \XoopsMemberHandler $memberHandler */
266 266
     $memberHandler = xoops_getHandler('member');
267 267
     $userid_array  = array_keys($poster_array);
268
-    $user_criteria = '(' . implode(',', $userid_array) . ')';
268
+    $user_criteria = '('.implode(',', $userid_array).')';
269 269
     $users         = $memberHandler->getUsers(new \Criteria('uid', $user_criteria, 'IN'), true);
270 270
 } else {
271 271
     $users = [];
@@ -283,10 +283,10 @@  discard block
 block discarded – undo
283 283
 
284 284
 if ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $require_reply) {
285 285
     if (!empty($GLOBALS['xoopsModuleConfig']['cache_enabled'])) {
286
-        $viewtopic_posters = newbbGetSession('t' . $topic_id, true);
286
+        $viewtopic_posters = newbbGetSession('t'.$topic_id, true);
287 287
         if (!is_array($viewtopic_posters) || 0 === count($viewtopic_posters)) {
288 288
             $viewtopic_posters = $topicHandler->getAllPosters($topicObject);
289
-            newbbSetSession('t' . $topic_id, $viewtopic_posters);
289
+            newbbSetSession('t'.$topic_id, $viewtopic_posters);
290 290
         }
291 291
     } else {
292 292
         $viewtopic_posters = $topicHandler->getAllPosters($topicObject);
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
         'post_date'       => 0,
303 303
         'post_image'      => '',
304 304
         'post_title'      => '',
305
-        'post_text'       => '<div style="text-align: center;vertical-align: middle;"><br>' . xoops_getbanner() . '</div>',
305
+        'post_text'       => '<div style="text-align: center;vertical-align: middle;"><br>'.xoops_getbanner().'</div>',
306 306
         'post_attachment' => '',
307 307
         'post_edit'       => 0,
308 308
         'post_no'         => 0,
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 if ($total_posts > $GLOBALS['xoopsModuleConfig']['posts_per_page']) {
340 340
     include $GLOBALS['xoops']->path('class/pagenav.php');
341 341
 
342
-    $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id=' . $topic_id . '&amp;order=' . $order . '&amp;status=' . $status . '&amp;mode=' . $mode);
342
+    $nav = new \XoopsPageNav($total_posts, $GLOBALS['xoopsModuleConfig']['posts_per_page'], $start, 'start', 'topic_id='.$topic_id.'&amp;order='.$order.'&amp;status='.$status.'&amp;mode='.$mode);
343 343
     //if (isset($GLOBALS['xoopsModuleConfig']['do_rewrite']) && $GLOBALS['xoopsModuleConfig']['do_rewrite'] === 1) $nav->url = XOOPS_URL . $nav->url;
344 344
     if ('select' === $GLOBALS['xoopsModuleConfig']['pagenav_display']) {
345 345
         $navi = $nav->renderSelect();
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
 }
360 360
 
361 361
 if (!empty($postsArray[$post_id])) {
362
-    $xoops_pagetitle = $postsArray[$post_id]->getVar('subject') . ' [' . $forumObject->getVar('forum_name') . ']';
362
+    $xoops_pagetitle = $postsArray[$post_id]->getVar('subject').' ['.$forumObject->getVar('forum_name').']';
363 363
     $xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle);
364 364
     $xoopsOption['xoops_pagetitle'] = $xoops_pagetitle;
365 365
     $kw                             = array_unique(explode(' ', strip_tags($postsArray[$post_id]->getVar('post_text')), 150));
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     $z     = 0;
369 369
     foreach ($kw as $k) {
370 370
         if ($z < 30 && strlen(trim($k)) > 5) {
371
-            $kwort .= trim($k) . ' ';
371
+            $kwort .= trim($k).' ';
372 372
             ++$z;
373 373
         }
374 374
     }
@@ -395,56 +395,56 @@  discard block
 block discarded – undo
395 395
 // START irmtfan add restore to viewtopic
396 396
 // if the topic is active
397 397
 if ($topicObject->getVar('approved') > 0) {
398
-    $admin_actions['merge']  = [
399
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=merge&amp;topic_id=' . $topic_id,
398
+    $admin_actions['merge'] = [
399
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=merge&amp;topic_id='.$topic_id,
400 400
         'name'  => _MD_NEWBB_MERGETOPIC,
401 401
         'image' => $ad_merge
402 402
     ];
403
-    $admin_actions['move']   = [
404
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=move&amp;topic_id=' . $topic_id,
403
+    $admin_actions['move'] = [
404
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=move&amp;topic_id='.$topic_id,
405 405
         'name'  => _MD_NEWBB_MOVETOPIC,
406 406
         'image' => $ad_move
407 407
     ];
408 408
     $admin_actions['delete'] = [
409
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=delete&amp;topic_id=' . $topic_id,
409
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=delete&amp;topic_id='.$topic_id,
410 410
         'name'  => _MD_NEWBB_DELETETOPIC,
411 411
         'image' => $ad_delete
412 412
     ];
413 413
     if (!$topicObject->getVar('topic_status')) {
414 414
         $admin_actions['lock'] = [
415
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=lock&amp;topic_id=' . $topic_id,
415
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=lock&amp;topic_id='.$topic_id,
416 416
             'image' => $ad_lock,
417 417
             'name'  => _MD_NEWBB_LOCKTOPIC
418 418
         ];
419 419
     } else {
420 420
         $admin_actions['unlock'] = [
421
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unlock&amp;topic_id=' . $topic_id,
421
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unlock&amp;topic_id='.$topic_id,
422 422
             'image' => $ad_unlock,
423 423
             'name'  => _MD_NEWBB_UNLOCKTOPIC
424 424
         ];
425 425
     }
426 426
     if (!$topicObject->getVar('topic_sticky')) {
427 427
         $admin_actions['sticky'] = [
428
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=sticky&amp;topic_id=' . $topic_id,
428
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=sticky&amp;topic_id='.$topic_id,
429 429
             'image' => $ad_sticky,
430 430
             'name'  => _MD_NEWBB_STICKYTOPIC
431 431
         ];
432 432
     } else {
433 433
         $admin_actions['unsticky'] = [
434
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=unsticky&amp;topic_id=' . $topic_id,
434
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=unsticky&amp;topic_id='.$topic_id,
435 435
             'image' => $ad_unsticky,
436 436
             'name'  => _MD_NEWBB_UNSTICKYTOPIC
437 437
         ];
438 438
     }
439 439
     if (!$topicObject->getVar('topic_digest')) {
440 440
         $admin_actions['digest'] = [
441
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=digest&amp;topic_id=' . $topic_id,
441
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=digest&amp;topic_id='.$topic_id,
442 442
             'image' => $ad_digest,
443 443
             'name'  => _MD_NEWBB_DIGESTTOPIC
444 444
         ];
445 445
     } else {
446 446
         $admin_actions['undigest'] = [
447
-            'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=undigest&amp;topic_id=' . $topic_id,
447
+            'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=undigest&amp;topic_id='.$topic_id,
448 448
             'image' => $ad_undigest,
449 449
             'name'  => _MD_NEWBB_UNDIGESTTOPIC
450 450
         ];
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
     // if the topic is pending/deleted then restore/approve
453 453
 } else {
454 454
     $admin_actions['restore'] = [
455
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/topicmanager.php?mode=restore&amp;topic_id=' . $topic_id,
455
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/topicmanager.php?mode=restore&amp;topic_id='.$topic_id,
456 456
         'name'  => _MD_NEWBB_RESTORETOPIC,
457 457
         'image' => $ad_restore
458 458
     ];
@@ -531,11 +531,11 @@  discard block
 block discarded – undo
531 531
                                                  'is_visible'      => $isVisible,
532 532
                                                  'visible_message' => $visibleMsg,
533 533
                                                  'disp_votes'      => $xp_config['disp_vote_nums'],
534
-                                                 'lang_vote'       => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_VOTE'),
535
-                                                 'lang_results'    => constant('_MD_' . strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']) . '_RESULTS'),
534
+                                                 'lang_vote'       => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_VOTE'),
535
+                                                 'lang_results'    => constant('_MD_'.strtoupper($GLOBALS['xoopsModuleConfig']['poll_module']).'_RESULTS'),
536 536
                                                  'back_link'       => ''
537 537
                                              ]);
538
-                $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']) . 'Renderer';
538
+                $classRenderer = ucfirst($GLOBALS['xoopsModuleConfig']['poll_module']).'Renderer';
539 539
                 /** @var Xoopspoll\Renderer $renderer */
540 540
                 $renderer = new $classRenderer($pollObject);
541 541
                 // check to see if user has voted, show form if not, otherwise get results for form
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
                     $myTpl = new \XoopsTpl();
548 548
                     $renderer->assignForm($myTpl);
549 549
                     $myTpl->assign('action', $GLOBALS['xoops']->url("modules/newbb/votepolls.php?topic_id={$topic_id}&amp;poll_id={$poll_id}"));
550
-                    $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '/templates/' . $GLOBALS['xoopsModuleConfig']['poll_module'] . '_view.tpl'));
550
+                    $topic_pollform = $myTpl->fetch($GLOBALS['xoops']->path('modules/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'/templates/'.$GLOBALS['xoopsModuleConfig']['poll_module'].'_view.tpl'));
551 551
                     $GLOBALS['xoopsTpl']->assign('topic_pollform', $topic_pollform);
552 552
                 } else {
553 553
                     $GLOBALS['xoopsTpl']->assign('can_vote', false);
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             // old xoopspoll or umfrage or any clone from them
559 559
         } else {
560 560
             $pollObject    = new $classPoll($poll_id);
561
-            $classRenderer = $classPoll . 'Renderer';
561
+            $classRenderer = $classPoll.'Renderer';
562 562
             $renderer      = new $classRenderer($pollObject);
563 563
             $xoopsTpl->assign('lang_alreadyvoted2', _PL_ALREADYVOTED2);
564 564
             $xoopsTpl->assign('has_ended', $pollObject->getVar('end_time') < time() ? 1 : 0);
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 
580 580
                 }
581 581
             }
582
-            $classLog = $classPoll . 'Log';
582
+            $classLog = $classPoll.'Log';
583 583
             $hasvoted = 0;
584 584
             if ($GLOBALS['xoopsUser']) {
585 585
                 if ($classLog::hasVoted($poll_id, Request::getString('REMOTE_ADDR', '', 'SERVER'), $uid)) {
@@ -595,12 +595,12 @@  discard block
 block discarded – undo
595 595
             if ($hasvoted || $pollObject->hasExpired()) {
596 596
                 $renderer->assignResults($xoopsTpl);
597 597
                 $xoopsTpl->assign('topic_pollresult', 1);
598
-                setcookie('newbb_polls[' . $poll_id . ']', 1);
598
+                setcookie('newbb_polls['.$poll_id.']', 1);
599 599
             } else {
600 600
                 $renderer->assignForm($xoopsTpl);
601 601
                 $xoopsTpl->assign('lang_vote', _PL_VOTE);
602 602
                 $xoopsTpl->assign('lang_results', _PL_RESULTS);
603
-                setcookie('newbb_polls[' . $poll_id . ']', 1);
603
+                setcookie('newbb_polls['.$poll_id.']', 1);
604 604
             }
605 605
         }
606 606
     }
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
             if (is_object($GLOBALS['xoopsUser'])
612 612
                 && $GLOBALS['xoopsUser']->getVar('uid') == $topicObject->getVar('topic_poster')) {
613 613
                 $t_poll = newbbDisplayImage('t_poll', _MD_NEWBB_ADDPOLL);
614
-                $xoopsTpl->assign('forum_addpoll', '<a href=\'' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=add&amp;topic_id=' . $topic_id . '\'>' . $t_poll . '</a>');
614
+                $xoopsTpl->assign('forum_addpoll', '<a href=\''.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=add&amp;topic_id='.$topic_id.'\'>'.$t_poll.'</a>');
615 615
             }
616 616
         } elseif ($isAdmin
617 617
                   || (is_object($pollObject) && is_object($GLOBALS['xoopsUser'])
@@ -623,22 +623,22 @@  discard block
 block discarded – undo
623 623
 
624 624
             $adminpoll_actions                = [];
625 625
             $adminpoll_actions['editpoll']    = [
626
-                'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=edit&amp;poll_id=' . $topicObject->getVar('poll_id') . '&amp;topic_id=' . $topic_id,
626
+                'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=edit&amp;poll_id='.$topicObject->getVar('poll_id').'&amp;topic_id='.$topic_id,
627 627
                 'image' => $poll_edit,
628 628
                 'name'  => _MD_NEWBB_EDITPOLL
629 629
             ];
630
-            $adminpoll_actions['deletepoll']  = [
631
-                'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=delete&amp;poll_id=' . $topicObject->getVar('poll_id') . '&amp;topic_id=' . $topic_id,
630
+            $adminpoll_actions['deletepoll'] = [
631
+                'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=delete&amp;poll_id='.$topicObject->getVar('poll_id').'&amp;topic_id='.$topic_id,
632 632
                 'image' => $poll_delete,
633 633
                 'name'  => _MD_NEWBB_DELETEPOLL
634 634
             ];
635 635
             $adminpoll_actions['restartpoll'] = [
636
-                'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=restart&amp;poll_id=' . $topicObject->getVar('poll_id') . '&amp;topic_id=' . $topic_id . '&amp;forum=' . $forum_id,
636
+                'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=restart&amp;poll_id='.$topicObject->getVar('poll_id').'&amp;topic_id='.$topic_id.'&amp;forum='.$forum_id,
637 637
                 'image' => $poll_restart,
638 638
                 'name'  => _MD_NEWBB_RESTARTPOLL
639 639
             ];
640
-            $adminpoll_actions['logpoll']     = [
641
-                'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/polls.php?op=log&amp;poll_id=' . $topicObject->getVar('poll_id') . '&amp;topic_id=' . $topic_id . '&amp;forum=' . $forum_id,
640
+            $adminpoll_actions['logpoll'] = [
641
+                'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/polls.php?op=log&amp;poll_id='.$topicObject->getVar('poll_id').'&amp;topic_id='.$topic_id.'&amp;forum='.$forum_id,
642 642
                 'image' => $poll_log,
643 643
                 'name'  => _MD_NEWBB_POLL_VIEWLOG
644 644
             ];
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
         $rating_img = newbbDisplayImage('blank');
671 671
     } else {
672 672
         // irmtfan - add alt key for rating
673
-        $rating_img = newbbDisplayImage('rate' . $rating, constant('_MD_NEWBB_RATE' . $rating));
673
+        $rating_img = newbbDisplayImage('rate'.$rating, constant('_MD_NEWBB_RATE'.$rating));
674 674
     }
675 675
     $xoopsTpl->assign('rating_img', $rating_img);
676 676
     $xoopsTpl->assign('rate1', newbbDisplayImage('rate1', _MD_NEWBB_RATE1));
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 
683 683
 // create jump box
684 684
 if (!empty($GLOBALS['xoopsModuleConfig']['show_jump'])) {
685
-    require_once __DIR__ . '/include/functions.forum.php';
685
+    require_once __DIR__.'/include/functions.forum.php';
686 686
     $xoopsTpl->assign('forum_jumpbox', newbbMakeJumpbox($forum_id));
687 687
 }
688 688
 
@@ -703,25 +703,25 @@  discard block
 block discarded – undo
703 703
 $viewmode_options = [];
704 704
 if ('DESC' === $order) {
705 705
     $viewmode_options[] = [
706
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&amp;status=$status&amp;topic_id=' . $topic_id,
706
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=ASC&amp;status=$status&amp;topic_id='.$topic_id,
707 707
         'title' => _OLDESTFIRST
708 708
     ];
709 709
 } else {
710 710
     $viewmode_options[] = [
711
-        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&amp;status=$status&amp;topic_id=' . $topic_id,
711
+        'link'  => XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/viewtopic.php?order=DESC&amp;status=$status&amp;topic_id='.$topic_id,
712 712
         'title' => _NEWESTFIRST
713 713
     ];
714 714
 }
715 715
 
716 716
 switch ($status) {
717 717
     case 'active':
718
-        $current_status = '[' . _MD_NEWBB_TYPE_ADMIN . ']';
718
+        $current_status = '['._MD_NEWBB_TYPE_ADMIN.']';
719 719
         break;
720 720
     case 'pending':
721
-        $current_status = '[' . _MD_NEWBB_TYPE_PENDING . ']';
721
+        $current_status = '['._MD_NEWBB_TYPE_PENDING.']';
722 722
         break;
723 723
     case 'deleted':
724
-        $current_status = '[' . _MD_NEWBB_TYPE_DELETED . ']';
724
+        $current_status = '['._MD_NEWBB_TYPE_DELETED.']';
725 725
         break;
726 726
     default:
727 727
         $current_status = '';
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     && $topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')
745 745
     && $moderateHandler->verifyUser(-1, '', $forumObject->getVar('forum_id'))) {
746 746
     // END irmtfan add verifyUser to quick reply
747
-    $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/post.php', 'post', true);
747
+    $forum_form = new \XoopsThemeForm(_MD_NEWBB_POSTREPLY, 'quick_reply', XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/post.php', 'post', true);
748 748
     if (!is_object($GLOBALS['xoopsUser'])) {
749 749
         //$configHandler = xoops_getHandler('config');
750 750
         $user_tray = new \XoopsFormElementTray(_MD_NEWBB_ACCOUNT);
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 
780 780
     $forum_form->addElement(new \XoopsFormHidden('isreply', 1));
781 781
 
782
-    $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE . ': ' . $topicObject->getVar('topic_title', 'e')));
782
+    $forum_form->addElement(new \XoopsFormHidden('subject', _MD_NEWBB_RE.': '.$topicObject->getVar('topic_title', 'e')));
783 783
     $forum_form->addElement(new \XoopsFormHidden('pid', empty($post_id) ? $topicHandler->getTopPostId($topic_id) : $post_id));
784 784
     $forum_form->addElement(new \XoopsFormHidden('topic_id', $topic_id));
785 785
     $forum_form->addElement(new \XoopsFormHidden('forum', $forum_id));
@@ -791,7 +791,7 @@  discard block
 block discarded – undo
791 791
     $forum_form->addElement(new \XoopsFormHidden('contents_submit', 1));
792 792
 
793 793
     $submit_button = new \XoopsFormButton('', 'quick_submit', _SUBMIT, 'submit');
794
-    $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\'' . _MD_NEWBB_QUICKREPLY_EMPTY . '\'); return false;} else { return true;}"');
794
+    $submit_button->setExtra('onclick="if (document.forms.quick_reply.message.value === \'RE\' || document.forms.quick_reply.message.value === \'\') { alert(\''._MD_NEWBB_QUICKREPLY_EMPTY.'\'); return false;} else { return true;}"');
795 795
     $forum_form->addElement($submit_button);
796 796
 
797 797
     $toggles = newbbGetCookie('G', true);
@@ -806,13 +806,13 @@  discard block
 block discarded – undo
806 806
     $quickreply['show']   = 1; // = !empty($GLOBALS['xoopsModuleConfig']['quickreply_enabled']
807 807
     $quickreply['expand'] = (count($toggles) > 0) ? (in_array('qr', $toggles, true) ? false : true) : true;
808 808
     if ($quickreply['expand']) {
809
-        $quickreply['style']     = 'block';        //irmtfan move semicolon
809
+        $quickreply['style']     = 'block'; //irmtfan move semicolon
810 810
         $quickreply_icon_display = $qr_expand;
811
-        $quickreply_alt          = _MD_NEWBB_HIDE . ' ' . _MD_NEWBB_QUICKREPLY;
811
+        $quickreply_alt          = _MD_NEWBB_HIDE.' '._MD_NEWBB_QUICKREPLY;
812 812
     } else {
813
-        $quickreply['style']     = 'none';        //irmtfan move semicolon
813
+        $quickreply['style']     = 'none'; //irmtfan move semicolon
814 814
         $quickreply_icon_display = $qr_collapse;
815
-        $quickreply_alt          = _MD_NEWBB_SEE . ' ' . _MD_NEWBB_QUICKREPLY;
815
+        $quickreply_alt          = _MD_NEWBB_SEE.' '._MD_NEWBB_QUICKREPLY;
816 816
     }
817 817
     $quickreply['displayImage'] = newbbDisplayImage($quickreply_icon_display, $quickreply_alt);
818 818
     $quickreply['form']         = $forum_form->render();
@@ -828,6 +828,6 @@  discard block
 block discarded – undo
828 828
     $xoopsTpl->assign('tagbar', tagBar($topicObject->getVar('topic_tags', 'n')));
829 829
 }
830 830
 // irmtfan move to footer.php
831
-require_once __DIR__ . '/footer.php';
831
+require_once __DIR__.'/footer.php';
832 832
 include $GLOBALS['xoops']->path('footer.php');
833 833
 $xoopsLogger->stopTime('newBB_viewtopic');
Please login to merge, or discard this patch.
class/GroupFormCheckBox.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     public function _renderOptionTree(&$tree, $option, $prefix, $parentIds = [])
43 43
     {
44 44
         if ($option['id'] > 0) {
45
-            $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="';
45
+            $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="';
46 46
             foreach ($parentIds as $pid) {
47 47
                 if ($pid <= 0) {
48 48
                     continue;
49 49
                 }
50
-                $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']';
51
-                $tree       .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}";
50
+                $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']';
51
+                $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}";
52 52
             }
53 53
             foreach ($option['allchild'] as $cid) {
54
-                $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']';
55
-                $tree      .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}";
54
+                $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']';
55
+                $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}";
56 56
             }
57 57
             $tree .= '" value="1"';
58 58
             if (in_array($option['id'], $this->_value)) {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                      . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75 75
                      . "\" /><br>\n";
76 76
         } else {
77
-            $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
77
+            $tree .= $prefix.$option['name'].'<input type="hidden" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id']."]\" /><br>\n";
78 78
         }
79 79
         if (isset($option['children'])) {
80 80
             foreach ($option['children'] as $child) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     //                  array_push($parentIds, $option['id']);
83 83
                     $parentIds[] = $option['id'];
84 84
                 }
85
-                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix . '&nbsp;-', $parentIds);
85
+                $this->_renderOptionTree($tree, $this->_optionTree[$child], $prefix.'&nbsp;-', $parentIds);
86 86
             }
87 87
         }
88 88
     }
Please login to merge, or discard this patch.
class/Post.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $attachmentSave = base64_encode(serialize($this->attachmentArray));
123 123
         }
124 124
         $this->setVar('attachment', $attachmentSave);
125
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('newbb_posts') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachmentSave) . ' WHERE post_id = ' . $this->getVar('post_id');
125
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('newbb_posts').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachmentSave).' WHERE post_id = '.$this->getVar('post_id');
126 126
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
127 127
             //xoops_error($GLOBALS['xoopsDB']->error());
128 128
             return false;
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 
153 153
         foreach ($attachOld as $key => $attach) {
154 154
             if (in_array($key, $attachArray)) {
155
-                @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $attach['name_saved']));
156
-                @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/thumbs/' . $attach['name_saved'])); // delete thumbnails
155
+                @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$attach['name_saved']));
156
+                @unlink($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/thumbs/'.$attach['name_saved'])); // delete thumbnails
157 157
                 continue;
158 158
             }
159 159
             $this->attachmentArray[$key] = $attach;
@@ -210,25 +210,25 @@  discard block
 block discarded – undo
210 210
         if (is_array($attachments) && count($attachments) > 0) {
211 211
             $iconHandler = newbbGetIconHandler();
212 212
             $mime_path   = $iconHandler->getPath('mime');
213
-            require_once dirname(__DIR__) . '/include/functions.image.php';
213
+            require_once dirname(__DIR__).'/include/functions.image.php';
214 214
             $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!!
215
-            $post_attachment  .= '<br><strong>' . _MD_NEWBB_ATTACHMENT . '</strong>:';
215
+            $post_attachment  .= '<br><strong>'._MD_NEWBB_ATTACHMENT.'</strong>:';
216 216
             $post_attachment  .= '<br><hr size="1" noshade="noshade" /><br>';
217 217
             foreach ($attachments as $key => $att) {
218 218
                 $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
219 219
                 $filetype       = $file_extension;
220
-                if (file_exists($GLOBALS['xoops']->path($mime_path . '/' . $filetype . '.gif'))) {
221
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif';
220
+                if (file_exists($GLOBALS['xoops']->path($mime_path.'/'.$filetype.'.gif'))) {
221
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif';
222 222
                 } else {
223
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif';
223
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif';
224 224
                 }
225
-                $file_size = @filesize($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'] . '/' . $att['name_saved']));
226
-                $file_size = number_format($file_size / 1024, 2) . ' KB';
225
+                $file_size = @filesize($GLOBALS['xoops']->path($GLOBALS['xoopsModuleConfig']['dir_attachments'].'/'.$att['name_saved']));
226
+                $file_size = number_format($file_size / 1024, 2).' KB';
227 227
                 if (in_array(strtolower($file_extension), $image_extensions)
228 228
                     && $GLOBALS['xoopsModuleConfig']['media_allowed']) {
229
-                    $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '" /><strong>&nbsp; ' . $att['nameDisplay'] . '</strong> <small>(' . $file_size . ')</small>';
230
-                    $post_attachment .= '<br>' . newbbAttachmentImage($att['name_saved']);
231
-                    $isDisplayed     = true;
229
+                    $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'" /><strong>&nbsp; '.$att['nameDisplay'].'</strong> <small>('.$file_size.')</small>';
230
+                    $post_attachment .= '<br>'.newbbAttachmentImage($att['name_saved']);
231
+                    $isDisplayed = true;
232 232
                 } else {
233 233
                     if (empty($GLOBALS['xoopsModuleConfig']['show_userattach'])) {
234 234
                         $post_attachment .= '<a href="'
@@ -362,10 +362,10 @@  discard block
 block discarded – undo
362 362
                 // End irmtfan add option to do only the latest edit when do_latestedit=0 (Alfred)
363 363
                 // START hacked by irmtfan
364 364
                 // display/save all edit records.
365
-                $post_edit .= _MD_NEWBB_EDITEDBY . ' ' . $edit_user . ' ' . _MD_NEWBB_ON . ' ' . formatTimestamp($edit_time) . '<br>';
365
+                $post_edit .= _MD_NEWBB_EDITEDBY.' '.$edit_user.' '._MD_NEWBB_ON.' '.formatTimestamp($edit_time).'<br>';
366 366
                 // if reason is not empty
367 367
                 if ('' !== $edit_msg) {
368
-                    $post_edit .= _MD_NEWBB_EDITEDMSG . ' ' . $edit_msg . '<br>';
368
+                    $post_edit .= _MD_NEWBB_EDITEDMSG.' '.$edit_msg.'<br>';
369 369
                 }
370 370
                 // START hacked by irmtfan
371 371
             }
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
     {
382 382
         global $viewtopic_users;
383 383
         $newbbConfig = newbbLoadConfig();
384
-        require_once __DIR__ . '/../include/functions.user.php';
385
-        require_once __DIR__ . '/../include/functions.render.php';
384
+        require_once __DIR__.'/../include/functions.user.php';
385
+        require_once __DIR__.'/../include/functions.render.php';
386 386
 
387 387
         $uid = is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
388 388
         /** @var KarmaHandler $karmaHandler */
@@ -393,14 +393,14 @@  discard block
 block discarded – undo
393 393
         $post['attachment'] = false;
394 394
         $post_text          = newbbDisplayTarea($this->vars['post_text']['value'], $this->getVar('dohtml'), $this->getVar('dosmiley'), $this->getVar('doxcode'), $this->getVar('doimage'), $this->getVar('dobr'));
395 395
         if (newbbIsAdmin($this->getVar('forum_id')) || $this->checkIdentity()) {
396
-            $post['text'] = $post_text . '<br>' . $this->displayAttachment();
396
+            $post['text'] = $post_text.'<br>'.$this->displayAttachment();
397 397
         } elseif ($newbbConfig['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
398 398
             $post['text'] = sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma'));
399 399
         } elseif ($newbbConfig['allow_require_reply'] && $this->getVar('require_reply')
400 400
                   && (!$uid || !isset($viewtopic_users[$uid]))) {
401 401
             $post['text'] = _MD_NEWBB_REPLY_REQUIREMENT;
402 402
         } else {
403
-            $post['text'] = $post_text . '<br>' . $this->displayAttachment();
403
+            $post['text'] = $post_text.'<br>'.$this->displayAttachment();
404 404
         }
405 405
         /** @var \XoopsMemberHandler $memberHandler */
406 406
         $memberHandler = xoops_getHandler('member');
@@ -485,8 +485,8 @@  discard block
 block discarded – undo
485 485
             $name_anonymous = $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']);
486 486
         }
487 487
 
488
-        require_once __DIR__ . '/../include/functions.time.php';
489
-        require_once __DIR__ . '/../include/functions.render.php';
488
+        require_once __DIR__.'/../include/functions.time.php';
489
+        require_once __DIR__.'/../include/functions.render.php';
490 490
 
491 491
         $post_id  = $this->getVar('post_id');
492 492
         $topic_id = $this->getVar('topic_id');
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         $query_array['topic_id'] = "topic_id={$topic_id}";
498 498
         foreach ($query_vars as $var) {
499 499
             if (Request::getString($var, '', 'GET')) {
500
-                $query_array[$var] = "{$var}=" . Request::getString($var, '', 'GET');
500
+                $query_array[$var] = "{$var}=".Request::getString($var, '', 'GET');
501 501
             }
502 502
         }
503 503
         $page_query = htmlspecialchars(implode('&', array_values($query_array)), ENT_QUOTES | ENT_HTML5);
@@ -515,11 +515,11 @@  discard block
 block discarded – undo
515 515
             $post_text       = $this->getVar('post_text');
516 516
             $post_attachment = $this->displayAttachment();
517 517
         } elseif ($GLOBALS['xoopsModuleConfig']['enable_karma'] && $this->getVar('post_karma') > $user_karma) {
518
-            $post_text       = "<div class='karma'>" . sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')) . '</div>';
518
+            $post_text       = "<div class='karma'>".sprintf(_MD_NEWBB_KARMA_REQUIREMENT, $user_karma, $this->getVar('post_karma')).'</div>';
519 519
             $post_attachment = '';
520 520
         } elseif ($GLOBALS['xoopsModuleConfig']['allow_require_reply'] && $this->getVar('require_reply')
521 521
                   && (!$uid || !in_array($uid, $viewtopic_posters))) {
522
-            $post_text       = "<div class='karma'>" . _MD_NEWBB_REPLY_REQUIREMENT . '</div>';
522
+            $post_text       = "<div class='karma'>"._MD_NEWBB_REPLY_REQUIREMENT.'</div>';
523 523
             $post_attachment = '';
524 524
         } else {
525 525
             $post_text       = $this->getVar('post_text');
@@ -546,9 +546,9 @@  discard block
 block discarded – undo
546 546
         }
547 547
 
548 548
         if ($posticon = $this->getVar('icon')) {
549
-            $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/subject/' . $posticon . '" alt="" /></a>';
549
+            $post_image = '<a name="'.$post_id.'"><img src="'.XOOPS_URL.'/images/subject/'.$posticon.'" alt="" /></a>';
550 550
         } else {
551
-            $post_image = '<a name="' . $post_id . '"><img src="' . XOOPS_URL . '/images/icons/posticon.gif" alt="" /></a>';
551
+            $post_image = '<a name="'.$post_id.'"><img src="'.XOOPS_URL.'/images/icons/posticon.gif" alt="" /></a>';
552 552
         }
553 553
 
554 554
         $thread_buttons = [];
@@ -557,10 +557,10 @@  discard block
 block discarded – undo
557 557
         if ($isAdmin && ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser']->getVar('uid') !== $this->getVar('uid'))
558 558
             && $this->getVar('uid') > 0) {
559 559
             $mod_buttons['bann']['image']    = newbbDisplayImage('p_bann', _MD_NEWBB_SUSPEND_MANAGEMENT);
560
-            $mod_buttons['bann']['link']     = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/moderate.php?forum=' . $forum_id . '&amp;uid=' . $this->getVar('uid');
560
+            $mod_buttons['bann']['link']     = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/moderate.php?forum='.$forum_id.'&amp;uid='.$this->getVar('uid');
561 561
             $mod_buttons['bann']['name']     = _MD_NEWBB_SUSPEND_MANAGEMENT;
562 562
             $thread_buttons['bann']['image'] = newbbDisplayImage('p_bann', _MD_NEWBB_SUSPEND_MANAGEMENT);
563
-            $thread_buttons['bann']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/moderate.php?forum=' . $forum_id . '&amp;uid=' . $this->getVar('uid');
563
+            $thread_buttons['bann']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/moderate.php?forum='.$forum_id.'&amp;uid='.$this->getVar('uid');
564 564
             $thread_buttons['bann']['name']  = _MD_NEWBB_SUSPEND_MANAGEMENT;
565 565
         }
566 566
 
@@ -573,10 +573,10 @@  discard block
 block discarded – undo
573 573
 
574 574
                 if ($edit_ok) {
575 575
                     $thread_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT);
576
-                    $thread_buttons['edit']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}";
576
+                    $thread_buttons['edit']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}";
577 577
                     $thread_buttons['edit']['name']  = _EDIT;
578 578
                     $mod_buttons['edit']['image']    = newbbDisplayImage('p_edit', _EDIT);
579
-                    $mod_buttons['edit']['link']     = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}";
579
+                    $mod_buttons['edit']['link']     = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}";
580 580
                     $mod_buttons['edit']['name']     = _EDIT;
581 581
                 }
582 582
             }
@@ -586,55 +586,55 @@  discard block
 block discarded – undo
586 586
 
587 587
                 if ($delete_ok) {
588 588
                     $thread_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE);
589
-                    $thread_buttons['delete']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}";
589
+                    $thread_buttons['delete']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}";
590 590
                     $thread_buttons['delete']['name']  = _DELETE;
591 591
                     $mod_buttons['delete']['image']    = newbbDisplayImage('p_delete', _DELETE);
592
-                    $mod_buttons['delete']['link']     = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}";
592
+                    $mod_buttons['delete']['link']     = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}";
593 593
                     $mod_buttons['delete']['name']     = _DELETE;
594 594
                 }
595 595
             }
596 596
             if ($topicHandler->getPermission($forum_id, $topic_status, 'reply')) {
597 597
                 $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY);
598
-                $thread_buttons['reply']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}";
598
+                $thread_buttons['reply']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}";
599 599
                 $thread_buttons['reply']['name']  = _MD_NEWBB_REPLY;
600 600
 
601 601
                 $thread_buttons['quote']['image'] = newbbDisplayImage('p_quote', _MD_NEWBB_QUOTE);
602
-                $thread_buttons['quote']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}&amp;quotedac=1";
602
+                $thread_buttons['quote']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}&amp;quotedac=1";
603 603
                 $thread_buttons['quote']['name']  = _MD_NEWBB_QUOTE;
604 604
             }
605 605
         } else {
606 606
             $mod_buttons['edit']['image'] = newbbDisplayImage('p_edit', _EDIT);
607
-            $mod_buttons['edit']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/edit.php?{$page_query}";
607
+            $mod_buttons['edit']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/edit.php?{$page_query}";
608 608
             $mod_buttons['edit']['name']  = _EDIT;
609 609
 
610 610
             $mod_buttons['delete']['image'] = newbbDisplayImage('p_delete', _DELETE);
611
-            $mod_buttons['delete']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/delete.php?{$page_query}";
611
+            $mod_buttons['delete']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/delete.php?{$page_query}";
612 612
             $mod_buttons['delete']['name']  = _DELETE;
613 613
 
614 614
             $thread_buttons['reply']['image'] = newbbDisplayImage('p_reply', _MD_NEWBB_REPLY);
615
-            $thread_buttons['reply']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/reply.php?{$page_query}";
615
+            $thread_buttons['reply']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/reply.php?{$page_query}";
616 616
             $thread_buttons['reply']['name']  = _MD_NEWBB_REPLY;
617 617
         }
618 618
 
619 619
         if (!$isAdmin && $GLOBALS['xoopsModuleConfig']['reportmod_enabled']) {
620 620
             $thread_buttons['report']['image'] = newbbDisplayImage('p_report', _MD_NEWBB_REPORT);
621
-            $thread_buttons['report']['link']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/report.php?{$page_query}";
621
+            $thread_buttons['report']['link']  = XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname')."/report.php?{$page_query}";
622 622
             $thread_buttons['report']['name']  = _MD_NEWBB_REPORT;
623 623
         }
624 624
 
625 625
         $thread_action = [];
626 626
         // irmtfan add pdf permission
627
-        if (file_exists(XOOPS_ROOT_PATH . '/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')
627
+        if (file_exists(XOOPS_ROOT_PATH.'/class/libraries/vendor/tecnickcom/tcpdf/tcpdf.php')
628 628
             && $topicHandler->getPermission($forum_id, $topic_status, 'pdf')) {
629 629
             $thread_action['pdf']['image']  = newbbDisplayImage('pdf', _MD_NEWBB_PDF);
630
-            $thread_action['pdf']['link']   = XOOPS_URL . '/modules/newbb/makepdf.php?type=post&amp;pageid=0';
630
+            $thread_action['pdf']['link']   = XOOPS_URL.'/modules/newbb/makepdf.php?type=post&amp;pageid=0';
631 631
             $thread_action['pdf']['name']   = _MD_NEWBB_PDF;
632 632
             $thread_action['pdf']['target'] = '_blank';
633 633
         }
634 634
         // irmtfan add print permission
635 635
         if ($topicHandler->getPermission($forum_id, $topic_status, 'print')) {
636 636
             $thread_action['print']['image']  = newbbDisplayImage('printer', _MD_NEWBB_PRINT);
637
-            $thread_action['print']['link']   = XOOPS_URL . '/modules/newbb/print.php?form=2&amp;forum=' . $forum_id . '&amp;topic_id=' . $topic_id;
637
+            $thread_action['print']['link']   = XOOPS_URL.'/modules/newbb/print.php?form=2&amp;forum='.$forum_id.'&amp;topic_id='.$topic_id;
638 638
             $thread_action['print']['name']   = _MD_NEWBB_PRINT;
639 639
             $thread_action['print']['target'] = '_blank';
640 640
         }
@@ -642,45 +642,45 @@  discard block
 block discarded – undo
642 642
         if ($GLOBALS['xoopsModuleConfig']['show_sociallinks']) {
643 643
             $full_title  = $this->getVar('subject');
644 644
             $clean_title = preg_replace('/[^A-Za-z0-9-]+/', '+', $this->getVar('subject'));
645
-            $full_link   = XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $post_id;
645
+            $full_link   = XOOPS_URL.'/modules/newbb/viewtopic.php?post_id='.$post_id;
646 646
 
647 647
             $thread_action['social_twitter']['image']  = newbbDisplayImage('twitter', _MD_NEWBB_SHARE_TWITTER);
648
-            $thread_action['social_twitter']['link']   = 'http://twitter.com/share?text=' . $clean_title . '&amp;url=' . $full_link;
648
+            $thread_action['social_twitter']['link']   = 'http://twitter.com/share?text='.$clean_title.'&amp;url='.$full_link;
649 649
             $thread_action['social_twitter']['name']   = _MD_NEWBB_SHARE_TWITTER;
650 650
             $thread_action['social_twitter']['target'] = '_blank';
651 651
 
652 652
             $thread_action['social_facebook']['image']  = newbbDisplayImage('facebook', _MD_NEWBB_SHARE_FACEBOOK);
653
-            $thread_action['social_facebook']['link']   = 'http://www.facebook.com/sharer.php?u=' . $full_link;
653
+            $thread_action['social_facebook']['link']   = 'http://www.facebook.com/sharer.php?u='.$full_link;
654 654
             $thread_action['social_facebook']['name']   = _MD_NEWBB_SHARE_FACEBOOK;
655 655
             $thread_action['social_facebook']['target'] = '_blank';
656 656
 
657 657
             $thread_action['social_gplus']['image']  = newbbDisplayImage('googleplus', _MD_NEWBB_SHARE_GOOGLEPLUS);
658
-            $thread_action['social_gplus']['link']   = 'https://plusone.google.com/_/+1/confirm?hl=en&url=' . $full_link;
658
+            $thread_action['social_gplus']['link']   = 'https://plusone.google.com/_/+1/confirm?hl=en&url='.$full_link;
659 659
             $thread_action['social_gplus']['name']   = _MD_NEWBB_SHARE_GOOGLEPLUS;
660 660
             $thread_action['social_gplus']['target'] = '_blank';
661 661
 
662 662
             $thread_action['social_linkedin']['image']  = newbbDisplayImage('linkedin', _MD_NEWBB_SHARE_LINKEDIN);
663
-            $thread_action['social_linkedin']['link']   = 'http://www.linkedin.com/shareArticle?mini=true&amp;title=' . $full_title . '&amp;url=' . $full_link;
663
+            $thread_action['social_linkedin']['link']   = 'http://www.linkedin.com/shareArticle?mini=true&amp;title='.$full_title.'&amp;url='.$full_link;
664 664
             $thread_action['social_linkedin']['name']   = _MD_NEWBB_SHARE_LINKEDIN;
665 665
             $thread_action['social_linkedin']['target'] = '_blank';
666 666
 
667 667
             $thread_action['social_delicious']['image']  = newbbDisplayImage('delicious', _MD_NEWBB_SHARE_DELICIOUS);
668
-            $thread_action['social_delicious']['link']   = 'http://del.icio.us/post?title=' . $full_title . '&amp;url=' . $full_link;
668
+            $thread_action['social_delicious']['link']   = 'http://del.icio.us/post?title='.$full_title.'&amp;url='.$full_link;
669 669
             $thread_action['social_delicious']['name']   = _MD_NEWBB_SHARE_DELICIOUS;
670 670
             $thread_action['social_delicious']['target'] = '_blank';
671 671
 
672 672
             $thread_action['social_digg']['image']  = newbbDisplayImage('digg', _MD_NEWBB_SHARE_DIGG);
673
-            $thread_action['social_digg']['link']   = 'http://digg.com/submit?phase=2&amp;title=' . $full_title . '&amp;url=' . $full_link;
673
+            $thread_action['social_digg']['link']   = 'http://digg.com/submit?phase=2&amp;title='.$full_title.'&amp;url='.$full_link;
674 674
             $thread_action['social_digg']['name']   = _MD_NEWBB_SHARE_DIGG;
675 675
             $thread_action['social_digg']['target'] = '_blank';
676 676
 
677 677
             $thread_action['social_reddit']['image']  = newbbDisplayImage('reddit', _MD_NEWBB_SHARE_REDDIT);
678
-            $thread_action['social_reddit']['link']   = 'http://reddit.com/submit?title=' . $full_title . '&amp;url=' . $full_link;
678
+            $thread_action['social_reddit']['link']   = 'http://reddit.com/submit?title='.$full_title.'&amp;url='.$full_link;
679 679
             $thread_action['social_reddit']['name']   = _MD_NEWBB_SHARE_REDDIT;
680 680
             $thread_action['social_reddit']['target'] = '_blank';
681 681
 
682 682
             $thread_action['social_wong']['image']  = newbbDisplayImage('wong', _MD_NEWBB_SHARE_MRWONG);
683
-            $thread_action['social_wong']['link']   = 'http://www.mister-wong.de/index.php?action=addurl&bm_url=' . $full_link;
683
+            $thread_action['social_wong']['link']   = 'http://www.mister-wong.de/index.php?action=addurl&bm_url='.$full_link;
684 684
             $thread_action['social_wong']['name']   = _MD_NEWBB_SHARE_MRWONG;
685 685
             $thread_action['social_wong']['target'] = '_blank';
686 686
         }
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
             'thread_buttons'  => $thread_buttons,
705 705
             'mod_buttons'     => $mod_buttons,
706 706
             'poster'          => $poster,
707
-            'post_permalink'  => '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewtopic.php?post_id=' . $post_id . '"></a>'
707
+            'post_permalink'  => '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?post_id='.$post_id.'"></a>'
708 708
         ];
709 709
 
710 710
         unset($thread_buttons, $mod_buttons, $eachposter);
Please login to merge, or discard this patch.
class/TopicHandler.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $topic_id = $object->getVar('topic_id');
90 90
         if ($force) {
91
-            $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . " SET approved = -1 WHERE topic_id = {$topic_id}";
91
+            $sql = 'UPDATE '.$this->db->prefix('newbb_topics')." SET approved = -1 WHERE topic_id = {$topic_id}";
92 92
         } else {
93
-            $sql = 'UPDATE ' . $this->db->prefix('newbb_topics') . " SET approved = 1 WHERE topic_id = {$topic_id}";
93
+            $sql = 'UPDATE '.$this->db->prefix('newbb_topics')." SET approved = 1 WHERE topic_id = {$topic_id}";
94 94
         }
95 95
         if (!$result = $this->db->queryF($sql)) {
96 96
             //xoops_error($this->db->error());
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $topic = null;
132 132
         if (!empty($action)) {
133
-            $sql = 'SELECT * FROM ' . $this->table . ' WHERE 1=1' . (($forum_id > 0) ? ' AND forum_id=' . (int)$forum_id : '') . ' AND topic_id ' . (($action > 0) ? '>' : '<') . (int)$topic_id . ' ORDER BY topic_id ' . (($action > 0) ? 'ASC' : 'DESC') . ' LIMIT 1';
133
+            $sql = 'SELECT * FROM '.$this->table.' WHERE 1=1'.(($forum_id > 0) ? ' AND forum_id='.(int)$forum_id : '').' AND topic_id '.(($action > 0) ? '>' : '<').(int)$topic_id.' ORDER BY topic_id '.(($action > 0) ? 'ASC' : 'DESC').' LIMIT 1';
134 134
             if ($result = $this->db->query($sql)) {
135 135
                 if ($row = $this->db->fetchArray($result)) {
136 136
                     $topic = $this->create(false);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     public function &getByPost($post_id)
153 153
     {
154 154
         $topic  = null;
155
-        $sql    = 'SELECT t.* FROM ' . $this->db->prefix('newbb_topics') . ' t, ' . $this->db->prefix('newbb_posts') . ' p
155
+        $sql    = 'SELECT t.* FROM '.$this->db->prefix('newbb_topics').' t, '.$this->db->prefix('newbb_posts').' p
156 156
                 WHERE t.topic_id = p.topic_id AND p.post_id = ' . (int)$post_id;
157 157
         $result = $this->db->query($sql);
158 158
         if (!$result) {
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
     public function &getTopPost($topic_id)
201 201
     {
202 202
         $post = null;
203
-        $sql  = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p,
204
-            ' . $this->db->prefix('newbb_posts_text') . ' t
203
+        $sql  = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p,
204
+            ' . $this->db->prefix('newbb_posts_text').' t
205 205
             WHERE
206
-            p.topic_id = ' . $topic_id . ' AND p.pid = 0
206
+            p.topic_id = ' . $topic_id.' AND p.pid = 0
207 207
             AND t.post_id = p.post_id';
208 208
 
209 209
         $result = $this->db->query($sql);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     public function getTopPostId($topic_id)
229 229
     {
230
-        $sql    = 'SELECT MIN(post_id) AS post_id FROM ' . $this->db->prefix('newbb_posts') . ' WHERE topic_id = ' . $topic_id . ' AND pid = 0';
230
+        $sql    = 'SELECT MIN(post_id) AS post_id FROM '.$this->db->prefix('newbb_posts').' WHERE topic_id = '.$topic_id.' AND pid = 0';
231 231
         $result = $this->db->query($sql);
232 232
         if (!$result) {
233 233
             //xoops_error($this->db->error());
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
                 $operator_for_position = '<';
273 273
             }
274 274
             //$approveCriteria = ' AND approved = 1'; // any others?
275
-            $sql    = 'SELECT COUNT(*) FROM ' . $this->db->prefix('newbb_posts') . ' AS p WHERE p.topic_id=' . (int)$topic->getVar('topic_id') . $approveCriteria . " AND p.post_id $operator_for_position $post_id";
275
+            $sql    = 'SELECT COUNT(*) FROM '.$this->db->prefix('newbb_posts').' AS p WHERE p.topic_id='.(int)$topic->getVar('topic_id').$approveCriteria." AND p.post_id $operator_for_position $post_id";
276 276
             $result = $this->db->query($sql);
277 277
             if (!$result) {
278 278
                 //xoops_error($this->db->error());
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
             $start = (int)($position / $perpage) * $perpage;
283 283
         }
284 284
 
285
-        $sql    = 'SELECT p.*, t.* FROM ' . $this->db->prefix('newbb_posts') . ' p, ' . $this->db->prefix('newbb_posts_text') . ' t WHERE p.topic_id=' . $topic->getVar('topic_id') . ' AND p.post_id = t.post_id' . $approveCriteria . " ORDER BY p.post_id $order";
285
+        $sql    = 'SELECT p.*, t.* FROM '.$this->db->prefix('newbb_posts').' p, '.$this->db->prefix('newbb_posts_text').' t WHERE p.topic_id='.$topic->getVar('topic_id').' AND p.post_id = t.post_id'.$approveCriteria." ORDER BY p.post_id $order";
286 286
         $result = $this->db->query($sql, $perpage, $start);
287 287
         if (!$result) {
288 288
             //xoops_error($this->db->error());
@@ -327,18 +327,18 @@  discard block
 block discarded – undo
327 327
         $postArray['post_time'] = newbbFormatTimestamp($postArray['post_time']);
328 328
 
329 329
         if (!empty($postArray['icon'])) {
330
-            $postArray['icon'] = '<img src="' . XOOPS_URL . '/images/subject/' . htmlspecialchars($postArray['icon'], ENT_QUOTES | ENT_HTML5) . '" alt="" />';
330
+            $postArray['icon'] = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($postArray['icon'], ENT_QUOTES | ENT_HTML5).'" alt="" />';
331 331
         } else {
332
-            $postArray['icon'] = '<a name="' . $postArray['post_id'] . '"><img src="' . XOOPS_URL . '/images/icons/no_posticon.gif" alt="" /></a>';
332
+            $postArray['icon'] = '<a name="'.$postArray['post_id'].'"><img src="'.XOOPS_URL.'/images/icons/no_posticon.gif" alt="" /></a>';
333 333
         }
334 334
 
335
-        $postArray['subject'] = '<a href="viewtopic.php?viewmode=thread&amp;topic_id=' . $topic->getVar('topic_id') . '&amp;forum=' . $postArray['forum_id'] . '&amp;post_id=' . $postArray['post_id'] . '">' . $postArray['subject'] . '</a>';
335
+        $postArray['subject'] = '<a href="viewtopic.php?viewmode=thread&amp;topic_id='.$topic->getVar('topic_id').'&amp;forum='.$postArray['forum_id'].'&amp;post_id='.$postArray['post_id'].'">'.$postArray['subject'].'</a>';
336 336
 
337 337
         $isActiveUser = false;
338 338
         if (isset($viewtopic_users[$postArray['uid']]['name'])) {
339 339
             $postArray['poster'] = $viewtopic_users[$postArray['uid']]['name'];
340 340
             if ($postArray['uid'] > 0) {
341
-                $postArray['poster'] = '<a href="' . XOOPS_URL . '/userinfo.php?uid=' . $postArray['uid'] . '">' . $viewtopic_users[$postArray['uid']]['name'] . '</a>';
341
+                $postArray['poster'] = '<a href="'.XOOPS_URL.'/userinfo.php?uid='.$postArray['uid'].'">'.$viewtopic_users[$postArray['uid']]['name'].'</a>';
342 342
             }
343 343
         } else {
344 344
             $postArray['poster'] = empty($postArray['poster_name']) ? $myts->htmlSpecialChars($GLOBALS['xoopsConfig']['anonymous']) : $postArray['poster_name'];
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
      */
355 355
     public function &getAllPosters(&$topic, $isApproved = true)
356 356
     {
357
-        $sql = 'SELECT DISTINCT uid FROM ' . $this->db->prefix('newbb_posts') . '  WHERE topic_id=' . $topic->getVar('topic_id') . ' AND uid>0';
357
+        $sql = 'SELECT DISTINCT uid FROM '.$this->db->prefix('newbb_posts').'  WHERE topic_id='.$topic->getVar('topic_id').' AND uid>0';
358 358
         if ($isApproved) {
359 359
             $sql .= ' AND approved = 1';
360 360
         }
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     public function getPermission($forum, $topic_locked = 0, $type = 'view')
409 409
     {
410 410
         static $_cachedTopicPerms;
411
-        require_once __DIR__ . '/../include/functions.user.php';
411
+        require_once __DIR__.'/../include/functions.user.php';
412 412
         if (newbbIsAdmin($forum)) {
413 413
             return true;
414 414
         }
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
         }
506 506
         $b1 = $this->insert($object, $force);
507 507
         $criteria->add(new \Criteria('post_id', $top_post, '<>'), 'AND');
508
-        $criteria->add(new \Criteria('pid', '(' . implode(', ', $post_ids) . ')', 'NOT IN'), 'AND');
508
+        $criteria->add(new \Criteria('pid', '('.implode(', ', $post_ids).')', 'NOT IN'), 'AND');
509 509
         $b2       = $postHandler->updateAll('pid', $top_post, $criteria, $force);
510 510
         $criteria = new \CriteriaCompo();
511 511
         $criteria->add(new \Criteria('post_id', $top_post, '='), 'AND');
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         $allDirs  = xoops_getActiveModules();
527 527
         foreach ($allDirs as $dirname) {
528 528
             // pollresults.php file is exist in all xoopspoll versions and umfrage versions
529
-            if (file_exists($GLOBALS['xoops']->path('modules/' . $dirname . '/pollresults.php'))) {
529
+            if (file_exists($GLOBALS['xoops']->path('modules/'.$dirname.'/pollresults.php'))) {
530 530
                 $pollDirs[$dirname] = $dirname;
531 531
             }
532 532
         }
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'], ENT_QUOTES | ENT_HTML5) . '" alt="" />';
314
+                $topic_icon = '<img src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5).'" 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/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'], ENT_QUOTES | ENT_HTML5) . '" alt="" />';
945
+                $topic_icon = '<img align="middle" src="'.XOOPS_URL.'/images/subject/'.htmlspecialchars($myrow['icon'], ENT_QUOTES | ENT_HTML5).'" 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.
class/GroupPermForm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         foreach (array_keys($glist) as $i) {
55 55
             // get selected item id(s) for each group
56 56
             $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid);
57
-            $ele      = new Newbb\GroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
57
+            $ele      = new Newbb\GroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
58 58
             $ele->setOptionTree($this->_itemTree);
59 59
             $this->addElement($ele);
60 60
             unset($ele);
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
64 64
         $tray->addElement(new \XoopsFormButton('', 'reset', _CANCEL, 'reset'));
65 65
         $this->addElement($tray);
66
-        $ret      = '<br><strong>' . $this->getTitle() . '</strong><br>' . $this->_permDesc . '<br>';
67
-        $ret      .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
66
+        $ret      = '<br><strong>'.$this->getTitle().'</strong><br>'.$this->_permDesc.'<br>';
67
+        $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1' valign='top'>\n";
68 68
         $elements = $this->getElements();
69 69
         $hidden   = '';
70 70
         foreach (array_keys($elements) as $i) {
71 71
             if (!is_object($elements[$i])) {
72 72
                 $ret .= $elements[$i];
73 73
             } elseif (!$elements[$i]->isHidden()) {
74
-                $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
74
+                $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption();
75 75
                 if ('' !== $elements[$i]->getDescription()) {
76
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
76
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>';
77 77
                 }
78
-                $ret .= "</td>\n<td class='even' style='text-align:center;'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
78
+                $ret .= "</td>\n<td class='even' style='text-align:center;'>\n".$elements[$i]->render()."\n</td></tr>\n";
79 79
             } else {
80 80
                 $hidden .= $elements[$i]->render();
81 81
             }
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 
12 12
 use Xmf\Request;
13 13
 
14
-include dirname(dirname(__DIR__)) . '/mainfile.php';
15
-require_once __DIR__ . '/include/common.php';
14
+include dirname(dirname(__DIR__)).'/mainfile.php';
15
+require_once __DIR__.'/include/common.php';
16 16
 
17 17
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
18 18
 /** @var \XoopsLogger $xoopsLogger */
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 //require_once $GLOBALS['xoops']->path('header.php');
24 24
 
25 25
 if (!empty($GLOBALS['xoopsModuleConfig']['do_rewrite'])) {
26
-    require_once __DIR__ . '/seo_url.php';
26
+    require_once __DIR__.'/seo_url.php';
27 27
     /* for seo */
28 28
     $toseo_url = ['index.php', 'viewforum.php', 'viewtopic.php', 'rss.php'];
29 29
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 //rewrite only for files
38 38
 
39 39
                 if ('' !== trim(getenv('SCRIPT_NAME'))) {
40
-                    if (false === strpos(getenv('REQUEST_URI'), '/' . SEO_MODULE_NAME . '/')) {
40
+                    if (false === strpos(getenv('REQUEST_URI'), '/'.SEO_MODULE_NAME.'/')) {
41 41
                         $redir = true;
42 42
                     } elseif (getenv('QUERY_STRING')) {
43 43
                         $redir = true;
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
         }
48 48
 
49 49
         if (true === $redir) {
50
-            $s      = 'http://' . getenv('HTTP_HOST') . getenv('REQUEST_URI');
51
-            $s      = str_replace('/' . REAL_MODULE_NAME . '/', '/' . SEO_MODULE_NAME . '/', $s);
52
-            $newurl = seo_urls('<a href="' . $s . '"></a>');
50
+            $s      = 'http://'.getenv('HTTP_HOST').getenv('REQUEST_URI');
51
+            $s      = str_replace('/'.REAL_MODULE_NAME.'/', '/'.SEO_MODULE_NAME.'/', $s);
52
+            $newurl = seo_urls('<a href="'.$s.'"></a>');
53 53
             $newurl = str_replace('<a href="', '', $newurl);
54 54
             $newurl = str_replace('"></a>', '', $newurl);
55 55
             if (!headers_sent()) {
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
     }
62 62
 }
63 63
 
64
-require_once $GLOBALS['xoops']->path('modules/' . $moduleDirName . '/include/vars.php');
64
+require_once $GLOBALS['xoops']->path('modules/'.$moduleDirName.'/include/vars.php');
65 65
 
66
-require_once __DIR__ . '/include/functions.user.php';
67
-require_once __DIR__ . '/include/functions.topic.php';
66
+require_once __DIR__.'/include/functions.user.php';
67
+require_once __DIR__.'/include/functions.topic.php';
68 68
 
69 69
 require_once $GLOBALS['xoops']->path('class/xoopsformloader.php');
70 70
 require_once $GLOBALS['xoops']->path('class/module.textsanitizer.php');
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 $menumode       = 0;
74 74
 $menumode_other = [];
75 75
 $menu_url       = htmlspecialchars(preg_replace('/&menumode=[^&]/', '', Request::getString('REQUEST_URI', '', 'SERVER')), ENT_QUOTES | ENT_HTML5);
76
-$menu_url       .= (false === strpos($menu_url, '?')) ? '?menumode=' : '&amp;menumode=';
76
+$menu_url .= (false === strpos($menu_url, '?')) ? '?menumode=' : '&amp;menumode=';
77 77
 //foreach ($GLOBALS['xoopsModuleConfig']['valid_menumodes'] as $key => $val) {
78 78
 //    if ($key !== $menumode) {
79 79
 //        $menumode_other[] = array('title' => $val, 'link' => $menu_url . $key);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 if (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsModuleConfig']['welcome_forum'])
84 84
     && !$GLOBALS['xoopsUser']->getVar('posts')) {
85
-    require_once __DIR__ . '/include/functions.welcome.php';
85
+    require_once __DIR__.'/include/functions.welcome.php';
86 86
 }
87 87
 // irmtfan for backward compatibility
88 88
 $pollmodules = $GLOBALS['xoopsModuleConfig']['poll_module'];
Please login to merge, or discard this patch.