Completed
Push — master ( 80219e...2744eb )
by Michael
08:05
created
open_category.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 
14 14
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
15 15
 
16 16
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
17 17
 
18
-require_once XOOPS_ROOT_PATH . '/header.php';
19
-require_once __DIR__ . '/footer.php';
18
+require_once XOOPS_ROOT_PATH.'/header.php';
19
+require_once __DIR__.'/footer.php';
20 20
 
21 21
 $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
22 22
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 $last_qnaObj = $faqHandler->getLastPublishedByCat([Constants::SF_STATUS_OPENED]);
64 64
 if (isset($last_qnaObj[$categoryid])) {
65 65
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
66
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
66
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
67 67
 }
68 68
 // Populating the smarty variables with informations related to the selected category
69 69
 $category                 = $categoryObj->toArray(null, true);
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 $category['categoryPath'] = $categoryObj->getCategoryPath(false, true);
72 72
 
73 73
 // Creating the sub-categories objects that belong to the selected category
74
-$subcatsObj     =& $categoryHandler->getCategories(0, 0, $categoryid);
74
+$subcatsObj     = & $categoryHandler->getCategories(0, 0, $categoryid);
75 75
 $total_subcats  = count($subcatsObj);
76 76
 $catQnasWithSub = 0;
77 77
 if (0 != $total_subcats) {
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
83 83
             if (isset($last_qnaObj[$subcat_id])) {
84 84
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
85
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
85
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
86 86
             }
87 87
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
88 88
             $subcats[$subcat_id] = $subcat->toArray(null, true);
89
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
89
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
90 90
         }
91 91
     }
92 92
     $xoopsTpl->assign('subcats', $subcats);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     }
101 101
 
102 102
     $memberHandler = xoops_getHandler('member');
103
-    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
103
+    $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
104 104
     foreach ($faqsObj as $iValue) {
105 105
         $faq = $iValue->toArray(null, $allcategories);
106 106
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     }
113 113
 }
114 114
 // Language constants
115
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
115
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
116 116
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
117 117
 
118 118
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
130 130
 
131 131
 // The Navigation Bar
132
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
133
-$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
132
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
133
+$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
134 134
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
135
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
135
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
136 136
 } else {
137
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
137
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
138 138
 }
139 139
 
140 140
 $xoopsTpl->assign('category', $category);
141 141
 
142 142
 // Page Title Hack by marcan
143 143
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
144
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
144
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
145 145
 // End Page Title Hack by marcan
146 146
 
147
-require_once XOOPS_ROOT_PATH . '/footer.php';
147
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
class/Answer.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             $attachment_save = base64_encode(serialize($this->attachment_array));
101 101
         }
102 102
         $this->setVar('attachment', $attachment_save);
103
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid');
103
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid');
104 104
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
105 105
             //xoops_error($GLOBALS["xoopsDB"]->error());
106 106
             return false;
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
132 132
 
133 133
         foreach ($attach_old as $key => $attach) {
134 134
             if (in_array($key, $attach_array)) {
135
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']);
136
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails
135
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']);
136
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails
137 137
                 continue;
138 138
             }
139 139
             $this->attachment_array[$key] = $attach;
@@ -190,24 +190,24 @@  discard block
 block discarded – undo
190 190
         if (is_array($attachments) && count($attachments) > 0) {
191 191
             $iconHandler = sf_getIconHandler();
192 192
             $mime_path   = $iconHandler->getPath('mime');
193
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php';
193
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php';
194 194
             $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!!
195
-            $post_attachment  .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:';
195
+            $post_attachment  .= '<br><strong>'._MD_ATTACHMENT.'</strong>:';
196 196
             $post_attachment  .= '<br><hr size="1" noshade="noshade"><br>';
197 197
             foreach ($attachments as $key => $att) {
198 198
                 $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
199 199
                 $filetype       = $file_extension;
200
-                if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) {
201
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif';
200
+                if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) {
201
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif';
202 202
                 } else {
203
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif';
203
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif';
204 204
                 }
205
-                $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']);
206
-                $file_size = number_format($file_size / 1024, 2) . ' KB';
205
+                $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']);
206
+                $file_size = number_format($file_size / 1024, 2).' KB';
207 207
                 if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) {
208
-                    $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong>&nbsp; ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>';
209
-                    $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']);
210
-                    $isDisplayed     = true;
208
+                    $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong>&nbsp; '.$att['name_display'].'</strong> <small>('.$file_size.')</small>';
209
+                    $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']);
210
+                    $isDisplayed = true;
211 211
                 } else {
212 212
                     global $xoopsUser;
213 213
                     if (empty($xoopsModuleConfig['show_userattach'])) {
@@ -364,9 +364,9 @@  discard block
 block discarded – undo
364 364
         $tags                  = [];
365 365
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
366 366
         $tags['FAQ_NAME']      = $faqObj->question();
367
-        $tags['FAQ_URL']       = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid();
367
+        $tags['FAQ_URL']       = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid();
368 368
         $tags['CATEGORY_NAME'] = $faqObj->getCategoryName();
369
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid();
369
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid();
370 370
         $tags['FAQ_QUESTION']  = $faqObj->question();
371 371
 
372 372
         // TODO : Not sure about the 'formpreview' ...
Please login to merge, or discard this patch.
class/Faq.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         if (0 != $maxLength) {
188 188
             if (!XOOPS_USE_MULTIBYTES) {
189 189
                 if (strlen($ret) >= $maxLength) {
190
-                    $ret = substr($ret, 0, $maxLength - 1) . '...';
190
+                    $ret = substr($ret, 0, $maxLength - 1).'...';
191 191
                 }
192 192
             }
193 193
         }
@@ -379,14 +379,14 @@  discard block
 block discarded – undo
379 379
                 $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_APPROVED, 1, 0);
380 380
                 //echo "test";
381 381
                 //exit;
382
-                $this->answer =& $theAnswers[0];
382
+                $this->answer = & $theAnswers[0];
383 383
                 break;
384 384
 
385 385
             case Constants::SF_STATUS_ANSWERED:
386 386
                 $theAnswers = $answerHandler->getAllAnswers($this->faqid(), Constants::SF_AN_STATUS_PROPOSED, 1, 0);
387 387
                 //echo "test";
388 388
                 //exit;
389
-                $this->answer =& $theAnswers[0];
389
+                $this->answer = & $theAnswers[0];
390 390
                 break;
391 391
 
392 392
             case Constants::SF_STATUS_PUBLISHED:
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
473 473
         $tags['FAQ_NAME']      = $this->question();
474 474
         $tags['CATEGORY_NAME'] = $this->getCategoryName();
475
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid();
475
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid();
476 476
         $tags['FAQ_QUESTION']  = $this->question();
477 477
         $answerObj             = $this->answer();
478 478
         if (is_object($answerObj)) {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
         foreach ($notifications as $notification) {
485 485
             switch ($notification) {
486 486
                 case Constants::SF_NOT_FAQ_PUBLISHED:
487
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $this->faqid();
487
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$this->faqid();
488 488
 
489 489
                     $notificationHandler->triggerEvent('global_faq', 0, 'published', $tags);
490 490
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'published', $tags);
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
                     break;
493 493
 
494 494
                 case Constants::SF_NOT_FAQ_SUBMITTED:
495
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/faq.php?faqid=' . $this->faqid();
495
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/faq.php?faqid='.$this->faqid();
496 496
                     $notificationHandler->triggerEvent('global_faq', 0, 'submitted', $tags);
497 497
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'submitted', $tags);
498 498
                     break;
499 499
 
500 500
                 case Constants::SF_NOT_QUESTION_PUBLISHED:
501
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/answer.php?faqid=' . $this->faqid();
501
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/answer.php?faqid='.$this->faqid();
502 502
                     $notificationHandler->triggerEvent('global_question', 0, 'published', $tags);
503 503
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'published', $tags);
504 504
                     $notificationHandler->triggerEvent('question', $this->faqid(), 'approved', $tags);
505 505
                     break;
506 506
 
507 507
                 case Constants::SF_NOT_QUESTION_SUBMITTED:
508
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/question.php?op=mod&faqid=' . $this->faqid();
508
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/question.php?op=mod&faqid='.$this->faqid();
509 509
                     $notificationHandler->triggerEvent('global_question', 0, 'submitted', $tags);
510 510
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'submitted', $tags);
511 511
                     break;
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                     break;
516 516
 
517 517
                 case Constants::SF_NOT_NEW_ANSWER_PROPOSED:
518
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/answer.php?op=mod&faqid=' . $this->faqid();
518
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/answer.php?op=mod&faqid='.$this->faqid();
519 519
                     $notificationHandler->triggerEvent('global_faq', 0, 'answer_proposed', $tags);
520 520
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'answer_proposed', $tags);
521 521
                     break;
@@ -629,7 +629,7 @@  discard block
 block discarded – undo
629 629
             $text = _MD_SF_FAQCOMEFROM;
630 630
         }
631 631
 
632
-        return $text . $xoopsConfig['sitename'] . ' : <a href=' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '>' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '</a>';
632
+        return $text.$xoopsConfig['sitename'].' : <a href='.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'>'.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'</a>';
633 633
     }
634 634
 
635 635
     /**
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
         $faq['question']   = $this->question();
649 649
         $page              = (Constants::SF_STATUS_OPENED == $this->status()) ? 'answer.php' : 'faq.php';
650 650
 
651
-        $faq['questionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question($lastfaqsize) . '</a>';
651
+        $faq['questionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question($lastfaqsize).'</a>';
652 652
         if ($linkInQuestion) {
653
-            $faq['fullquestionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question() . '</a>';
653
+            $faq['fullquestionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question().'</a>';
654 654
         } else {
655 655
             $faq['fullquestionlink'] = $this->question();
656 656
         }
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                 $categoryObj = $category[$this->categoryid()];
667 667
             }
668 668
             $faq['categoryname'] = $categoryObj->getVar('name');
669
-            $faq['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $categoryObj->getVar('name') . '</a>';
669
+            $faq['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$categoryObj->getVar('name').'</a>';
670 670
         }
671 671
 
672 672
         return $faq;
Please login to merge, or discard this patch.
class/GroupPermForm.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@  discard block
 block discarded – undo
27 27
 
28 28
 // defined('XOOPS_ROOT_PATH') || die('Restricted access');
29 29
 
30
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php';
31
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php';
32
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php';
33
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php';
34
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php';
35
-require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php';
30
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php';
31
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php';
32
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php';
33
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php';
34
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php';
35
+require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php';
36 36
 
37 37
 /**
38 38
  * Renders a form for setting module specific group permissions
@@ -162,11 +162,11 @@  discard block
 block discarded – undo
162 162
         }
163 163
         $gpermHandler  = xoops_getHandler('groupperm');
164 164
         $memberHandler = xoops_getHandler('member');
165
-        $glist         =& $memberHandler->getGroupList();
165
+        $glist         = & $memberHandler->getGroupList();
166 166
         foreach (array_keys($glist) as $i) {
167 167
             // get selected item id(s) for each group
168 168
             $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid);
169
-            $ele      = new Smartfaq\GroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected);
169
+            $ele      = new Smartfaq\GroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected);
170 170
             $ele->setOptionTree($this->_itemTree);
171 171
 
172 172
             foreach ($this->_appendix as $key => $append) {
@@ -193,18 +193,18 @@  discard block
 block discarded – undo
193 193
         $tray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
194 194
         $this->addElement($tray);
195 195
 
196
-        $ret      = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>';
197
-        $ret      .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n";
198
-        $elements =& $this->getElements();
196
+        $ret      = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>';
197
+        $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n";
198
+        $elements = & $this->getElements();
199 199
         foreach (array_keys($elements) as $i) {
200 200
             if (!is_object($elements[$i])) {
201 201
                 $ret .= $elements[$i];
202 202
             } elseif (!$elements[$i]->isHidden()) {
203
-                $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption();
203
+                $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption();
204 204
                 if ('' != $elements[$i]->getDescription()) {
205
-                    $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>';
205
+                    $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>';
206 206
                 }
207
-                $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n";
207
+                $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n";
208 208
             } else {
209 209
                 $ret .= $elements[$i]->render();
210 210
             }
Please login to merge, or discard this patch.
print.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
14 14
 
@@ -46,23 +46,23 @@  discard block
 block discarded – undo
46 46
 
47 47
 echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
48 48
 echo "<html>\n<head>\n";
49
-echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n";
50
-echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n";
51
-echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "'>\n";
52
-echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "'>\n";
53
-echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n";
54
-echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n\n\n";
49
+echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n";
50
+echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."'>\n";
51
+echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."'>\n";
52
+echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."'>\n";
53
+echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."'>\n";
54
+echo "<meta name='GENERATOR' content='".XOOPS_VERSION."'>\n\n\n";
55 55
 
56 56
 echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'>
57 57
      <div style='width: 650px; border: 1px solid #000; padding: 20px;'>
58
-     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div>
59
-     <div align='center'>" . $who_where . "</div>
58
+     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>".$faqObj->question()."</h2></div>
59
+     <div align='center'>" . $who_where."</div>
60 60
                 <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>
61 61
                 <div></div>
62
-                <b><p>" . $faqObj->question() . '</p></b>
63
-                <p>' . $answerObj->answer() . "</p>
62
+                <b><p>" . $faqObj->question().'</p></b>
63
+                <p>' . $answerObj->answer()."</p>
64 64
                 <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div>
65
-                <p>" . $comeFrom . '</p>
65
+                <p>" . $comeFrom.'</p>
66 66
             </div>
67 67
     <br>';
68 68
 
Please login to merge, or discard this patch.
include/functions.image.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,24 +28,24 @@  discard block
 block discarded – undo
28 28
     {
29 29
         global $xoopsModuleConfig;
30 30
 
31
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
32
-        $img_url    = XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'];
33
-        $thumb_path = $img_path . '/thumbs';
34
-        $thumb_url  = $img_url . '/thumbs';
31
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
32
+        $img_url    = XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'];
33
+        $thumb_path = $img_path.'/thumbs';
34
+        $thumb_url  = $img_url.'/thumbs';
35 35
 
36
-        $thumb     = $thumb_path . '/' . $source;
37
-        $image     = $img_path . '/' . $source;
38
-        $thumb_url = $thumb_url . '/' . $source;
39
-        $image_url = $img_url . '/' . $source;
36
+        $thumb     = $thumb_path.'/'.$source;
37
+        $image     = $img_path.'/'.$source;
38
+        $thumb_url = $thumb_url.'/'.$source;
39
+        $image_url = $img_url.'/'.$source;
40 40
 
41 41
         $imginfo  = @getimagesize($image);
42
-        $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : '';
42
+        $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : '';
43 43
 
44 44
         if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) {
45 45
             if ($imginfo[0] > $xoopsModuleConfig['max_image_width']
46 46
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
47 47
                 //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) {
48
-                if (!file_exists($thumb_path . '/' . $source)) {
48
+                if (!file_exists($thumb_path.'/'.$source)) {
49 49
                     sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']);
50 50
                 }
51 51
             }
@@ -54,27 +54,27 @@  discard block
 block discarded – undo
54 54
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
55 55
                 $pseudo_width  = $xoopsModuleConfig['max_image_width'];
56 56
                 $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]);
57
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
57
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
58 58
             }
59 59
             // irmtfan to fix Undefined variable: pseudo_height
60 60
             if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0
61 61
                 && $pseudo_height > $xoopsModuleConfig['max_image_height']) {
62 62
                 $pseudo_height = $xoopsModuleConfig['max_image_height'];
63 63
                 $pseudo_width  = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]);
64
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
64
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
65 65
             }
66 66
         }
67 67
 
68 68
         if (file_exists($thumb)) {
69
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
70
-            $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '">';
69
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
70
+            $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'">';
71 71
             $attachmentImage .= '</a>';
72 72
         } elseif (!empty($pseudo_size)) {
73
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
74
-            $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '">';
73
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
74
+            $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'">';
75 75
             $attachmentImage .= '</a>';
76 76
         } elseif (file_exists($image)) {
77
-            $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '">';
77
+            $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'">';
78 78
         } else {
79 79
             $attachmentImage = '';
80 80
         }
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     {
92 92
         global $xoopsModuleConfig;
93 93
 
94
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
95
-        $thumb_path = $img_path . '/thumbs';
96
-        $src_file   = $img_path . '/' . $source;
97
-        $new_file   = $thumb_path . '/' . $source;
94
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
95
+        $thumb_path = $img_path.'/thumbs';
96
+        $src_file   = $img_path.'/'.$source;
97
+        $new_file   = $thumb_path.'/'.$source;
98 98
         //$imageLibs = sf_getImageLibs();
99 99
 
100 100
         if (!filesize($src_file) || !is_readable($src_file)) {
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
         if (1 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
121 121
             if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
122 122
                 $cur_dir     = __DIR__;
123
-                $src_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $src_file) . '"';
124
-                $new_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $new_file) . '"';
123
+                $src_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $src_file).'"';
124
+                $new_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $new_file).'"';
125 125
             } else {
126 126
                 $src_file_im = @escapeshellarg($src_file);
127 127
                 $new_file_im = @escapeshellarg($new_file);
128 128
             }
129
-            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/';
130
-            $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
129
+            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/';
130
+            $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).'';
131 131
 
132 132
             @passthru($magick_command);
133 133
             if (file_exists($new_file)) {
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
         }
137 137
 
138 138
         if (2 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
139
-            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/';
139
+            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/';
140 140
             if (preg_match("/\.png/i", $source)) {
141
-                $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file";
141
+                $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file";
142 142
             } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) {
143
-                $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file";
143
+                $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file";
144 144
             } elseif (preg_match("/\.gif/i", $source)) {
145
-                $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file";
145
+                $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file";
146 146
             }
147 147
 
148 148
             @exec($cmd, $output, $retval);
Please login to merge, or discard this patch.
include/config.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,25 +22,25 @@  discard block
 block discarded – undo
22 22
     $moduleDirName      = basename(dirname(__DIR__));
23 23
     $moduleDirNameUpper = strtoupper($moduleDirName);
24 24
     return (object)[
25
-        'name'           => strtoupper($moduleDirName) . ' Module Configurator',
25
+        'name'           => strtoupper($moduleDirName).' Module Configurator',
26 26
         'paths'          => [
27 27
             'dirname'    => $moduleDirName,
28
-            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
29
-            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
30
-            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
31
-            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
32
-            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
28
+            'admin'      => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin',
29
+            'modPath'    => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName,
30
+            'modUrl'     => XOOPS_URL.'/modules/'.$moduleDirName,
31
+            'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
32
+            'uploadUrl'  => XOOPS_UPLOAD_URL.'/'.$moduleDirName,
33 33
         ],
34 34
         'uploadFolders'  => [
35
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
36
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
37
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
35
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
36
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
37
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
38 38
             //XOOPS_UPLOAD_PATH . '/flags'
39 39
         ],
40 40
         'copyBlankFiles' => [
41
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
42
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
43
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
41
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
42
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
43
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
44 44
             //XOOPS_UPLOAD_PATH . '/flags'
45 45
         ],
46 46
 
@@ -75,6 +75,6 @@  discard block
 block discarded – undo
75 75
             '/images',
76 76
         ],
77 77
         'modCopyright'    => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
78
-                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
78
+                     <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>',
79 79
     ];
80 80
 }
Please login to merge, or discard this patch.
category.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
14 14
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 }
36 36
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
37 37
 
38
-require_once XOOPS_ROOT_PATH . '/header.php';
39
-require_once __DIR__ . '/footer.php';
38
+require_once XOOPS_ROOT_PATH.'/header.php';
39
+require_once __DIR__.'/footer.php';
40 40
 
41 41
 // At which record shall we start
42 42
 $start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 }
77 77
 $lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize'];
78 78
 // Creating the sub-categories objects that belong to the selected category
79
-$subcatsObj    =& $categoryHandler->getCategories(0, 0, $categoryid);
79
+$subcatsObj    = & $categoryHandler->getCategories(0, 0, $categoryid);
80 80
 $total_subcats = count($subcatsObj);
81 81
 $total_faqs    = 0;
82 82
 if (0 != $total_subcats) {
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
87 87
             if (isset($last_qnaObj[$subcat_id])) {
88 88
                 $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
89
-                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>');
89
+                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>');
90 90
             }
91 91
         }
92 92
         $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]);
93 93
         $subcats[$subcat_id] = $subcatsObj[$i]->toArray();
94
-        $total_faqs          += $totalQnas[$subcat_id];
94
+        $total_faqs += $totalQnas[$subcat_id];
95 95
         //}replacé ligne 92
96 96
     }
97 97
     $xoopsTpl->assign('subcats', $subcats);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     }
115 115
 
116 116
     $memberHandler = xoops_getHandler('member');
117
-    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
117
+    $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
118 118
     // Adding the Q&As of the selected category
119 119
     foreach ($faqsObj as $iValue) {
120 120
         $faq = $iValue->toArray(null, $categoryObj);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     if (isset($last_qnaObj) && $last_qnaObj) {
142 142
         $category['last_faqid']         = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid');
143
-        $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>';
143
+        $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>';
144 144
     }
145 145
 }
146 146
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS);
166 166
 
167 167
 // The Navigation Bar
168
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
169
-$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
168
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
169
+$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
170 170
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
171
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
171
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
172 172
 } else {
173
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
173
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
174 174
 }
175 175
 
176 176
 $xoopsTpl->assign('category', $category);
177 177
 
178 178
 // Page Title Hack by marcan
179 179
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
180
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
180
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
181 181
 // End Page Title Hack by marcan
182 182
 
183 183
 //code to include smartie
184
-if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
185
-    require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
184
+if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) {
185
+    require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php';
186 186
     $xoopsTpl->assign('smarttie', 1);
187 187
 }
188 188
 //end code for smarttie
189 189
 
190
-require_once XOOPS_ROOT_PATH . '/footer.php';
190
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
class/CategoryHandler.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $sql = sprintf(
93 93
                 'INSERT INTO `%s` (parentid, name, description, total, weight, created) VALUES (%u, %s, %s, %u, %u, %u)',
94 94
                 $this->db->prefix('smartfaq_categories'),
95
-                           $parentid,
95
+                            $parentid,
96 96
                 $this->db->quoteString($name),
97 97
                 $this->db->quoteString($description),
98 98
                 $total,
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                 'UPDATE `%s` SET parentid = %u, name = %s, description = %s, total = %s, weight = %u, created = %u WHERE categoryid = %u',
105 105
                 $this->db->prefix('smartfaq_categories'),
106 106
                 $parentid,
107
-                           $this->db->quoteString($name),
107
+                            $this->db->quoteString($name),
108 108
                 $this->db->quoteString($description),
109 109
                 $total,
110 110
                 $weight,
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $false = false;
49 49
         if ((int)$id > 0) {
50
-            $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories') . ' WHERE categoryid=' . $id;
50
+            $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories').' WHERE categoryid='.$id;
51 51
             if (!$result = $this->db->query($sql)) {
52 52
                 return $false;
53 53
             }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         }
150 150
 
151 151
         // Deleteing the sub categories
152
-        $subcats =& $this->getCategories(0, 0, $category->categoryid());
152
+        $subcats = & $this->getCategories(0, 0, $category->categoryid());
153 153
         foreach ($subcats as $subcat) {
154 154
             $this->delete($subcat);
155 155
         }
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
     {
187 187
         $ret   = [];
188 188
         $limit = $start = 0;
189
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories');
189
+        $sql   = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories');
190 190
         if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) {
191
-            $sql .= ' ' . $criteria->renderWhere();
191
+            $sql .= ' '.$criteria->renderWhere();
192 192
             if ('' != $criteria->getSort()) {
193
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
193
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
194 194
             }
195 195
             $limit = $criteria->getLimit();
196 196
             $start = $criteria->getStart();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
248 248
 
249 249
             $categoriesGranted = $smartPermHandler->getPermissions('category');
250
-            $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
250
+            $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
251 251
         }
252 252
         $criteria->setStart($start);
253 253
         $criteria->setLimit($limit);
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
287 287
 
288 288
             $categoriesGranted = $smartPermHandler->getPermissions('category');
289
-            $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
289
+            $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
290 290
         }
291 291
 
292 292
         $criteria->add(new \Criteria('f.status', Constants::SF_STATUS_OPENED));
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
 
296 296
         $ret   = [];
297 297
         $limit = $start = 0;
298
-        $sql   = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid';
298
+        $sql   = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid';
299 299
         if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) {
300
-            $sql .= ' ' . $criteria->renderWhere();
300
+            $sql .= ' '.$criteria->renderWhere();
301 301
             if ('' != $criteria->getSort()) {
302
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
302
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
303 303
             }
304 304
             $limit = $criteria->getLimit();
305 305
             $start = $criteria->getStart();
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
      */
329 329
     public function getCount($criteria = null)
330 330
     {
331
-        $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories');
331
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories');
332 332
         if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) {
333
-            $sql .= ' ' . $criteria->renderWhere();
333
+            $sql .= ' '.$criteria->renderWhere();
334 334
         }
335 335
         $result = $this->db->query($sql);
336 336
         if (!$result) {
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
                 $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
359 359
 
360 360
                 $categoriesGranted = $smartPermHandler->getPermissions('category');
361
-                $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
361
+                $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
362 362
             }
363 363
         }
364 364
 
@@ -382,16 +382,16 @@  discard block
 block discarded – undo
382 382
                 $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
383 383
 
384 384
                 $categoriesGranted = $smartPermHandler->getPermissions('category');
385
-                $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
385
+                $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
386 386
             }
387 387
         }
388 388
 
389 389
         $criteria->add(new \Criteria('f.status', Constants::SF_STATUS_OPENED));
390 390
 
391
-        $sql = 'SELECT COUNT(c.categoryid) FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid';
391
+        $sql = 'SELECT COUNT(c.categoryid) FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid';
392 392
 
393 393
         if (isset($criteria) && is_subclass_of($criteria, 'CriteriaElement')) {
394
-            $sql .= ' ' . $criteria->renderWhere();
394
+            $sql .= ' '.$criteria->renderWhere();
395 395
         }
396 396
 
397 397
         $result = $this->db->query($sql);
@@ -409,16 +409,16 @@  discard block
 block discarded – undo
409 409
      */
410 410
     public function getSubCats($categories)
411 411
     {
412
-        $criteria = new \CriteriaCompo(new \Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN');
412
+        $criteria = new \CriteriaCompo(new \Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN');
413 413
         $ret      = [];
414 414
         if (!Smartfaq\Utility::userIsAdmin()) {
415 415
             /** @var Smartfaq\PermissionHandler $smartPermHandler */
416 416
             $smartPermHandler = Smartfaq\Helper::getInstance()->getHandler('Permission');
417 417
 
418 418
             $categoriesGranted = $smartPermHandler->getPermissions('category');
419
-            $criteria->add(new \Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
419
+            $criteria->add(new \Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
420 420
         }
421
-        $subcats =& $this->getObjects($criteria, true);
421
+        $subcats = & $this->getObjects($criteria, true);
422 422
         foreach ($subcats as $subcat_id => $subcat) {
423 423
             $ret[$subcat->getVar('parentid')][$subcat->getVar('categoryid')] = $subcat;
424 424
         }
@@ -434,9 +434,9 @@  discard block
 block discarded – undo
434 434
      */
435 435
     public function deleteAll($criteria = null)
436 436
     {
437
-        $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories');
437
+        $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories');
438 438
         if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) {
439
-            $sql .= ' ' . $criteria->renderWhere();
439
+            $sql .= ' '.$criteria->renderWhere();
440 440
         }
441 441
         if (!$this->db->query($sql)) {
442 442
             return false;
@@ -458,10 +458,10 @@  discard block
 block discarded – undo
458 458
      **/
459 459
     public function updateAll($fieldname, $fieldvalue, \CriteriaElement $criteria = null)
460 460
     {
461
-        $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue);
462
-        $sql        = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause;
461
+        $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
462
+        $sql        = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause;
463 463
         if (null !== $criteria && is_subclass_of($criteria, 'CriteriaElement')) {
464
-            $sql .= ' ' . $criteria->renderWhere();
464
+            $sql .= ' '.$criteria->renderWhere();
465 465
         }
466 466
         if (!$this->db->queryF($sql)) {
467 467
             return false;
Please login to merge, or discard this patch.