Cancelled
Push — master ( dd6e46...186ca8 )
by Michael
72:53 queued 72:53
created
view.tag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,5 +8,5 @@
 block discarded – undo
8 8
  * @since          4.00
9 9
  * @package        module::newbb
10 10
  */
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 include $GLOBALS['xoops']->path('modules/tag/view.tag.php');
Please login to merge, or discard this patch.
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.
class/GroupFormCheckBox.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,20 +59,20 @@
 block discarded – undo
59 59
                 $tree .= ' checked';
60 60
             }
61 61
             $tree .= ' />'
62
-                     . $option['name']
63
-                     . '<input type="hidden" name="'
64
-                     . $this->getName()
65
-                     . '[parents]['
66
-                     . $option['id']
67
-                     . ']" value="'
68
-                     . implode(':', $parentIds)
69
-                     . '" /><input type="hidden" name="'
70
-                     . $this->getName()
71
-                     . '[itemname]['
72
-                     . $option['id']
73
-                     . ']" value="'
74
-                     . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75
-                     . "\" /><br>\n";
62
+                        . $option['name']
63
+                        . '<input type="hidden" name="'
64
+                        . $this->getName()
65
+                        . '[parents]['
66
+                        . $option['id']
67
+                        . ']" value="'
68
+                        . implode(':', $parentIds)
69
+                        . '" /><input type="hidden" name="'
70
+                        . $this->getName()
71
+                        . '[itemname]['
72
+                        . $option['id']
73
+                        . ']" value="'
74
+                        . htmlspecialchars($option['name'], ENT_QUOTES | ENT_HTML5)
75
+                        . "\" /><br>\n";
76 76
         } else {
77 77
             $tree .= $prefix . $option['name'] . '<input type="hidden" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . "]\" /><br>\n";
78 78
         }
Please login to merge, or discard this 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/Readtopic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 //  URL: https://xoops.org                                                    //
30 30
 //  Project: Article Project                                                 //
31 31
 //  ------------------------------------------------------------------------ //
32
-require_once __DIR__ . '/read.php';
32
+require_once __DIR__.'/read.php';
33 33
 
34 34
 /**
35 35
  * A handler for read/unread handling
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.