@@ -9,16 +9,16 @@ discard block |
||
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 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
21 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
22 | 22 | |
23 | 23 | // Creating the category object for the selected category |
24 | 24 | $categoryObj = new Smartfaq\Category($categoryid); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $categoryHandler = \XoopsModules\Smartfaq\Helper::getInstance()->getHandler('Category'); |
39 | 39 | |
40 | 40 | // At which record shall we start |
41 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
41 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
42 | 42 | |
43 | 43 | // Creating the faq handler object |
44 | 44 | /** @var \XoopsModules\Smartfaq\FaqHandler $faqHandler */ |
@@ -63,7 +63,7 @@ discard block |
||
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 |
||
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,16 +82,16 @@ discard block |
||
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); |
93 | 93 | } |
94 | -$category['total'] = $catQnasWithSub + $totalQnas[$categoryid]; |
|
94 | +$category['total'] = $catQnasWithSub+$totalQnas[$categoryid]; |
|
95 | 95 | if ($faqsObj) { |
96 | 96 | $userids = []; |
97 | 97 | foreach ($faqsObj as $key => $thisfaq) { |
@@ -100,7 +100,7 @@ discard block |
||
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 |
||
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 |
||
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'; |
@@ -38,7 +38,7 @@ discard block |
||
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 |
||
72 | 72 | |
73 | 73 | $form = Smartfaq\Utility::createCategorySelect($options[0]); |
74 | 74 | |
75 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
75 | + $form .= ' <br>'._MB_SF_ORDER." <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 .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_QUESTIONS . ''; |
|
98 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
97 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_QUESTIONS.''; |
|
98 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
99 | 99 | |
100 | - $form .= '<br>' . _MB_SF_SHOW_DATE . " <input type='radio' id='options[]' name='options[]' value='1'"; |
|
100 | + $form .= '<br>'._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
|
101 | 101 | if (1 == $options[4]) { |
102 | 102 | $form .= ' checked'; |
103 | 103 | } |
104 | - $form .= '> ' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'"; |
|
104 | + $form .= '> '._YES."<input type='radio' id='options[]' name='options[]' value='0'"; |
|
105 | 105 | if (0 == $options[4]) { |
106 | 106 | $form .= ' checked'; |
107 | 107 | } |
108 | - $form .= '> ' . _NO . ''; |
|
108 | + $form .= '> '._NO.''; |
|
109 | 109 | |
110 | 110 | return $form; |
111 | 111 | } |
@@ -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 | } |