@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/include/comment_delete.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/include/comment_delete.php'; |
|
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | function smartfaq_com_update($faq_id, $total_num) |
| 11 | 11 | { |
| 12 | 12 | $db = &XoopsDatabaseFactory::getDatabaseConnection(); |
| 13 | - $sql = 'UPDATE ' . $db->prefix('smartfaq_faq') . ' SET comments = ' . $total_num . ' WHERE faqid = ' . $faq_id; |
|
| 13 | + $sql = 'UPDATE '.$db->prefix('smartfaq_faq').' SET comments = '.$total_num.' WHERE faqid = '.$faq_id; |
|
| 14 | 14 | $db->query($sql); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/include/comment_reply.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/include/comment_reply.php'; |
|
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/include/comment_post.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/include/comment_post.php'; |
|
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/include/comment_edit.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/include/comment_edit.php'; |
|
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include XOOPS_ROOT_PATH . '/include/notification_update.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include XOOPS_ROOT_PATH.'/include/notification_update.php'; |
|
@@ -7,5 +7,5 @@ |
||
| 7 | 7 | * Licence: GNU |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 11 | -include_once XOOPS_ROOT_PATH . '/include/comment_new.php'; |
|
| 10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/include/comment_new.php'; |
|
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @version $Id $ |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | -include_once __DIR__ . '/admin_header.php'; |
|
| 21 | +include_once __DIR__.'/admin_header.php'; |
|
| 22 | 22 | |
| 23 | 23 | xoops_cp_header(); |
| 24 | 24 | |
@@ -27,4 +27,4 @@ discard block |
||
| 27 | 27 | echo $aboutAdmin->addNavigation('about.php'); |
| 28 | 28 | echo $aboutAdmin->renderAbout('6KJ7RW5DR3VTJ', false); |
| 29 | 29 | |
| 30 | -include_once __DIR__ . '/admin_footer.php'; |
|
| 30 | +include_once __DIR__.'/admin_footer.php'; |
|
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | - * @param bool $showmenu |
|
| 32 | + * @param string $showmenu |
|
| 33 | 33 | * @param int $faqid |
| 34 | 34 | * @param int $answerid |
| 35 | 35 | * @param bool $merge |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/admin_header.php'; |
|
| 9 | +include_once __DIR__.'/admin_header.php'; |
|
| 10 | 10 | |
| 11 | 11 | // Creating the faq handler object |
| 12 | 12 | $faqHandler = sf_gethandler('faq'); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // Where shall we start? |
| 29 | -$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
| 29 | +$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @param bool $showmenu |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | global $answerHandler, $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
| 40 | 40 | |
| 41 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 41 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 42 | 42 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
| 43 | 43 | if ($faqid != -1) { |
| 44 | 44 | // Creating the FAQ object |
@@ -140,12 +140,12 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | echo "<br />\n"; |
| 142 | 142 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 143 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . $collapsableBar_title . '</h3>'; |
|
| 143 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> ".$collapsableBar_title.'</h3>'; |
|
| 144 | 144 | echo "<div id='bottomtable'>"; |
| 145 | - echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">" . $collapsableBar_info . '</span>'; |
|
| 145 | + echo "<span style=\"color: #567; margin: 3px 0 12px 0; font-size: small; display: block; \">".$collapsableBar_info.'</span>'; |
|
| 146 | 146 | } else { |
| 147 | 147 | // there's no parameter, so we're adding a faq |
| 148 | - $faqObj =& $faqHandler->create(); |
|
| 148 | + $faqObj = & $faqHandler->create(); |
|
| 149 | 149 | $faqObj->setVar('uid', $xoopsUser->getVar('uid')); |
| 150 | 150 | $categoryObj = $categoryHandler->create(); |
| 151 | 151 | $answerObj = $answerHandler->create(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $button_caption = _AM_SF_CREATE; |
| 157 | 157 | |
| 158 | 158 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 159 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a> " . _AM_SF_CREATESMARTFAQ . '</h3>'; |
|
| 159 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a> "._AM_SF_CREATESMARTFAQ.'</h3>'; |
|
| 160 | 160 | echo "<div id='bottomtable'>"; |
| 161 | 161 | } |
| 162 | 162 | $sform = new XoopsThemeForm(_AM_SF_SMARTFAQ, 'op', xoops_getenv('PHP_SELF')); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | |
| 188 | 188 | // ANSWER |
| 189 | 189 | if ($merge) { |
| 190 | - $theanswer = $originalAnswerObj->answer('e') . "\n\n" . sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e')); |
|
| 190 | + $theanswer = $originalAnswerObj->answer('e')."\n\n".sprintf(_AM_SF_NEW_CONTRIBUTION, sf_getLinkedUnameFromId($answerObj->uid(), $xoopsModuleConfig['userealname']), $answerObj->datesub(), $answerObj->answer('e')); |
|
| 191 | 191 | } else { |
| 192 | 192 | $theanswer = $answerObj->answer('e'); |
| 193 | 193 | } |
@@ -235,14 +235,14 @@ discard block |
||
| 235 | 235 | $sform->addElement(new XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false); |
| 236 | 236 | |
| 237 | 237 | // EXACT URL? |
| 238 | - $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 238 | + $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 239 | 239 | $sform->addElement($excaturl_radio); |
| 240 | 240 | // WEIGHT |
| 241 | 241 | $sform->addElement(new XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true); |
| 242 | 242 | |
| 243 | 243 | // COMMENTS |
| 244 | 244 | // Code to allow comments |
| 245 | - $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 245 | + $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 246 | 246 | $sform->addElement($addcomments_radio); |
| 247 | 247 | |
| 248 | 248 | // PER ITEM PERMISSIONS |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | } |
| 257 | 257 | $sform->addElement($groups_checkbox); |
| 258 | 258 | |
| 259 | - $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 259 | + $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 260 | 260 | $sform->addElement($partial_view); |
| 261 | 261 | |
| 262 | 262 | // VARIOUS OPTIONS |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | // OFFLINE |
| 280 | 280 | if ($faqObj->status() == _SF_STATUS_OFFLINE) { |
| 281 | 281 | // Back OnLine |
| 282 | - $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 282 | + $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 283 | 283 | $sform->addElement($offline_radio); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | xoops_cp_header(); |
| 356 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 356 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 357 | 357 | |
| 358 | 358 | editfaq(true, $faqid, $answerid, true); |
| 359 | 359 | break; |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | xoops_cp_header(); |
| 375 | 375 | |
| 376 | 376 | echo $indexAdmin->addNavigation(basename(__FILE__)); |
| 377 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 377 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 378 | 378 | |
| 379 | 379 | editfaq(true, $faqid, $answerid); |
| 380 | 380 | break; |
@@ -382,9 +382,9 @@ discard block |
||
| 382 | 382 | case 'addfaq': |
| 383 | 383 | global $xoopsUser; |
| 384 | 384 | |
| 385 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1; |
|
| 386 | - $requester_uid = isset($_POST['requester_uid']) ? (int)$_POST['requester_uid'] : 0; |
|
| 387 | - $answerer_uid = isset($_POST['answerer_uid']) ? (int)$_POST['answerer_uid'] : 0; |
|
| 385 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1; |
|
| 386 | + $requester_uid = isset($_POST['requester_uid']) ? (int) $_POST['requester_uid'] : 0; |
|
| 387 | + $answerer_uid = isset($_POST['answerer_uid']) ? (int) $_POST['answerer_uid'] : 0; |
|
| 388 | 388 | |
| 389 | 389 | // Creating the FAQ and answer objects |
| 390 | 390 | if ($faqid != -1) { |
@@ -405,23 +405,23 @@ discard block |
||
| 405 | 405 | } else { |
| 406 | 406 | $faqObj->setGroups_read(); |
| 407 | 407 | } |
| 408 | - $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0); |
|
| 408 | + $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0); |
|
| 409 | 409 | $faqObj->setVar('question', $_POST['question']); |
| 410 | 410 | $faqObj->setVar('howdoi', $_POST['howdoi']); |
| 411 | 411 | $faqObj->setVar('diduno', $_POST['diduno']); |
| 412 | 412 | |
| 413 | - $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED); |
|
| 413 | + $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED); |
|
| 414 | 414 | |
| 415 | 415 | // If this SmartFAQ is offline and the user set this option to No |
| 416 | 416 | $offline = isset($_POST['offline']) ? $_POST['offline'] : 1; |
| 417 | 417 | if ((0 == $offline) && ($faqObj->status() == _SF_STATUS_OFFLINE)) { |
| 418 | 418 | $faqObj->setVar('status', _SF_STATUS_PUBLISHED); |
| 419 | 419 | } |
| 420 | - $faqObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : $faqObj->weight()); |
|
| 421 | - $faqObj->setVar('html', isset($_POST['html']) ? (int)$_POST['html'] : 0); |
|
| 422 | - $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int)$_POST['smiley'] : 0); |
|
| 423 | - $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int)$_POST['xcodes'] : 0); |
|
| 424 | - $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int)$_POST['cancomment'] : 0); |
|
| 420 | + $faqObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : $faqObj->weight()); |
|
| 421 | + $faqObj->setVar('html', isset($_POST['html']) ? (int) $_POST['html'] : 0); |
|
| 422 | + $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int) $_POST['smiley'] : 0); |
|
| 423 | + $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int) $_POST['xcodes'] : 0); |
|
| 424 | + $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int) $_POST['cancomment'] : 0); |
|
| 425 | 425 | $faqObj->setVar('modulelink', $_POST['modulelink']); |
| 426 | 426 | $faqObj->setVar('contextpage', $_POST['contextpage']); |
| 427 | 427 | $faqObj->setVar('exacturl', $_POST['exacturl']); |
@@ -505,13 +505,13 @@ discard block |
||
| 505 | 505 | |
| 506 | 506 | // Storing the FAQ |
| 507 | 507 | if (!$faqObj->store()) { |
| 508 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($faqObj->getErrors())); |
|
| 508 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($faqObj->getErrors())); |
|
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | // Storing the answer |
| 512 | 512 | $answerObj->setVar('faqid', $faqObj->faqid()); |
| 513 | 513 | if (!$answerObj->store()) { |
| 514 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($answerObj->getErrors())); |
|
| 514 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($answerObj->getErrors())); |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | // Send notifications |
@@ -528,8 +528,8 @@ discard block |
||
| 528 | 528 | $module_id = $xoopsModule->getVar('mid'); |
| 529 | 529 | $gpermHandler = xoops_getHandler('groupperm'); |
| 530 | 530 | |
| 531 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
|
| 532 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid; |
|
| 531 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0; |
|
| 532 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid; |
|
| 533 | 533 | |
| 534 | 534 | $faqObj = new sfFaq($faqid); |
| 535 | 535 | |
@@ -538,15 +538,15 @@ discard block |
||
| 538 | 538 | |
| 539 | 539 | if ($confirm) { |
| 540 | 540 | if (!$faqHandler->delete($faqObj)) { |
| 541 | - redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 541 | + redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question())); |
| 545 | 545 | } else { |
| 546 | 546 | // no confirm: show deletion condition |
| 547 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 547 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 548 | 548 | xoops_cp_header(); |
| 549 | - xoops_confirm(array('op' => 'del', 'faqid' => $faqObj->faqid(), 'confirm' => 1, 'name' => $faqObj->question()), 'faq.php', _AM_SF_DELETETHISARTICLE . " <br />'" . $faqObj->question() . "'. <br /> <br />", _AM_SF_DELETE); |
|
| 549 | + xoops_confirm(array('op' => 'del', 'faqid' => $faqObj->faqid(), 'confirm' => 1, 'name' => $faqObj->question()), 'faq.php', _AM_SF_DELETETHISARTICLE." <br />'".$faqObj->question()."'. <br /> <br />", _AM_SF_DELETE); |
|
| 550 | 550 | xoops_cp_footer(); |
| 551 | 551 | } |
| 552 | 552 | |
@@ -560,10 +560,10 @@ discard block |
||
| 560 | 560 | |
| 561 | 561 | echo $indexAdmin->addNavigation(basename(__FILE__)); |
| 562 | 562 | |
| 563 | - include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 564 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 563 | + include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 564 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 565 | 565 | |
| 566 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
| 566 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
| 567 | 567 | |
| 568 | 568 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
| 569 | 569 | if ($totalcategories > 0) { |
@@ -573,4 +573,4 @@ discard block |
||
| 573 | 573 | break; |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | -include_once __DIR__ . '/admin_footer.php'; |
|
| 576 | +include_once __DIR__.'/admin_footer.php'; |
|