@@ -184,7 +184,7 @@ |
||
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | //redirect_header("javascript:history.go(-1)", 3, $redirect_msg); |
| 187 | - redirect_header("index.php", 3, $redirect_msg); |
|
| 187 | + redirect_header("index.php", 3, $redirect_msg); |
|
| 188 | 188 | exit; |
| 189 | 189 | |
| 190 | 190 | break; |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include_once __DIR__ . '/header.php'; |
|
| 10 | +include_once __DIR__.'/header.php'; |
|
| 11 | 11 | |
| 12 | 12 | global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 13 | 13 | |
@@ -24,8 +24,8 @@ discard block |
||
| 24 | 24 | if (isset($_POST['op'])) $op = $_POST['op']; |
| 25 | 25 | |
| 26 | 26 | // Getting the faqid |
| 27 | -$faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0; |
|
| 28 | -$faqid = isset($_POST['faqid'])? intval($_POST['faqid']) : $faqid; |
|
| 27 | +$faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0; |
|
| 28 | +$faqid = isset($_POST['faqid']) ? intval($_POST['faqid']) : $faqid; |
|
| 29 | 29 | |
| 30 | 30 | // If no FAQ is selected, exit |
| 31 | 31 | if ($faqid == 0) { |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | // Creating the FAQ handler object |
| 37 | -$faq_handler =& sf_gethandler('faq'); |
|
| 37 | +$faq_handler = & sf_gethandler('faq'); |
|
| 38 | 38 | |
| 39 | 39 | // Creating the answer handler object |
| 40 | -$answer_handler =& sf_gethandler('answer'); |
|
| 40 | +$answer_handler = & sf_gethandler('answer'); |
|
| 41 | 41 | |
| 42 | 42 | switch ($op) { |
| 43 | 43 | // The answer is posted |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Get the category object related to that FAQ |
| 70 | - $categoryObj =& $faqObj->category(); |
|
| 70 | + $categoryObj = & $faqObj->category(); |
|
| 71 | 71 | |
| 72 | 72 | // Create the answer object |
| 73 | 73 | $newAnswerObj = $answer_handler->create(); |
| 74 | 74 | |
| 75 | 75 | // Putting the values in the answer object |
| 76 | 76 | $newAnswerObj->setVar('faqid', $faqObj->faqid()); |
| 77 | - $newAnswerObj->setVar('answer',$_POST['answer']); |
|
| 77 | + $newAnswerObj->setVar('answer', $_POST['answer']); |
|
| 78 | 78 | $newAnswerObj->setVar('uid', $uid); |
| 79 | 79 | |
| 80 | 80 | // Depending of the status of the FAQ, some values need to be set |
@@ -127,14 +127,14 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // Storing the FAQ object in the database |
| 130 | - if ( !$faqObj->store() ) { |
|
| 131 | - redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 130 | + if (!$faqObj->store()) { |
|
| 131 | + redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 132 | 132 | exit(); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Storing the answer object in the database |
| 136 | - if ( !$newAnswerObj->store() ) { |
|
| 137 | - redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($newAnswerObj->getErrors())); |
|
| 136 | + if (!$newAnswerObj->store()) { |
|
| 137 | + redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($newAnswerObj->getErrors())); |
|
| 138 | 138 | exit(); |
| 139 | 139 | } |
| 140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | case 2 : |
| 152 | 152 | // Answer for an open question submitted, auto-approved; became Q&A, need approbation |
| 153 | 153 | if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) { |
| 154 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 154 | + include_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 155 | 155 | $notification_handler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 156 | 156 | } |
| 157 | 157 | // Send notifications |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | case 3 : |
| 162 | 162 | // Answer submitted, needs approbation |
| 163 | 163 | if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) { |
| 164 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 164 | + include_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 165 | 165 | $notification_handler->subscribe('question', $newAnswerObj->answerid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 166 | 166 | } |
| 167 | 167 | // Send notifications |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | // New answer submitted for a published Q&A, need approbation |
| 176 | 176 | // Send notifications |
| 177 | 177 | if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) { |
| 178 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 178 | + include_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 179 | 179 | $notification_handler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 180 | 180 | } |
| 181 | 181 | |
@@ -204,10 +204,10 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | // Creating the category object that holds the selected FAQ |
| 207 | - $categoryObj =& $faqObj->category(); |
|
| 207 | + $categoryObj = & $faqObj->category(); |
|
| 208 | 208 | |
| 209 | 209 | // Creating the answer object |
| 210 | - $answerObj =& $faqObj->answer(); |
|
| 210 | + $answerObj = & $faqObj->answer(); |
|
| 211 | 211 | |
| 212 | 212 | // Check user permissions to access that category of the selected FAQ |
| 213 | 213 | if (faqAccessGranted($faqObj) < 0) { |
@@ -216,20 +216,20 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | $xoopsOption['template_main'] = 'smartfaq_submit.tpl'; |
| 219 | - include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
| 220 | - include_once __DIR__ . '/footer.php'; |
|
| 219 | + include_once(XOOPS_ROOT_PATH."/header.php"); |
|
| 220 | + include_once __DIR__.'/footer.php'; |
|
| 221 | 221 | |
| 222 | - $name = ($xoopsUser)? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 222 | + $name = ($xoopsUser) ? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 223 | 223 | |
| 224 | 224 | $moduleName = $myts->displayTarea($xoopsModule->getVar('name')); |
| 225 | 225 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 226 | 226 | $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER); |
| 227 | 227 | |
| 228 | 228 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name()))); |
| 229 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUBMITANSWER_INTRO); |
|
| 229 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUBMITANSWER_INTRO); |
|
| 230 | 230 | |
| 231 | 231 | include_once 'include/answer.inc.php'; |
| 232 | 232 | |
| 233 | - include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 233 | + include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 234 | 234 | break; |
| 235 | 235 | } |
@@ -36,8 +36,12 @@ |
||
| 36 | 36 | |
| 37 | 37 | $op = ''; |
| 38 | 38 | |
| 39 | -if (isset($_GET['op'])) $op = $_GET['op']; |
|
| 40 | -if (isset($_POST['op'])) $op = $_POST['op']; |
|
| 39 | +if (isset($_GET['op'])) { |
|
| 40 | + $op = $_GET['op']; |
|
| 41 | +} |
|
| 42 | +if (isset($_POST['op'])) { |
|
| 43 | + $op = $_POST['op']; |
|
| 44 | +} |
|
| 41 | 45 | |
| 42 | 46 | switch ($op) { |
| 43 | 47 | case 'post': |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include_once __DIR__ . '/header.php'; |
|
| 10 | +include_once __DIR__.'/header.php'; |
|
| 11 | 11 | |
| 12 | 12 | $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0; |
| 13 | 13 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | // Creating the FAQ handler object |
| 20 | -$faq_handler =& sf_gethandler('faq'); |
|
| 20 | +$faq_handler = & sf_gethandler('faq'); |
|
| 21 | 21 | |
| 22 | 22 | // Creating the FAQ object for the selected FAQ |
| 23 | 23 | $faqObj = new sfFaq($faqid); |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | $faqObj->updateCounter(); |
| 47 | 47 | } |
| 48 | 48 | $xoopsOption['template_main'] = 'smartfaq_faq.tpl'; |
| 49 | -include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
| 50 | -include_once __DIR__ . '/footer.php'; |
|
| 49 | +include_once(XOOPS_ROOT_PATH."/header.php"); |
|
| 50 | +include_once __DIR__.'/footer.php'; |
|
| 51 | 51 | |
| 52 | 52 | $faq = $faqObj->toArray(null, $categoryObj, false); |
| 53 | 53 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $xoopsTpl->assign('display_categoryname', false); |
| 83 | 83 | |
| 84 | 84 | $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes')); |
| 85 | -$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')); |
|
| 85 | +$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')); |
|
| 86 | 86 | $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY); |
| 87 | 87 | $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY); |
| 88 | 88 | $xoopsTpl->assign('faqid', $faqObj->getVar('faqid')); |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | // Page Title Hack by marcan |
| 100 | 100 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 101 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']); |
|
| 101 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']); |
|
| 102 | 102 | // End Page Title Hack by marcan |
| 103 | 103 | |
| 104 | 104 | // Include the comments if the selected FAQ supports comments |
| 105 | 105 | if ($faqObj->cancomment() == 1) { |
| 106 | - include_once XOOPS_ROOT_PATH . "/include/comment_view.php"; |
|
| 106 | + include_once XOOPS_ROOT_PATH."/include/comment_view.php"; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | //code to include smartie |
| 110 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 111 | - include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 112 | - $xoopsTpl->assign('smarttie',1); |
|
| 110 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 111 | + include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 112 | + $xoopsTpl->assign('smarttie', 1); |
|
| 113 | 113 | } |
| 114 | 114 | //end code for smarttie |
| 115 | 115 | |
| 116 | -include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 116 | +include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -7,9 +7,9 @@ discard block |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -$categoryID = isset($categoryID)? intval($categoryID) : 0; |
|
| 11 | -$type = isset($type)? intval($type) : 3; |
|
| 12 | -$term = isset($term)? ($type) : ''; |
|
| 10 | +$categoryID = isset($categoryID) ? intval($categoryID) : 0; |
|
| 11 | +$type = isset($type) ? intval($type) : 3; |
|
| 12 | +$term = isset($term) ? ($type) : ''; |
|
| 13 | 13 | |
| 14 | 14 | $sform = new XoopsThemeForm(_MD_WB_SEARCHFORM, "searchform", "search.php"); |
| 15 | 15 | $sform->setExtra('enctype="multipart/form-data"'); |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | if ($xoopsModuleConfig['multicats'] == 1) { |
| 22 | 22 | $searchcat = new XoopsFormSelect(_MD_WB_CATEGORY, 'categoryID', $categoryID); |
| 23 | - $searchcat->addOption ("0", _MD_WB_ALLOFTHEM); |
|
| 23 | + $searchcat->addOption("0", _MD_WB_ALLOFTHEM); |
|
| 24 | 24 | |
| 25 | - $resultcat = $xoopsDB->query ("SELECT categoryID, name FROM " . $xoopsDB->prefix ("wbcategories") . " ORDER BY categoryID"); |
|
| 25 | + $resultcat = $xoopsDB->query("SELECT categoryID, name FROM ".$xoopsDB->prefix("wbcategories")." ORDER BY categoryID"); |
|
| 26 | 26 | |
| 27 | 27 | while (list($categoryID, $name) = $xoopsDB->fetchRow($resultcat)) { |
| 28 | - $searchcat->addOption ("categoryID", "$categoryID : $name"); |
|
| 28 | + $searchcat->addOption("categoryID", "$categoryID : $name"); |
|
| 29 | 29 | } |
| 30 | 30 | $sform->addElement($searchcat, true); |
| 31 | 31 | } |
@@ -24,19 +24,19 @@ |
||
| 24 | 24 | //$form->addElement(new XoopsFormDhtmlTextArea(_MD_SF_ANSWER_FAQ, 'answer', '', 15, 60), true); |
| 25 | 25 | |
| 26 | 26 | $editorTray = new XoopsFormElementTray(_MD_SF_ANSWER_FAQ, '<br />'); |
| 27 | - if (class_exists('XoopsFormEditor')) { |
|
| 28 | - $options['name'] = 'answer'; |
|
| 29 | - $options['value'] = ''; |
|
| 30 | - $options['rows'] = 5; |
|
| 31 | - $options['cols'] = '100%'; |
|
| 32 | - $options['width'] = '100%'; |
|
| 33 | - $options['height'] = '200px'; |
|
| 34 | - $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptionsUser'], $options, $nohtml = false, $onfailure = 'textarea'); |
|
| 35 | - $editorTray->addElement($answerEditor,true ); |
|
| 36 | - } else { |
|
| 37 | - $answerEditor = new XoopsFormDhtmlTextArea(_MD_SF_ANSWER_FAQ, 'answer', '', '100%', '100%'); |
|
| 38 | - $editorTray->addElement($answerEditor, true ); |
|
| 39 | - } |
|
| 27 | + if (class_exists('XoopsFormEditor')) { |
|
| 28 | + $options['name'] = 'answer'; |
|
| 29 | + $options['value'] = ''; |
|
| 30 | + $options['rows'] = 5; |
|
| 31 | + $options['cols'] = '100%'; |
|
| 32 | + $options['width'] = '100%'; |
|
| 33 | + $options['height'] = '200px'; |
|
| 34 | + $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptionsUser'], $options, $nohtml = false, $onfailure = 'textarea'); |
|
| 35 | + $editorTray->addElement($answerEditor,true ); |
|
| 36 | + } else { |
|
| 37 | + $answerEditor = new XoopsFormDhtmlTextArea(_MD_SF_ANSWER_FAQ, 'answer', '', '100%', '100%'); |
|
| 38 | + $editorTray->addElement($answerEditor, true ); |
|
| 39 | + } |
|
| 40 | 40 | $form->addElement($editorTray); |
| 41 | 41 | |
| 42 | 42 | // NOTIFY ON PUBLISH |
@@ -10,9 +10,9 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | global $_POST; |
| 12 | 12 | |
| 13 | -include_once XOOPS_ROOT_PATH . "/class/xoopstree.php"; |
|
| 14 | -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; |
|
| 15 | -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
| 13 | +include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; |
|
| 14 | +include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|
| 15 | +include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
| 16 | 16 | //include_once 'functions.php'; |
| 17 | 17 | |
| 18 | 18 | $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid"); |
@@ -32,10 +32,10 @@ discard block |
||
| 32 | 32 | $options['width'] = '100%'; |
| 33 | 33 | $options['height'] = '200px'; |
| 34 | 34 | $answerEditor = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptionsUser'], $options, $nohtml = false, $onfailure = 'textarea'); |
| 35 | - $editorTray->addElement($answerEditor,true ); |
|
| 35 | + $editorTray->addElement($answerEditor, true); |
|
| 36 | 36 | } else { |
| 37 | 37 | $answerEditor = new XoopsFormDhtmlTextArea(_MD_SF_ANSWER_FAQ, 'answer', '', '100%', '100%'); |
| 38 | - $editorTray->addElement($answerEditor, true ); |
|
| 38 | + $editorTray->addElement($answerEditor, true); |
|
| 39 | 39 | } |
| 40 | 40 | $form->addElement($editorTray); |
| 41 | 41 | |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | $form->addElement($notify_checkbox); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if (($faqObj->status() == _SF_STATUS_PUBLISHED) || ($faqObj->status() == _SF_STATUS_NEW_ANSWER) ) { |
|
| 50 | - $answerObj =& $faqObj->answer(); |
|
| 49 | +if (($faqObj->status() == _SF_STATUS_PUBLISHED) || ($faqObj->status() == _SF_STATUS_NEW_ANSWER)) { |
|
| 50 | + $answerObj = & $faqObj->answer(); |
|
| 51 | 51 | $form->addElement(new XoopsFormLabel(_MD_SF_ORIGINAL_ANSWER, $answerObj->answer()), false); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -10,13 +10,13 @@ |
||
| 10 | 10 | |
| 11 | 11 | global $_POST; |
| 12 | 12 | |
| 13 | -include_once XOOPS_ROOT_PATH . "/class/xoopstree.php"; |
|
| 14 | -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; |
|
| 15 | -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
| 13 | +include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; |
|
| 14 | +include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|
| 15 | +include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
| 16 | 16 | |
| 17 | 17 | $form = new XoopsThemeForm(_MD_SF_REQUEST, "form", xoops_getenv('PHP_SELF')); |
| 18 | 18 | // CATEGORY |
| 19 | -$mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid" , "parentid"); |
|
| 19 | +$mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid"); |
|
| 20 | 20 | ob_start(); |
| 21 | 21 | $form->addElement(new XoopsFormHidden('categoryid', '')); |
| 22 | 22 | $mytree->makeMySelBox("name", "weight", ''); |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | sf_collapsableBar('toptable', 'toptableicon'); |
| 26 | 26 | |
| 27 | -echo "<img id='toptableicon' src=" . XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . $faqs_title . "</h3>"; |
|
| 27 | +echo "<img id='toptableicon' src=".XOOPS_URL."/modules/".$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> ".$faqs_title."</h3>"; |
|
| 28 | 28 | echo "<div id='toptable'>"; |
| 29 | -echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $faqs_info . "</span>"; |
|
| 29 | +echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$faqs_info."</span>"; |
|
| 30 | 30 | |
| 31 | 31 | // Get the total number of published FAQs |
| 32 | 32 | $totalfaqs = $faq_handler->getFaqsCount($sel_cat, array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER)); |
@@ -37,29 +37,29 @@ discard block |
||
| 37 | 37 | $allcats = $category_handler->getObjects(null, true); |
| 38 | 38 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 39 | 39 | echo "<tr>"; |
| 40 | -echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . "</b></td>"; |
|
| 41 | -echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . "</b></td>"; |
|
| 42 | -echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . "</b></td>"; |
|
| 40 | +echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID."</b></td>"; |
|
| 41 | +echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME."</b></td>"; |
|
| 42 | +echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION."</b></td>"; |
|
| 43 | 43 | |
| 44 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . "</b></td>"; |
|
| 45 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . "</b></td>"; |
|
| 44 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED."</b></td>"; |
|
| 45 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED."</b></td>"; |
|
| 46 | 46 | |
| 47 | -echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . "</b></td>"; |
|
| 48 | -echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . "</b></td>"; |
|
| 47 | +echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED."</b></td>"; |
|
| 48 | +echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION."</b></td>"; |
|
| 49 | 49 | echo "</tr>"; |
| 50 | 50 | if ($totalfaqs > 0) { |
| 51 | 51 | global $pathIcon16, $smartModuleConfig; |
| 52 | 52 | for ($i = 0; $i < $totalFaqsOnPage; ++$i) { |
| 53 | - $categoryObj =& $allcats[$faqsObj[$i]->categoryid()]; |
|
| 54 | - $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>"; |
|
| 55 | - $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 | + $categoryObj = & $allcats[$faqsObj[$i]->categoryid()]; |
|
| 54 | + $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>"; |
|
| 55 | + $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>"; |
|
| 56 | 56 | |
| 57 | 57 | //adding name of the Question Submitter |
| 58 | - $requester= sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
|
| 58 | + $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
|
| 59 | 59 | |
| 60 | 60 | //adding name of the Answer Submitter |
| 61 | 61 | |
| 62 | - $answer_handler =& sf_gethandler('answer'); |
|
| 62 | + $answer_handler = & sf_gethandler('answer'); |
|
| 63 | 63 | |
| 64 | 64 | $criteria = new CriteriaCompo(); |
| 65 | 65 | $criteria->add(new Criteria('faqid', $faqsObj[$i]->faqid())); |
@@ -81,26 +81,26 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | echo "<tr>"; |
| 84 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . "</td>"; |
|
| 85 | - echo "<td class='even' align='left'>" . $categoryObj->name() . "</td>"; |
|
| 86 | - 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>"; |
|
| 84 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid()."</td>"; |
|
| 85 | + echo "<td class='even' align='left'>".$categoryObj->name()."</td>"; |
|
| 86 | + 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>"; |
|
| 87 | 87 | |
| 88 | - echo "<td class='even' align='center'>" . $requester . "</td>"; |
|
| 89 | - echo "<td class='even' align='center'>" . $answerSubmitter . "</td>"; |
|
| 88 | + echo "<td class='even' align='center'>".$requester."</td>"; |
|
| 89 | + echo "<td class='even' align='center'>".$answerSubmitter."</td>"; |
|
| 90 | 90 | |
| 91 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . "</td>"; |
|
| 91 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s')."</td>"; |
|
| 92 | 92 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 93 | 93 | echo "</tr>"; |
| 94 | 94 | } |
| 95 | 95 | } else { |
| 96 | 96 | $faqid = -1; |
| 97 | 97 | echo "<tr>"; |
| 98 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . "</td>"; |
|
| 98 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS."</td>"; |
|
| 99 | 99 | echo "</tr>"; |
| 100 | 100 | } |
| 101 | 101 | echo "</table>\n"; |
| 102 | 102 | echo "<br />\n"; |
| 103 | 103 | |
| 104 | 104 | $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq', $pagenav_extra_args); |
| 105 | -echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 105 | +echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 106 | 106 | echo "</div>"; |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | // Changing categoryid type to int(11) |
| 27 | - $table->addAlteredField('categoryid', "int(11) NOT NULL default '0'", false); |
|
| 27 | + $table->addAlteredField('categoryid', "int(11) NOT NULL default '0'", false); |
|
| 28 | 28 | |
| 29 | 29 | if (!$dbupdater->updateTable($table)) { |
| 30 | 30 | /** |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | // Editing smartfaq_categories table |
| 37 | 37 | $table = new SmartDbTable('smartfaq_categories'); |
| 38 | 38 | // Changing categoryid type to int(11) |
| 39 | - $table->addAlteredField('categoryid', "int(11) NOT NULL default '0'", false); |
|
| 39 | + $table->addAlteredField('categoryid', "int(11) NOT NULL default '0'", false); |
|
| 40 | 40 | |
| 41 | 41 | // Changing parentid type to int(11) |
| 42 | - $table->addAlteredField('parentid', "int(11) NOT NULL default '0'", false); |
|
| 42 | + $table->addAlteredField('parentid', "int(11) NOT NULL default '0'", false); |
|
| 43 | 43 | |
| 44 | 44 | if (!$dbupdater->updateTable($table)) { |
| 45 | 45 | /** |
@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | // Editing smartfaq_answers table |
| 52 | 52 | $table = new SmartDbTable('smartfaq_answers'); |
| 53 | 53 | // Changing categoryid type to int(11) |
| 54 | - $table->addAlteredField('answerid', "int(11) NOT NULL default '0'", false); |
|
| 54 | + $table->addAlteredField('answerid', "int(11) NOT NULL default '0'", false); |
|
| 55 | 55 | |
| 56 | 56 | // Changing parentid type to int(11) |
| 57 | - $table->addAlteredField('faqid', "int(11) NOT NULL default '0'", false); |
|
| 57 | + $table->addAlteredField('faqid', "int(11) NOT NULL default '0'", false); |
|
| 58 | 58 | |
| 59 | 59 | if (!$dbupdater->updateTable($table)) { |
| 60 | 60 | /** |
@@ -5,9 +5,9 @@ discard block |
||
| 5 | 5 | function xoops_module_update_smartfaq($module) |
| 6 | 6 | { |
| 7 | 7 | // Load SmartDbUpdater from the SmartObject Framework if present |
| 8 | - $smartdbupdater = XOOPS_ROOT_PATH . "/modules/smartobject/class/smartdbupdater.php"; |
|
| 8 | + $smartdbupdater = XOOPS_ROOT_PATH."/modules/smartobject/class/smartdbupdater.php"; |
|
| 9 | 9 | if (!file_exists($smartdbupdater)) { |
| 10 | - $smartdbupdater = XOOPS_ROOT_PATH . "/modules/smartfaq/class/smartdbupdater.php"; |
|
| 10 | + $smartdbupdater = XOOPS_ROOT_PATH."/modules/smartfaq/class/smartdbupdater.php"; |
|
| 11 | 11 | } |
| 12 | 12 | include_once($smartdbupdater); |
| 13 | 13 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | ob_start(); |
| 17 | 17 | |
| 18 | - echo "<code>" . _SDU_UPDATE_UPDATING_DATABASE . "<br />"; |
|
| 18 | + echo "<code>"._SDU_UPDATE_UPDATING_DATABASE."<br />"; |
|
| 19 | 19 | |
| 20 | 20 | // Adding partialview field |
| 21 | 21 | $table = new SmartDbTable('smartfaq_faq'); |
@@ -66,9 +66,9 @@ discard block |
||
| 66 | 66 | /** |
| 67 | 67 | * Check for items with categoryid=0 |
| 68 | 68 | */ |
| 69 | - include_once(XOOPS_ROOT_PATH . "/modules/smartfaq/include/functions.php"); |
|
| 70 | - $smartfaq_faq_handler = $answer_handler =& sf_gethandler('faq'); |
|
| 71 | - $smartfaq_category_handler = $answer_handler =& sf_gethandler('category'); |
|
| 69 | + include_once(XOOPS_ROOT_PATH."/modules/smartfaq/include/functions.php"); |
|
| 70 | + $smartfaq_faq_handler = $answer_handler = & sf_gethandler('faq'); |
|
| 71 | + $smartfaq_category_handler = $answer_handler = & sf_gethandler('category'); |
|
| 72 | 72 | |
| 73 | 73 | //find a valid categoryid |
| 74 | 74 | $categoriesObj = $smartfaq_category_handler->getCategories(1, 0, 0, 'weight', 'ASC', false); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | ob_start(); |
| 98 | 98 | |
| 99 | - include_once(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname') . "/include/functions.php"); |
|
| 99 | + include_once(XOOPS_ROOT_PATH."/modules/".$module->getVar('dirname')."/include/functions.php"); |
|
| 100 | 100 | |
| 101 | 101 | $feedback = ob_get_clean(); |
| 102 | 102 | if (method_exists($module, "setMessage")) { |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | if ( isset($HTTP_POST_VARS) ) { |
| 49 | 49 | foreach ($HTTP_POST_VARS as $k => $v) { |
| 50 | 50 | $$k = $v; |
| 51 | - } |
|
| 51 | + } |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | if ( isset($HTTP_GET_VARS['op']) ) { |
@@ -203,18 +203,18 @@ |
||
| 203 | 203 | } |
| 204 | 204 | if ($myblock->getVar('block_type') == 'C') { |
| 205 | 205 | switch ($bctype) { |
| 206 | - case 'H': |
|
| 207 | - $name = _AM_CUSTOMHTML; |
|
| 208 | - break; |
|
| 209 | - case 'P': |
|
| 210 | - $name = _AM_CUSTOMPHP; |
|
| 211 | - break; |
|
| 212 | - case 'S': |
|
| 213 | - $name = _AM_CUSTOMSMILE; |
|
| 214 | - break; |
|
| 215 | - default: |
|
| 216 | - $name = _AM_CUSTOMNOSMILE; |
|
| 217 | - break; |
|
| 206 | + case 'H': |
|
| 207 | + $name = _AM_CUSTOMHTML; |
|
| 208 | + break; |
|
| 209 | + case 'P': |
|
| 210 | + $name = _AM_CUSTOMPHP; |
|
| 211 | + break; |
|
| 212 | + case 'S': |
|
| 213 | + $name = _AM_CUSTOMSMILE; |
|
| 214 | + break; |
|
| 215 | + default: |
|
| 216 | + $name = _AM_CUSTOMNOSMILE; |
|
| 217 | + break; |
|
| 218 | 218 | } |
| 219 | 219 | $myblock->setVar('name', $name); |
| 220 | 220 | $myblock->setVar('c_type', $bctype); |
@@ -38,23 +38,23 @@ discard block |
||
| 38 | 38 | // ------------------------------------------------------------------------- // |
| 39 | 39 | // defined("XOOPS_ROOT_PATH") || exit("XOOPS root path not defined"); |
| 40 | 40 | |
| 41 | -if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) { |
|
| 41 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
|
| 42 | 42 | exit("Access Denied"); |
| 43 | 43 | } |
| 44 | 44 | include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
| 45 | 45 | include XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php"; |
| 46 | 46 | |
| 47 | 47 | $op = "list"; |
| 48 | -if ( isset($HTTP_POST_VARS) ) { |
|
| 48 | +if (isset($HTTP_POST_VARS)) { |
|
| 49 | 49 | foreach ($HTTP_POST_VARS as $k => $v) { |
| 50 | 50 | $$k = $v; |
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -if ( isset($HTTP_GET_VARS['op']) ) { |
|
| 54 | +if (isset($HTTP_GET_VARS['op'])) { |
|
| 55 | 55 | if ($HTTP_GET_VARS['op'] == "edit" || $HTTP_GET_VARS['op'] == "delete" || $HTTP_GET_VARS['op'] == "delete_ok" || $HTTP_GET_VARS['op'] == "clone" || $HTTP_GET_VARS['op'] == 'previewpopup') { |
| 56 | 56 | $op = $HTTP_GET_VARS['op']; |
| 57 | - $bid = isset($HTTP_GET_VARS['bid'])? intval($HTTP_GET_VARS['bid']) : 0; |
|
| 57 | + $bid = isset($HTTP_GET_VARS['bid']) ? intval($HTTP_GET_VARS['bid']) : 0; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $myblock = new XoopsBlock(); |
| 78 | 78 | $myblock->setVar('block_type', 'C'); |
| 79 | 79 | } |
| 80 | - $myts =& MyTextSanitizer::getInstance(); |
|
| 80 | + $myts = & MyTextSanitizer::getInstance(); |
|
| 81 | 81 | $myblock->setVar('title', $myts->stripSlashesGPC($btitle)); |
| 82 | 82 | $myblock->setVar('content', $myts->stripSlashesGPC($bcontent)); |
| 83 | 83 | $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.$xoopsConfig['sitename'].'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body><table><tr><th>'.$myblock->getVar('title').'</th></tr><tr><td>'.$myblock->getContent('S', $bctype).'</td></tr></table></body></html>'; |
@@ -94,11 +94,11 @@ discard block |
||
| 94 | 94 | $block['visible'] = $bvisible; |
| 95 | 95 | $block['title'] = $myblock->getVar('title', 'E'); |
| 96 | 96 | $block['content'] = $myblock->getVar('content', 'E'); |
| 97 | - $block['modules'] =& $bmodule; |
|
| 98 | - $block['ctype'] = isset($bctype)? $bctype : $myblock->getVar('c_type'); |
|
| 97 | + $block['modules'] = & $bmodule; |
|
| 98 | + $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); |
|
| 99 | 99 | $block['is_custom'] = true; |
| 100 | 100 | $block['cachetime'] = intval($bcachetime); |
| 101 | - echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />'; |
|
| 101 | + echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />'; |
|
| 102 | 102 | include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; |
| 103 | 103 | $form->display(); |
| 104 | 104 | xoops_cp_footer(); |
@@ -129,19 +129,19 @@ discard block |
||
| 129 | 129 | if ($op == "order") { |
| 130 | 130 | foreach (array_keys($bid) as $i) { |
| 131 | 131 | if ($side[$i] < 0) { |
| 132 | - $visible[$i] = 0 ; |
|
| 133 | - $side[$i] = -1 ; |
|
| 132 | + $visible[$i] = 0; |
|
| 133 | + $side[$i] = -1; |
|
| 134 | 134 | } else { |
| 135 | - $visible[$i] = 1 ; |
|
| 135 | + $visible[$i] = 1; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - $bmodule[$i] = (isset($bmodule[$i]) && is_array($bmodule[$i]))? $bmodule[$i] : array(-1) ; |
|
| 138 | + $bmodule[$i] = (isset($bmodule[$i]) && is_array($bmodule[$i])) ? $bmodule[$i] : array(-1); |
|
| 139 | 139 | |
| 140 | 140 | myblocksadmin_update_block($i, $side[$i], $weight[$i], $visible[$i], $title[$i], '', '', $bcachetime[$i], $bmodule[$i], array()); |
| 141 | 141 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - redirect_header("myblocksadmin.php",1,_AM_DBUPDATED); |
|
| 144 | + redirect_header("myblocksadmin.php", 1, _AM_DBUPDATED); |
|
| 145 | 145 | exit(); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -151,13 +151,13 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | if ($op == "update") { |
| 154 | - $bcachetime = isset($bcachetime)? intval($bcachetime) : 0; |
|
| 155 | - $options = isset($options)? $options : array(); |
|
| 156 | - $bcontent = isset($bcontent)? $bcontent : ''; |
|
| 157 | - $bctype = isset($bctype)? $bctype : ''; |
|
| 158 | - $bmodule = (isset($bmodule) && is_array($bmodule))? $bmodule : array(-1) ; // GIJ + |
|
| 154 | + $bcachetime = isset($bcachetime) ? intval($bcachetime) : 0; |
|
| 155 | + $options = isset($options) ? $options : array(); |
|
| 156 | + $bcontent = isset($bcontent) ? $bcontent : ''; |
|
| 157 | + $bctype = isset($bctype) ? $bctype : ''; |
|
| 158 | + $bmodule = (isset($bmodule) && is_array($bmodule)) ? $bmodule : array(-1); // GIJ + |
|
| 159 | 159 | $msg = myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options); // GIJ c |
| 160 | - redirect_header('myblocksadmin.php',1,$msg); // GIJ + |
|
| 160 | + redirect_header('myblocksadmin.php', 1, $msg); // GIJ + |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | if ($op == "delete_ok") { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | // import from modules/system/admin/blocksadmin/blocksadmin.php |
| 183 | - function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array()) |
|
| 183 | + function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options = array()) |
|
| 184 | 184 | { |
| 185 | 185 | global $xoopsConfig; |
| 186 | 186 | if (empty($bmodule)) { |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | } |
| 192 | 192 | $myblock = new XoopsBlock($bid); |
| 193 | 193 | // $myblock->setVar('side', $bside); GIJ - |
| 194 | - if ( $bside >= 0 ) $myblock->setVar('side', $bside); // GIJ + |
|
| 194 | + if ($bside >= 0) $myblock->setVar('side', $bside); // GIJ + |
|
| 195 | 195 | $myblock->setVar('weight', $bweight); |
| 196 | 196 | $myblock->setVar('visible', $bvisible); |
| 197 | 197 | $myblock->setVar('title', $btitle); |
| 198 | 198 | $myblock->setVar('content', $bcontent); |
| 199 | 199 | $myblock->setVar('bcachetime', $bcachetime); |
| 200 | - if ( isset($options) && (count($options) > 0) ) { |
|
| 200 | + if (isset($options) && (count($options) > 0)) { |
|
| 201 | 201 | $options = implode('|', $options); |
| 202 | 202 | $myblock->setVar('options', $options); |
| 203 | 203 | } |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | $msg = _AM_DBUPDATED; |
| 225 | 225 | if ($myblock->store() != false) { |
| 226 | - $db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 226 | + $db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
| 227 | 227 | $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid); |
| 228 | 228 | $db->query($sql); |
| 229 | 229 | foreach ($bmodule as $bmid) { |
@@ -250,5 +250,5 @@ discard block |
||
| 250 | 250 | $msg = 'Failed update of block. ID:'.$bid; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - return $msg ; // GIJ + |
|
| 253 | + return $msg; // GIJ + |
|
| 254 | 254 | } |
@@ -191,7 +191,10 @@ |
||
| 191 | 191 | } |
| 192 | 192 | $myblock = new XoopsBlock($bid); |
| 193 | 193 | // $myblock->setVar('side', $bside); GIJ - |
| 194 | - if ( $bside >= 0 ) $myblock->setVar('side', $bside); // GIJ + |
|
| 194 | + if ( $bside >= 0 ) { |
|
| 195 | + $myblock->setVar('side', $bside); |
|
| 196 | + } |
|
| 197 | + // GIJ + |
|
| 195 | 198 | $myblock->setVar('weight', $bweight); |
| 196 | 199 | $myblock->setVar('visible', $bvisible); |
| 197 | 200 | $myblock->setVar('title', $btitle); |
@@ -32,22 +32,22 @@ |
||
| 32 | 32 | |
| 33 | 33 | if ($category == 'category') { |
| 34 | 34 | // Assume we have a valid category id |
| 35 | - $sql = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid = ' . $item_id; |
|
| 35 | + $sql = 'SELECT name FROM '.$xoopsDB->prefix('smartfaq_categories').' WHERE categoryid = '.$item_id; |
|
| 36 | 36 | $result = $xoopsDB->query($sql); // TODO: error check |
| 37 | 37 | $result_array = $xoopsDB->fetchArray($result); |
| 38 | 38 | $item['name'] = $result_array['name']; |
| 39 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id; |
|
| 39 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/category.php?categoryid='.$item_id; |
|
| 40 | 40 | |
| 41 | 41 | return $item; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | if ($category == 'faq') { |
| 45 | 45 | // Assume we have a valid story id |
| 46 | - $sql = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id; |
|
| 46 | + $sql = 'SELECT question FROM '.$xoopsDB->prefix('smartfaq_faq').' WHERE faqid = '.$item_id; |
|
| 47 | 47 | $result = $xoopsDB->query($sql); // TODO: error check |
| 48 | 48 | $result_array = $xoopsDB->fetchArray($result); |
| 49 | 49 | $item['name'] = $result_array['question']; |
| 50 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id; |
|
| 50 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/faq.php?faqid='.$item_id; |
|
| 51 | 51 | |
| 52 | 52 | return $item; |
| 53 | 53 | } |