Completed
Branch master (4e30dc)
by Michael
02:57
created
blocks/faqs_recent_questions.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq');
39 39
 
40 40
     // creating the FAQ objects that belong to the selected category
41
-    $faqsObj   = $faqHandler->getFaqs($limit, 0, Constants::SF_STATUS_OPENED, $categoryid, $sort);
41
+    $faqsObj = $faqHandler->getFaqs($limit, 0, Constants::SF_STATUS_OPENED, $categoryid, $sort);
42 42
 
43 43
     if ($faqsObj) {
44 44
         foreach ($faqsObj as $iValue) {
@@ -72,40 +72,40 @@  discard block
 block discarded – undo
72 72
 
73 73
     $form = Smartfaq\Utility::createCategorySelect($options[0]);
74 74
 
75
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
75
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
76 76
 
77 77
     $form .= "<option value='datesub'";
78 78
     if ('datesub' === $options[1]) {
79 79
         $form .= ' selected';
80 80
     }
81
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
81
+    $form .= '>'._MB_SF_DATE."</option>\n";
82 82
 
83 83
     $form .= "<option value='counter'";
84 84
     if ('counter' === $options[1]) {
85 85
         $form .= ' selected';
86 86
     }
87
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
87
+    $form .= '>'._MB_SF_HITS."</option>\n";
88 88
 
89 89
     $form .= "<option value='weight'";
90 90
     if ('weight' === $options[1]) {
91 91
         $form .= ' selected';
92 92
     }
93
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
93
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
94 94
 
95 95
     $form .= "</select>\n";
96 96
 
97
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_QUESTIONS . '';
98
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
97
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_QUESTIONS.'';
98
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
99 99
 
100
-    $form .= '<br>' . _MB_SF_SHOW_DATE . "&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
100
+    $form .= '<br>'._MB_SF_SHOW_DATE."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
101 101
     if (1 == $options[4]) {
102 102
         $form .= ' checked';
103 103
     }
104
-    $form .= '>&nbsp;' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'";
104
+    $form .= '>&nbsp;'._YES."<input type='radio' id='options[]' name='options[]' value='0'";
105 105
     if (0 == $options[4]) {
106 106
         $form .= ' checked';
107 107
     }
108
-    $form .= '>&nbsp;' . _NO . '';
108
+    $form .= '>&nbsp;'._NO.'';
109 109
 
110 110
     return $form;
111 111
 }
Please login to merge, or discard this patch.
blocks/faqs_new.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
37 37
     $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq');
38 38
     // creating the FAQ objects that belong to the selected category
39
-    $faqsObj   = $faqHandler->getAllPublished($limit, 0, $categoryid, $sort);
39
+    $faqsObj = $faqHandler->getAllPublished($limit, 0, $categoryid, $sort);
40 40
 
41 41
     if ($faqsObj) {
42 42
         foreach ($faqsObj as $iValue) {
@@ -69,40 +69,40 @@  discard block
 block discarded – undo
69 69
 
70 70
     $form = Smartfaq\Utility::createCategorySelect($options[0]);
71 71
 
72
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
72
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
73 73
 
74 74
     $form .= "<option value='datesub'";
75 75
     if ('datesub' === $options[1]) {
76 76
         $form .= ' selected';
77 77
     }
78
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
78
+    $form .= '>'._MB_SF_DATE."</option>\n";
79 79
 
80 80
     $form .= "<option value='counter'";
81 81
     if ('counter' === $options[1]) {
82 82
         $form .= ' selected';
83 83
     }
84
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
84
+    $form .= '>'._MB_SF_HITS."</option>\n";
85 85
 
86 86
     $form .= "<option value='weight'";
87 87
     if ('weight' === $options[1]) {
88 88
         $form .= ' selected';
89 89
     }
90
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
90
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
91 91
 
92 92
     $form .= "</select>\n";
93 93
 
94
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_FAQS . '';
95
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
94
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_FAQS.'';
95
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
96 96
 
97
-    $form .= '<br>' . _MB_SF_SHOW_DATE . "&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
97
+    $form .= '<br>'._MB_SF_SHOW_DATE."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
98 98
     if (1 == $options[4]) {
99 99
         $form .= ' checked';
100 100
     }
101
-    $form .= '>&nbsp;' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'";
101
+    $form .= '>&nbsp;'._YES."<input type='radio' id='options[]' name='options[]' value='0'";
102 102
     if (0 == $options[4]) {
103 103
         $form .= ' checked';
104 104
     }
105
-    $form .= '>&nbsp;' . _NO . '';
105
+    $form .= '>&nbsp;'._NO.'';
106 106
 
107 107
     return $form;
108 108
 }
Please login to merge, or discard this patch.
blocks/faqs_most_viewed.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */
35 35
     $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq');
36 36
     // creating the FAQ objects that belong to the selected category
37
-    $faqsObj   = $faqHandler->getAllPublished($limit, 0, $categoryid, $sort);
37
+    $faqsObj = $faqHandler->getAllPublished($limit, 0, $categoryid, $sort);
38 38
 
39 39
     if ($faqsObj) {
40 40
         foreach ($faqsObj as $iValue) {
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 
61 61
     $form = Smartfaq\Utility::createCategorySelect($options[0]);
62 62
 
63
-    $form .= '&nbsp;<br>' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[1] . "'>&nbsp;" . _MB_SF_FAQS . '';
64
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_LENGTH . '';
63
+    $form .= '&nbsp;<br>'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[1]."'>&nbsp;"._MB_SF_FAQS.'';
64
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_LENGTH.'';
65 65
 
66 66
     return $form;
67 67
 }
Please login to merge, or discard this patch.
blocks/faqs_recent.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         }
63 63
 
64 64
         $memberHandler = xoops_getHandler('member');
65
-        $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
65
+        $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
66 66
         foreach ($faqsObj as $iValue) {
67 67
             $faqs['categoryid']   = $iValue->categoryid();
68 68
             $faqs['question']     = $iValue->question($maxQuestionLength);
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $block['lang_poster']   = _MB_SF_ANSWEREDBY;
85 85
         $block['lang_date']     = _MB_SF_DATE;
86 86
         $modulename             = $myts->htmlSpecialChars($smartModule->getVar('name'));
87
-        $block['lang_visitfaq'] = _MB_SF_VISITFAQ . ' ' . $modulename;
87
+        $block['lang_visitfaq'] = _MB_SF_VISITFAQ.' '.$modulename;
88 88
     }
89 89
 
90 90
     return $block;
@@ -100,30 +100,30 @@  discard block
 block discarded – undo
100 100
 
101 101
     $form = Smartfaq\Utility::createCategorySelect($options[0]);
102 102
 
103
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
103
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
104 104
 
105 105
     $form .= "<option value='datesub'";
106 106
     if ('datesub' === $options[1]) {
107 107
         $form .= ' selected';
108 108
     }
109
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
109
+    $form .= '>'._MB_SF_DATE."</option>\n";
110 110
 
111 111
     $form .= "<option value='counter'";
112 112
     if ('counter' === $options[1]) {
113 113
         $form .= ' selected';
114 114
     }
115
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
115
+    $form .= '>'._MB_SF_HITS."</option>\n";
116 116
 
117 117
     $form .= "<option value='weight'";
118 118
     if ('weight' === $options[1]) {
119 119
         $form .= ' selected';
120 120
     }
121
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
121
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
122 122
 
123 123
     $form .= "</select>\n";
124 124
 
125
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_FAQS . '';
126
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
125
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_FAQS.'';
126
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
127 127
 
128 128
     return $form;
129 129
 }
Please login to merge, or discard this patch.
blocks/faqs_context.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     $faqHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Faq');
29 29
 
30 30
     // creating the FAQ objects that belong to the selected category
31
-    $faqsObj   = $faqHandler->getContextualFaqs($limit);
31
+    $faqsObj = $faqHandler->getContextualFaqs($limit);
32 32
 
33 33
     if ($faqsObj) {
34 34
         foreach ($faqsObj as $iValue) {
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
  */
49 49
 function b_faqs_context_edit($options)
50 50
 {
51
-    $form = '' . _MB_SF_DISP . '&nbsp;';
52
-    $form .= "<input type='text' name='options[]' value='" . $options[0] . "'>&nbsp;" . _MB_SF_FAQS . '';
51
+    $form = ''._MB_SF_DISP.'&nbsp;';
52
+    $form .= "<input type='text' name='options[]' value='".$options[0]."'>&nbsp;"._MB_SF_FAQS.'';
53 53
 
54 54
     return $form;
55 55
 }
Please login to merge, or discard this patch.
class/Answer.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
         if (!$attach_key) {
86 86
             return false;
87 87
         }
88
-        $this->attachment_array[(string)$attach_key]['num_download']++;
88
+        $this->attachment_array[(string) $attach_key]['num_download']++;
89 89
 
90
-        return $this->attachment_array[(string)$attach_key]['num_download'];
90
+        return $this->attachment_array[(string) $attach_key]['num_download'];
91 91
     }
92 92
 
93 93
     /**
@@ -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;
@@ -159,12 +159,12 @@  discard block
 block discarded – undo
159 159
         static $counter = 0;
160 160
         $this->attachment_array = $this->getAttachment();
161 161
         if ($name_saved) {
162
-            $key                          = (string)(time() + ($counter++));
162
+            $key                          = (string) (time()+($counter++));
163 163
             $this->attachment_array[$key] = [
164 164
                 'name_saved'   => $name_saved,
165 165
                 'name_display' => isset($name_display) ? $name_display : $name_saved,
166 166
                 'mimetype'     => $mimetype,
167
-                'num_download' => isset($num_download) ? (int)$num_download : 0
167
+                'num_download' => isset($num_download) ? (int) $num_download : 0
168 168
             ];
169 169
         }
170 170
         $attachment_save = null;
@@ -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/Utility.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 break;
72 72
 
73 73
             case 'inside':
74
-                return XOOPS_URL . '/modules/smartfaq/doc/';
74
+                return XOOPS_URL.'/modules/smartfaq/doc/';
75 75
                 break;
76 76
 
77 77
             case 'custom':
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     {
89 89
         $ret = '';
90 90
         foreach ($errors as $key => $value) {
91
-            $ret .= '<br> - ' . $value;
91
+            $ret .= '<br> - '.$value;
92 92
         }
93 93
 
94 94
         return $ret;
@@ -112,13 +112,13 @@  discard block
 block discarded – undo
112 112
             $spaces .= '--';
113 113
         }
114 114
 
115
-        $ret .= "<option value='" . $categoryObj->categoryid() . "'";
115
+        $ret .= "<option value='".$categoryObj->categoryid()."'";
116 116
         if ($selectedid == $categoryObj->categoryid()) {
117 117
             $ret .= ' selected';
118 118
         }
119
-        $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n";
119
+        $ret .= '>'.$spaces.$categoryObj->name()."</option>\n";
120 120
 
121
-        $subCategoriesObj =& $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
121
+        $subCategoriesObj = & $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
122 122
         if (count($subCategoriesObj) > 0) {
123 123
             ++$level;
124 124
             foreach ($subCategoriesObj as $catID => $subCategoryObj) {
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public static function createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true)
139 139
     {
140
-        $ret = '' . _MB_SF_SELECTCAT . "&nbsp;<select name='options[]'>";
140
+        $ret = ''._MB_SF_SELECTCAT."&nbsp;<select name='options[]'>";
141 141
         if ($allCatOption) {
142 142
             $ret .= "<option value='0'";
143
-            $ret .= '>' . _MB_SF_ALLCAT . "</option>\n";
143
+            $ret .= '>'._MB_SF_ALLCAT."</option>\n";
144 144
         }
145 145
 
146 146
         // Creating the category handler object
@@ -209,9 +209,9 @@  discard block
 block discarded – undo
209 209
     {
210 210
         $smartModule = self::getModuleInfo();
211 211
 
212
-        $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . '';
212
+        $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').'';
213 213
 
214
-        $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>";
214
+        $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>";
215 215
 
216 216
         return $modfooter;
217 217
     }
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         $module_id   = $smartModule->getVar('mid');
234 234
 
235 235
         if (!empty($xoopsUser)) {
236
-            $groups =& $xoopsUser->getGroups();
236
+            $groups = & $xoopsUser->getGroups();
237 237
             $result = in_array(XOOPS_GROUP_ADMIN, $groups) || $xoopsUser->isAdmin($module_id);
238 238
         }
239 239
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
         $gpermHandler = xoops_getHandler('groupperm');
309 309
 
310
-        $sql    = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' ";
310
+        $sql    = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' ";
311 311
         $result = $xoopsDB->queryF($sql);
312 312
 
313 313
         if ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) {
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         $ret = [];
423 423
         global $xoopsDB;
424 424
 
425
-        $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'");
425
+        $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'");
426 426
         $ret    = $xoopsDB->fetchArray($result);
427 427
 
428 428
         return $ret;
@@ -441,26 +441,26 @@  discard block
 block discarded – undo
441 441
     {
442 442
         global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
443 443
         $adminLinks = '';
444
-        $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/';
444
+        $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/';
445 445
         $page       = $open ? 'question.php' : 'faq.php';
446 446
         if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
447 447
             // Edit button
448
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'></a>";
448
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'></a>";
449 449
             $adminLinks .= ' ';
450 450
             // Delete button
451
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'></a>";
451
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'></a>";
452 452
             $adminLinks .= ' ';
453 453
         }
454 454
         // Print button
455
-        $adminLinks .= "<a href='" . $modulePath . 'print.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'></a>";
455
+        $adminLinks .= "<a href='".$modulePath.'print.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'></a>";
456 456
         $adminLinks .= ' ';
457 457
         // Email button
458
-        $maillink   = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
459
-        $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>";
458
+        $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.$modulePath.'faq.php?faqid='.$faqid;
459
+        $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>";
460 460
         $adminLinks .= ' ';
461 461
         // Submit New Answer button
462 462
         if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) {
463
-            $adminLinks .= "<a href='" . $modulePath . 'answer.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'></a>";
463
+            $adminLinks .= "<a href='".$modulePath.'answer.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'></a>";
464 464
             $adminLinks .= ' ';
465 465
         }
466 466
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
             return $userid;
482 482
         }
483 483
 
484
-        $userid = (int)$userid;
484
+        $userid = (int) $userid;
485 485
         if ($userid > 0) {
486 486
             if ($users == []) {
487 487
                 //fetching users
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
                 if (!isset($users[$userid])) {
492 492
                     return $GLOBALS['xoopsConfig']['anonymous'];
493 493
                 }
494
-                $user =& $users[$userid];
494
+                $user = & $users[$userid];
495 495
             }
496 496
 
497 497
             if (is_object($user)) {
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
                     $fullname = $user->getVar('name');
506 506
                 }
507 507
                 if (!empty($fullname)) {
508
-                    $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
508
+                    $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
509 509
                 } else {
510
-                    $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
510
+                    $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
511 511
                 }
512 512
 
513 513
                 return $linkeduser;
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
             //-->
590 590
         </script>
591 591
         <?php
592
-        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
592
+        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">";
593 593
     }
594 594
 
595 595
     /**
@@ -602,16 +602,16 @@  discard block
 block discarded – undo
602 602
         static $handlers;
603 603
         $name = strtolower(trim($name));
604 604
         if (!isset($handlers[$name])) {
605
-            if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) {
605
+            if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) {
606 606
                 require_once $hnd_file;
607 607
             }
608
-            $class = 'sf' . ucfirst($name) . 'Handler';
608
+            $class = 'sf'.ucfirst($name).'Handler';
609 609
             if (class_exists($class)) {
610 610
                 $handlers[$name] = new $class($GLOBALS['xoopsDB']);
611 611
             }
612 612
         }
613 613
         if (!$optional && !isset($handlers[$name])) {
614
-            trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
614
+            trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
615 615
         }
616 616
         $false = false;
617 617
 
Please login to merge, or discard this patch.
class/SmartobjectDbupdater.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
         $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to);
62 62
         $ret   = $xoopsDB->queryF($query);
63 63
         if (!$ret) {
64
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>';
64
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>';
65 65
 
66 66
             return false;
67 67
         } else {
68
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>';
68
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>';
69 69
 
70 70
             return true;
71 71
         }
Please login to merge, or discard this patch.
class/Category.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $filename = 'open_category.php';
167 167
         }
168 168
         if ($withAllLink) {
169
-            $ret = "<a href='" . XOOPS_URL . '/modules/smartfaq/' . $filename . '?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
169
+            $ret = "<a href='".XOOPS_URL.'/modules/smartfaq/'.$filename.'?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
170 170
         } else {
171 171
             $ret = $this->name();
172 172
         }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
                 exit;
180 180
             }
181 181
             $parentid = $parentObj->parentid();
182
-            $ret      = $parentObj->getCategoryPath(true, $open) . ' > ' . $ret;
182
+            $ret      = $parentObj->getCategoryPath(true, $open).' > '.$ret;
183 183
         }
184 184
 
185 185
         return $ret;
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         $tags                  = [];
237 237
         $tags['MODULE_NAME']   = $myts->htmlSpecialChars($smartModule->getVar('name'));
238 238
         $tags['CATEGORY_NAME'] = $this->name();
239
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid();
239
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid();
240 240
 
241 241
         $notificationHandler = xoops_getHandler('notification');
242 242
         $notificationHandler->triggerEvent('global_faq', 0, 'category_created', $tags);
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
         $category['categoryid'] = $this->categoryid();
253 253
         $category['name']       = $this->name();
254 254
         if (false !== $open) {
255
-            $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/open_category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
255
+            $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/open_category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
256 256
         } else {
257
-            $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
257
+            $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
258 258
         }
259 259
         $category['total']       = $this->getVar('faqcount');
260 260
         $category['description'] = $this->description();
Please login to merge, or discard this patch.