@@ -71,7 +71,7 @@ |
||
| 71 | 71 | { |
| 72 | 72 | $ret = false; |
| 73 | 73 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
| 74 | - $class = '\\XoopsModules\\' . ucfirst(strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler'; |
|
| 74 | + $class = '\\XoopsModules\\'.ucfirst(strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler'; |
|
| 75 | 75 | $ret = new $class($db); |
| 76 | 76 | return $ret; |
| 77 | 77 | } |
@@ -54,153 +54,153 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | switch ($op) { |
| 57 | - case 'preview': |
|
| 57 | + case 'preview': |
|
| 58 | 58 | |
| 59 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 59 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 60 | 60 | |
| 61 | - $faqObj = $faqHandler->create(); |
|
| 62 | - $answerObj = $answerHandler->create(); |
|
| 63 | - $categoryObj = $categoryHandler->get($_POST['categoryid']); |
|
| 61 | + $faqObj = $faqHandler->create(); |
|
| 62 | + $answerObj = $answerHandler->create(); |
|
| 63 | + $categoryObj = $categoryHandler->get($_POST['categoryid']); |
|
| 64 | 64 | |
| 65 | - if (!$xoopsUser) { |
|
| 66 | - if (1 == $helper->getConfig('anonpost')) { |
|
| 67 | - $uid = 0; |
|
| 65 | + if (!$xoopsUser) { |
|
| 66 | + if (1 == $helper->getConfig('anonpost')) { |
|
| 67 | + $uid = 0; |
|
| 68 | + } else { |
|
| 69 | + redirect_header('index.php', 3, _NOPERM); |
|
| 70 | + } |
|
| 68 | 71 | } else { |
| 69 | - redirect_header('index.php', 3, _NOPERM); |
|
| 72 | + $uid = $xoopsUser->uid(); |
|
| 70 | 73 | } |
| 71 | - } else { |
|
| 72 | - $uid = $xoopsUser->uid(); |
|
| 73 | - } |
|
| 74 | 74 | |
| 75 | - $notifypub = \Xmf\Request::getInt('notifypub', 0, POST); |
|
| 75 | + $notifypub = \Xmf\Request::getInt('notifypub', 0, POST); |
|
| 76 | 76 | |
| 77 | - // Putting the values about the FAQ in the FAQ object |
|
| 78 | - $faqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 79 | - $faqObj->setVar('uid', $uid); |
|
| 80 | - $faqObj->setVar('question', $_POST['question']); |
|
| 81 | - $faqObj->setVar('howdoi', $_POST['howdoi']); |
|
| 82 | - $faqObj->setVar('diduno', $_POST['diduno']); |
|
| 83 | - $faqObj->setVar('datesub', time()); |
|
| 77 | + // Putting the values about the FAQ in the FAQ object |
|
| 78 | + $faqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 79 | + $faqObj->setVar('uid', $uid); |
|
| 80 | + $faqObj->setVar('question', $_POST['question']); |
|
| 81 | + $faqObj->setVar('howdoi', $_POST['howdoi']); |
|
| 82 | + $faqObj->setVar('diduno', $_POST['diduno']); |
|
| 83 | + $faqObj->setVar('datesub', time()); |
|
| 84 | 84 | |
| 85 | - // Putting the values in the answer object |
|
| 86 | - $answerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED); |
|
| 87 | - $answerObj->setVar('faqid', $faqObj->faqid()); |
|
| 88 | - $answerObj->setVar('answer', $_POST['answer']); |
|
| 89 | - $answerObj->setVar('uid', $uid); |
|
| 85 | + // Putting the values in the answer object |
|
| 86 | + $answerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED); |
|
| 87 | + $answerObj->setVar('faqid', $faqObj->faqid()); |
|
| 88 | + $answerObj->setVar('answer', $_POST['answer']); |
|
| 89 | + $answerObj->setVar('uid', $uid); |
|
| 90 | 90 | |
| 91 | - global $xoopsUser, $myts; |
|
| 91 | + global $xoopsUser, $myts; |
|
| 92 | 92 | |
| 93 | - $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
|
| 94 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 95 | - require_once __DIR__ . '/footer.php'; |
|
| 93 | + $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
|
| 94 | + require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 95 | + require_once __DIR__ . '/footer.php'; |
|
| 96 | 96 | |
| 97 | - $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 97 | + $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 98 | 98 | |
| 99 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 100 | - $faq = $faqObj->toArray(null, $categoryObj, false); |
|
| 101 | - $faq['categoryPath'] = $categoryObj->getCategoryPath(true); |
|
| 102 | - $faq['answer'] = $answerObj->answer(); |
|
| 103 | - $faq['who_when'] = $faqObj->getWhoAndWhen(); |
|
| 99 | + $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 100 | + $faq = $faqObj->toArray(null, $categoryObj, false); |
|
| 101 | + $faq['categoryPath'] = $categoryObj->getCategoryPath(true); |
|
| 102 | + $faq['answer'] = $answerObj->answer(); |
|
| 103 | + $faq['who_when'] = $faqObj->getWhoAndWhen(); |
|
| 104 | 104 | |
| 105 | - $faq['comments'] = -1; |
|
| 106 | - $xoopsTpl->assign('faq', $faq); |
|
| 107 | - $xoopsTpl->assign('op', 'preview'); |
|
| 108 | - $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 109 | - $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
|
| 105 | + $faq['comments'] = -1; |
|
| 106 | + $xoopsTpl->assign('faq', $faq); |
|
| 107 | + $xoopsTpl->assign('op', 'preview'); |
|
| 108 | + $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 109 | + $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
|
| 110 | 110 | |
| 111 | - $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
|
| 112 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 111 | + $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
|
| 112 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 113 | 113 | |
| 114 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
| 114 | + require_once __DIR__ . '/include/submit.inc.php'; |
|
| 115 | 115 | |
| 116 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 116 | + require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 117 | 117 | |
| 118 | - exit(); |
|
| 119 | - break; |
|
| 118 | + exit(); |
|
| 119 | + break; |
|
| 120 | 120 | |
| 121 | - case 'post': |
|
| 121 | + case 'post': |
|
| 122 | 122 | |
| 123 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 123 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 124 | 124 | |
| 125 | - $newFaqObj = $faqHandler->create(); |
|
| 126 | - $newAnswerObj = $answerHandler->create(); |
|
| 125 | + $newFaqObj = $faqHandler->create(); |
|
| 126 | + $newAnswerObj = $answerHandler->create(); |
|
| 127 | 127 | |
| 128 | - if (!$xoopsUser) { |
|
| 129 | - if (1 == $helper->getConfig('anonpost')) { |
|
| 130 | - $uid = 0; |
|
| 128 | + if (!$xoopsUser) { |
|
| 129 | + if (1 == $helper->getConfig('anonpost')) { |
|
| 130 | + $uid = 0; |
|
| 131 | + } else { |
|
| 132 | + redirect_header('index.php', 3, _NOPERM); |
|
| 133 | + } |
|
| 131 | 134 | } else { |
| 132 | - redirect_header('index.php', 3, _NOPERM); |
|
| 135 | + $uid = $xoopsUser->uid(); |
|
| 133 | 136 | } |
| 134 | - } else { |
|
| 135 | - $uid = $xoopsUser->uid(); |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - $notifypub = \Xmf\Request::getInt('notifypub', 0, POST); |
|
| 139 | - |
|
| 140 | - // Putting the values about the FAQ in the FAQ object |
|
| 141 | - $newFaqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 142 | - $newFaqObj->setVar('uid', $uid); |
|
| 143 | - $newFaqObj->setVar('question', $_POST['question']); |
|
| 144 | - $newFaqObj->setVar('howdoi', $_POST['howdoi']); |
|
| 145 | - $newFaqObj->setVar('diduno', $_POST['diduno']); |
|
| 146 | - $newFaqObj->setVar('notifypub', $notifypub); |
|
| 147 | - //$newFaqObj->setVar('modulelink', $_POST['modulelink']); |
|
| 148 | - //$newFaqObj->setVar('contextpage', $_POST['contextpage']); |
|
| 149 | 137 | |
| 150 | - // Setting the status of the FAQ |
|
| 151 | - |
|
| 152 | - // if user is admin, FAQ are automatically published |
|
| 153 | - $isAdmin = Smartfaq\Utility::userIsAdmin(); |
|
| 154 | - if ($isAdmin) { |
|
| 155 | - $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED); |
|
| 156 | - } elseif (1 == $helper->getConfig('autoapprove_submitted_faq')) { |
|
| 157 | - $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED); |
|
| 158 | - } else { |
|
| 159 | - $newFaqObj->setVar('status', Constants::SF_STATUS_SUBMITTED); |
|
| 160 | - } |
|
| 138 | + $notifypub = \Xmf\Request::getInt('notifypub', 0, POST); |
|
| 139 | + |
|
| 140 | + // Putting the values about the FAQ in the FAQ object |
|
| 141 | + $newFaqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 142 | + $newFaqObj->setVar('uid', $uid); |
|
| 143 | + $newFaqObj->setVar('question', $_POST['question']); |
|
| 144 | + $newFaqObj->setVar('howdoi', $_POST['howdoi']); |
|
| 145 | + $newFaqObj->setVar('diduno', $_POST['diduno']); |
|
| 146 | + $newFaqObj->setVar('notifypub', $notifypub); |
|
| 147 | + //$newFaqObj->setVar('modulelink', $_POST['modulelink']); |
|
| 148 | + //$newFaqObj->setVar('contextpage', $_POST['contextpage']); |
|
| 149 | + |
|
| 150 | + // Setting the status of the FAQ |
|
| 151 | + |
|
| 152 | + // if user is admin, FAQ are automatically published |
|
| 153 | + $isAdmin = Smartfaq\Utility::userIsAdmin(); |
|
| 154 | + if ($isAdmin) { |
|
| 155 | + $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED); |
|
| 156 | + } elseif (1 == $helper->getConfig('autoapprove_submitted_faq')) { |
|
| 157 | + $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED); |
|
| 158 | + } else { |
|
| 159 | + $newFaqObj->setVar('status', Constants::SF_STATUS_SUBMITTED); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - // Storing the FAQ object in the database |
|
| 163 | - if (!$newFaqObj->store()) { |
|
| 164 | - redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR); |
|
| 165 | - } |
|
| 162 | + // Storing the FAQ object in the database |
|
| 163 | + if (!$newFaqObj->store()) { |
|
| 164 | + redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR); |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | - // Putting the values in the answer object |
|
| 168 | - $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED); |
|
| 169 | - $newAnswerObj->setVar('faqid', $newFaqObj->faqid()); |
|
| 170 | - $newAnswerObj->setVar('answer', $_POST['answer']); |
|
| 171 | - $newAnswerObj->setVar('uid', $uid); |
|
| 172 | - |
|
| 173 | - //==================================================================================== |
|
| 174 | - //TODO post Attachment |
|
| 175 | - $attachments_tmp = []; |
|
| 176 | - if (!empty($_POST['attachments_tmp'])) { |
|
| 177 | - $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp'])); |
|
| 178 | - if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) { |
|
| 179 | - foreach ($_POST['delete_tmp'] as $key) { |
|
| 180 | - unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0]); |
|
| 181 | - unset($attachments_tmp[$key]); |
|
| 167 | + // Putting the values in the answer object |
|
| 168 | + $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED); |
|
| 169 | + $newAnswerObj->setVar('faqid', $newFaqObj->faqid()); |
|
| 170 | + $newAnswerObj->setVar('answer', $_POST['answer']); |
|
| 171 | + $newAnswerObj->setVar('uid', $uid); |
|
| 172 | + |
|
| 173 | + //==================================================================================== |
|
| 174 | + //TODO post Attachment |
|
| 175 | + $attachments_tmp = []; |
|
| 176 | + if (!empty($_POST['attachments_tmp'])) { |
|
| 177 | + $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp'])); |
|
| 178 | + if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) { |
|
| 179 | + foreach ($_POST['delete_tmp'] as $key) { |
|
| 180 | + unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0]); |
|
| 181 | + unset($attachments_tmp[$key]); |
|
| 182 | + } |
|
| 182 | 183 | } |
| 183 | 184 | } |
| 184 | - } |
|
| 185 | - if (count($attachments_tmp)) { |
|
| 186 | - foreach ($attachments_tmp as $key => $attach) { |
|
| 187 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0])) { |
|
| 188 | - $post_obj->setAttachment($attach[0], $attach[1], $attach[2]); |
|
| 185 | + if (count($attachments_tmp)) { |
|
| 186 | + foreach ($attachments_tmp as $key => $attach) { |
|
| 187 | + if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0])) { |
|
| 188 | + $post_obj->setAttachment($attach[0], $attach[1], $attach[2]); |
|
| 189 | + } |
|
| 189 | 190 | } |
| 190 | 191 | } |
| 191 | - } |
|
| 192 | - $error_upload = ''; |
|
| 192 | + $error_upload = ''; |
|
| 193 | 193 | |
| 194 | - if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name'] |
|
| 195 | - && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) { |
|
| 196 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'; |
|
| 197 | - $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024; |
|
| 198 | - $uploaddir = XOOPS_CACHE_PATH; |
|
| 194 | + if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name'] |
|
| 195 | + && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) { |
|
| 196 | + require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'; |
|
| 197 | + $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024; |
|
| 198 | + $uploaddir = XOOPS_CACHE_PATH; |
|
| 199 | 199 | |
| 200 | - $uploader = new Smartfaq\Uploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$helper->getConfig('max_img_width'), (int)$helper->getConfig('max_img_height')); |
|
| 200 | + $uploader = new Smartfaq\Uploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$helper->getConfig('max_img_width'), (int)$helper->getConfig('max_img_height')); |
|
| 201 | 201 | |
| 202 | - if ($_FILES['userfile']['error'] > 0) { |
|
| 203 | - switch ($_FILES['userfile']['error']) { |
|
| 202 | + if ($_FILES['userfile']['error'] > 0) { |
|
| 203 | + switch ($_FILES['userfile']['error']) { |
|
| 204 | 204 | case 1: |
| 205 | 205 | $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
| 206 | 206 | break; |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | default: |
| 211 | 211 | $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
| 212 | 212 | break; |
| 213 | - } |
|
| 213 | + } |
|
| 214 | 214 | } else { |
| 215 | 215 | $uploader->setCheckMediaTypeByExt(); |
| 216 | 216 | |
@@ -273,30 +273,30 @@ discard block |
||
| 273 | 273 | redirect_header('index.php', 2, $redirect_msg); |
| 274 | 274 | break; |
| 275 | 275 | |
| 276 | - case 'form': |
|
| 277 | - default: |
|
| 276 | + case 'form': |
|
| 277 | + default: |
|
| 278 | 278 | |
| 279 | - global $xoopsUser, $myts; |
|
| 279 | + global $xoopsUser, $myts; |
|
| 280 | 280 | |
| 281 | - $faqObj = $faqHandler->create(); |
|
| 282 | - $answerObj = $answerHandler->create(); |
|
| 283 | - $categoryObj = $categoryHandler->create(); |
|
| 281 | + $faqObj = $faqHandler->create(); |
|
| 282 | + $answerObj = $answerHandler->create(); |
|
| 283 | + $categoryObj = $categoryHandler->create(); |
|
| 284 | 284 | |
| 285 | - $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
|
| 286 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 287 | - require_once __DIR__ . '/footer.php'; |
|
| 285 | + $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
|
| 286 | + require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 287 | + require_once __DIR__ . '/footer.php'; |
|
| 288 | 288 | |
| 289 | - $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 290 | - $notifypub = 1; |
|
| 291 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 292 | - $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 293 | - $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
|
| 289 | + $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 290 | + $notifypub = 1; |
|
| 291 | + $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 292 | + $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 293 | + $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
|
| 294 | 294 | |
| 295 | - $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
|
| 296 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 295 | + $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
|
| 296 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 297 | 297 | |
| 298 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
| 298 | + require_once __DIR__ . '/include/submit.inc.php'; |
|
| 299 | 299 | |
| 300 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 301 | - break; |
|
| 300 | + require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 301 | + break; |
|
| 302 | 302 | } |
@@ -9,7 +9,7 @@ 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 $xoopsUser, $xoopsConfig, $xoopsModule; |
| 15 | 15 | /** @var Smartfaq\Helper $helper */ |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | switch ($op) { |
| 57 | 57 | case 'preview': |
| 58 | 58 | |
| 59 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 59 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 60 | 60 | |
| 61 | 61 | $faqObj = $faqHandler->create(); |
| 62 | 62 | $answerObj = $answerHandler->create(); |
@@ -91,12 +91,12 @@ discard block |
||
| 91 | 91 | global $xoopsUser, $myts; |
| 92 | 92 | |
| 93 | 93 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
| 94 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 95 | - require_once __DIR__ . '/footer.php'; |
|
| 94 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 95 | + require_once __DIR__.'/footer.php'; |
|
| 96 | 96 | |
| 97 | 97 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
| 98 | 98 | |
| 99 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 99 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 100 | 100 | $faq = $faqObj->toArray(null, $categoryObj, false); |
| 101 | 101 | $faq['categoryPath'] = $categoryObj->getCategoryPath(true); |
| 102 | 102 | $faq['answer'] = $answerObj->answer(); |
@@ -109,18 +109,18 @@ discard block |
||
| 109 | 109 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
| 110 | 110 | |
| 111 | 111 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
| 112 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 112 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
| 113 | 113 | |
| 114 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
| 114 | + require_once __DIR__.'/include/submit.inc.php'; |
|
| 115 | 115 | |
| 116 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 116 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 117 | 117 | |
| 118 | 118 | exit(); |
| 119 | 119 | break; |
| 120 | 120 | |
| 121 | 121 | case 'post': |
| 122 | 122 | |
| 123 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 123 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsDB; |
|
| 124 | 124 | |
| 125 | 125 | $newFaqObj = $faqHandler->create(); |
| 126 | 126 | $newAnswerObj = $answerHandler->create(); |
@@ -177,14 +177,14 @@ discard block |
||
| 177 | 177 | $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp'])); |
| 178 | 178 | if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) { |
| 179 | 179 | foreach ($_POST['delete_tmp'] as $key) { |
| 180 | - unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0]); |
|
| 180 | + unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attachments_tmp[$key][0]); |
|
| 181 | 181 | unset($attachments_tmp[$key]); |
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | if (count($attachments_tmp)) { |
| 186 | 186 | foreach ($attachments_tmp as $key => $attach) { |
| 187 | - if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attachments_tmp[$key][0])) { |
|
| 187 | + if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attachments_tmp[$key][0])) { |
|
| 188 | 188 | $post_obj->setAttachment($attach[0], $attach[1], $attach[2]); |
| 189 | 189 | } |
| 190 | 190 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name'] |
| 195 | 195 | && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) { |
| 196 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php'; |
|
| 196 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php'; |
|
| 197 | 197 | $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024; |
| 198 | 198 | $uploaddir = XOOPS_CACHE_PATH; |
| 199 | 199 | |
@@ -215,19 +215,19 @@ discard block |
||
| 215 | 215 | $uploader->setCheckMediaTypeByExt(); |
| 216 | 216 | |
| 217 | 217 | if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
| 218 | - $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_'; |
|
| 218 | + $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid().'_' : 'newbb_'; |
|
| 219 | 219 | $uploader->setPrefix($prefix); |
| 220 | 220 | if (!$uploader->upload()) { |
| 221 | - $error_message[] = $error_upload =& $uploader->getErrors(); |
|
| 221 | + $error_message[] = $error_upload = & $uploader->getErrors(); |
|
| 222 | 222 | } else { |
| 223 | 223 | if (is_file($uploader->getSavedDestination())) { |
| 224 | - if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $uploader->getSavedFileName())) { |
|
| 224 | + if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$uploader->getSavedFileName())) { |
|
| 225 | 225 | $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | } else { |
| 230 | - $error_message[] = $error_upload =& $uploader->getErrors(); |
|
| 230 | + $error_message[] = $error_upload = & $uploader->getErrors(); |
|
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | } else { |
| 261 | 261 | // Subscribe the user to On Published notification, if requested |
| 262 | 262 | if (1 == $notifypub) { |
| 263 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 263 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 264 | 264 | $notificationHandler = xoops_getHandler('notification'); |
| 265 | 265 | $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 266 | 266 | } |
@@ -283,20 +283,20 @@ discard block |
||
| 283 | 283 | $categoryObj = $categoryHandler->create(); |
| 284 | 284 | |
| 285 | 285 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
| 286 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 287 | - require_once __DIR__ . '/footer.php'; |
|
| 286 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 287 | + require_once __DIR__.'/footer.php'; |
|
| 288 | 288 | |
| 289 | 289 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
| 290 | 290 | $notifypub = 1; |
| 291 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 291 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 292 | 292 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 293 | 293 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
| 294 | 294 | |
| 295 | 295 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
| 296 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 296 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
| 297 | 297 | |
| 298 | - require_once __DIR__ . '/include/submit.inc.php'; |
|
| 298 | + require_once __DIR__.'/include/submit.inc.php'; |
|
| 299 | 299 | |
| 300 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 300 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 301 | 301 | break; |
| 302 | 302 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | /** @var Smartfaq\Helper $helper */ |
| 11 | 11 | $helper = Smartfaq\Helper::getInstance(); |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/header.php'; |
|
| 13 | +require_once __DIR__.'/header.php'; |
|
| 14 | 14 | |
| 15 | 15 | $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET'); |
| 16 | 16 | |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
| 39 | 39 | |
| 40 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 41 | -require_once __DIR__ . '/footer.php'; |
|
| 40 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 41 | +require_once __DIR__.'/footer.php'; |
|
| 42 | 42 | |
| 43 | 43 | // At which record shall we start |
| 44 | 44 | $start = \Xmf\Request::getInt('start', 0, 'GET'); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | $lastfaqsize = (int)$helper->getConfig('lastfaqsize'); |
| 80 | 80 | // Creating the sub-categories objects that belong to the selected category |
| 81 | -$subcatsObj =& $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 81 | +$subcatsObj = & $categoryHandler->getCategories(0, 0, $categoryid); |
|
| 82 | 82 | $total_subcats = count($subcatsObj); |
| 83 | 83 | $total_faqs = 0; |
| 84 | 84 | if (0 != $total_subcats) { |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 89 | 89 | if (isset($last_qnaObj[$subcat_id])) { |
| 90 | 90 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 91 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 91 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
| 95 | 95 | $subcats[$subcat_id] = $subcatsObj[$i]->toArray(); |
| 96 | - $total_faqs += $totalQnas[$subcat_id]; |
|
| 96 | + $total_faqs += $totalQnas[$subcat_id]; |
|
| 97 | 97 | //}replacé ligne 92 |
| 98 | 98 | } |
| 99 | 99 | $xoopsTpl->assign('subcats', $subcats); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $memberHandler = xoops_getHandler('member'); |
| 119 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 119 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 120 | 120 | // Adding the Q&As of the selected category |
| 121 | 121 | foreach ($faqsObj as $iValue) { |
| 122 | 122 | $faq = $iValue->toArray(null, $categoryObj); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if (isset($last_qnaObj) && $last_qnaObj) { |
| 144 | 144 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
| 145 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
| 145 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -167,26 +167,26 @@ discard block |
||
| 167 | 167 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 168 | 168 | |
| 169 | 169 | // The Navigation Bar |
| 170 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 171 | -$pagenav = new \XoopsPageNav($thiscategory_faqcount, $helper->getConfig('indexperpage'), $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
| 170 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 171 | +$pagenav = new \XoopsPageNav($thiscategory_faqcount, $helper->getConfig('indexperpage'), $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
| 172 | 172 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 173 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 173 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 174 | 174 | } else { |
| 175 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 175 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | $xoopsTpl->assign('category', $category); |
| 179 | 179 | |
| 180 | 180 | // Page Title Hack by marcan |
| 181 | 181 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 182 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
| 182 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
| 183 | 183 | // End Page Title Hack by marcan |
| 184 | 184 | |
| 185 | 185 | //code to include smartie |
| 186 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 187 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 186 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 187 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 188 | 188 | $xoopsTpl->assign('smarttie', 1); |
| 189 | 189 | } |
| 190 | 190 | //end code for smarttie |
| 191 | 191 | |
| 192 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 192 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | /** @var Smartfaq\Helper $helper */ |
| 11 | 11 | $helper = Smartfaq\Helper::getInstance(); |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/header.php'; |
|
| 13 | +require_once __DIR__.'/header.php'; |
|
| 14 | 14 | |
| 15 | 15 | $faqid = \Xmf\Request::getInt('faqid', 0, 'GET'); |
| 16 | 16 | |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | $faqObj->updateCounter(); |
| 50 | 50 | } |
| 51 | 51 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_faq.tpl'; |
| 52 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 53 | -require_once __DIR__ . '/footer.php'; |
|
| 52 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 53 | +require_once __DIR__.'/footer.php'; |
|
| 54 | 54 | |
| 55 | 55 | $faq = $faqObj->toArray(null, $categoryObj, false); |
| 56 | 56 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $xoopsTpl->assign('display_categoryname', false); |
| 86 | 86 | |
| 87 | 87 | $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes')); |
| 88 | -$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid')); |
|
| 88 | +$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid')); |
|
| 89 | 89 | $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY); |
| 90 | 90 | $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY); |
| 91 | 91 | $xoopsTpl->assign('faqid', $faqObj->getVar('faqid')); |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | // Page Title Hack by marcan |
| 103 | 103 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 104 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']); |
|
| 104 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']); |
|
| 105 | 105 | // End Page Title Hack by marcan |
| 106 | 106 | |
| 107 | 107 | // Include the comments if the selected FAQ supports comments |
| 108 | 108 | if (1 == $faqObj->cancomment()) { |
| 109 | - require_once XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
| 109 | + require_once XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | //code to include smartie |
| 113 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 114 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 113 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 114 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 115 | 115 | $xoopsTpl->assign('smarttie', 1); |
| 116 | 116 | } |
| 117 | 117 | //end code for smarttie |
| 118 | 118 | |
| 119 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 119 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | use XoopsModules\Smartfaq\Constants; |
| 11 | 11 | |
| 12 | 12 | |
| 13 | -require_once __DIR__ . '/header.php'; |
|
| 13 | +require_once __DIR__.'/header.php'; |
|
| 14 | 14 | |
| 15 | 15 | global $xoopsConfig, $xoopsModule; |
| 16 | 16 | /** @var Smartfaq\Helper $helper */ |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
| 51 | 51 | |
| 52 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 53 | -require_once __DIR__ . '/footer.php'; |
|
| 52 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 53 | +require_once __DIR__.'/footer.php'; |
|
| 54 | 54 | |
| 55 | 55 | //get all categories for future reference |
| 56 | 56 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -72,11 +72,11 @@ discard block |
||
| 72 | 72 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 73 | 73 | if (isset($last_qnaObj[$subcat_id])) { |
| 74 | 74 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 75 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
| 75 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
| 76 | 76 | } |
| 77 | 77 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 78 | 78 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
| 79 | - $total += $totalQnas[$subcat_id]; |
|
| 79 | + $total += $totalQnas[$subcat_id]; |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | $memberHandler = xoops_getHandler('member'); |
| 111 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 111 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 112 | 112 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 113 | 113 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
| 114 | 114 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | // Language constants |
| 124 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 124 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 125 | 125 | $xoopsTpl->assign([ |
| 126 | 126 | 'lang_on' => _MD_SF_ON, |
| 127 | 127 | 'lang_postedby' => _MD_SF_POSTEDBY, |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | 'lang_hits' => _MD_SF_HITS |
| 132 | 132 | ]); |
| 133 | 133 | |
| 134 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 134 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 135 | 135 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
| 136 | 136 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($helper->getConfig('openquestionintromsg'), 1)); |
| 137 | 137 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
| 140 | 140 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 141 | 141 | $xoopsTpl->assign('sectionname', $moduleName); |
| 142 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
| 142 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
| 143 | 143 | |
| 144 | 144 | $xoopsTpl->assign('displayFull', false); |
| 145 | 145 | $xoopsTpl->assign('displaylastfaqs', $helper->getConfig('displaylastfaqs')); |
@@ -155,25 +155,25 @@ discard block |
||
| 155 | 155 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 156 | 156 | |
| 157 | 157 | // Category Navigation Bar |
| 158 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 158 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 159 | 159 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('catperpage'), $catstart, 'catstart', ''); |
| 160 | 160 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 161 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 161 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 162 | 162 | } else { |
| 163 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 163 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // FAQ Navigation Bar |
| 167 | 167 | $pagenav = new \XoopsPageNav($totalFaqs, $helper->getConfig('indexperpage'), $start, 'start', ''); |
| 168 | 168 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 169 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 169 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 170 | 170 | } else { |
| 171 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 171 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // Page Title Hack by marcan |
| 175 | 175 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 176 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
| 176 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
| 177 | 177 | // End Page Title Hack by marcan |
| 178 | 178 | |
| 179 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 179 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** @var Smartfaq\Helper $helper */ |
| 12 | 12 | $helper = Smartfaq\Helper::getInstance(); |
| 13 | 13 | |
| 14 | -require_once __DIR__ . '/header.php'; |
|
| 14 | +require_once __DIR__.'/header.php'; |
|
| 15 | 15 | |
| 16 | 16 | // At which record shall we start for the Categories |
| 17 | 17 | $catstart = \Xmf\Request::getInt('catstart', 0, 'GET'); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
| 46 | 46 | |
| 47 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 48 | -require_once __DIR__ . '/footer.php'; |
|
| 47 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 48 | +require_once __DIR__.'/footer.php'; |
|
| 49 | 49 | |
| 50 | 50 | // Creating the categories objects |
| 51 | -$categoriesObj =& $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
| 51 | +$categoriesObj = & $categoryHandler->getCategories($helper->getConfig('catperpage'), $catstart); |
|
| 52 | 52 | // If no categories are found, exit |
| 53 | 53 | $totalCategoriesOnPage = count($categoriesObj); |
| 54 | 54 | if (0 == $totalCategoriesOnPage) { |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 79 | 79 | if (isset($last_qnaObj[$subcat_id])) { |
| 80 | 80 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 81 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 81 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 82 | 82 | } |
| 83 | 83 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 84 | 84 | if ($helper->getConfig('displaysubcatonindex')) { |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | if ($total > 0) { |
| 97 | 97 | if (isset($last_qnaObj[$cat_id])) { |
| 98 | 98 | $category->setVar('last_faqid', $last_qnaObj[$cat_id]->getVar('faqid')); |
| 99 | - $category->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$cat_id]->getVar('faqid') . "'>" . $last_qnaObj[$cat_id]->question($lastfaqsize) . '</a>'); |
|
| 99 | + $category->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$cat_id]->getVar('faqid')."'>".$last_qnaObj[$cat_id]->question($lastfaqsize).'</a>'); |
|
| 100 | 100 | } |
| 101 | 101 | $category->setVar('faqcount', $total); |
| 102 | 102 | if (!isset($categories[$cat_id])) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $memberHandler = xoops_getHandler('member'); |
| 138 | - $users = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 138 | + $users = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 139 | 139 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 140 | 140 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
| 141 | 141 | |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | // Language constants |
| 164 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 164 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 165 | 165 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 166 | 166 | $xoopsTpl->assign('displaysubcatonindex', $helper->getConfig('displaysubcatonindex')); |
| 167 | 167 | $xoopsTpl->assign('displaylastfaqs', $helper->getConfig('displaylastfaqs')); |
| 168 | 168 | $xoopsTpl->assign('display_categoryname', true); |
| 169 | 169 | $xoopsTpl->assign('displayFull', 'full' === $helper->getConfig('displaytype')); |
| 170 | 170 | |
| 171 | -$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD . ' ' . $moduleName); |
|
| 171 | +$xoopsTpl->assign('lang_mainhead', _MD_SF_MAINHEAD.' '.$moduleName); |
|
| 172 | 172 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($helper->getConfig('indexwelcomemsg'), 1)); |
| 173 | 173 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_SMARTFAQS); |
| 174 | 174 | $xoopsTpl->assign('lang_home', _MD_SF_HOME); |
@@ -187,20 +187,20 @@ discard block |
||
| 187 | 187 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 188 | 188 | |
| 189 | 189 | // Category Navigation Bar |
| 190 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 190 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 191 | 191 | $pagenav = new \XoopsPageNav($totalCategories, $helper->getConfig('catperpage'), $catstart, 'catstart', ''); |
| 192 | 192 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 193 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 193 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 194 | 194 | } else { |
| 195 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 195 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // FAQ Navigation Bar |
| 199 | 199 | $pagenav = new \XoopsPageNav($totalFaqs, $helper->getConfig('indexperpage'), $start, 'start', ''); |
| 200 | 200 | if (1 == $helper->getConfig('useimagenavpage')) { |
| 201 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 201 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 202 | 202 | } else { |
| 203 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 203 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Page Title Hack by marcan |
@@ -208,4 +208,4 @@ discard block |
||
| 208 | 208 | $xoopsTpl->assign('xoops_pagetitle', $module_name); |
| 209 | 209 | // End Page Title Hack by marcan |
| 210 | 210 | |
| 211 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 211 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | /** @var Smartfaq\Helper $helper */ |
| 13 | 13 | $helper = Smartfaq\Helper::getInstance(); |
| 14 | 14 | |
| 15 | -require_once __DIR__ . '/header.php'; |
|
| 15 | +require_once __DIR__.'/header.php'; |
|
| 16 | 16 | |
| 17 | 17 | global $xoopsUser, $xoopsConfig, $xoopsModule; |
| 18 | 18 | |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | // Storing the FAQ object in the database |
| 137 | 137 | if (!$faqObj->store()) { |
| 138 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 138 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.Smartfaq\Utility::formatErrors($faqObj->getErrors())); |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Storing the answer object in the database |
| 142 | 142 | if (!$newAnswerObj->store()) { |
| 143 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . Smartfaq\Utility::formatErrors($newAnswerObj->getErrors())); |
|
| 143 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.Smartfaq\Utility::formatErrors($newAnswerObj->getErrors())); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** @var \XoopsNotificationHandler $notificationHandler */ |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | case 2: |
| 158 | 158 | // Answer for an open question submitted, auto-approved; became Q&A, need approbation |
| 159 | 159 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 160 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 160 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 161 | 161 | $notificationHandler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 162 | 162 | } |
| 163 | 163 | // Send notifications |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | case 3: |
| 168 | 168 | // Answer submitted, needs approbation |
| 169 | 169 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 170 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 170 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 171 | 171 | $notificationHandler->subscribe('question', $newAnswerObj->answerid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 172 | 172 | } |
| 173 | 173 | // Send notifications |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | // New answer submitted for a published Q&A, need approbation |
| 183 | 183 | // Send notifications |
| 184 | 184 | if (isset($_POST['notifypub']) && 1 == $_POST['notifypub']) { |
| 185 | - require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 185 | + require_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 186 | 186 | $notificationHandler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -218,20 +218,20 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl'; |
| 221 | - require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 222 | - require_once __DIR__ . '/footer.php'; |
|
| 221 | + require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 222 | + require_once __DIR__.'/footer.php'; |
|
| 223 | 223 | |
| 224 | 224 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
| 225 | 225 | |
| 226 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 226 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 227 | 227 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 228 | 228 | $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER); |
| 229 | 229 | |
| 230 | 230 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name()))); |
| 231 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUBMITANSWER_INTRO); |
|
| 231 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUBMITANSWER_INTRO); |
|
| 232 | 232 | |
| 233 | - require_once __DIR__ . '/include/answer.inc.php'; |
|
| 233 | + require_once __DIR__.'/include/answer.inc.php'; |
|
| 234 | 234 | |
| 235 | - require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 235 | + require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 236 | 236 | break; |
| 237 | 237 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $attachment_save = base64_encode(serialize($this->attachment_array)); |
| 103 | 103 | } |
| 104 | 104 | $this->setVar('attachment', $attachment_save); |
| 105 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
|
| 105 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid'); |
|
| 106 | 106 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 107 | 107 | //xoops_error($GLOBALS["xoopsDB"]->error()); |
| 108 | 108 | return false; |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | foreach ($attach_old as $key => $attach) { |
| 137 | 137 | if (in_array($key, $attach_array)) { |
| 138 | - @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $attach['name_saved']); |
|
| 139 | - @unlink(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/thumbs/' . $attach['name_saved']); // delete thumbnails |
|
| 138 | + @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$attach['name_saved']); |
|
| 139 | + @unlink(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/thumbs/'.$attach['name_saved']); // delete thumbnails |
|
| 140 | 140 | continue; |
| 141 | 141 | } |
| 142 | 142 | $this->attachment_array[$key] = $attach; |
@@ -195,24 +195,24 @@ discard block |
||
| 195 | 195 | if (is_array($attachments) && count($attachments) > 0) { |
| 196 | 196 | $iconHandler = sf_getIconHandler(); |
| 197 | 197 | $mime_path = $iconHandler->getPath('mime'); |
| 198 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php'; |
|
| 198 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php'; |
|
| 199 | 199 | $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!! |
| 200 | - $post_attachment .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:'; |
|
| 200 | + $post_attachment .= '<br><strong>'._MD_ATTACHMENT.'</strong>:'; |
|
| 201 | 201 | $post_attachment .= '<br><hr size="1" noshade="noshade"><br>'; |
| 202 | 202 | foreach ($attachments as $key => $att) { |
| 203 | 203 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 204 | 204 | $filetype = $file_extension; |
| 205 | - if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) { |
|
| 206 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 205 | + if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) { |
|
| 206 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 207 | 207 | } else { |
| 208 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 208 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 209 | 209 | } |
| 210 | - $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $helper->getConfig('dir_attachments') . '/' . $att['name_saved']); |
|
| 211 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 210 | + $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$helper->getConfig('dir_attachments').'/'.$att['name_saved']); |
|
| 211 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 212 | 212 | if ($helper->getConfig('media_allowed') && in_array(strtolower($file_extension), $image_extensions)) { |
| 213 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong> ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 214 | - $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']); |
|
| 215 | - $isDisplayed = true; |
|
| 213 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong> '.$att['name_display'].'</strong> <small>('.$file_size.')</small>'; |
|
| 214 | + $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']); |
|
| 215 | + $isDisplayed = true; |
|
| 216 | 216 | } else { |
| 217 | 217 | global $xoopsUser; |
| 218 | 218 | if (empty($helper->getConfig('show_userattach'))) { |
@@ -369,9 +369,9 @@ discard block |
||
| 369 | 369 | $tags = []; |
| 370 | 370 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 371 | 371 | $tags['FAQ_NAME'] = $faqObj->question(); |
| 372 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid(); |
|
| 372 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid(); |
|
| 373 | 373 | $tags['CATEGORY_NAME'] = $faqObj->getCategoryName(); |
| 374 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid(); |
|
| 374 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid(); |
|
| 375 | 375 | $tags['FAQ_QUESTION'] = $faqObj->question(); |
| 376 | 376 | |
| 377 | 377 | // 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; |
@@ -439,31 +439,31 @@ discard block |
||
| 439 | 439 | // TODO : Move this to the Smartfaq\Faq class |
| 440 | 440 | public static function getAdminLinks($faqid = 0, $open = false) |
| 441 | 441 | { |
| 442 | - global $xoopsUser, $xoopsModule, $xoopsConfig; |
|
| 442 | + global $xoopsUser, $xoopsModule, $xoopsConfig; |
|
| 443 | 443 | /** @var Smartfaq\Helper $helper */ |
| 444 | 444 | $helper = Smartfaq\Helper::getInstance(); |
| 445 | 445 | |
| 446 | 446 | $adminLinks = ''; |
| 447 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
| 447 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
| 448 | 448 | $page = $open ? 'question.php' : 'faq.php'; |
| 449 | 449 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 450 | 450 | // Edit button |
| 451 | - $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>"; |
|
| 451 | + $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>"; |
|
| 452 | 452 | $adminLinks .= ' '; |
| 453 | 453 | // Delete button |
| 454 | - $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>"; |
|
| 454 | + $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>"; |
|
| 455 | 455 | $adminLinks .= ' '; |
| 456 | 456 | } |
| 457 | 457 | // Print button |
| 458 | - $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>"; |
|
| 458 | + $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>"; |
|
| 459 | 459 | $adminLinks .= ' '; |
| 460 | 460 | // Email button |
| 461 | - $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . $modulePath . 'faq.php?faqid=' . $faqid; |
|
| 462 | - $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>"; |
|
| 461 | + $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.$modulePath.'faq.php?faqid='.$faqid; |
|
| 462 | + $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>"; |
|
| 463 | 463 | $adminLinks .= ' '; |
| 464 | 464 | // Submit New Answer button |
| 465 | 465 | if ($helper->getConfig('allownewanswer') && (is_object($xoopsUser) || $helper->getConfig('anonpost'))) { |
| 466 | - $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>"; |
|
| 466 | + $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>"; |
|
| 467 | 467 | $adminLinks .= ' '; |
| 468 | 468 | } |
| 469 | 469 | |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | if (!isset($users[$userid])) { |
| 495 | 495 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 496 | 496 | } |
| 497 | - $user =& $users[$userid]; |
|
| 497 | + $user = & $users[$userid]; |
|
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | if (is_object($user)) { |
@@ -508,9 +508,9 @@ discard block |
||
| 508 | 508 | $fullname = $user->getVar('name'); |
| 509 | 509 | } |
| 510 | 510 | if (!empty($fullname)) { |
| 511 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 511 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 512 | 512 | } else { |
| 513 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 513 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | return $linkeduser; |
@@ -592,6 +592,6 @@ discard block |
||
| 592 | 592 | //--> |
| 593 | 593 | </script> |
| 594 | 594 | <?php |
| 595 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
| 595 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
| 596 | 596 | } |
| 597 | 597 | } |