@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $maxQuestionLength = $options[3]; |
| 26 | 26 | |
| 27 | 27 | // Creating the faq handler object |
| 28 | - $faq_handler =& sf_gethandler('faq'); |
|
| 28 | + $faq_handler = & sf_gethandler('faq'); |
|
| 29 | 29 | // creating the FAQ objects that belong to the selected category |
| 30 | 30 | $faqsObj = $faq_handler->getAllPublished($limit, 0, $categoryid, $sort); |
| 31 | 31 | $totalfaqs = count($faqsObj); |
@@ -56,30 +56,30 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $form = sf_createCategorySelect($options[0]); |
| 58 | 58 | |
| 59 | - $form .= " <br>" . _MB_SF_ORDER . " <select name='options[]'>"; |
|
| 59 | + $form .= " <br>"._MB_SF_ORDER." <select name='options[]'>"; |
|
| 60 | 60 | |
| 61 | 61 | $form .= "<option value='datesub'"; |
| 62 | 62 | if ($options[1] == "datesub") { |
| 63 | 63 | $form .= " selected='selected'"; |
| 64 | 64 | } |
| 65 | - $form .= ">" . _MB_SF_DATE . "</option>\n"; |
|
| 65 | + $form .= ">"._MB_SF_DATE."</option>\n"; |
|
| 66 | 66 | |
| 67 | 67 | $form .= "<option value='counter'"; |
| 68 | 68 | if ($options[1] == "counter") { |
| 69 | 69 | $form .= " selected='selected'"; |
| 70 | 70 | } |
| 71 | - $form .= ">" . _MB_SF_HITS . "</option>\n"; |
|
| 71 | + $form .= ">"._MB_SF_HITS."</option>\n"; |
|
| 72 | 72 | |
| 73 | 73 | $form .= "<option value='weight'"; |
| 74 | 74 | if ($options[1] == "weight") { |
| 75 | 75 | $form .= " selected='selected'"; |
| 76 | 76 | } |
| 77 | - $form .= ">" . _MB_SF_WEIGHT . "</option>\n"; |
|
| 77 | + $form .= ">"._MB_SF_WEIGHT."</option>\n"; |
|
| 78 | 78 | |
| 79 | 79 | $form .= "</select>\n"; |
| 80 | 80 | |
| 81 | - $form .= " " . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "' /> " . _MB_SF_FAQS . ""; |
|
| 82 | - $form .= " <br>" . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "' /> " . _MB_SF_LENGTH . ""; |
|
| 81 | + $form .= " "._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."' /> "._MB_SF_FAQS.""; |
|
| 82 | + $form .= " <br>"._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."' /> "._MB_SF_LENGTH.""; |
|
| 83 | 83 | |
| 84 | 84 | $form .= "<br />"._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
| 85 | 85 | if ($options[4] == 1) { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $limit = $options[0]; |
| 24 | 24 | |
| 25 | 25 | // Creating the faq handler object |
| 26 | - $faq_handler =& sf_gethandler('faq'); |
|
| 26 | + $faq_handler = & sf_gethandler('faq'); |
|
| 27 | 27 | |
| 28 | 28 | // creating the FAQ objects that belong to the selected category |
| 29 | 29 | $faqsObj = $faq_handler->getContextualFaqs($limit); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | } |
| 43 | 43 | function b_faqs_context_edit($options) |
| 44 | 44 | { |
| 45 | - $form = "" . _MB_SF_DISP . " "; |
|
| 46 | - $form .= "<input type='text' name='options[]' value='" . $options[0] . "' /> " . _MB_SF_FAQS . ""; |
|
| 45 | + $form = ""._MB_SF_DISP." "; |
|
| 46 | + $form .= "<input type='text' name='options[]' value='".$options[0]."' /> "._MB_SF_FAQS.""; |
|
| 47 | 47 | |
| 48 | 48 | return $form; |
| 49 | 49 | } |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | $maxQuestionLength = $options[3]; |
| 26 | 26 | |
| 27 | 27 | // Creating the faq handler object |
| 28 | - $faq_handler =& sf_gethandler('faq'); |
|
| 28 | + $faq_handler = & sf_gethandler('faq'); |
|
| 29 | 29 | |
| 30 | 30 | // creating the FAQ objects that belong to the selected category |
| 31 | - $faqsObj = $faq_handler->getFaqs( $limit, 0, _SF_STATUS_OPENED, $categoryid, $sort); |
|
| 31 | + $faqsObj = $faq_handler->getFaqs($limit, 0, _SF_STATUS_OPENED, $categoryid, $sort); |
|
| 32 | 32 | $totalfaqs = count($faqsObj); |
| 33 | 33 | |
| 34 | 34 | if ($faqsObj) { |
@@ -59,30 +59,30 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $form = sf_createCategorySelect($options[0]); |
| 61 | 61 | |
| 62 | - $form .= " <br>" . _MB_SF_ORDER . " <select name='options[]'>"; |
|
| 62 | + $form .= " <br>"._MB_SF_ORDER." <select name='options[]'>"; |
|
| 63 | 63 | |
| 64 | 64 | $form .= "<option value='datesub'"; |
| 65 | 65 | if ($options[1] == "datesub") { |
| 66 | 66 | $form .= " selected='selected'"; |
| 67 | 67 | } |
| 68 | - $form .= ">" . _MB_SF_DATE . "</option>\n"; |
|
| 68 | + $form .= ">"._MB_SF_DATE."</option>\n"; |
|
| 69 | 69 | |
| 70 | 70 | $form .= "<option value='counter'"; |
| 71 | 71 | if ($options[1] == "counter") { |
| 72 | 72 | $form .= " selected='selected'"; |
| 73 | 73 | } |
| 74 | - $form .= ">" . _MB_SF_HITS . "</option>\n"; |
|
| 74 | + $form .= ">"._MB_SF_HITS."</option>\n"; |
|
| 75 | 75 | |
| 76 | 76 | $form .= "<option value='weight'"; |
| 77 | 77 | if ($options[1] == "weight") { |
| 78 | 78 | $form .= " selected='selected'"; |
| 79 | 79 | } |
| 80 | - $form .= ">" . _MB_SF_WEIGHT . "</option>\n"; |
|
| 80 | + $form .= ">"._MB_SF_WEIGHT."</option>\n"; |
|
| 81 | 81 | |
| 82 | 82 | $form .= "</select>\n"; |
| 83 | 83 | |
| 84 | - $form .= " " . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "' /> " . _MB_SF_QUESTIONS . ""; |
|
| 85 | - $form .= " <br>" . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "' /> " . _MB_SF_LENGTH . ""; |
|
| 84 | + $form .= " "._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."' /> "._MB_SF_QUESTIONS.""; |
|
| 85 | + $form .= " <br>"._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."' /> "._MB_SF_LENGTH.""; |
|
| 86 | 86 | |
| 87 | 87 | $form .= "<br />"._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
| 88 | 88 | if ($options[4] == 1) { |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | $maxQuestionLength = $options[2]; |
| 24 | 24 | |
| 25 | 25 | // Creating the faq handler object |
| 26 | - $faq_handler =& sf_gethandler('faq'); |
|
| 26 | + $faq_handler = & sf_gethandler('faq'); |
|
| 27 | 27 | // creating the FAQ objects that belong to the selected category |
| 28 | 28 | $faqsObj = $faq_handler->getAllPublished($limit, 0, $categoryid, $sort); |
| 29 | 29 | $totalfaqs = count($faqsObj); |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $form = sf_createCategorySelect($options[0]); |
| 49 | 49 | |
| 50 | - $form .= " <br />" . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[1] . "' /> " . _MB_SF_FAQS . ""; |
|
| 51 | - $form .= " <br />" . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[2] . "' /> " . _MB_SF_LENGTH . ""; |
|
| 50 | + $form .= " <br />"._MB_SF_DISP." <input type='text' name='options[]' value='".$options[1]."' /> "._MB_SF_FAQS.""; |
|
| 51 | + $form .= " <br />"._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[2]."' /> "._MB_SF_LENGTH.""; |
|
| 52 | 52 | |
| 53 | 53 | return $form; |
| 54 | 54 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $block = array(); |
| 16 | 16 | |
| 17 | 17 | // Creating the faq handler object |
| 18 | - $faq_handler =& sf_gethandler('faq'); |
|
| 18 | + $faq_handler = & sf_gethandler('faq'); |
|
| 19 | 19 | |
| 20 | 20 | // creating the FAQ object |
| 21 | 21 | $faqsObj = $faq_handler->getRandomFaq('diduno', array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER)); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $block = array(); |
| 16 | 16 | |
| 17 | 17 | // Creating the faq handler object |
| 18 | - $faq_handler =& sf_gethandler('faq'); |
|
| 18 | + $faq_handler = & sf_gethandler('faq'); |
|
| 19 | 19 | |
| 20 | 20 | // creating the FAQ object |
| 21 | 21 | $faqsObj = $faq_handler->getRandomFaq('howdoi', array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER)); |
@@ -14,8 +14,8 @@ discard block |
||
| 14 | 14 | include_once(XOOPS_ROOT_PATH."/modules/smartfaq/include/functions.php"); |
| 15 | 15 | $myts = &MyTextSanitizer::getInstance(); |
| 16 | 16 | |
| 17 | - $smartModule =& sf_getModuleInfo(); |
|
| 18 | - $smartModuleConfig =& sf_getModuleConfig(); |
|
| 17 | + $smartModule = & sf_getModuleInfo(); |
|
| 18 | + $smartModuleConfig = & sf_getModuleConfig(); |
|
| 19 | 19 | |
| 20 | 20 | $block = array(); |
| 21 | 21 | |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | $maxQuestionLength = $options[3]; |
| 31 | 31 | |
| 32 | 32 | // Creating the faq handler object |
| 33 | - $faq_handler =& sf_gethandler('faq'); |
|
| 33 | + $faq_handler = & sf_gethandler('faq'); |
|
| 34 | 34 | |
| 35 | 35 | // Creating the category handler object |
| 36 | - $category_handler =& sf_gethandler('category'); |
|
| 36 | + $category_handler = & sf_gethandler('category'); |
|
| 37 | 37 | |
| 38 | 38 | // Creating the last FAQs |
| 39 | 39 | $faqsObj = $faq_handler->getAllPublished($limit, 0, $categoryid, $sort); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $faqids[] = $thisfaq->getVar('faqid'); |
| 45 | 45 | $userids[$thisfaq->uid()] = 1; |
| 46 | 46 | } |
| 47 | - $answer_handler =& sf_gethandler('answer'); |
|
| 47 | + $answer_handler = & sf_gethandler('answer'); |
|
| 48 | 48 | $allanswers = $answer_handler->getLastPublishedByFaq($faqids); |
| 49 | 49 | |
| 50 | 50 | foreach ($allanswers as $key => $thisanswer) { |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | $member_handler = &xoops_gethandler('member'); |
| 55 | 55 | $users = $member_handler->getUsers(new Criteria('uid', "(".implode(',', array_keys($userids)).")", "IN"), true); |
| 56 | - for ( $i = 0; $i < count($faqsObj); ++$i ) { |
|
| 56 | + for ($i = 0; $i < count($faqsObj); ++$i) { |
|
| 57 | 57 | $faqs['categoryid'] = $faqsObj[$i]->categoryid(); |
| 58 | 58 | $faqs['question'] = $faqsObj[$i]->question($maxQuestionLength); |
| 59 | 59 | $faqs['faqid'] = $faqsObj[$i]->faqid(); |
| 60 | 60 | $faqs['categoryname'] = $allcategories[$faqsObj[$i]->categoryid()]->getVar('name'); |
| 61 | 61 | |
| 62 | 62 | // Creating the answer object |
| 63 | - $answerObj =& $allanswers[$faqsObj[$i]->faqid()]; |
|
| 63 | + $answerObj = & $allanswers[$faqsObj[$i]->faqid()]; |
|
| 64 | 64 | |
| 65 | 65 | $faqs['date'] = $faqsObj[$i]->datesub(); |
| 66 | 66 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $block['lang_poster'] = _MB_SF_ANSWEREDBY; |
| 75 | 75 | $block['lang_date'] = _MB_SF_DATE; |
| 76 | 76 | $modulename = $myts->htmlSpecialChars($smartModule->getVar('name')); |
| 77 | - $block['lang_visitfaq'] = _MB_SF_VISITFAQ . " " . $modulename; |
|
| 77 | + $block['lang_visitfaq'] = _MB_SF_VISITFAQ." ".$modulename; |
|
| 78 | 78 | |
| 79 | 79 | } |
| 80 | 80 | |
@@ -87,30 +87,30 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $form = sf_createCategorySelect($options[0]); |
| 89 | 89 | |
| 90 | - $form .= " <br>" . _MB_SF_ORDER . " <select name='options[]'>"; |
|
| 90 | + $form .= " <br>"._MB_SF_ORDER." <select name='options[]'>"; |
|
| 91 | 91 | |
| 92 | 92 | $form .= "<option value='datesub'"; |
| 93 | 93 | if ($options[1] == "datesub") { |
| 94 | 94 | $form .= " selected='selected'"; |
| 95 | 95 | } |
| 96 | - $form .= ">" . _MB_SF_DATE . "</option>\n"; |
|
| 96 | + $form .= ">"._MB_SF_DATE."</option>\n"; |
|
| 97 | 97 | |
| 98 | 98 | $form .= "<option value='counter'"; |
| 99 | 99 | if ($options[1] == "counter") { |
| 100 | 100 | $form .= " selected='selected'"; |
| 101 | 101 | } |
| 102 | - $form .= ">" . _MB_SF_HITS . "</option>\n"; |
|
| 102 | + $form .= ">"._MB_SF_HITS."</option>\n"; |
|
| 103 | 103 | |
| 104 | 104 | $form .= "<option value='weight'"; |
| 105 | 105 | if ($options[1] == "weight") { |
| 106 | 106 | $form .= " selected='selected'"; |
| 107 | 107 | } |
| 108 | - $form .= ">" . _MB_SF_WEIGHT . "</option>\n"; |
|
| 108 | + $form .= ">"._MB_SF_WEIGHT."</option>\n"; |
|
| 109 | 109 | |
| 110 | 110 | $form .= "</select>\n"; |
| 111 | 111 | |
| 112 | - $form .= " " . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "' /> " . _MB_SF_FAQS . ""; |
|
| 113 | - $form .= " <br>" . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "' /> " . _MB_SF_LENGTH . ""; |
|
| 112 | + $form .= " "._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."' /> "._MB_SF_FAQS.""; |
|
| 113 | + $form .= " <br>"._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."' /> "._MB_SF_LENGTH.""; |
|
| 114 | 114 | |
| 115 | 115 | return $form; |
| 116 | 116 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $block = array(); |
| 16 | 16 | |
| 17 | 17 | // Creating the faq handler object |
| 18 | - $faq_handler =& sf_gethandler('faq'); |
|
| 18 | + $faq_handler = & sf_gethandler('faq'); |
|
| 19 | 19 | |
| 20 | 20 | // creating the FAQ object |
| 21 | 21 | $faqsObj = $faq_handler->getRandomFaq('question', array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER)); |
@@ -7,18 +7,18 @@ 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 | |
| 14 | 14 | // Creating the category handler object |
| 15 | -$category_handler =& sf_gethandler('category'); |
|
| 15 | +$category_handler = & sf_gethandler('category'); |
|
| 16 | 16 | |
| 17 | 17 | // Creating the FAQ handler object |
| 18 | -$faq_handler =& sf_gethandler('faq'); |
|
| 18 | +$faq_handler = & sf_gethandler('faq'); |
|
| 19 | 19 | |
| 20 | 20 | // Creating the answer handler object |
| 21 | -$answer_handler =& sf_gethandler('answer'); |
|
| 21 | +$answer_handler = & sf_gethandler('answer'); |
|
| 22 | 22 | |
| 23 | 23 | // Get the total number of categories |
| 24 | 24 | $totalCategories = count($category_handler->getCategories()); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | $uid = $xoopsUser->uid(); |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - $notifypub = isset($_POST['notifypub'])? $_POST['notifypub'] : 0; |
|
| 69 | + $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0; |
|
| 70 | 70 | |
| 71 | 71 | // Putting the values about the FAQ in the FAQ object |
| 72 | 72 | $faqObj->setVar('categoryid', $_POST['categoryid']); |
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | global $xoopsUser, $myts; |
| 86 | 86 | |
| 87 | 87 | $xoopsOption['template_main'] = 'smartfaq_submit.tpl'; |
| 88 | - include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
| 89 | - include_once __DIR__ . '/footer.php'; |
|
| 88 | + include_once(XOOPS_ROOT_PATH."/header.php"); |
|
| 89 | + include_once __DIR__.'/footer.php'; |
|
| 90 | 90 | |
| 91 | - $name = ($xoopsUser)? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 91 | + $name = ($xoopsUser) ? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 92 | 92 | |
| 93 | 93 | $moduleName = $myts->displayTarea($xoopsModule->getVar('name')); |
| 94 | 94 | $faq = $faqObj->toArray(null, $categoryObj, false); |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
| 104 | 104 | |
| 105 | 105 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
| 106 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 106 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
| 107 | 107 | |
| 108 | 108 | include_once 'include/submit.inc.php'; |
| 109 | 109 | |
| 110 | - include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 110 | + include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 111 | 111 | |
| 112 | 112 | exit(); |
| 113 | 113 | break; |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $uid = $xoopsUser->uid(); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $notifypub = isset($_POST['notifypub'])? $_POST['notifypub'] : 0; |
|
| 133 | + $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0; |
|
| 134 | 134 | |
| 135 | 135 | // Putting the values about the FAQ in the FAQ object |
| 136 | 136 | $newFaqObj->setVar('categoryid', $_POST['categoryid']); |
@@ -148,14 +148,14 @@ discard block |
||
| 148 | 148 | $isAdmin = sf_userIsAdmin(); |
| 149 | 149 | if ($isAdmin) { |
| 150 | 150 | $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED); |
| 151 | - } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) { |
|
| 151 | + } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) { |
|
| 152 | 152 | $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED); |
| 153 | 153 | } else { |
| 154 | 154 | $newFaqObj->setVar('status', _SF_STATUS_SUBMITTED); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // Storing the FAQ object in the database |
| 158 | - if ( !$newFaqObj->store() ) { |
|
| 158 | + if (!$newFaqObj->store()) { |
|
| 159 | 159 | redirect_header("javascript:history.go(-1)", 2, _MD_SF_SUBMIT_ERROR); |
| 160 | 160 | exit(); |
| 161 | 161 | } |
@@ -173,22 +173,22 @@ discard block |
||
| 173 | 173 | $attachments_tmp = unserialize(base64_decode($_POST["attachments_tmp"])); |
| 174 | 174 | if (isset($_POST["delete_tmp"]) && count($_POST["delete_tmp"])) { |
| 175 | 175 | foreach ($_POST["delete_tmp"] as $key) { |
| 176 | - unlink(XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['dir_attachments'] . "/" . $attachments_tmp[$key][0]); |
|
| 176 | + unlink(XOOPS_ROOT_PATH."/".$xoopsModuleConfig['dir_attachments']."/".$attachments_tmp[$key][0]); |
|
| 177 | 177 | unset($attachments_tmp[$key]); |
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | if (count($attachments_tmp)) { |
| 182 | 182 | foreach ($attachments_tmp as $key => $attach) { |
| 183 | - if (rename(XOOPS_CACHE_PATH . "/" . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['dir_attachments'] . "/" . $attachments_tmp[$key][0])) { |
|
| 183 | + if (rename(XOOPS_CACHE_PATH."/".$attachments_tmp[$key][0], XOOPS_ROOT_PATH."/".$xoopsModuleConfig['dir_attachments']."/".$attachments_tmp[$key][0])) { |
|
| 184 | 184 | $post_obj->setAttachment($attach[0], $attach[1], $attach[2]); |
| 185 | 185 | } |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | $error_upload = ''; |
| 189 | 189 | |
| 190 | - if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != '' && $topic_handler->getPermission($forum_obj, $topic_status, 'attach') ) { |
|
| 191 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar("dirname", "n") . '/class/uploader.php'; |
|
| 190 | + if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != '' && $topic_handler->getPermission($forum_obj, $topic_status, 'attach')) { |
|
| 191 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar("dirname", "n").'/class/uploader.php'; |
|
| 192 | 192 | $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024; |
| 193 | 193 | $uploaddir = XOOPS_CACHE_PATH; |
| 194 | 194 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI; |
| 207 | 207 | break; |
| 208 | 208 | case 2: |
| 209 | - $error_message[] = sprintf(_MD_NEWBB_MAXKB,$forum_obj->getVar('attach_maxkb')); |
|
| 209 | + $error_message[] = sprintf(_MD_NEWBB_MAXKB, $forum_obj->getVar('attach_maxkb')); |
|
| 210 | 210 | break; |
| 211 | 211 | default: |
| 212 | 212 | $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF; |
@@ -215,14 +215,14 @@ discard block |
||
| 215 | 215 | } else { |
| 216 | 216 | $uploader->setCheckMediaTypeByExt(); |
| 217 | 217 | |
| 218 | - if ( $uploader->fetchMedia( $_POST['xoops_upload_file'][0]) ) { |
|
| 219 | - $prefix = is_object($xoopsUser) ? strval($xoopsUser->uid()) . '_' : 'newbb_'; |
|
| 218 | + if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) { |
|
| 219 | + $prefix = is_object($xoopsUser) ? strval($xoopsUser->uid()).'_' : 'newbb_'; |
|
| 220 | 220 | $uploader->setPrefix($prefix); |
| 221 | - if ( !$uploader->upload() ) { |
|
| 221 | + if (!$uploader->upload()) { |
|
| 222 | 222 | $error_message[] = $error_upload = $uploader->getErrors(); |
| 223 | 223 | } else { |
| 224 | - if ( is_file( $uploader->getSavedDestination() )) { |
|
| 225 | - if (rename(XOOPS_CACHE_PATH . "/" . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . "/" . $xoopsModuleConfig['dir_attachments'] . "/" . $uploader->getSavedFileName())) { |
|
| 224 | + if (is_file($uploader->getSavedDestination())) { |
|
| 225 | + if (rename(XOOPS_CACHE_PATH."/".$uploader->getSavedFileName(), XOOPS_ROOT_PATH."/".$xoopsModuleConfig['dir_attachments']."/".$uploader->getSavedFileName())) { |
|
| 226 | 226 | $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType()); |
| 227 | 227 | } |
| 228 | 228 | } |
@@ -236,13 +236,13 @@ discard block |
||
| 236 | 236 | //==================================================== |
| 237 | 237 | |
| 238 | 238 | // Storing the answer object in the database |
| 239 | - if ( !$newAnswerObj->store() ) { |
|
| 239 | + if (!$newAnswerObj->store()) { |
|
| 240 | 240 | redirect_header("javascript:history.go(-1)", 2, _MD_SF_SUBMIT_ERROR); |
| 241 | 241 | exit(); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | // Get the cateopry object related to that FAQ |
| 245 | - $categoryObj =& $newFaqObj->category(); |
|
| 245 | + $categoryObj = & $newFaqObj->category(); |
|
| 246 | 246 | |
| 247 | 247 | // If autoapprove_submitted_faq |
| 248 | 248 | if ($isAdmin) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $newFaqObj->sendNotifications(array(_SF_NOT_FAQ_PUBLISHED)); |
| 253 | 253 | |
| 254 | 254 | $redirect_msg = _MD_SF_SUBMIT_FROM_ADMIN; |
| 255 | - } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) { |
|
| 255 | + } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) { |
|
| 256 | 256 | // We do not not subscribe user to notification on publish since we publish it right away |
| 257 | 257 | |
| 258 | 258 | // Send notifications |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | } else { |
| 263 | 263 | // Subscribe the user to On Published notification, if requested |
| 264 | 264 | if ($notifypub == 1) { |
| 265 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 265 | + include_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 266 | 266 | $notification_handler = &xoops_gethandler('notification'); |
| 267 | 267 | $notification_handler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 268 | 268 | } |
@@ -287,20 +287,20 @@ discard block |
||
| 287 | 287 | $categoryObj = $category_handler->create(); |
| 288 | 288 | |
| 289 | 289 | $xoopsOption['template_main'] = 'smartfaq_submit.html'; |
| 290 | - include_once(XOOPS_ROOT_PATH . "/header.php"); |
|
| 291 | - include_once __DIR__ . '/footer.php'; |
|
| 290 | + include_once(XOOPS_ROOT_PATH."/header.php"); |
|
| 291 | + include_once __DIR__.'/footer.php'; |
|
| 292 | 292 | |
| 293 | - $name = ($xoopsUser)? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 293 | + $name = ($xoopsUser) ? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous'; |
|
| 294 | 294 | $notifypub = 1; |
| 295 | 295 | $moduleName = $myts->displayTarea($xoopsModule->getVar('name')); |
| 296 | 296 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 297 | 297 | $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME); |
| 298 | 298 | |
| 299 | 299 | $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name()))); |
| 300 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO); |
|
| 300 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO); |
|
| 301 | 301 | |
| 302 | 302 | include_once 'include/submit.inc.php'; |
| 303 | 303 | |
| 304 | - include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 304 | + include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 305 | 305 | break; |
| 306 | 306 | } |