@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/header.php'; |
|
| 9 | +require_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
| 11 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
| 12 | 12 | |
| 13 | 13 | // Creating the category handler object |
| 14 | 14 | $categoryHandler = sf_gethandler('category'); |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl'; |
| 34 | 34 | |
| 35 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 36 | -require_once __DIR__ . '/footer.php'; |
|
| 35 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 36 | +require_once __DIR__.'/footer.php'; |
|
| 37 | 37 | |
| 38 | 38 | // At which record shall we start |
| 39 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
| 39 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
| 40 | 40 | |
| 41 | 41 | // Creating the faq handler object |
| 42 | 42 | $faqHandler = sf_gethandler('faq'); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | // Get the last smartfaq |
| 71 | 71 | $last_qnaObj = $faqHandler->getLastPublishedByCat(); |
| 72 | 72 | } |
| 73 | -$lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
|
| 73 | +$lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize']; |
|
| 74 | 74 | // Creating the sub-categories objects that belong to the selected category |
| 75 | 75 | $subcatsObj = $categoryHandler->getCategories(0, 0, $categoryid); |
| 76 | 76 | $total_subcats = count($subcatsObj); |
@@ -82,18 +82,18 @@ discard block |
||
| 82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
| 84 | 84 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 85 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 85 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
| 89 | 89 | $subcats[$subcat_id] = $subcatsObj[$i]->toArray(); |
| 90 | - $total_faqs += $totalQnas[$subcat_id]; |
|
| 90 | + $total_faqs += $totalQnas[$subcat_id]; |
|
| 91 | 91 | //}replacé ligne 92 |
| 92 | 92 | } |
| 93 | 93 | $xoopsTpl->assign('subcats', $subcats); |
| 94 | 94 | } |
| 95 | 95 | $thiscategory_faqcount = isset($totalQnas[$categoryid]) ? $totalQnas[$categoryid] : 0; |
| 96 | -$category['total'] = $thiscategory_faqcount + $total_faqs; |
|
| 96 | +$category['total'] = $thiscategory_faqcount+$total_faqs; |
|
| 97 | 97 | |
| 98 | 98 | if (count($faqsObj) > 0) { |
| 99 | 99 | $userids = []; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $memberHandler = xoops_getHandler('member'); |
| 112 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 112 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 113 | 113 | // Adding the Q&As of the selected category |
| 114 | 114 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 115 | 115 | $faq = $faqsObj[$i]->toArray(null, $categoryObj); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (isset($last_qnaObj) && $last_qnaObj) { |
| 137 | 137 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
| 138 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
| 138 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -160,26 +160,26 @@ discard block |
||
| 160 | 160 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 161 | 161 | |
| 162 | 162 | // The Navigation Bar |
| 163 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 164 | -$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
| 163 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 164 | +$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
| 165 | 165 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 166 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 166 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 167 | 167 | } else { |
| 168 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 168 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $xoopsTpl->assign('category', $category); |
| 172 | 172 | |
| 173 | 173 | // Page Title Hack by marcan |
| 174 | 174 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 175 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
| 175 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
| 176 | 176 | // End Page Title Hack by marcan |
| 177 | 177 | |
| 178 | 178 | //code to include smartie |
| 179 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 180 | - require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 179 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 180 | + require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 181 | 181 | $xoopsTpl->assign('smarttie', 1); |
| 182 | 182 | } |
| 183 | 183 | //end code for smarttie |
| 184 | 184 | |
| 185 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 185 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -6,15 +6,15 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/header.php'; |
|
| 9 | +require_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | 11 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 12 | 12 | |
| 13 | 13 | // At which record shall we start for the Categories |
| 14 | -$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0; |
|
| 14 | +$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0; |
|
| 15 | 15 | |
| 16 | 16 | // At which record shall we start for the FAQs |
| 17 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
| 17 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
| 18 | 18 | |
| 19 | 19 | // Creating the category handler object |
| 20 | 20 | $categoryHandler = sf_gethandler('category'); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl'; |
| 44 | 44 | |
| 45 | -require_once XOOPS_ROOT_PATH . '/header.php'; |
|
| 46 | -require_once __DIR__ . '/footer.php'; |
|
| 45 | +require_once XOOPS_ROOT_PATH.'/header.php'; |
|
| 46 | +require_once __DIR__.'/footer.php'; |
|
| 47 | 47 | |
| 48 | 48 | //get all categories for future reference |
| 49 | 49 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -65,11 +65,11 @@ discard block |
||
| 65 | 65 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 66 | 66 | if (isset($last_qnaObj[$subcat_id])) { |
| 67 | 67 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 68 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
| 68 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
| 69 | 69 | } |
| 70 | 70 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 71 | 71 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
| 72 | - $total += $totalQnas[$subcat_id]; |
|
| 72 | + $total += $totalQnas[$subcat_id]; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $memberHandler = xoops_getHandler('member'); |
| 104 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 104 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 105 | 105 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 106 | 106 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
| 107 | 107 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | // Language constants |
| 117 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 117 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 118 | 118 | $xoopsTpl->assign([ |
| 119 | 119 | 'lang_on' => _MD_SF_ON, |
| 120 | 120 | 'lang_postedby' => _MD_SF_POSTEDBY, |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'lang_hits' => _MD_SF_HITS |
| 125 | 125 | ]); |
| 126 | 126 | |
| 127 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 127 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 128 | 128 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
| 129 | 129 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1)); |
| 130 | 130 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
| 133 | 133 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 134 | 134 | $xoopsTpl->assign('sectionname', $moduleName); |
| 135 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
| 135 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
| 136 | 136 | |
| 137 | 137 | $xoopsTpl->assign('displayFull', false); |
| 138 | 138 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
@@ -148,25 +148,25 @@ discard block |
||
| 148 | 148 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 149 | 149 | |
| 150 | 150 | // Category Navigation Bar |
| 151 | -require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 151 | +require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 152 | 152 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
| 153 | 153 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 154 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 154 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 155 | 155 | } else { |
| 156 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 156 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | // FAQ Navigation Bar |
| 160 | 160 | $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
| 161 | 161 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 162 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 162 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 163 | 163 | } else { |
| 164 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 164 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // Page Title Hack by marcan |
| 168 | 168 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 169 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
| 169 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
| 170 | 170 | // End Page Title Hack by marcan |
| 171 | 171 | |
| 172 | -require_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 172 | +require_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
| 29 | 29 | exit('Access Denied'); |
| 30 | 30 | } |
| 31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
| 32 | -include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
| 31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
| 32 | +include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
| 33 | 33 | |
| 34 | 34 | $op = 'list'; |
| 35 | 35 | if (isset($HTTP_POST_VARS)) { |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | || $HTTP_GET_VARS['op'] === 'clone' |
| 44 | 44 | || $HTTP_GET_VARS['op'] === 'previewpopup') { |
| 45 | 45 | $op = $HTTP_GET_VARS['op']; |
| 46 | - $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0; |
|
| 46 | + $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0; |
|
| 47 | 47 | } |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (isset($previewblock)) { |
| 51 | 51 | xoops_cp_header(); |
| 52 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 52 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 53 | 53 | $xoopsTpl = new XoopsTpl(); |
| 54 | 54 | $xoopsTpl->xoops_setCaching(0); |
| 55 | 55 | if (isset($bid)) { |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | . $myblock->getContent('S', $bctype) |
| 84 | 84 | . '</td></tr></table></body></html>'; |
| 85 | 85 | |
| 86 | - $dummyfile = '_dummyfile_' . time() . '.html'; |
|
| 87 | - $fp = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w'); |
|
| 86 | + $dummyfile = '_dummyfile_'.time().'.html'; |
|
| 87 | + $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w'); |
|
| 88 | 88 | fwrite($fp, $dummyhtml); |
| 89 | 89 | fclose($fp); |
| 90 | 90 | $block['edit_form'] = false; |
@@ -95,24 +95,24 @@ discard block |
||
| 95 | 95 | $block['visible'] = $bvisible; |
| 96 | 96 | $block['title'] = $myblock->getVar('title', 'E'); |
| 97 | 97 | $block['content'] = $myblock->getVar('content', 'E'); |
| 98 | - $block['modules'] =& $bmodule; |
|
| 98 | + $block['modules'] = & $bmodule; |
|
| 99 | 99 | $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); |
| 100 | 100 | $block['is_custom'] = true; |
| 101 | - $block['cachetime'] = (int)$bcachetime; |
|
| 102 | - echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a> <span style="font-weight:bold;">»»</span> ' . $block['form_title'] . '<br><br>'; |
|
| 103 | - include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php'; |
|
| 101 | + $block['cachetime'] = (int) $bcachetime; |
|
| 102 | + echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br><br>'; |
|
| 103 | + include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; |
|
| 104 | 104 | $form->display(); |
| 105 | 105 | xoops_cp_footer(); |
| 106 | 106 | echo '<script type="text/javascript"> |
| 107 | 107 | <!--// |
| 108 | - preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200); |
|
| 108 | + preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200); |
|
| 109 | 109 | //--> |
| 110 | 110 | </script>'; |
| 111 | 111 | exit(); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($op === 'previewpopup') { |
| 115 | - $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file'])); |
|
| 115 | + $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file'])); |
|
| 116 | 116 | if (file_exists($file)) { |
| 117 | 117 | include $file; |
| 118 | 118 | @unlink($file); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | if ($op === 'update') { |
| 153 | - $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0; |
|
| 153 | + $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0; |
|
| 154 | 154 | $options = isset($options) ? $options : []; |
| 155 | 155 | $bcontent = isset($bcontent) ? $bcontent : ''; |
| 156 | 156 | $bctype = isset($bctype) ? $bctype : ''; |
@@ -251,27 +251,27 @@ discard block |
||
| 251 | 251 | $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid); |
| 252 | 252 | $db->query($sql); |
| 253 | 253 | foreach ($bmodule as $bmid) { |
| 254 | - $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid); |
|
| 254 | + $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid); |
|
| 255 | 255 | $db->query($sql); |
| 256 | 256 | } |
| 257 | - require_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
| 257 | + require_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
| 258 | 258 | $xoopsTpl = new XoopsTpl(); |
| 259 | 259 | $xoopsTpl->xoops_setCaching(2); |
| 260 | 260 | if ($myblock->getVar('template') != '') { |
| 261 | - if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) { |
|
| 262 | - if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) { |
|
| 263 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
| 261 | + if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) { |
|
| 262 | + if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) { |
|
| 263 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | } else { |
| 267 | - if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block' . $bid)) { |
|
| 268 | - if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block' . $bid)) { |
|
| 269 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
| 267 | + if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block'.$bid)) { |
|
| 268 | + if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block'.$bid)) { |
|
| 269 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | } else { |
| 274 | - $msg = 'Failed update of block. ID:' . $bid; |
|
| 274 | + $msg = 'Failed update of block. ID:'.$bid; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | return $msg; // GIJ + |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | function smartfaq_search($queryarray, $andor, $limit, $offset, $userid) |
| 17 | 17 | { |
| 18 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 18 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 19 | 19 | |
| 20 | 20 | $ret = []; |
| 21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) { |
| 27 | 27 | $ret[$i]['image'] = 'assets/images/smartfaq.gif'; |
| 28 | - $ret[$i]['link'] = 'faq.php?faqid=' . $faqsObj[$i]->faqid(); |
|
| 28 | + $ret[$i]['link'] = 'faq.php?faqid='.$faqsObj[$i]->faqid(); |
|
| 29 | 29 | $ret[$i]['title'] = $faqsObj[$i]->question(50); |
| 30 | 30 | $ret[$i]['time'] = $faqsObj[$i]->getVar('datesub'); |
| 31 | 31 | $ret[$i]['uid'] = $faqsObj[$i]->uid(); |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 13 | 13 | |
| 14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
| 14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
| 15 | 15 | define('NEWBB_FUNCTIONS_RENDER_LOADED', true); |
| 16 | 16 | |
| 17 | 17 | if (!defined('NEWBB_FUNCTIONS_RENDER')): |
@@ -56,16 +56,16 @@ discard block |
||
| 56 | 56 | // decode xcode |
| 57 | 57 | if ($image != 0) { |
| 58 | 58 | // image allowed |
| 59 | - $text =& $myts->xoopsCodeDecode($text); |
|
| 59 | + $text = & $myts->xoopsCodeDecode($text); |
|
| 60 | 60 | } else { |
| 61 | 61 | // image not allowed |
| 62 | - $text =& $myts->xoopsCodeDecode($text, 0); |
|
| 62 | + $text = & $myts->xoopsCodeDecode($text, 0); |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | if ($br != 0) { |
| 66 | - $text =& $myts->nl2Br($text); |
|
| 66 | + $text = & $myts->nl2Br($text); |
|
| 67 | 67 | } |
| 68 | - $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
| 68 | + $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
| 69 | 69 | |
| 70 | 70 | return $text; |
| 71 | 71 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}'>"; |
| 97 | 97 | if (empty($asImage)) { |
| 98 | - $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>'; |
|
| 98 | + $button = "<a href='{$link}' title='{$alt}' {$extra}>".sf_displayImage($button, $alt, true).'</a>'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | return $button; |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (!class_exists('NewbbIconHandler')) { |
| 150 | - require_once __DIR__ . '/../class/icon.php'; |
|
| 150 | + require_once __DIR__.'/../class/icon.php'; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $iconHandler = NewbbIconHandler::getInstance(); |
@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 9 | 9 | |
| 10 | -require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
|
| 11 | -require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php'; |
|
| 12 | -require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php'; |
|
| 10 | +require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
|
| 11 | +require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php'; |
|
| 12 | +require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php'; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * @return mixed|null |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | break; |
| 64 | 64 | |
| 65 | 65 | case 'inside': |
| 66 | - return XOOPS_URL . '/modules/smartfaq/doc/'; |
|
| 66 | + return XOOPS_URL.'/modules/smartfaq/doc/'; |
|
| 67 | 67 | break; |
| 68 | 68 | |
| 69 | 69 | case 'custom': |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | $ret = ''; |
| 82 | 82 | foreach ($errors as $key => $value) { |
| 83 | - $ret .= '<br> - ' . $value; |
|
| 83 | + $ret .= '<br> - '.$value; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $ret; |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $spaces .= '--'; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - $ret .= "<option value='" . $categoryObj->categoryid() . "'"; |
|
| 106 | + $ret .= "<option value='".$categoryObj->categoryid()."'"; |
|
| 107 | 107 | if ($selectedid == $categoryObj->categoryid()) { |
| 108 | 108 | $ret .= ' selected'; |
| 109 | 109 | } |
| 110 | - $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n"; |
|
| 110 | + $ret .= '>'.$spaces.$categoryObj->name()."</option>\n"; |
|
| 111 | 111 | |
| 112 | 112 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
| 113 | 113 | if (count($subCategoriesObj) > 0) { |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
| 130 | 130 | { |
| 131 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
| 131 | + $ret = ''._MB_SF_SELECTCAT." <select name='options[]'>"; |
|
| 132 | 132 | if ($allCatOption) { |
| 133 | 133 | $ret .= "<option value='0'"; |
| 134 | - $ret .= '>' . _MB_SF_ALLCAT . "</option>\n"; |
|
| 134 | + $ret .= '>'._MB_SF_ALLCAT."</option>\n"; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // Creating the category handler object |
@@ -199,9 +199,9 @@ discard block |
||
| 199 | 199 | { |
| 200 | 200 | $smartModule = sf_getModuleInfo(); |
| 201 | 201 | |
| 202 | - $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
|
| 202 | + $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').''; |
|
| 203 | 203 | |
| 204 | - $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>"; |
|
| 204 | + $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>"; |
|
| 205 | 205 | |
| 206 | 206 | return $modfooter; |
| 207 | 207 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | |
| 298 | 298 | $gpermHandler = xoops_getHandler('groupperm'); |
| 299 | 299 | |
| 300 | - $sql = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' "; |
|
| 300 | + $sql = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' "; |
|
| 301 | 301 | $result = $xoopsDB->queryF($sql); |
| 302 | 302 | |
| 303 | 303 | if (count($result) > 0) { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | $ret = []; |
| 413 | 413 | global $xoopsDB; |
| 414 | 414 | |
| 415 | - $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'"); |
|
| 415 | + $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'"); |
|
| 416 | 416 | $ret = $xoopsDB->fetcharray($result); |
| 417 | 417 | |
| 418 | 418 | return $ret; |
@@ -431,26 +431,26 @@ discard block |
||
| 431 | 431 | { |
| 432 | 432 | global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig; |
| 433 | 433 | $adminLinks = ''; |
| 434 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
| 434 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
| 435 | 435 | $page = $open ? 'question.php' : 'faq.php'; |
| 436 | 436 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 437 | 437 | // Edit button |
| 438 | - $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>"; |
|
| 438 | + $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>"; |
|
| 439 | 439 | $adminLinks .= ' '; |
| 440 | 440 | // Delete button |
| 441 | - $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>"; |
|
| 441 | + $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>"; |
|
| 442 | 442 | $adminLinks .= ' '; |
| 443 | 443 | } |
| 444 | 444 | // Print button |
| 445 | - $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>"; |
|
| 445 | + $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>"; |
|
| 446 | 446 | $adminLinks .= ' '; |
| 447 | 447 | // Email button |
| 448 | - $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . $modulePath . 'faq.php?faqid=' . $faqid; |
|
| 449 | - $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>"; |
|
| 448 | + $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.$modulePath.'faq.php?faqid='.$faqid; |
|
| 449 | + $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>"; |
|
| 450 | 450 | $adminLinks .= ' '; |
| 451 | 451 | // Submit New Answer button |
| 452 | 452 | if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) { |
| 453 | - $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>"; |
|
| 453 | + $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>"; |
|
| 454 | 454 | $adminLinks .= ' '; |
| 455 | 455 | } |
| 456 | 456 | |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | return $userid; |
| 472 | 472 | } |
| 473 | 473 | |
| 474 | - $userid = (int)$userid; |
|
| 474 | + $userid = (int) $userid; |
|
| 475 | 475 | if ($userid > 0) { |
| 476 | 476 | if ($users == []) { |
| 477 | 477 | //fetching users |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | if (!isset($users[$userid])) { |
| 482 | 482 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 483 | 483 | } |
| 484 | - $user =& $users[$userid]; |
|
| 484 | + $user = & $users[$userid]; |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | if (is_object($user)) { |
@@ -495,9 +495,9 @@ discard block |
||
| 495 | 495 | $fullname = $user->getVar('name'); |
| 496 | 496 | } |
| 497 | 497 | if (!empty($fullname)) { |
| 498 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 498 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 499 | 499 | } else { |
| 500 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 500 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | return $linkeduser; |
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | //--> |
| 580 | 580 | </script> |
| 581 | 581 | <?php |
| 582 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
| 582 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | /** |
@@ -592,16 +592,16 @@ discard block |
||
| 592 | 592 | static $handlers; |
| 593 | 593 | $name = strtolower(trim($name)); |
| 594 | 594 | if (!isset($handlers[$name])) { |
| 595 | - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) { |
|
| 595 | + if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) { |
|
| 596 | 596 | require_once $hnd_file; |
| 597 | 597 | } |
| 598 | - $class = 'sf' . ucfirst($name) . 'Handler'; |
|
| 598 | + $class = 'sf'.ucfirst($name).'Handler'; |
|
| 599 | 599 | if (class_exists($class)) { |
| 600 | 600 | $handlers[$name] = new $class($GLOBALS['xoopsDB']); |
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | 603 | if (!$optional && !isset($handlers[$name])) { |
| 604 | - trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR); |
|
| 604 | + trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR); |
|
| 605 | 605 | } |
| 606 | 606 | $false = false; |
| 607 | 607 | |
@@ -23,9 +23,9 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | sf_collapsableBar('toptable', 'toptableicon'); |
| 25 | 25 | |
| 26 | -echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . $faqs_title . '</h3>'; |
|
| 26 | +echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".$faqs_title.'</h3>'; |
|
| 27 | 27 | echo "<div id='toptable'>"; |
| 28 | -echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $faqs_info . '</span>'; |
|
| 28 | +echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$faqs_info.'</span>'; |
|
| 29 | 29 | |
| 30 | 30 | // Get the total number of published FAQs |
| 31 | 31 | $totalfaqs = $faqHandler->getFaqsCount($sel_cat, [_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER]); |
@@ -36,22 +36,22 @@ discard block |
||
| 36 | 36 | $allCats = $categoryHandler->getObjects(null, true); |
| 37 | 37 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 38 | 38 | echo '<tr>'; |
| 39 | -echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
| 40 | -echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 41 | -echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 39 | +echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
| 40 | +echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
| 41 | +echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 42 | 42 | |
| 43 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 44 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>'; |
|
| 43 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 44 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>'; |
|
| 45 | 45 | |
| 46 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 47 | -echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 46 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 47 | +echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 48 | 48 | echo '</tr>'; |
| 49 | 49 | if ($totalfaqs > 0) { |
| 50 | 50 | global $pathIcon16, $smartModuleConfig; |
| 51 | 51 | for ($i = 0; $i < $totalFaqsOnPage; ++$i) { |
| 52 | 52 | $categoryObj = $allCats[$faqsObj[$i]->categoryid()]; |
| 53 | - $modify = "<a href='faq.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>"; |
|
| 54 | - $delete = "<a href='faq.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 53 | + $modify = "<a href='faq.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>"; |
|
| 54 | + $delete = "<a href='faq.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 55 | 55 | |
| 56 | 56 | //adding name of the Question Submitter |
| 57 | 57 | $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
@@ -79,26 +79,26 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | echo '<tr>'; |
| 82 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 83 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 84 | - echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>'; |
|
| 82 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 83 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 84 | + echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>'; |
|
| 85 | 85 | |
| 86 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 87 | - echo "<td class='even' align='center'>" . $answerSubmitter . '</td>'; |
|
| 86 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 87 | + echo "<td class='even' align='center'>".$answerSubmitter.'</td>'; |
|
| 88 | 88 | |
| 89 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 89 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 90 | 90 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 91 | 91 | echo '</tr>'; |
| 92 | 92 | } |
| 93 | 93 | } else { |
| 94 | 94 | $faqid = -1; |
| 95 | 95 | echo '<tr>'; |
| 96 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . '</td>'; |
|
| 96 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS.'</td>'; |
|
| 97 | 97 | echo '</tr>'; |
| 98 | 98 | } |
| 99 | 99 | echo "</table>\n"; |
| 100 | 100 | echo "<br>\n"; |
| 101 | 101 | |
| 102 | 102 | $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq', $pagenav_extra_args); |
| 103 | -echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 103 | +echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 104 | 104 | echo '</div>'; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $this->assignVars($id); |
| 49 | 49 | } else { |
| 50 | 50 | $categoryHandler = new sfCategoryHandler($this->db); |
| 51 | - $category =& $categoryHandler->get($id); |
|
| 51 | + $category = & $categoryHandler->get($id); |
|
| 52 | 52 | foreach ($category->vars as $k => $v) { |
| 53 | 53 | $this->assignVar($k, $v['value']); |
| 54 | 54 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function checkPermission() |
| 83 | 83 | { |
| 84 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 84 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 85 | 85 | |
| 86 | 86 | $userIsAdmin = sf_userIsAdmin(); |
| 87 | 87 | if ($userIsAdmin) { |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $filename = 'open_category.php'; |
| 159 | 159 | } |
| 160 | 160 | if ($withAllLink) { |
| 161 | - $ret = "<a href='" . XOOPS_URL . '/modules/smartfaq/' . $filename . '?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
| 161 | + $ret = "<a href='".XOOPS_URL.'/modules/smartfaq/'.$filename.'?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
| 162 | 162 | } else { |
| 163 | 163 | $ret = $this->name(); |
| 164 | 164 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | exit; |
| 171 | 171 | } |
| 172 | 172 | $parentid = $parentObj->parentid(); |
| 173 | - $ret = $parentObj->getCategoryPath(true, $open) . ' > ' . $ret; |
|
| 173 | + $ret = $parentObj->getCategoryPath(true, $open).' > '.$ret; |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | return $ret; |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $tags = []; |
| 225 | 225 | $tags['MODULE_NAME'] = $myts->htmlSpecialChars($smartModule->getVar('name')); |
| 226 | 226 | $tags['CATEGORY_NAME'] = $this->name(); |
| 227 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid(); |
|
| 227 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid(); |
|
| 228 | 228 | |
| 229 | 229 | $notificationHandler = xoops_getHandler('notification'); |
| 230 | 230 | $notificationHandler->triggerEvent('global_faq', 0, 'category_created', $tags); |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | $category['categoryid'] = $this->categoryid(); |
| 241 | 241 | $category['name'] = $this->name(); |
| 242 | 242 | if ($open !== false) { |
| 243 | - $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/open_category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
| 243 | + $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/open_category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
| 244 | 244 | } else { |
| 245 | - $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>'; |
|
| 245 | + $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>'; |
|
| 246 | 246 | } |
| 247 | 247 | $category['total'] = $this->getVar('faqcount'); |
| 248 | 248 | $category['description'] = $this->description(); |
@@ -291,8 +291,8 @@ discard block |
||
| 291 | 291 | public function get($id) |
| 292 | 292 | { |
| 293 | 293 | $false = false; |
| 294 | - if ((int)$id > 0) { |
|
| 295 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories') . ' WHERE categoryid=' . $id; |
|
| 294 | + if ((int) $id > 0) { |
|
| 295 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories').' WHERE categoryid='.$id; |
|
| 296 | 296 | if (!$result = $this->db->query($sql)) { |
| 297 | 297 | return $false; |
| 298 | 298 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | // Deleteing the sub categories |
| 396 | - $subcats =& $this->getCategories(0, 0, $category->categoryid()); |
|
| 396 | + $subcats = & $this->getCategories(0, 0, $category->categoryid()); |
|
| 397 | 397 | foreach ($subcats as $subcat) { |
| 398 | 398 | $this->delete($subcat); |
| 399 | 399 | } |
@@ -430,11 +430,11 @@ discard block |
||
| 430 | 430 | { |
| 431 | 431 | $ret = []; |
| 432 | 432 | $limit = $start = 0; |
| 433 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 433 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 434 | 434 | if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) { |
| 435 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 435 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 436 | 436 | if ($criteria->getSort() != '') { |
| 437 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 437 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 438 | 438 | } |
| 439 | 439 | $limit = $criteria->getLimit(); |
| 440 | 440 | $start = $criteria->getStart(); |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | $order = 'ASC', |
| 477 | 477 | $id_as_key = true |
| 478 | 478 | ) { |
| 479 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 479 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 480 | 480 | |
| 481 | 481 | $criteria = new CriteriaCompo(); |
| 482 | 482 | |
@@ -490,7 +490,7 @@ discard block |
||
| 490 | 490 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 491 | 491 | |
| 492 | 492 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 493 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 493 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 494 | 494 | } |
| 495 | 495 | $criteria->setStart($start); |
| 496 | 496 | $criteria->setLimit($limit); |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $sort = 'weight', |
| 515 | 515 | $order = 'ASC' |
| 516 | 516 | ) { |
| 517 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 517 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 518 | 518 | |
| 519 | 519 | $criteria = new CriteriaCompo(); |
| 520 | 520 | |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 529 | 529 | |
| 530 | 530 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 531 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 531 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
@@ -537,11 +537,11 @@ discard block |
||
| 537 | 537 | |
| 538 | 538 | $ret = []; |
| 539 | 539 | $limit = $start = 0; |
| 540 | - $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
| 540 | + $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
| 541 | 541 | if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 542 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 542 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 543 | 543 | if ($criteria->getSort() != '') { |
| 544 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 544 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 545 | 545 | } |
| 546 | 546 | $limit = $criteria->getLimit(); |
| 547 | 547 | $start = $criteria->getStart(); |
@@ -570,9 +570,9 @@ discard block |
||
| 570 | 570 | */ |
| 571 | 571 | public function getCount($criteria = null) |
| 572 | 572 | { |
| 573 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 573 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 574 | 574 | if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 575 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 575 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 576 | 576 | } |
| 577 | 577 | $result = $this->db->query($sql); |
| 578 | 578 | if (!$result) { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 600 | 600 | |
| 601 | 601 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 602 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 602 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 603 | 603 | } |
| 604 | 604 | } |
| 605 | 605 | |
@@ -622,16 +622,16 @@ discard block |
||
| 622 | 622 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 623 | 623 | |
| 624 | 624 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 625 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 625 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 626 | 626 | } |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED)); |
| 630 | 630 | |
| 631 | - $sql = 'SELECT COUNT(c.categoryid) FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
| 631 | + $sql = 'SELECT COUNT(c.categoryid) FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid'; |
|
| 632 | 632 | |
| 633 | 633 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 634 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 634 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | $result = $this->db->query($sql); |
@@ -649,13 +649,13 @@ discard block |
||
| 649 | 649 | */ |
| 650 | 650 | public function getSubCats($categories) |
| 651 | 651 | { |
| 652 | - $criteria = new CriteriaCompo(new Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN'); |
|
| 652 | + $criteria = new CriteriaCompo(new Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN'); |
|
| 653 | 653 | $ret = []; |
| 654 | 654 | if (!sf_userIsAdmin()) { |
| 655 | 655 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 656 | 656 | |
| 657 | 657 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 658 | - $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN')); |
|
| 658 | + $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN')); |
|
| 659 | 659 | } |
| 660 | 660 | $subcats = $this->getObjects($criteria, true); |
| 661 | 661 | foreach ($subcats as $subcat_id => $subcat) { |
@@ -673,9 +673,9 @@ discard block |
||
| 673 | 673 | */ |
| 674 | 674 | public function deleteAll($criteria = null) |
| 675 | 675 | { |
| 676 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 676 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories'); |
|
| 677 | 677 | if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 678 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 678 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 679 | 679 | } |
| 680 | 680 | if (!$this->db->query($sql)) { |
| 681 | 681 | return false; |
@@ -697,10 +697,10 @@ discard block |
||
| 697 | 697 | **/ |
| 698 | 698 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null) |
| 699 | 699 | { |
| 700 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
| 701 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause; |
|
| 700 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
| 701 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause; |
|
| 702 | 702 | if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 703 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 703 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 704 | 704 | } |
| 705 | 705 | if (!$this->db->queryF($sql)) { |
| 706 | 706 | return false; |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | public function faqsCount($cat_id = 0, $status = '') |
| 727 | 727 | { |
| 728 | 728 | global $xoopsUser; |
| 729 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 729 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 730 | 730 | |
| 731 | 731 | $faqHandler = sf_gethandler('faq'); |
| 732 | 732 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | if (!mkdir($folder) && !is_dir($folder)) { |
| 30 | 30 | throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder)); |
| 31 | 31 | } else { |
| 32 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
| 32 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | } catch (Exception $e) { |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | // @mkdir($dst); |
| 68 | 68 | while (false !== ($file = readdir($dir))) { |
| 69 | 69 | if (($file !== '.') && ($file !== '..')) { |
| 70 | - if (is_dir($src . '/' . $file)) { |
|
| 71 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
| 70 | + if (is_dir($src.'/'.$file)) { |
|
| 71 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
| 72 | 72 | } else { |
| 73 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
| 73 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string |
| 98 | 98 | $currArray = explode('.', $currentVer); |
| 99 | 99 | if (null === $requiredVer) { |
| 100 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
| 100 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
| 101 | 101 | } |
| 102 | 102 | $reqArray = explode('.', $requiredVer); |
| 103 | 103 | $success = true; |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | break; |
| 113 | 113 | } |
| 114 | 114 | } else { |
| 115 | - if ((int)$v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 115 | + if ((int) $v > 0) { // handles versions like x.x.x.0_RC2 |
|
| 116 | 116 | $success = false; |
| 117 | 117 | break; |
| 118 | 118 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | break; |
| 204 | 204 | |
| 205 | 205 | case 'inside': |
| 206 | - return XOOPS_URL . '/modules/smartfaq/doc/'; |
|
| 206 | + return XOOPS_URL.'/modules/smartfaq/doc/'; |
|
| 207 | 207 | break; |
| 208 | 208 | |
| 209 | 209 | case 'custom': |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | { |
| 221 | 221 | $ret = ''; |
| 222 | 222 | foreach ($errors as $key => $value) { |
| 223 | - $ret .= '<br> - ' . $value; |
|
| 223 | + $ret .= '<br> - '.$value; |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | return $ret; |
@@ -243,11 +243,11 @@ discard block |
||
| 243 | 243 | $spaces .= '--'; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - $ret .= "<option value='" . $categoryObj->categoryid() . "'"; |
|
| 246 | + $ret .= "<option value='".$categoryObj->categoryid()."'"; |
|
| 247 | 247 | if ($selectedid == $categoryObj->categoryid()) { |
| 248 | 248 | $ret .= ' selected'; |
| 249 | 249 | } |
| 250 | - $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n"; |
|
| 250 | + $ret .= '>'.$spaces.$categoryObj->name()."</option>\n"; |
|
| 251 | 251 | |
| 252 | 252 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
| 253 | 253 | if (count($subCategoriesObj) > 0) { |
@@ -268,10 +268,10 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public static function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
| 270 | 270 | { |
| 271 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
| 271 | + $ret = ''._MB_SF_SELECTCAT." <select name='options[]'>"; |
|
| 272 | 272 | if ($allCatOption) { |
| 273 | 273 | $ret .= "<option value='0'"; |
| 274 | - $ret .= '>' . _MB_SF_ALLCAT . "</option>\n"; |
|
| 274 | + $ret .= '>'._MB_SF_ALLCAT."</option>\n"; |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | // Creating the category handler object |
@@ -339,9 +339,9 @@ discard block |
||
| 339 | 339 | { |
| 340 | 340 | $smartModule = sf_getModuleInfo(); |
| 341 | 341 | |
| 342 | - $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
|
| 342 | + $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').''; |
|
| 343 | 343 | |
| 344 | - $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>"; |
|
| 344 | + $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>"; |
|
| 345 | 345 | |
| 346 | 346 | return $modfooter; |
| 347 | 347 | } |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | $gpermHandler = xoops_getHandler('groupperm'); |
| 439 | 439 | |
| 440 | - $sql = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' "; |
|
| 440 | + $sql = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' "; |
|
| 441 | 441 | $result = $xoopsDB->queryF($sql); |
| 442 | 442 | |
| 443 | 443 | if (count($result) > 0) { |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | $ret = []; |
| 553 | 553 | global $xoopsDB; |
| 554 | 554 | |
| 555 | - $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'"); |
|
| 555 | + $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'"); |
|
| 556 | 556 | $ret = $xoopsDB->fetcharray($result); |
| 557 | 557 | |
| 558 | 558 | return $ret; |
@@ -571,26 +571,26 @@ discard block |
||
| 571 | 571 | { |
| 572 | 572 | global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig; |
| 573 | 573 | $adminLinks = ''; |
| 574 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
| 574 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
| 575 | 575 | $page = $open ? 'question.php' : 'faq.php'; |
| 576 | 576 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
| 577 | 577 | // Edit button |
| 578 | - $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>"; |
|
| 578 | + $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>"; |
|
| 579 | 579 | $adminLinks .= ' '; |
| 580 | 580 | // Delete button |
| 581 | - $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>"; |
|
| 581 | + $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>"; |
|
| 582 | 582 | $adminLinks .= ' '; |
| 583 | 583 | } |
| 584 | 584 | // Print button |
| 585 | - $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>"; |
|
| 585 | + $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>"; |
|
| 586 | 586 | $adminLinks .= ' '; |
| 587 | 587 | // Email button |
| 588 | - $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . $modulePath . 'faq.php?faqid=' . $faqid; |
|
| 589 | - $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>"; |
|
| 588 | + $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.$modulePath.'faq.php?faqid='.$faqid; |
|
| 589 | + $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>"; |
|
| 590 | 590 | $adminLinks .= ' '; |
| 591 | 591 | // Submit New Answer button |
| 592 | 592 | if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) { |
| 593 | - $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>"; |
|
| 593 | + $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>"; |
|
| 594 | 594 | $adminLinks .= ' '; |
| 595 | 595 | } |
| 596 | 596 | |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | return $userid; |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | - $userid = (int)$userid; |
|
| 614 | + $userid = (int) $userid; |
|
| 615 | 615 | if ($userid > 0) { |
| 616 | 616 | if ($users == []) { |
| 617 | 617 | //fetching users |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | if (!isset($users[$userid])) { |
| 622 | 622 | return $GLOBALS['xoopsConfig']['anonymous']; |
| 623 | 623 | } |
| 624 | - $user =& $users[$userid]; |
|
| 624 | + $user = & $users[$userid]; |
|
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | if (is_object($user)) { |
@@ -635,9 +635,9 @@ discard block |
||
| 635 | 635 | $fullname = $user->getVar('name'); |
| 636 | 636 | } |
| 637 | 637 | if (!empty($fullname)) { |
| 638 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
| 638 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
| 639 | 639 | } else { |
| 640 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
| 640 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | return $linkeduser; |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | //--> |
| 720 | 720 | </script> |
| 721 | 721 | <?php |
| 722 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
| 722 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /** |
@@ -732,16 +732,16 @@ discard block |
||
| 732 | 732 | static $handlers; |
| 733 | 733 | $name = strtolower(trim($name)); |
| 734 | 734 | if (!isset($handlers[$name])) { |
| 735 | - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) { |
|
| 735 | + if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) { |
|
| 736 | 736 | require_once $hnd_file; |
| 737 | 737 | } |
| 738 | - $class = 'sf' . ucfirst($name) . 'Handler'; |
|
| 738 | + $class = 'sf'.ucfirst($name).'Handler'; |
|
| 739 | 739 | if (class_exists($class)) { |
| 740 | 740 | $handlers[$name] = new $class($GLOBALS['xoopsDB']); |
| 741 | 741 | } |
| 742 | 742 | } |
| 743 | 743 | if (!$optional && !isset($handlers[$name])) { |
| 744 | - trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR); |
|
| 744 | + trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR); |
|
| 745 | 745 | } |
| 746 | 746 | $false = false; |
| 747 | 747 | |