@@ -36,7 +36,7 @@ discard block |
||
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 |
||
69 | 69 | |
70 | 70 | $form = Smartfaq\Utility::createCategorySelect($options[0]); |
71 | 71 | |
72 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
72 | + $form .= ' <br>'._MB_SF_ORDER." <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 .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_FAQS . ''; |
|
95 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
94 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_FAQS.''; |
|
95 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
96 | 96 | |
97 | - $form .= '<br>' . _MB_SF_SHOW_DATE . " <input type='radio' id='options[]' name='options[]' value='1'"; |
|
97 | + $form .= '<br>'._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
|
98 | 98 | if (1 == $options[4]) { |
99 | 99 | $form .= ' checked'; |
100 | 100 | } |
101 | - $form .= '> ' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'"; |
|
101 | + $form .= '> '._YES."<input type='radio' id='options[]' name='options[]' value='0'"; |
|
102 | 102 | if (0 == $options[4]) { |
103 | 103 | $form .= ' checked'; |
104 | 104 | } |
105 | - $form .= '> ' . _NO . ''; |
|
105 | + $form .= '> '._NO.''; |
|
106 | 106 | |
107 | 107 | return $form; |
108 | 108 | } |
@@ -34,7 +34,7 @@ discard block |
||
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 |
||
60 | 60 | |
61 | 61 | $form = Smartfaq\Utility::createCategorySelect($options[0]); |
62 | 62 | |
63 | - $form .= ' <br>' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[1] . "'> " . _MB_SF_FAQS . ''; |
|
64 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_LENGTH . ''; |
|
63 | + $form .= ' <br>'._MB_SF_DISP." <input type='text' name='options[]' value='".$options[1]."'> "._MB_SF_FAQS.''; |
|
64 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_LENGTH.''; |
|
65 | 65 | |
66 | 66 | return $form; |
67 | 67 | } |
@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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 |
||
100 | 100 | |
101 | 101 | $form = Smartfaq\Utility::createCategorySelect($options[0]); |
102 | 102 | |
103 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
103 | + $form .= ' <br>'._MB_SF_ORDER." <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 .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_FAQS . ''; |
|
126 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
125 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_FAQS.''; |
|
126 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
127 | 127 | |
128 | 128 | return $form; |
129 | 129 | } |
@@ -28,7 +28,7 @@ discard block |
||
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 |
||
48 | 48 | */ |
49 | 49 | function b_faqs_context_edit($options) |
50 | 50 | { |
51 | - $form = '' . _MB_SF_DISP . ' '; |
|
52 | - $form .= "<input type='text' name='options[]' value='" . $options[0] . "'> " . _MB_SF_FAQS . ''; |
|
51 | + $form = ''._MB_SF_DISP.' '; |
|
52 | + $form .= "<input type='text' name='options[]' value='".$options[0]."'> "._MB_SF_FAQS.''; |
|
53 | 53 | |
54 | 54 | return $form; |
55 | 55 | } |
@@ -85,9 +85,9 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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> ' . $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> '.$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 |
||
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' ... |
@@ -71,7 +71,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
137 | 137 | */ |
138 | 138 | public static function createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
139 | 139 | { |
140 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
140 | + $ret = ''._MB_SF_SELECTCAT." <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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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&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&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&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&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']) . '&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']).'&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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -61,11 +61,11 @@ |
||
61 | 61 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
62 | 62 | $ret = $xoopsDB->queryF($query); |
63 | 63 | if (!$ret) { |
64 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
64 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
65 | 65 | |
66 | 66 | return false; |
67 | 67 | } else { |
68 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
68 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
69 | 69 | |
70 | 70 | return true; |
71 | 71 | } |
@@ -166,7 +166,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | //Verifies that a MySQL table exists |
23 | 23 | $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection(); |
24 | 24 | $realname = $xoopsDB->prefix($table); |
25 | - $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME; |
|
25 | + $sql = 'SHOW TABLES FROM '.XOOPS_DB_NAME; |
|
26 | 26 | $ret = $xoopsDB->queryF($sql); |
27 | 27 | while (list($m_table) = $xoopsDB->fetchRow($ret)) { |
28 | 28 | if ($m_table == $realname) { |
@@ -163,14 +163,14 @@ discard block |
||
163 | 163 | public function getExistingFieldsArray() |
164 | 164 | { |
165 | 165 | global $xoopsDB; |
166 | - $result = $xoopsDB->queryF('SHOW COLUMNS FROM ' . $this->name()); |
|
166 | + $result = $xoopsDB->queryF('SHOW COLUMNS FROM '.$this->name()); |
|
167 | 167 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
168 | 168 | $fields[$existing_field['Field']] = $existing_field['Type']; |
169 | 169 | if ('YES' !== $existing_field['Null']) { |
170 | 170 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
171 | 171 | } |
172 | 172 | if ($existing_field['Extra']) { |
173 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
173 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
@@ -246,9 +246,9 @@ discard block |
||
246 | 246 | $query = sprintf('INSERT INTO %s VALUES ("%s")', $this->name(), $data); |
247 | 247 | $ret = $xoopsDB->queryF($query); |
248 | 248 | if (!$ret) { |
249 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
249 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
250 | 250 | } else { |
251 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
251 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | |
@@ -413,9 +413,9 @@ discard block |
||
413 | 413 | |
414 | 414 | $ret = $xoopsDB->queryF($query); |
415 | 415 | if (!$ret) { |
416 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '<br>'; |
|
416 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).'<br>'; |
|
417 | 417 | } else { |
418 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
418 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | return $ret; |
@@ -434,11 +434,11 @@ discard block |
||
434 | 434 | $query = sprintf('DROP TABLE %s', $this->name()); |
435 | 435 | $ret = $xoopsDB->queryF($query); |
436 | 436 | if (!$ret) { |
437 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '<br>'; |
|
437 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).'<br>'; |
|
438 | 438 | |
439 | 439 | return false; |
440 | 440 | } else { |
441 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
441 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
442 | 442 | |
443 | 443 | return true; |
444 | 444 | } |
@@ -462,9 +462,9 @@ discard block |
||
462 | 462 | $ret = $ret && $xoopsDB->queryF($query); |
463 | 463 | if ($alteredField['showerror']) { |
464 | 464 | if (!$ret) { |
465 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '<br>'; |
|
465 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).'<br>'; |
|
466 | 466 | } else { |
467 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
467 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
468 | 468 | } |
469 | 469 | } |
470 | 470 | } |
@@ -488,9 +488,9 @@ discard block |
||
488 | 488 | //echo $query; |
489 | 489 | $ret = $ret && $xoopsDB->queryF($query); |
490 | 490 | if (!$ret) { |
491 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
491 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
492 | 492 | } else { |
493 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
493 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
494 | 494 | } |
495 | 495 | } |
496 | 496 | |
@@ -513,9 +513,9 @@ discard block |
||
513 | 513 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
514 | 514 | $ret = $ret && $xoopsDB->queryF($query); |
515 | 515 | if (!$ret) { |
516 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
516 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
517 | 517 | } else { |
518 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
518 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
519 | 519 | } |
520 | 520 | } |
521 | 521 | |
@@ -538,9 +538,9 @@ discard block |
||
538 | 538 | //echo $query."<br>"; |
539 | 539 | $ret = $ret && $xoopsDB->queryF($query); |
540 | 540 | if (!$ret) { |
541 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
541 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
542 | 542 | } else { |
543 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
543 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
544 | 544 | } |
545 | 545 | } |
546 | 546 | |
@@ -564,9 +564,9 @@ discard block |
||
564 | 564 | |
565 | 565 | $ret = $ret && $xoopsDB->queryF($query); |
566 | 566 | if (!$ret) { |
567 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br>'; |
|
567 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).'<br>'; |
|
568 | 568 | } else { |
569 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
569 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
570 | 570 | } |
571 | 571 | } |
572 | 572 |