@@ -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 |
@@ -548,11 +548,11 @@ |
||
| 548 | 548 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
| 549 | 549 | xoops_cp_header(); |
| 550 | 550 | xoops_confirm([ |
| 551 | - 'op' => 'del', |
|
| 552 | - 'faqid' => $faqObj->faqid(), |
|
| 553 | - 'confirm' => 1, |
|
| 554 | - 'name' => $faqObj->question() |
|
| 555 | - ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 551 | + 'op' => 'del', |
|
| 552 | + 'faqid' => $faqObj->faqid(), |
|
| 553 | + 'confirm' => 1, |
|
| 554 | + 'name' => $faqObj->question() |
|
| 555 | + ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 556 | 556 | xoops_cp_footer(); |
| 557 | 557 | } |
| 558 | 558 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/admin_header.php'; |
|
| 9 | +require_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 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 41 | + require_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,9 +140,9 @@ 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 | 148 | $faqObj = $faqHandler->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'), 'post', true); |
@@ -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 | } |
@@ -236,14 +236,14 @@ discard block |
||
| 236 | 236 | $sform->addElement(new XoopsFormText(_AM_SF_SPECIFIC_URL, 'contextpage', 50, 60, $faqObj->contextpage()), false); |
| 237 | 237 | |
| 238 | 238 | // EXACT URL? |
| 239 | - $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 239 | + $excaturl_radio = new XoopsFormRadioYN(_AM_SF_EXACTURL, 'exacturl', $faqObj->exacturl(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 240 | 240 | $sform->addElement($excaturl_radio); |
| 241 | 241 | // WEIGHT |
| 242 | 242 | $sform->addElement(new XoopsFormText(_AM_SF_WEIGHT, 'weight', 5, 5, $faqObj->weight()), true); |
| 243 | 243 | |
| 244 | 244 | // COMMENTS |
| 245 | 245 | // Code to allow comments |
| 246 | - $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 246 | + $addcomments_radio = new XoopsFormRadioYN(_AM_SF_ALLOWCOMMENTS, 'cancomment', $faqObj->cancomment(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 247 | 247 | $sform->addElement($addcomments_radio); |
| 248 | 248 | |
| 249 | 249 | // PER ITEM PERMISSIONS |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | } |
| 258 | 258 | $sform->addElement($groups_checkbox); |
| 259 | 259 | |
| 260 | - $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 260 | + $partial_view = new XoopsFormRadioYN(_AM_SF_PARTIALVIEW, 'partialview', $faqObj->partialview(), ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 261 | 261 | $sform->addElement($partial_view); |
| 262 | 262 | |
| 263 | 263 | // VARIOUS OPTIONS |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | // OFFLINE |
| 281 | 281 | if (_SF_STATUS_OFFLINE == $faqObj->status()) { |
| 282 | 282 | // Back OnLine |
| 283 | - $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' ' . _AM_SF_YES . '', ' ' . _AM_SF_NO . ''); |
|
| 283 | + $offline_radio = new XoopsFormRadioYN(_AM_SF_OFFLINE_FIELD, 'offline', 1, ' '._AM_SF_YES.'', ' '._AM_SF_NO.''); |
|
| 284 | 284 | $sform->addElement($offline_radio); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | xoops_cp_header(); |
| 357 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 357 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 358 | 358 | |
| 359 | 359 | editfaq(true, $faqid, $answerid, true); |
| 360 | 360 | break; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | xoops_cp_header(); |
| 376 | 376 | |
| 377 | 377 | $adminObject->displayNavigation(basename(__FILE__)); |
| 378 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 378 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 379 | 379 | |
| 380 | 380 | editfaq(true, $faqid, $answerid); |
| 381 | 381 | break; |
@@ -383,9 +383,9 @@ discard block |
||
| 383 | 383 | case 'addfaq': |
| 384 | 384 | global $xoopsUser; |
| 385 | 385 | |
| 386 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1; |
|
| 387 | - $requester_uid = isset($_POST['requester_uid']) ? (int)$_POST['requester_uid'] : 0; |
|
| 388 | - $answerer_uid = isset($_POST['answerer_uid']) ? (int)$_POST['answerer_uid'] : 0; |
|
| 386 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1; |
|
| 387 | + $requester_uid = isset($_POST['requester_uid']) ? (int) $_POST['requester_uid'] : 0; |
|
| 388 | + $answerer_uid = isset($_POST['answerer_uid']) ? (int) $_POST['answerer_uid'] : 0; |
|
| 389 | 389 | |
| 390 | 390 | // Creating the FAQ and answer objects |
| 391 | 391 | if ($faqid != -1) { |
@@ -406,23 +406,23 @@ discard block |
||
| 406 | 406 | } else { |
| 407 | 407 | $faqObj->setGroups_read(); |
| 408 | 408 | } |
| 409 | - $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0); |
|
| 409 | + $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0); |
|
| 410 | 410 | $faqObj->setVar('question', $_POST['question']); |
| 411 | 411 | $faqObj->setVar('howdoi', $_POST['howdoi']); |
| 412 | 412 | $faqObj->setVar('diduno', $_POST['diduno']); |
| 413 | 413 | |
| 414 | - $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED); |
|
| 414 | + $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED); |
|
| 415 | 415 | |
| 416 | 416 | // If this SmartFAQ is offline and the user set this option to No |
| 417 | 417 | $offline = isset($_POST['offline']) ? $_POST['offline'] : 1; |
| 418 | 418 | if ((0 == $offline) && (_SF_STATUS_OFFLINE == $faqObj->status())) { |
| 419 | 419 | $faqObj->setVar('status', _SF_STATUS_PUBLISHED); |
| 420 | 420 | } |
| 421 | - $faqObj->setVar('weight', isset($_POST['weight']) ? (int)$_POST['weight'] : $faqObj->weight()); |
|
| 422 | - $faqObj->setVar('html', isset($_POST['html']) ? (int)$_POST['html'] : 0); |
|
| 423 | - $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int)$_POST['smiley'] : 0); |
|
| 424 | - $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int)$_POST['xcodes'] : 0); |
|
| 425 | - $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int)$_POST['cancomment'] : 0); |
|
| 421 | + $faqObj->setVar('weight', isset($_POST['weight']) ? (int) $_POST['weight'] : $faqObj->weight()); |
|
| 422 | + $faqObj->setVar('html', isset($_POST['html']) ? (int) $_POST['html'] : 0); |
|
| 423 | + $faqObj->setVar('smiley', isset($_POST['smiley']) ? (int) $_POST['smiley'] : 0); |
|
| 424 | + $faqObj->setVar('xcodes', isset($_POST['xcodes']) ? (int) $_POST['xcodes'] : 0); |
|
| 425 | + $faqObj->setVar('cancomment', isset($_POST['cancomment']) ? (int) $_POST['cancomment'] : 0); |
|
| 426 | 426 | $faqObj->setVar('modulelink', $_POST['modulelink']); |
| 427 | 427 | $faqObj->setVar('contextpage', $_POST['contextpage']); |
| 428 | 428 | $faqObj->setVar('exacturl', $_POST['exacturl']); |
@@ -506,13 +506,13 @@ discard block |
||
| 506 | 506 | |
| 507 | 507 | // Storing the FAQ |
| 508 | 508 | if (!$faqObj->store()) { |
| 509 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($faqObj->getErrors())); |
|
| 509 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($faqObj->getErrors())); |
|
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | // Storing the answer |
| 513 | 513 | $answerObj->setVar('faqid', $faqObj->faqid()); |
| 514 | 514 | if (!$answerObj->store()) { |
| 515 | - redirect_header('javascript:history.go(-1)', 3, $error_msg . sf_formatErrors($answerObj->getErrors())); |
|
| 515 | + redirect_header('javascript:history.go(-1)', 3, $error_msg.sf_formatErrors($answerObj->getErrors())); |
|
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | // Send notifications |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | $module_id = $xoopsModule->getVar('mid'); |
| 530 | 530 | $gpermHandler = xoops_getHandler('groupperm'); |
| 531 | 531 | |
| 532 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
|
| 533 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid; |
|
| 532 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0; |
|
| 533 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid; |
|
| 534 | 534 | |
| 535 | 535 | $faqObj = new sfFaq($faqid); |
| 536 | 536 | |
@@ -539,20 +539,20 @@ discard block |
||
| 539 | 539 | |
| 540 | 540 | if ($confirm) { |
| 541 | 541 | if (!$faqHandler->delete($faqObj)) { |
| 542 | - redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 542 | + redirect_header('faq.php', 2, _AM_SF_FAQ_DELETE_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | redirect_header('faq.php', 2, sprintf(_AM_SF_ARTISDELETED, $faqObj->question())); |
| 546 | 546 | } else { |
| 547 | 547 | // no confirm: show deletion condition |
| 548 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 548 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 549 | 549 | xoops_cp_header(); |
| 550 | 550 | xoops_confirm([ |
| 551 | 551 | 'op' => 'del', |
| 552 | 552 | 'faqid' => $faqObj->faqid(), |
| 553 | 553 | 'confirm' => 1, |
| 554 | 554 | 'name' => $faqObj->question() |
| 555 | - ], 'faq.php', _AM_SF_DELETETHISARTICLE . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 555 | + ], 'faq.php', _AM_SF_DELETETHISARTICLE." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
| 556 | 556 | xoops_cp_footer(); |
| 557 | 557 | } |
| 558 | 558 | |
@@ -566,10 +566,10 @@ discard block |
||
| 566 | 566 | |
| 567 | 567 | $adminObject->displayNavigation(basename(__FILE__)); |
| 568 | 568 | |
| 569 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 570 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 569 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 570 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 571 | 571 | |
| 572 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/displayfaqs.php'; |
|
| 572 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/displayfaqs.php'; |
|
| 573 | 573 | |
| 574 | 574 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
| 575 | 575 | if ($totalcategories > 0) { |
@@ -579,4 +579,4 @@ discard block |
||
| 579 | 579 | break; |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 582 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -120,9 +120,9 @@ discard block |
||
| 120 | 120 | * Add appendix |
| 121 | 121 | * |
| 122 | 122 | * @access public |
| 123 | - * @param $permName |
|
| 123 | + * @param string $permName |
|
| 124 | 124 | * @param $itemId |
| 125 | - * @param $itemName |
|
| 125 | + * @param string $itemName |
|
| 126 | 126 | */ |
| 127 | 127 | public function addAppendix($permName, $itemId, $itemName) |
| 128 | 128 | { |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * Constructor |
| 258 | 258 | * @param $caption |
| 259 | - * @param $name |
|
| 259 | + * @param string $name |
|
| 260 | 260 | * @param $groupId |
| 261 | 261 | * @param null $values |
| 262 | 262 | */ |
@@ -379,20 +379,20 @@ |
||
| 379 | 379 | $tree .= ' checked'; |
| 380 | 380 | } |
| 381 | 381 | $tree .= '>' |
| 382 | - . $option['name'] |
|
| 383 | - . '<input type="hidden" name="' |
|
| 384 | - . $this->getName() |
|
| 385 | - . '[parents][' |
|
| 386 | - . $option['id'] |
|
| 387 | - . ']" value="' |
|
| 388 | - . implode(':', $parentIds) |
|
| 389 | - . '"><input type="hidden" name="' |
|
| 390 | - . $this->getName() |
|
| 391 | - . '[itemname][' |
|
| 392 | - . $option['id'] |
|
| 393 | - . ']" value="' |
|
| 394 | - . htmlspecialchars($option['name']) |
|
| 395 | - . "\"><br>\n"; |
|
| 382 | + . $option['name'] |
|
| 383 | + . '<input type="hidden" name="' |
|
| 384 | + . $this->getName() |
|
| 385 | + . '[parents][' |
|
| 386 | + . $option['id'] |
|
| 387 | + . ']" value="' |
|
| 388 | + . implode(':', $parentIds) |
|
| 389 | + . '"><input type="hidden" name="' |
|
| 390 | + . $this->getName() |
|
| 391 | + . '[itemname][' |
|
| 392 | + . $option['id'] |
|
| 393 | + . ']" value="' |
|
| 394 | + . htmlspecialchars($option['name']) |
|
| 395 | + . "\"><br>\n"; |
|
| 396 | 396 | if (isset($option['children'])) { |
| 397 | 397 | foreach ($option['children'] as $child) { |
| 398 | 398 | array_push($parentIds, $option['id']); |
@@ -24,12 +24,12 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 26 | 26 | |
| 27 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelement.php'; |
|
| 28 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhidden.php'; |
|
| 29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formhiddentoken.php'; |
|
| 30 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formbutton.php'; |
|
| 31 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/formelementtray.php'; |
|
| 32 | -require_once XOOPS_ROOT_PATH . '/class/xoopsform/form.php'; |
|
| 27 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelement.php'; |
|
| 28 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhidden.php'; |
|
| 29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formhiddentoken.php'; |
|
| 30 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formbutton.php'; |
|
| 31 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/formelementtray.php'; |
|
| 32 | +require_once XOOPS_ROOT_PATH.'/class/xoopsform/form.php'; |
|
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * Renders a form for setting module specific group permissions |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | // $this->XoopsForm($title, 'groupperm_form', XOOPS_URL.'/modules/system/admin/groupperm.php', 'post'); GIJ |
| 82 | 82 | parent::__construct($title, 'groupperm_form', '', 'post'); |
| 83 | - $this->_modid = (int)$modid; |
|
| 83 | + $this->_modid = (int) $modid; |
|
| 84 | 84 | $this->_permName = $permname; |
| 85 | 85 | $this->_permDesc = $permdesc; |
| 86 | 86 | $this->addElement(new XoopsFormHidden('modid', $this->_modid)); |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | $gpermHandler = xoops_getHandler('groupperm'); |
| 161 | 161 | $memberHandler = xoops_getHandler('member'); |
| 162 | - $glist =& $memberHandler->getGroupList(); |
|
| 162 | + $glist = & $memberHandler->getGroupList(); |
|
| 163 | 163 | foreach (array_keys($glist) as $i) { |
| 164 | 164 | // get selected item id(s) for each group |
| 165 | 165 | $selected = $gpermHandler->getItemIds($this->_permName, $i, $this->_modid); |
| 166 | - $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms[' . $this->_permName . ']', $i, $selected); |
|
| 166 | + $ele = new MyXoopsGroupFormCheckBox($glist[$i], 'perms['.$this->_permName.']', $i, $selected); |
|
| 167 | 167 | $ele->setOptionTree($this->_itemTree); |
| 168 | 168 | |
| 169 | 169 | foreach ($this->_appendix as $key => $append) { |
@@ -190,18 +190,18 @@ discard block |
||
| 190 | 190 | $tray->addElement(new XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
| 191 | 191 | $this->addElement($tray); |
| 192 | 192 | |
| 193 | - $ret = '<h4>' . $this->getTitle() . '</h4>' . $this->_permDesc . '<br>'; |
|
| 194 | - $ret .= "<form name='" . $this->getName() . "' id='" . $this->getName() . "' action='" . $this->getAction() . "' method='" . $this->getMethod() . "'" . $this->getExtra() . ">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 195 | - $elements =& $this->getElements(); |
|
| 193 | + $ret = '<h4>'.$this->getTitle().'</h4>'.$this->_permDesc.'<br>'; |
|
| 194 | + $ret .= "<form name='".$this->getName()."' id='".$this->getName()."' action='".$this->getAction()."' method='".$this->getMethod()."'".$this->getExtra().">\n<table width='100%' class='outer' cellspacing='1'>\n"; |
|
| 195 | + $elements = & $this->getElements(); |
|
| 196 | 196 | foreach (array_keys($elements) as $i) { |
| 197 | 197 | if (!is_object($elements[$i])) { |
| 198 | 198 | $ret .= $elements[$i]; |
| 199 | 199 | } elseif (!$elements[$i]->isHidden()) { |
| 200 | - $ret .= "<tr valign='top' align='left'><td class='head'>" . $elements[$i]->getCaption(); |
|
| 200 | + $ret .= "<tr valign='top' align='left'><td class='head'>".$elements[$i]->getCaption(); |
|
| 201 | 201 | if ('' != $elements[$i]->getDescription()) { |
| 202 | - $ret .= '<br><br><span style="font-weight: normal;">' . $elements[$i]->getDescription() . '</span>'; |
|
| 202 | + $ret .= '<br><br><span style="font-weight: normal;">'.$elements[$i]->getDescription().'</span>'; |
|
| 203 | 203 | } |
| 204 | - $ret .= "</td>\n<td class='even'>\n" . $elements[$i]->render() . "\n</td></tr>\n"; |
|
| 204 | + $ret .= "</td>\n<td class='even'>\n".$elements[$i]->render()."\n</td></tr>\n"; |
|
| 205 | 205 | } else { |
| 206 | 206 | $ret .= $elements[$i]->render(); |
| 207 | 207 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function setOptionTree(&$optionTree) |
| 289 | 289 | { |
| 290 | - $this->_optionTree =& $optionTree; |
|
| 290 | + $this->_optionTree = & $optionTree; |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -312,34 +312,34 @@ discard block |
||
| 312 | 312 | $ret = ''; |
| 313 | 313 | |
| 314 | 314 | if (count($this->_appendix) > 0) { |
| 315 | - $ret .= '<table class="outer"><tr>'; |
|
| 315 | + $ret .= '<table class="outer"><tr>'; |
|
| 316 | 316 | $cols = 1; |
| 317 | 317 | foreach ($this->_appendix as $append) { |
| 318 | 318 | if ($cols > 4) { |
| 319 | - $ret .= '</tr><tr>'; |
|
| 319 | + $ret .= '</tr><tr>'; |
|
| 320 | 320 | $cols = 1; |
| 321 | 321 | } |
| 322 | 322 | $checked = $append['selected'] ? 'checked' : ''; |
| 323 | - $name = 'perms[' . $append['permname'] . ']'; |
|
| 323 | + $name = 'perms['.$append['permname'].']'; |
|
| 324 | 324 | $itemid = $append['itemid']; |
| 325 | 325 | $itemid = $append['itemid']; |
| 326 | - $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked>{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\"><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\"><br></td>"; |
|
| 326 | + $ret .= "<td class=\"odd\"><input type=\"checkbox\" name=\"{$name}[groups][$this->_groupId][$itemid]\" id=\"{$name}[groups][$this->_groupId][$itemid]\" value=\"1\" $checked>{$append['itemname']}<input type=\"hidden\" name=\"{$name}[parents][$itemid]\" value=\"\"><input type=\"hidden\" name=\"{$name}[itemname][$itemid]\" value=\"{$append['itemname']}\"><br></td>"; |
|
| 327 | 327 | ++$cols; |
| 328 | 328 | } |
| 329 | 329 | $ret .= '</tr></table>'; |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | - $ret .= '<table class="outer"><tr>'; |
|
| 332 | + $ret .= '<table class="outer"><tr>'; |
|
| 333 | 333 | $cols = 1; |
| 334 | 334 | foreach ($this->_optionTree[0]['children'] as $topitem) { |
| 335 | 335 | if ($cols > 4) { |
| 336 | - $ret .= '</tr><tr>'; |
|
| 336 | + $ret .= '</tr><tr>'; |
|
| 337 | 337 | $cols = 1; |
| 338 | 338 | } |
| 339 | 339 | $tree = '<td class="odd">'; |
| 340 | 340 | $prefix = ''; |
| 341 | 341 | $this->renderOptionTree($tree, $this->_optionTree[$topitem], $prefix); |
| 342 | - $ret .= $tree . '</td>'; |
|
| 342 | + $ret .= $tree.'</td>'; |
|
| 343 | 343 | ++$cols; |
| 344 | 344 | } |
| 345 | 345 | $ret .= '</tr></table>'; |
@@ -358,21 +358,21 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | private function renderOptionTree(&$tree, $option, $prefix, $parentIds = []) |
| 360 | 360 | { |
| 361 | - $tree .= $prefix . '<input type="checkbox" name="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" id="' . $this->getName() . '[groups][' . $this->_groupId . '][' . $option['id'] . ']" onclick="'; |
|
| 361 | + $tree .= $prefix.'<input type="checkbox" name="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" id="'.$this->getName().'[groups]['.$this->_groupId.']['.$option['id'].']" onclick="'; |
|
| 362 | 362 | // If there are parent elements, add javascript that will |
| 363 | 363 | // make them selecteded when this element is checked to make |
| 364 | 364 | // sure permissions to parent items are added as well. |
| 365 | 365 | foreach ($parentIds as $pid) { |
| 366 | - $parent_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $pid . ']'; |
|
| 367 | - $tree .= "var ele = xoopsGetElementById('" . $parent_ele . "'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
| 366 | + $parent_ele = $this->getName().'[groups]['.$this->_groupId.']['.$pid.']'; |
|
| 367 | + $tree .= "var ele = xoopsGetElementById('".$parent_ele."'); if (ele.checked !== true) {ele.checked = this.checked;}"; |
|
| 368 | 368 | } |
| 369 | 369 | // If there are child elements, add javascript that will |
| 370 | 370 | // make them unchecked when this element is unchecked to make |
| 371 | 371 | // sure permissions to child items are not added when there |
| 372 | 372 | // is no permission to this item. |
| 373 | 373 | foreach ($option['allchild'] as $cid) { |
| 374 | - $child_ele = $this->getName() . '[groups][' . $this->_groupId . '][' . $cid . ']'; |
|
| 375 | - $tree .= "var ele = xoopsGetElementById('" . $child_ele . "'); if (this.checked !== true) {ele.checked = false;}"; |
|
| 374 | + $child_ele = $this->getName().'[groups]['.$this->_groupId.']['.$cid.']'; |
|
| 375 | + $tree .= "var ele = xoopsGetElementById('".$child_ele."'); if (this.checked !== true) {ele.checked = false;}"; |
|
| 376 | 376 | } |
| 377 | 377 | $tree .= '" value="1"'; |
| 378 | 378 | if (null !== $this->_value && in_array($option['id'], $this->_value)) { |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | if (isset($option['children'])) { |
| 397 | 397 | foreach ($option['children'] as $child) { |
| 398 | 398 | array_push($parentIds, $option['id']); |
| 399 | - $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix . ' -', $parentIds); |
|
| 399 | + $this->renderOptionTree($tree, $this->_optionTree[$child], $prefix.' -', $parentIds); |
|
| 400 | 400 | } |
| 401 | 401 | } |
| 402 | 402 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param bool $showmenu |
|
| 29 | + * @param string $showmenu |
|
| 30 | 30 | * @param int $faqid |
| 31 | 31 | */ |
| 32 | 32 | function editfaq($showmenu = false, $faqid = -1) |
@@ -284,11 +284,11 @@ |
||
| 284 | 284 | $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
| 285 | 285 | xoops_cp_header(); |
| 286 | 286 | xoops_confirm([ |
| 287 | - 'op' => 'del', |
|
| 288 | - 'faqid' => $faqObj->faqid(), |
|
| 289 | - 'confirm' => 1, |
|
| 290 | - 'name' => $faqObj->question() |
|
| 291 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 287 | + 'op' => 'del', |
|
| 288 | + 'faqid' => $faqObj->faqid(), |
|
| 289 | + 'confirm' => 1, |
|
| 290 | + 'name' => $faqObj->question() |
|
| 291 | + ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 292 | 292 | xoops_cp_footer(); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -require_once __DIR__ . '/admin_header.php'; |
|
| 9 | +require_once __DIR__.'/admin_header.php'; |
|
| 10 | 10 | |
| 11 | 11 | // Creating the faq handler object |
| 12 | 12 | $faqHandler = sf_gethandler('faq'); |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // Where shall we start? |
| 26 | -$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0; |
|
| 26 | +$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @param bool $showmenu |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | global $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts; |
| 35 | 35 | |
| 36 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 36 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 37 | 37 | // If there is a parameter, and the id exists, retrieve data: we're editing a faq |
| 38 | 38 | if ($faqid != -1) { |
| 39 | 39 | // Creating the FAQ object |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | echo "<br>\n"; |
| 67 | 67 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 68 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . $collapsableBar_title . '</h3>'; |
|
| 68 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> ".$collapsableBar_title.'</h3>'; |
|
| 69 | 69 | echo "<div id='bottomtable'>"; |
| 70 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>'; |
|
| 70 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>'; |
|
| 71 | 71 | } else { |
| 72 | 72 | // there's no parameter, so we're adding a faq |
| 73 | 73 | $faqObj = $faqHandler->create(); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $button_caption = _AM_SF_CREATE; |
| 79 | 79 | |
| 80 | 80 | sf_collapsableBar('bottomtable', 'bottomtableicon'); |
| 81 | - echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_CREATEQUESTION . '</h3>'; |
|
| 81 | + echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_CREATEQUESTION.'</h3>'; |
|
| 82 | 82 | echo "<div id='bottomtable'>"; |
| 83 | 83 | } |
| 84 | 84 | $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true); |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $button_tray->addElement($butt_create); |
| 153 | 153 | |
| 154 | 154 | $butt_edit = new XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button'); |
| 155 | - $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=" . $faqid . "'\""); |
|
| 155 | + $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&faqid=".$faqid."'\""); |
|
| 156 | 156 | $button_tray->addElement($butt_edit); |
| 157 | 157 | |
| 158 | 158 | $butt_cancel = new XoopsFormButton('', '', _AM_SF_CANCEL, 'button'); |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | xoops_cp_header(); |
| 185 | 185 | |
| 186 | 186 | $adminObject->displayNavigation(basename(__FILE__)); |
| 187 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 187 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 188 | 188 | |
| 189 | 189 | editfaq(true, $faqid); |
| 190 | 190 | break; |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $uid = $xoopsUser->uid(); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1; |
|
| 205 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1; |
|
| 206 | 206 | |
| 207 | 207 | // Creating the FAQ |
| 208 | 208 | if ($faqid != -1) { |
@@ -213,9 +213,9 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | // Putting the values in the FAQ object |
| 215 | 215 | $faqObj->setGroups_read(isset($_POST['groups']) ? $_POST['groups'] : []); |
| 216 | - $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0); |
|
| 216 | + $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0); |
|
| 217 | 217 | $faqObj->setVar('question', $_POST['question']); |
| 218 | - $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED); |
|
| 218 | + $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED); |
|
| 219 | 219 | |
| 220 | 220 | $notifToDo = null; |
| 221 | 221 | |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | // Storing the FAQ |
| 249 | 249 | if (!$faqObj->store()) { |
| 250 | - redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . sf_formatErrors($faqObj->getErrors())); |
|
| 250 | + redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.sf_formatErrors($faqObj->getErrors())); |
|
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | // Send notifications |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | $module_id = $xoopsModule->getVar('mid'); |
| 266 | 266 | $gpermHandler = xoops_getHandler('groupperm'); |
| 267 | 267 | |
| 268 | - $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0; |
|
| 269 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid; |
|
| 268 | + $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0; |
|
| 269 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid; |
|
| 270 | 270 | |
| 271 | 271 | $faqObj = new sfFaq($faqid); |
| 272 | 272 | |
@@ -281,14 +281,14 @@ discard block |
||
| 281 | 281 | redirect_header('question.php', 2, sprintf(_AM_SF_QUESTIONISDELETED, $faqObj->question())); |
| 282 | 282 | } else { |
| 283 | 283 | // no confirm: show deletion condition |
| 284 | - $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 284 | + $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 285 | 285 | xoops_cp_header(); |
| 286 | 286 | xoops_confirm([ |
| 287 | 287 | 'op' => 'del', |
| 288 | 288 | 'faqid' => $faqObj->faqid(), |
| 289 | 289 | 'confirm' => 1, |
| 290 | 290 | 'name' => $faqObj->question() |
| 291 | - ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE); |
|
| 291 | + ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE); |
|
| 292 | 292 | xoops_cp_footer(); |
| 293 | 293 | } |
| 294 | 294 | |
@@ -301,8 +301,8 @@ discard block |
||
| 301 | 301 | xoops_cp_header(); |
| 302 | 302 | $adminObject->displayNavigation(basename(__FILE__)); |
| 303 | 303 | |
| 304 | - require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
| 305 | - require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 304 | + require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
| 305 | + require_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 306 | 306 | |
| 307 | 307 | global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartModuleConfig; |
| 308 | 308 | |
@@ -310,9 +310,9 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | sf_collapsableBar('toptable', 'toptableicon'); |
| 312 | 312 | |
| 313 | - echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a> " . _AM_SF_OPENED_TITLE . '</h3>'; |
|
| 313 | + echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a> "._AM_SF_OPENED_TITLE.'</h3>'; |
|
| 314 | 314 | echo "<div id='toptable'>"; |
| 315 | - echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>'; |
|
| 315 | + echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>'; |
|
| 316 | 316 | |
| 317 | 317 | // Get the total number of published FAQs |
| 318 | 318 | $totalfaqs = $faqHandler->getFaqsCount(-1, [_SF_STATUS_OPENED]); |
@@ -322,14 +322,14 @@ discard block |
||
| 322 | 322 | $allCats = $categoryHandler->getObjects(null, true); |
| 323 | 323 | echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>"; |
| 324 | 324 | echo '<tr>'; |
| 325 | - echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>'; |
|
| 326 | - echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>'; |
|
| 327 | - echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>'; |
|
| 325 | + echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>'; |
|
| 326 | + echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>'; |
|
| 327 | + echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>'; |
|
| 328 | 328 | |
| 329 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>'; |
|
| 329 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>'; |
|
| 330 | 330 | |
| 331 | - echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>'; |
|
| 332 | - echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>'; |
|
| 331 | + echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>'; |
|
| 332 | + echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>'; |
|
| 333 | 333 | echo '</tr>'; |
| 334 | 334 | //var_dump( $faqsObj); |
| 335 | 335 | if ($totalfaqs > 0) { |
@@ -337,33 +337,33 @@ discard block |
||
| 337 | 337 | foreach (array_keys($faqsObj) as $i) { |
| 338 | 338 | $categoryObj = $allCats[$faqsObj[$i]->categoryid()]; |
| 339 | 339 | |
| 340 | - $modify = "<a href='question.php?op=mod&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>"; |
|
| 341 | - $delete = "<a href='question.php?op=del&faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>"; |
|
| 340 | + $modify = "<a href='question.php?op=mod&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>"; |
|
| 341 | + $delete = "<a href='question.php?op=del&faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>"; |
|
| 342 | 342 | |
| 343 | 343 | $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']); |
| 344 | 344 | |
| 345 | 345 | echo '<tr>'; |
| 346 | - echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>'; |
|
| 347 | - echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>'; |
|
| 348 | - echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/answer.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>'; |
|
| 346 | + echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>'; |
|
| 347 | + echo "<td class='even' align='left'>".$categoryObj->name().'</td>'; |
|
| 348 | + echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/answer.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>'; |
|
| 349 | 349 | |
| 350 | - echo "<td class='even' align='center'>" . $requester . '</td>'; |
|
| 350 | + echo "<td class='even' align='center'>".$requester.'</td>'; |
|
| 351 | 351 | |
| 352 | - echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>'; |
|
| 352 | + echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>'; |
|
| 353 | 353 | echo "<td class='even' align='center'> $modify $delete </td>"; |
| 354 | 354 | echo '</tr>'; |
| 355 | 355 | } |
| 356 | 356 | } else { |
| 357 | 357 | $faqid = -1; |
| 358 | 358 | echo '<tr>'; |
| 359 | - echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>'; |
|
| 359 | + echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>'; |
|
| 360 | 360 | echo '</tr>'; |
| 361 | 361 | } |
| 362 | 362 | echo "</table>\n"; |
| 363 | 363 | echo "<br>\n"; |
| 364 | 364 | |
| 365 | 365 | $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq'); |
| 366 | - echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'; |
|
| 366 | + echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'; |
|
| 367 | 367 | echo '</div>'; |
| 368 | 368 | |
| 369 | 369 | $totalcategories = $categoryHandler->getCategoriesCount(-1); |
@@ -374,4 +374,4 @@ discard block |
||
| 374 | 374 | break; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | -require_once __DIR__ . '/admin_footer.php'; |
|
| 377 | +require_once __DIR__.'/admin_footer.php'; |
|
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * constructor |
| 30 | - * @param null $id |
|
| 30 | + * @param integer $id |
|
| 31 | 31 | */ |
| 32 | 32 | public function __construct($id = null) |
| 33 | 33 | { |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | * create a new answer |
| 369 | 369 | * |
| 370 | 370 | * @param bool $isNew flag the new objects as "new"? |
| 371 | - * @return object sfAnswer |
|
| 371 | + * @return sfAnswer sfAnswer |
|
| 372 | 372 | */ |
| 373 | 373 | public function create($isNew = true) |
| 374 | 374 | { |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | /** |
| 411 | 411 | * insert a new answer in the database |
| 412 | 412 | * |
| 413 | - * @param XoopsObject $answerObj reference to the <a href='psi_element://sfAnswer'>sfAnswer</a> object |
|
| 413 | + * @param sfAnswer $answerObj reference to the <a href='psi_element://sfAnswer'>sfAnswer</a> object |
|
| 414 | 414 | * @param bool $force |
| 415 | 415 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 416 | 416 | */ |
@@ -91,9 +91,9 @@ discard block |
||
| 91 | 91 | if (!$attach_key) { |
| 92 | 92 | return false; |
| 93 | 93 | } |
| 94 | - $this->attachment_array[(string)$attach_key]['num_download']++; |
|
| 94 | + $this->attachment_array[(string) $attach_key]['num_download']++; |
|
| 95 | 95 | |
| 96 | - return $this->attachment_array[(string)$attach_key]['num_download']; |
|
| 96 | + return $this->attachment_array[(string) $attach_key]['num_download']; |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $attachment_save = base64_encode(serialize($this->attachment_array)); |
| 107 | 107 | } |
| 108 | 108 | $this->setVar('attachment', $attachment_save); |
| 109 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid'); |
|
| 109 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid'); |
|
| 110 | 110 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) { |
| 111 | 111 | //xoops_error($GLOBALS["xoopsDB"]->error()); |
| 112 | 112 | return false; |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | foreach ($attach_old as $key => $attach) { |
| 140 | 140 | if (in_array($key, $attach_array)) { |
| 141 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']); |
|
| 142 | - @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails |
|
| 141 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']); |
|
| 142 | + @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails |
|
| 143 | 143 | continue; |
| 144 | 144 | } |
| 145 | 145 | $this->attachment_array[$key] = $attach; |
@@ -165,12 +165,12 @@ discard block |
||
| 165 | 165 | static $counter = 0; |
| 166 | 166 | $this->attachment_array = $this->getAttachment(); |
| 167 | 167 | if ($name_saved) { |
| 168 | - $key = (string)(time() + ($counter++)); |
|
| 168 | + $key = (string) (time()+($counter++)); |
|
| 169 | 169 | $this->attachment_array[$key] = [ |
| 170 | 170 | 'name_saved' => $name_saved, |
| 171 | 171 | 'name_display' => isset($name_display) ? $name_display : $name_saved, |
| 172 | 172 | 'mimetype' => $mimetype, |
| 173 | - 'num_download' => isset($num_download) ? (int)$num_download : 0 |
|
| 173 | + 'num_download' => isset($num_download) ? (int) $num_download : 0 |
|
| 174 | 174 | ]; |
| 175 | 175 | } |
| 176 | 176 | $attachment_save = null; |
@@ -196,24 +196,24 @@ discard block |
||
| 196 | 196 | if (is_array($attachments) && count($attachments) > 0) { |
| 197 | 197 | $iconHandler = sf_getIconHandler(); |
| 198 | 198 | $mime_path = $iconHandler->getPath('mime'); |
| 199 | - require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php'; |
|
| 199 | + require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php'; |
|
| 200 | 200 | $image_extensions = ['jpg', 'jpeg', 'gif', 'png', 'bmp']; // need improve !!! |
| 201 | - $post_attachment .= '<br><strong>' . _MD_ATTACHMENT . '</strong>:'; |
|
| 201 | + $post_attachment .= '<br><strong>'._MD_ATTACHMENT.'</strong>:'; |
|
| 202 | 202 | $post_attachment .= '<br><hr size="1" noshade="noshade"><br>'; |
| 203 | 203 | foreach ($attachments as $key => $att) { |
| 204 | 204 | $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.'); |
| 205 | 205 | $filetype = $file_extension; |
| 206 | - if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) { |
|
| 207 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif'; |
|
| 206 | + if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) { |
|
| 207 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif'; |
|
| 208 | 208 | } else { |
| 209 | - $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif'; |
|
| 209 | + $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif'; |
|
| 210 | 210 | } |
| 211 | - $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']); |
|
| 212 | - $file_size = number_format($file_size / 1024, 2) . ' KB'; |
|
| 211 | + $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']); |
|
| 212 | + $file_size = number_format($file_size / 1024, 2).' KB'; |
|
| 213 | 213 | if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) { |
| 214 | - $post_attachment .= '<br><img src="' . $icon_filetype . '" alt="' . $filetype . '"><strong> ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>'; |
|
| 215 | - $post_attachment .= '<br>' . sf_attachmentImage($att['name_saved']); |
|
| 216 | - $isDisplayed = true; |
|
| 214 | + $post_attachment .= '<br><img src="'.$icon_filetype.'" alt="'.$filetype.'"><strong> '.$att['name_display'].'</strong> <small>('.$file_size.')</small>'; |
|
| 215 | + $post_attachment .= '<br>'.sf_attachmentImage($att['name_saved']); |
|
| 216 | + $isDisplayed = true; |
|
| 217 | 217 | } else { |
| 218 | 218 | global $xoopsUser; |
| 219 | 219 | if (empty($xoopsModuleConfig['show_userattach'])) { |
@@ -370,9 +370,9 @@ discard block |
||
| 370 | 370 | $tags = []; |
| 371 | 371 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 372 | 372 | $tags['FAQ_NAME'] = $faqObj->question(); |
| 373 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid(); |
|
| 373 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid(); |
|
| 374 | 374 | $tags['CATEGORY_NAME'] = $faqObj->getCategoryName(); |
| 375 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid(); |
|
| 375 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid(); |
|
| 376 | 376 | $tags['FAQ_QUESTION'] = $faqObj->question(); |
| 377 | 377 | |
| 378 | 378 | // TODO : Not sure about the 'formpreview' ... |
@@ -429,8 +429,8 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function get($id = null, $fields = null) |
| 431 | 431 | { |
| 432 | - if ((int)$id > 0) { |
|
| 433 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers') . ' WHERE answerid=' . $id; |
|
| 432 | + if ((int) $id > 0) { |
|
| 433 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers').' WHERE answerid='.$id; |
|
| 434 | 434 | if (!$result = $this->db->query($sql)) { |
| 435 | 435 | return false; |
| 436 | 436 | } |
@@ -558,11 +558,11 @@ discard block |
||
| 558 | 558 | { |
| 559 | 559 | $ret = []; |
| 560 | 560 | $limit = $start = 0; |
| 561 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 561 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 562 | 562 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 563 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 563 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 564 | 564 | if ('' != $criteria->getSort()) { |
| 565 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 565 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 566 | 566 | } |
| 567 | 567 | $limit = $criteria->getLimit(); |
| 568 | 568 | $start = $criteria->getStart(); |
@@ -576,9 +576,9 @@ discard block |
||
| 576 | 576 | $answer = new sfAnswer(); |
| 577 | 577 | $answer->assignVars($myrow); |
| 578 | 578 | if (!$id_as_key) { |
| 579 | - $ret[] =& $answer; |
|
| 579 | + $ret[] = & $answer; |
|
| 580 | 580 | } else { |
| 581 | - $ret[$myrow['answerid']] =& $answer; |
|
| 581 | + $ret[$myrow['answerid']] = & $answer; |
|
| 582 | 582 | } |
| 583 | 583 | unset($answer); |
| 584 | 584 | } |
@@ -659,9 +659,9 @@ discard block |
||
| 659 | 659 | */ |
| 660 | 660 | public function getCount(CriteriaElement $criteria = null) |
| 661 | 661 | { |
| 662 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 662 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 663 | 663 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 664 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 664 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 665 | 665 | } |
| 666 | 666 | $result = $this->db->query($sql); |
| 667 | 667 | if (!$result) { |
@@ -680,10 +680,10 @@ discard block |
||
| 680 | 680 | */ |
| 681 | 681 | public function getCountByFAQ($criteria = null) |
| 682 | 682 | { |
| 683 | - $sql = 'SELECT faqid, COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 683 | + $sql = 'SELECT faqid, COUNT(*) FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 684 | 684 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 685 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 686 | - $sql .= ' ' . $criteria->getGroupby(); |
|
| 685 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 686 | + $sql .= ' '.$criteria->getGroupby(); |
|
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | //echo "<br>$sql<br>"; |
@@ -710,9 +710,9 @@ discard block |
||
| 710 | 710 | */ |
| 711 | 711 | public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false) |
| 712 | 712 | { |
| 713 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 713 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_answers'); |
|
| 714 | 714 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 715 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 715 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 716 | 716 | } |
| 717 | 717 | if (!$this->db->query($sql)) { |
| 718 | 718 | return false; |
@@ -732,10 +732,10 @@ discard block |
||
| 732 | 732 | */ |
| 733 | 733 | public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false) |
| 734 | 734 | { |
| 735 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
| 736 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_answers') . ' SET ' . $set_clause; |
|
| 735 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
| 736 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_answers').' SET '.$set_clause; |
|
| 737 | 737 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 738 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 738 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 739 | 739 | } |
| 740 | 740 | //echo "<br>" . $sql . "<br>"; |
| 741 | 741 | if (!$this->db->queryF($sql)) { |
@@ -752,8 +752,8 @@ discard block |
||
| 752 | 752 | public function getLastPublishedByFaq($faqids) |
| 753 | 753 | { |
| 754 | 754 | $ret = []; |
| 755 | - $sql = 'SELECT faqid, answer, uid, datesub FROM ' . $this->db->prefix('smartfaq_answers') . ' |
|
| 756 | - WHERE faqid IN (' . implode(',', $faqids) . ') AND status = ' . _SF_AN_STATUS_APPROVED . ' GROUP BY faqid'; |
|
| 755 | + $sql = 'SELECT faqid, answer, uid, datesub FROM '.$this->db->prefix('smartfaq_answers').' |
|
| 756 | + WHERE faqid IN (' . implode(',', $faqids).') AND status = '._SF_AN_STATUS_APPROVED.' GROUP BY faqid'; |
|
| 757 | 757 | $result = $this->db->query($sql); |
| 758 | 758 | if (!$result) { |
| 759 | 759 | return $ret; |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | while ($row = $this->db->fetchArray($result)) { |
| 762 | 762 | $answer = new sfAnswer(); |
| 763 | 763 | $answer->assignVars($row); |
| 764 | - $ret[$row['faqid']] =& $answer; |
|
| 764 | + $ret[$row['faqid']] = & $answer; |
|
| 765 | 765 | unset($answer); |
| 766 | 766 | } |
| 767 | 767 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
| 170 | - * @param $field |
|
| 170 | + * @param string $field |
|
| 171 | 171 | * @return bool |
| 172 | 172 | */ |
| 173 | 173 | public function fieldExists($field) |
@@ -628,7 +628,7 @@ discard block |
||
| 628 | 628 | /** |
| 629 | 629 | * Use to update a table |
| 630 | 630 | * |
| 631 | - * @param object $table {@link SmartDbTable} that will be updated |
|
| 631 | + * @param SmartDbTable $table {@link SmartDbTable} that will be updated |
|
| 632 | 632 | * |
| 633 | 633 | * @see SmartDbTable |
| 634 | 634 | * |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | //Verifies that a MySQL table exists |
| 17 | 17 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection(); |
| 18 | 18 | $realname = $xoopsDB->prefix($table); |
| 19 | - $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME; |
|
| 19 | + $sql = 'SHOW TABLES FROM '.XOOPS_DB_NAME; |
|
| 20 | 20 | $ret = $xoopsDB->queryF($sql); |
| 21 | 21 | while (list($m_table) = $xoopsDB->fetchRow($ret)) { |
| 22 | 22 | if ($m_table == $realname) { |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | * Include the language constants for the SmartObjectDBUpdater |
| 54 | 54 | */ |
| 55 | 55 | global $xoopsConfig; |
| 56 | -$common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/' . $xoopsConfig['language'] . '/smartdbupdater.php'; |
|
| 56 | +$common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/'.$xoopsConfig['language'].'/smartdbupdater.php'; |
|
| 57 | 57 | if (!file_exists($common_file)) { |
| 58 | - $common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/english/smartdbupdater.php'; |
|
| 58 | + $common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/english/smartdbupdater.php'; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | include $common_file; |
@@ -152,14 +152,14 @@ discard block |
||
| 152 | 152 | public function getExistingFieldsArray() |
| 153 | 153 | { |
| 154 | 154 | global $xoopsDB; |
| 155 | - $result = $xoopsDB->queryF('SHOW COLUMNS FROM ' . $this->name()); |
|
| 155 | + $result = $xoopsDB->queryF('SHOW COLUMNS FROM '.$this->name()); |
|
| 156 | 156 | while ($existing_field = $xoopsDB->fetchArray($result)) { |
| 157 | 157 | $fields[$existing_field['Field']] = $existing_field['Type']; |
| 158 | 158 | if ('YES' !== $existing_field['Null']) { |
| 159 | 159 | $fields[$existing_field['Field']] .= ' NOT NULL'; |
| 160 | 160 | } |
| 161 | 161 | if ($existing_field['Extra']) { |
| 162 | - $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra']; |
|
| 162 | + $fields[$existing_field['Field']] .= ' '.$existing_field['Extra']; |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | |
@@ -235,9 +235,9 @@ discard block |
||
| 235 | 235 | $query = sprintf('INSERT INTO "%s" VALUES ("%s")', $this->name(), $data); |
| 236 | 236 | $ret = $xoopsDB->queryF($query); |
| 237 | 237 | if (!$ret) { |
| 238 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>'; |
|
| 238 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>'; |
|
| 239 | 239 | } else { |
| 240 | - echo ' ' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>'; |
|
| 240 | + echo ' '.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>'; |
|
| 241 | 241 | } |
| 242 | 242 | } |
| 243 | 243 | |
@@ -402,9 +402,9 @@ discard block |
||
| 402 | 402 | |
| 403 | 403 | $ret = $xoopsDB->queryF($query); |
| 404 | 404 | if (!$ret) { |
| 405 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 405 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 406 | 406 | } else { |
| 407 | - echo ' ' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>'; |
|
| 407 | + echo ' '.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>'; |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | return $ret; |
@@ -423,11 +423,11 @@ discard block |
||
| 423 | 423 | $query = sprintf('DROP TABLE %s', $this->name()); |
| 424 | 424 | $ret = $xoopsDB->queryF($query); |
| 425 | 425 | if (!$ret) { |
| 426 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '<br>'; |
|
| 426 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).'<br>'; |
|
| 427 | 427 | |
| 428 | 428 | return false; |
| 429 | 429 | } else { |
| 430 | - echo ' ' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>'; |
|
| 430 | + echo ' '.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>'; |
|
| 431 | 431 | |
| 432 | 432 | return true; |
| 433 | 433 | } |
@@ -451,9 +451,9 @@ discard block |
||
| 451 | 451 | $ret = $ret && $xoopsDB->queryF($query); |
| 452 | 452 | if ($alteredField['showerror']) { |
| 453 | 453 | if (!$ret) { |
| 454 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '<br>'; |
|
| 454 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).'<br>'; |
|
| 455 | 455 | } else { |
| 456 | - echo ' ' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>'; |
|
| 456 | + echo ' '.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>'; |
|
| 457 | 457 | } |
| 458 | 458 | } |
| 459 | 459 | } |
@@ -477,9 +477,9 @@ discard block |
||
| 477 | 477 | //echo $query; |
| 478 | 478 | $ret = $ret && $xoopsDB->queryF($query); |
| 479 | 479 | if (!$ret) { |
| 480 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>'; |
|
| 480 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>'; |
|
| 481 | 481 | } else { |
| 482 | - echo ' ' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>'; |
|
| 482 | + echo ' '.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>'; |
|
| 483 | 483 | } |
| 484 | 484 | } |
| 485 | 485 | |
@@ -502,9 +502,9 @@ discard block |
||
| 502 | 502 | $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']); |
| 503 | 503 | $ret = $ret && $xoopsDB->queryF($query); |
| 504 | 504 | if (!$ret) { |
| 505 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 505 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 506 | 506 | } else { |
| 507 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 507 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 508 | 508 | } |
| 509 | 509 | } |
| 510 | 510 | |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | //echo $query."<br>"; |
| 528 | 528 | $ret = $ret && $xoopsDB->queryF($query); |
| 529 | 529 | if (!$ret) { |
| 530 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>'; |
|
| 530 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>'; |
|
| 531 | 531 | } else { |
| 532 | - echo ' ' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>'; |
|
| 532 | + echo ' '.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>'; |
|
| 533 | 533 | } |
| 534 | 534 | } |
| 535 | 535 | |
@@ -553,9 +553,9 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | $ret = $ret && $xoopsDB->queryF($query); |
| 555 | 555 | if (!$ret) { |
| 556 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br>'; |
|
| 556 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).'<br>'; |
|
| 557 | 557 | } else { |
| 558 | - echo ' ' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>'; |
|
| 558 | + echo ' '.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>'; |
|
| 559 | 559 | } |
| 560 | 560 | } |
| 561 | 561 | |
@@ -624,11 +624,11 @@ discard block |
||
| 624 | 624 | $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to); |
| 625 | 625 | $ret = $xoopsDB->queryF($query); |
| 626 | 626 | if (!$ret) { |
| 627 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>'; |
|
| 627 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>'; |
|
| 628 | 628 | |
| 629 | 629 | return false; |
| 630 | 630 | } else { |
| 631 | - echo ' ' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>'; |
|
| 631 | + echo ' '.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>'; |
|
| 632 | 632 | |
| 633 | 633 | return true; |
| 634 | 634 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * Constructor |
| 26 | 26 | * |
| 27 | 27 | * @param string $uploadDir |
| 28 | - * @param array|int $allowedMimeTypes |
|
| 28 | + * @param integer $allowedMimeTypes |
|
| 29 | 29 | * @param int $maxFileSize |
| 30 | 30 | * @param int $maxWidth |
| 31 | 31 | * @param int $maxHeight |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 13 | 13 | |
| 14 | -require_once XOOPS_ROOT_PATH . '/class/uploader.php'; |
|
| 14 | +require_once XOOPS_ROOT_PATH.'/class/uploader.php'; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Class sfUploader |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | |
| 510 | 510 | /** |
| 511 | 511 | * @param string $url |
| 512 | - * @return mixed|string |
|
| 512 | + * @return string |
|
| 513 | 513 | */ |
| 514 | 514 | function sf_getxoopslink($url = '') |
| 515 | 515 | { |
@@ -582,7 +582,7 @@ discard block |
||
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | /** |
| 585 | - * @param $name |
|
| 585 | + * @param string $name |
|
| 586 | 586 | * @param bool $optional |
| 587 | 587 | * @return bool |
| 588 | 588 | */ |
@@ -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 ($GLOBALS['xoopsDB']->getRowsNum($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 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | function smartfaq_com_update($faq_id, $total_num) |
| 12 | 12 | { |
| 13 | 13 | $db = XoopsDatabaseFactory::getDatabaseConnection(); |
| 14 | - $sql = 'UPDATE ' . $db->prefix('smartfaq_faq') . ' SET comments = ' . $total_num . ' WHERE faqid = ' . $faq_id; |
|
| 14 | + $sql = 'UPDATE '.$db->prefix('smartfaq_faq').' SET comments = '.$total_num.' WHERE faqid = '.$faq_id; |
|
| 15 | 15 | $db->query($sql); |
| 16 | 16 | } |
| 17 | 17 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /** |
| 246 | - * @return mixed |
|
| 246 | + * @return integer |
|
| 247 | 247 | */ |
| 248 | 248 | public function uid() |
| 249 | 249 | { |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | /** |
| 755 | 755 | * insert a new faq in the database |
| 756 | 756 | * |
| 757 | - * @param XoopsObject $faq reference to the {@link sfFaq} object |
|
| 757 | + * @param sfFaq $faq reference to the {@link sfFaq} object |
|
| 758 | 758 | * @param bool $force |
| 759 | 759 | * @return bool FALSE if failed, TRUE if already present and unchanged or successful |
| 760 | 760 | */ |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | * @param string $order |
| 1144 | 1144 | * @param string $notNullFields |
| 1145 | 1145 | * @param bool $asobject |
| 1146 | - * @param null $otherCriteria |
|
| 1146 | + * @param null|CriteriaCompo $otherCriteria |
|
| 1147 | 1147 | * @return array |
| 1148 | 1148 | */ |
| 1149 | 1149 | public function getFaqs( |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | if ($faq->isNew()) { |
| 770 | 770 | $sql = sprintf( |
| 771 | 771 | 'INSERT INTO "%s" (faqid, categoryid, question, howdoi, diduno, uid, datesub, `status`, counter, weight, html, smiley, xcodes, cancomment, comments, notifypub, modulelink, contextpage, exacturl, partialview) VALUES (NULL, %u, %s, %s, %s, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %s, %s, %u, %u)', |
| 772 | - $this->db->prefix('smartfaq_faq'), |
|
| 772 | + $this->db->prefix('smartfaq_faq'), |
|
| 773 | 773 | $categoryid, |
| 774 | 774 | $this->db->quoteString($question), |
| 775 | 775 | $this->db->quoteString($howdoi), |
@@ -785,7 +785,7 @@ discard block |
||
| 785 | 785 | $cancomment, |
| 786 | 786 | $comments, |
| 787 | 787 | $notifypub, |
| 788 | - $this->db->quoteString($modulelink), |
|
| 788 | + $this->db->quoteString($modulelink), |
|
| 789 | 789 | $this->db->quoteString($contextpage), |
| 790 | 790 | $exacturl, |
| 791 | 791 | $partialview |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | } else { |
| 794 | 794 | $sql = sprintf( |
| 795 | 795 | 'UPDATE "%s" SET categoryid = "%u", question = "%s", howdoi = "%s", diduno = "%s", uid = "%u", datesub = "%u", `status` = "%u", counter = "%u", weight = "%u", html = "%u", smiley = "%u", xcodes = "%u", cancomment = "%u", comments = "%u", notifypub = "%u", modulelink = "%s", contextpage = "%s", exacturl = "%u", partialview = "%u" WHERE faqid = "%u"', |
| 796 | - $this->db->prefix('smartfaq_faq'), |
|
| 796 | + $this->db->prefix('smartfaq_faq'), |
|
| 797 | 797 | $categoryid, |
| 798 | 798 | $this->db->quoteString($question), |
| 799 | 799 | $this->db->quoteString($howdoi), |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | $cancomment, |
| 810 | 810 | $comments, |
| 811 | 811 | $notifypub, |
| 812 | - $this->db->quoteString($modulelink), |
|
| 812 | + $this->db->quoteString($modulelink), |
|
| 813 | 813 | $this->db->quoteString($contextpage), |
| 814 | 814 | $exacturl, |
| 815 | 815 | $partialview, |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | // defined('XOOPS_ROOT_PATH') || exit('Restricted access.'); |
| 10 | 10 | |
| 11 | -require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
|
| 11 | +require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
|
| 12 | 12 | |
| 13 | 13 | // FAQ status |
| 14 | 14 | define('_SF_STATUS_NOTSET', -1); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | if (null !== $id) { |
| 106 | 106 | $faqHandler = new sfFaqHandler($this->db); |
| 107 | - $faq =& $faqHandler->get($id); |
|
| 107 | + $faq = & $faqHandler->get($id); |
|
| 108 | 108 | foreach ($faq->vars as $k => $v) { |
| 109 | 109 | $this->assignVar($k, $v['value']); |
| 110 | 110 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function checkPermission() |
| 130 | 130 | { |
| 131 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 131 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 132 | 132 | |
| 133 | 133 | $userIsAdmin = sf_userIsAdmin(); |
| 134 | 134 | if ($userIsAdmin) { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | if (0 != $maxLength) { |
| 205 | 205 | if (!XOOPS_USE_MULTIBYTES) { |
| 206 | 206 | if (strlen($ret) >= $maxLength) { |
| 207 | - $ret = substr($ret, 0, $maxLength - 1) . '...'; |
|
| 207 | + $ret = substr($ret, 0, $maxLength-1).'...'; |
|
| 208 | 208 | } |
| 209 | 209 | } |
| 210 | 210 | } |
@@ -396,14 +396,14 @@ discard block |
||
| 396 | 396 | $theAnswers = $answerHandler->getAllAnswers($this->faqid(), _SF_AN_STATUS_APPROVED, 1, 0); |
| 397 | 397 | //echo "test"; |
| 398 | 398 | //exit; |
| 399 | - $this->answer =& $theAnswers[0]; |
|
| 399 | + $this->answer = & $theAnswers[0]; |
|
| 400 | 400 | break; |
| 401 | 401 | |
| 402 | 402 | case _SF_STATUS_ANSWERED: |
| 403 | 403 | $theAnswers = $answerHandler->getAllAnswers($this->faqid(), _SF_AN_STATUS_PROPOSED, 1, 0); |
| 404 | 404 | //echo "test"; |
| 405 | 405 | //exit; |
| 406 | - $this->answer =& $theAnswers[0]; |
|
| 406 | + $this->answer = & $theAnswers[0]; |
|
| 407 | 407 | break; |
| 408 | 408 | |
| 409 | 409 | case _SF_STATUS_PUBLISHED: |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $tags['MODULE_NAME'] = $myts->displayTarea($smartModule->getVar('name')); |
| 490 | 490 | $tags['FAQ_NAME'] = $this->question(); |
| 491 | 491 | $tags['CATEGORY_NAME'] = $this->getCategoryName(); |
| 492 | - $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid(); |
|
| 492 | + $tags['CATEGORY_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid(); |
|
| 493 | 493 | $tags['FAQ_QUESTION'] = $this->question(); |
| 494 | 494 | $answerObj = $this->answer(); |
| 495 | 495 | if (is_object($answerObj)) { |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | foreach ($notifications as $notification) { |
| 502 | 502 | switch ($notification) { |
| 503 | 503 | case _SF_NOT_FAQ_PUBLISHED: |
| 504 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $this->faqid(); |
|
| 504 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$this->faqid(); |
|
| 505 | 505 | |
| 506 | 506 | $notificationHandler->triggerEvent('global_faq', 0, 'published', $tags); |
| 507 | 507 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'published', $tags); |
@@ -509,20 +509,20 @@ discard block |
||
| 509 | 509 | break; |
| 510 | 510 | |
| 511 | 511 | case _SF_NOT_FAQ_SUBMITTED: |
| 512 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/faq.php?faqid=' . $this->faqid(); |
|
| 512 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/faq.php?faqid='.$this->faqid(); |
|
| 513 | 513 | $notificationHandler->triggerEvent('global_faq', 0, 'submitted', $tags); |
| 514 | 514 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'submitted', $tags); |
| 515 | 515 | break; |
| 516 | 516 | |
| 517 | 517 | case _SF_NOT_QUESTION_PUBLISHED: |
| 518 | - $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/answer.php?faqid=' . $this->faqid(); |
|
| 518 | + $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/answer.php?faqid='.$this->faqid(); |
|
| 519 | 519 | $notificationHandler->triggerEvent('global_question', 0, 'published', $tags); |
| 520 | 520 | $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'published', $tags); |
| 521 | 521 | $notificationHandler->triggerEvent('question', $this->faqid(), 'approved', $tags); |
| 522 | 522 | break; |
| 523 | 523 | |
| 524 | 524 | case _SF_NOT_QUESTION_SUBMITTED: |
| 525 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/question.php?op=mod&faqid=' . $this->faqid(); |
|
| 525 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/question.php?op=mod&faqid='.$this->faqid(); |
|
| 526 | 526 | $notificationHandler->triggerEvent('global_question', 0, 'submitted', $tags); |
| 527 | 527 | $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'submitted', $tags); |
| 528 | 528 | break; |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | break; |
| 533 | 533 | |
| 534 | 534 | case _SF_NOT_NEW_ANSWER_PROPOSED: |
| 535 | - $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/answer.php?op=mod&faqid=' . $this->faqid(); |
|
| 535 | + $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/answer.php?op=mod&faqid='.$this->faqid(); |
|
| 536 | 536 | $notificationHandler->triggerEvent('global_faq', 0, 'answer_proposed', $tags); |
| 537 | 537 | $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'answer_proposed', $tags); |
| 538 | 538 | break; |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $text = _MD_SF_FAQCOMEFROM; |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - return $text . $xoopsConfig['sitename'] . ' : <a href=' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '>' . XOOPS_URL . '/modules/smartfaq/faq.php?faqid=' . $this->faqid() . '</a>'; |
|
| 649 | + return $text.$xoopsConfig['sitename'].' : <a href='.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'>'.XOOPS_URL.'/modules/smartfaq/faq.php?faqid='.$this->faqid().'</a>'; |
|
| 650 | 650 | } |
| 651 | 651 | |
| 652 | 652 | /** |
@@ -658,16 +658,16 @@ discard block |
||
| 658 | 658 | public function toArray($faq = [], $category = null, $linkInQuestion = true) |
| 659 | 659 | { |
| 660 | 660 | global $xoopsModuleConfig; |
| 661 | - $lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
|
| 661 | + $lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize']; |
|
| 662 | 662 | |
| 663 | 663 | $faq['id'] = $this->faqid(); |
| 664 | 664 | $faq['categoryid'] = $this->categoryid(); |
| 665 | 665 | $faq['question'] = $this->question(); |
| 666 | 666 | $page = (_SF_STATUS_OPENED == $this->status()) ? 'answer.php' : 'faq.php'; |
| 667 | 667 | |
| 668 | - $faq['questionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question($lastfaqsize) . '</a>'; |
|
| 668 | + $faq['questionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question($lastfaqsize).'</a>'; |
|
| 669 | 669 | if ($linkInQuestion) { |
| 670 | - $faq['fullquestionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question() . '</a>'; |
|
| 670 | + $faq['fullquestionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question().'</a>'; |
|
| 671 | 671 | } else { |
| 672 | 672 | $faq['fullquestionlink'] = $this->question(); |
| 673 | 673 | } |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $categoryObj = $category[$this->categoryid()]; |
| 684 | 684 | } |
| 685 | 685 | $faq['categoryname'] = $categoryObj->getVar('name'); |
| 686 | - $faq['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $categoryObj->getVar('name') . '</a>'; |
|
| 686 | + $faq['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$categoryObj->getVar('name').'</a>'; |
|
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | return $faq; |
@@ -723,8 +723,8 @@ discard block |
||
| 723 | 723 | */ |
| 724 | 724 | public function get($id) |
| 725 | 725 | { |
| 726 | - if ((int)$id > 0) { |
|
| 727 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq') . ' WHERE faqid=' . $id; |
|
| 726 | + if ((int) $id > 0) { |
|
| 727 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_faq').' WHERE faqid='.$id; |
|
| 728 | 728 | if (!$result = $this->db->query($sql)) { |
| 729 | 729 | return false; |
| 730 | 730 | } |
@@ -886,26 +886,26 @@ discard block |
||
| 886 | 886 | { |
| 887 | 887 | $ret = []; |
| 888 | 888 | $limit = $start = 0; |
| 889 | - $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq'); |
|
| 889 | + $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_faq'); |
|
| 890 | 890 | |
| 891 | 891 | if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) { |
| 892 | 892 | $whereClause = $criteria->renderWhere(); |
| 893 | 893 | |
| 894 | 894 | if ('WHERE ()' !== $whereClause) { |
| 895 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 895 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 896 | 896 | if (!empty($notNullFields)) { |
| 897 | 897 | $sql .= $this->NotNullFieldClause($notNullFields, true); |
| 898 | 898 | } |
| 899 | 899 | } elseif (!empty($notNullFields)) { |
| 900 | - $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 900 | + $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 901 | 901 | } |
| 902 | 902 | if ('' != $criteria->getSort()) { |
| 903 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 903 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 904 | 904 | } |
| 905 | 905 | $limit = $criteria->getLimit(); |
| 906 | 906 | $start = $criteria->getStart(); |
| 907 | 907 | } elseif (!empty($notNullFields)) { |
| 908 | - $sql .= $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 908 | + $sql .= $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 909 | 909 | } |
| 910 | 910 | |
| 911 | 911 | //echo "<br>" . $sql . "<br>"; |
@@ -923,9 +923,9 @@ discard block |
||
| 923 | 923 | $faq->assignVars($myrow); |
| 924 | 924 | |
| 925 | 925 | if (!$id_as_key) { |
| 926 | - $ret[] =& $faq; |
|
| 926 | + $ret[] = & $faq; |
|
| 927 | 927 | } else { |
| 928 | - $ret[$myrow['faqid']] =& $faq; |
|
| 928 | + $ret[$myrow['faqid']] = & $faq; |
|
| 929 | 929 | } |
| 930 | 930 | unset($faq); |
| 931 | 931 | } |
@@ -965,26 +965,26 @@ discard block |
||
| 965 | 965 | faq.modulelink AS modulelink, |
| 966 | 966 | faq.contextpage AS contextpage, |
| 967 | 967 | faq.exacturl AS exacturl |
| 968 | - FROM ' . $this->db->prefix('smartfaq_faq') . ' AS faq INNER JOIN ' . $this->db->prefix('smartfaq_categories') . ' AS category ON faq.categoryid = category.categoryid '; |
|
| 968 | + FROM ' . $this->db->prefix('smartfaq_faq').' AS faq INNER JOIN '.$this->db->prefix('smartfaq_categories').' AS category ON faq.categoryid = category.categoryid '; |
|
| 969 | 969 | |
| 970 | 970 | if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) { |
| 971 | 971 | $whereClause = $criteria->renderWhere(); |
| 972 | 972 | |
| 973 | 973 | if ('WHERE ()' !== $whereClause) { |
| 974 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 974 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 975 | 975 | if (!empty($notNullFields)) { |
| 976 | 976 | $sql .= $this->NotNullFieldClause($notNullFields, true); |
| 977 | 977 | } |
| 978 | 978 | } elseif (!empty($notNullFields)) { |
| 979 | - $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 979 | + $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 980 | 980 | } |
| 981 | 981 | if ('' != $criteria->getSort()) { |
| 982 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 982 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 983 | 983 | } |
| 984 | 984 | $limit = $criteria->getLimit(); |
| 985 | 985 | $start = $criteria->getStart(); |
| 986 | 986 | } elseif (!empty($notNullFields)) { |
| 987 | - $sql .= $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 987 | + $sql .= $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 988 | 988 | } |
| 989 | 989 | |
| 990 | 990 | //echo "<br>" . $sql . "<br>"; |
@@ -1002,9 +1002,9 @@ discard block |
||
| 1002 | 1002 | $faq->assignVars($myrow); |
| 1003 | 1003 | |
| 1004 | 1004 | if (!$id_as_key) { |
| 1005 | - $ret[] =& $faq; |
|
| 1005 | + $ret[] = & $faq; |
|
| 1006 | 1006 | } else { |
| 1007 | - $ret[$myrow['faqid']] =& $faq; |
|
| 1007 | + $ret[$myrow['faqid']] = & $faq; |
|
| 1008 | 1008 | } |
| 1009 | 1009 | unset($faq); |
| 1010 | 1010 | } |
@@ -1034,19 +1034,19 @@ discard block |
||
| 1034 | 1034 | */ |
| 1035 | 1035 | public function getCount($criteria = null, $notNullFields = '') |
| 1036 | 1036 | { |
| 1037 | - $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_faq'); |
|
| 1037 | + $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_faq'); |
|
| 1038 | 1038 | if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) { |
| 1039 | 1039 | $whereClause = $criteria->renderWhere(); |
| 1040 | 1040 | if ('WHERE ()' !== $whereClause) { |
| 1041 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 1041 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 1042 | 1042 | if (!empty($notNullFields)) { |
| 1043 | 1043 | $sql .= $this->NotNullFieldClause($notNullFields, true); |
| 1044 | 1044 | } |
| 1045 | 1045 | } elseif (!empty($notNullFields)) { |
| 1046 | - $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 1046 | + $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 1047 | 1047 | } |
| 1048 | 1048 | } elseif (!empty($notNullFields)) { |
| 1049 | - $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields); |
|
| 1049 | + $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields); |
|
| 1050 | 1050 | } |
| 1051 | 1051 | |
| 1052 | 1052 | //echo "<br>" . $sql . "<br>"; |
@@ -1079,11 +1079,11 @@ discard block |
||
| 1079 | 1079 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 1080 | 1080 | |
| 1081 | 1081 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 1082 | - $grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 1082 | + $grantedCategories = new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'); |
|
| 1083 | 1083 | |
| 1084 | 1084 | $faqsGranted = $smartPermHandler->getPermissions('item'); |
| 1085 | 1085 | $grantedFaq = new CriteriaCompo(); |
| 1086 | - $grantedFaq->add(new Criteria('faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR'); |
|
| 1086 | + $grantedFaq->add(new Criteria('faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR'); |
|
| 1087 | 1087 | // If user is anonymous, check if the FAQ allow partialview |
| 1088 | 1088 | if (!is_object($xoopsUser)) { |
| 1089 | 1089 | $grantedFaq->add(new Criteria('partialview', '1'), 'OR'); |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | */ |
| 1131 | 1131 | public function getFaqsCountByStatus() |
| 1132 | 1132 | { |
| 1133 | - $sql = 'SELECT status, COUNT(*) FROM ' . $this->db->prefix('smartfaq_faq') . ' GROUP BY status'; |
|
| 1133 | + $sql = 'SELECT status, COUNT(*) FROM '.$this->db->prefix('smartfaq_faq').' GROUP BY status'; |
|
| 1134 | 1134 | $result = $this->db->query($sql); |
| 1135 | 1135 | if (!$result) { |
| 1136 | 1136 | return []; |
@@ -1187,7 +1187,7 @@ discard block |
||
| 1187 | 1187 | $otherCriteria = null |
| 1188 | 1188 | ) { |
| 1189 | 1189 | global $xoopsUser; |
| 1190 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 1190 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 1191 | 1191 | |
| 1192 | 1192 | //if ( ($categoryid == -1) && (empty($status) || ($status == -1)) && ($limit == 0) && ($start ==0) ) { |
| 1193 | 1193 | // return $this->getObjects(); |
@@ -1199,11 +1199,11 @@ discard block |
||
| 1199 | 1199 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 1200 | 1200 | |
| 1201 | 1201 | $categoriesGranted = $smartPermHandler->getPermissions('category'); |
| 1202 | - $grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 1202 | + $grantedCategories = new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'); |
|
| 1203 | 1203 | |
| 1204 | 1204 | $faqsGranted = $smartPermHandler->getPermissions('item'); |
| 1205 | 1205 | $grantedFaq = new CriteriaCompo(); |
| 1206 | - $grantedFaq->add(new Criteria('faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR'); |
|
| 1206 | + $grantedFaq->add(new Criteria('faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR'); |
|
| 1207 | 1207 | // If user is anonymous, check if the FAQ allow partialview |
| 1208 | 1208 | if (!is_object($xoopsUser)) { |
| 1209 | 1209 | $grantedFaq->add(new Criteria('partialview', '1'), 'OR'); |
@@ -1212,9 +1212,9 @@ discard block |
||
| 1212 | 1212 | |
| 1213 | 1213 | if (isset($categoryid) && ($categoryid != -1)) { |
| 1214 | 1214 | if (is_array($categoryid)) { |
| 1215 | - $criteriaCategory = new Criteria('categoryid', '(' . implode(',', $categoryid) . ')', 'IN'); |
|
| 1215 | + $criteriaCategory = new Criteria('categoryid', '('.implode(',', $categoryid).')', 'IN'); |
|
| 1216 | 1216 | } else { |
| 1217 | - $criteriaCategory = new Criteria('categoryid', (int)$categoryid); |
|
| 1217 | + $criteriaCategory = new Criteria('categoryid', (int) $categoryid); |
|
| 1218 | 1218 | } |
| 1219 | 1219 | } |
| 1220 | 1220 | |
@@ -1281,7 +1281,7 @@ discard block |
||
| 1281 | 1281 | $asobject = true, |
| 1282 | 1282 | $otherCriteria = null |
| 1283 | 1283 | ) { |
| 1284 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 1284 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 1285 | 1285 | |
| 1286 | 1286 | $smartModule = sf_getModuleInfo(); |
| 1287 | 1287 | |
@@ -1340,11 +1340,11 @@ discard block |
||
| 1340 | 1340 | |
| 1341 | 1341 | if ($totalFaqs > 0) { |
| 1342 | 1342 | --$totalFaqs; |
| 1343 | - mt_srand((double)microtime() * 1000000); |
|
| 1343 | + mt_srand((double) microtime() * 1000000); |
|
| 1344 | 1344 | $entrynumber = mt_rand(0, $totalFaqs); |
| 1345 | 1345 | $faq = $this->getFaqs(1, $entrynumber, $status, -1, 'datesub', 'DESC', $notNullFields); |
| 1346 | 1346 | if ($faq) { |
| 1347 | - $ret =& $faq[0]; |
|
| 1347 | + $ret = & $faq[0]; |
|
| 1348 | 1348 | } |
| 1349 | 1349 | } |
| 1350 | 1350 | |
@@ -1375,10 +1375,10 @@ discard block |
||
| 1375 | 1375 | $httphost = $_SERVER['HTTP_HOST']; |
| 1376 | 1376 | $querystring = $_SERVER['QUERY_STRING']; |
| 1377 | 1377 | if ('' != $querystring) { |
| 1378 | - $querystring = '?' . $querystring; |
|
| 1378 | + $querystring = '?'.$querystring; |
|
| 1379 | 1379 | } |
| 1380 | - $currenturl = $http . $httphost . $phpself . $querystring; |
|
| 1381 | - $fullcontexturl = XOOPS_URL . '/' . $faqsObj[$i]->contextpage(); |
|
| 1380 | + $currenturl = $http.$httphost.$phpself.$querystring; |
|
| 1381 | + $fullcontexturl = XOOPS_URL.'/'.$faqsObj[$i]->contextpage(); |
|
| 1382 | 1382 | switch ($faqsObj[$i]->modulelink()) { |
| 1383 | 1383 | case '': |
| 1384 | 1384 | $display = false; |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | } |
| 1398 | 1398 | break; |
| 1399 | 1399 | default: |
| 1400 | - if (false === strpos($currenturl, XOOPS_URL . '/modules/')) { |
|
| 1400 | + if (false === strpos($currenturl, XOOPS_URL.'/modules/')) { |
|
| 1401 | 1401 | $display = false; |
| 1402 | 1402 | } else { |
| 1403 | 1403 | if (false === strpos($currenturl, $faqsObj[$i]->modulelink())) { |
@@ -1409,19 +1409,19 @@ discard block |
||
| 1409 | 1409 | break; |
| 1410 | 1410 | } |
| 1411 | 1411 | if ($display) { |
| 1412 | - $randomFaqs[] =& $faqsObj[$i]; |
|
| 1412 | + $randomFaqs[] = & $faqsObj[$i]; |
|
| 1413 | 1413 | } |
| 1414 | 1414 | } |
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | if (count($randomFaqs) > $limit) { |
| 1418 | - mt_srand((float)microtime() * 10000000); |
|
| 1418 | + mt_srand((float) microtime() * 10000000); |
|
| 1419 | 1419 | $rand_keys = array_rand($randomFaqs, $limit); |
| 1420 | 1420 | for ($j = 0, $jMax = count($rand_keys); $j < $jMax; ++$j) { |
| 1421 | - $ret[] =& $randomFaqs[$rand_keys[$j]]; |
|
| 1421 | + $ret[] = & $randomFaqs[$rand_keys[$j]]; |
|
| 1422 | 1422 | } |
| 1423 | 1423 | } else { |
| 1424 | - $ret =& $randomFaqs; |
|
| 1424 | + $ret = & $randomFaqs; |
|
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | return $ret; |
@@ -1438,14 +1438,14 @@ discard block |
||
| 1438 | 1438 | if (!sf_userIsAdmin()) { |
| 1439 | 1439 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 1440 | 1440 | $items = $smartPermHandler->getPermissions('item'); |
| 1441 | - $faqclause = ' AND faqid IN (' . implode(',', $items) . ')'; |
|
| 1441 | + $faqclause = ' AND faqid IN ('.implode(',', $items).')'; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | |
| 1444 | 1444 | $sql = "CREATE TEMPORARY TABLE tmp (categoryid INT(8) UNSIGNED NOT NULL,datesub INT(11) DEFAULT '0' NOT NULL);"; |
| 1445 | - $sql2 = ' LOCK TABLES ' . $this->db->prefix('smartfaq_faq') . ' READ;'; |
|
| 1446 | - $sql3 = ' INSERT INTO tmp SELECT categoryid, MAX(datesub) FROM ' . $this->db->prefix('smartfaq_faq') . ' WHERE status IN (' . implode(',', $status) . ") $faqclause GROUP BY categoryid;"; |
|
| 1447 | - $sql4 = ' SELECT ' . $this->db->prefix('smartfaq_faq') . '.categoryid, faqid, question, uid, ' . $this->db->prefix('smartfaq_faq') . '.datesub FROM ' . $this->db->prefix('smartfaq_faq') . ', tmp |
|
| 1448 | - WHERE ' . $this->db->prefix('smartfaq_faq') . '.categoryid=tmp.categoryid AND ' . $this->db->prefix('smartfaq_faq') . '.datesub=tmp.datesub;'; |
|
| 1445 | + $sql2 = ' LOCK TABLES '.$this->db->prefix('smartfaq_faq').' READ;'; |
|
| 1446 | + $sql3 = ' INSERT INTO tmp SELECT categoryid, MAX(datesub) FROM '.$this->db->prefix('smartfaq_faq').' WHERE status IN ('.implode(',', $status).") $faqclause GROUP BY categoryid;"; |
|
| 1447 | + $sql4 = ' SELECT '.$this->db->prefix('smartfaq_faq').'.categoryid, faqid, question, uid, '.$this->db->prefix('smartfaq_faq').'.datesub FROM '.$this->db->prefix('smartfaq_faq').', tmp |
|
| 1448 | + WHERE ' . $this->db->prefix('smartfaq_faq').'.categoryid=tmp.categoryid AND '.$this->db->prefix('smartfaq_faq').'.datesub=tmp.datesub;'; |
|
| 1449 | 1449 | /* |
| 1450 | 1450 | //Old implementation |
| 1451 | 1451 | $sql = "SELECT categoryid, faqid, question, uid, MAX(datesub) AS datesub FROM ".$this->db->prefix("smartfaq_faq")." |
@@ -1460,14 +1460,14 @@ discard block |
||
| 1460 | 1460 | $this->db->queryF('UNLOCK TABLES;'); |
| 1461 | 1461 | $this->db->queryF('DROP TABLE tmp;'); |
| 1462 | 1462 | if (!$result) { |
| 1463 | - trigger_error('Error in getLastPublishedByCat SQL: ' . $error); |
|
| 1463 | + trigger_error('Error in getLastPublishedByCat SQL: '.$error); |
|
| 1464 | 1464 | |
| 1465 | 1465 | return $ret; |
| 1466 | 1466 | } |
| 1467 | 1467 | while ($row = $this->db->fetchArray($result)) { |
| 1468 | 1468 | $faq = new sfFaq(); |
| 1469 | 1469 | $faq->assignVars($row); |
| 1470 | - $ret[$row['categoryid']] =& $faq; |
|
| 1470 | + $ret[$row['categoryid']] = & $faq; |
|
| 1471 | 1471 | unset($faq); |
| 1472 | 1472 | } |
| 1473 | 1473 | |
@@ -1482,9 +1482,9 @@ discard block |
||
| 1482 | 1482 | */ |
| 1483 | 1483 | public function deleteAll($criteria = null) |
| 1484 | 1484 | { |
| 1485 | - $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_faq'); |
|
| 1485 | + $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_faq'); |
|
| 1486 | 1486 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 1487 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 1487 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 1488 | 1488 | } |
| 1489 | 1489 | if (!$this->db->query($sql)) { |
| 1490 | 1490 | return false; |
@@ -1505,10 +1505,10 @@ discard block |
||
| 1505 | 1505 | **/ |
| 1506 | 1506 | public function updateAll($fieldname, $fieldvalue, $criteria = null) |
| 1507 | 1507 | { |
| 1508 | - $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue); |
|
| 1509 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_faq') . ' SET ' . $set_clause; |
|
| 1508 | + $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue); |
|
| 1509 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_faq').' SET '.$set_clause; |
|
| 1510 | 1510 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 1511 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 1511 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 1512 | 1512 | } |
| 1513 | 1513 | if (!$this->db->queryF($sql)) { |
| 1514 | 1514 | return false; |
@@ -1523,7 +1523,7 @@ discard block |
||
| 1523 | 1523 | */ |
| 1524 | 1524 | public function updateCounter($faqid) |
| 1525 | 1525 | { |
| 1526 | - $sql = 'UPDATE ' . $this->db->prefix('smartfaq_faq') . ' SET counter=counter+1 WHERE faqid = ' . $faqid; |
|
| 1526 | + $sql = 'UPDATE '.$this->db->prefix('smartfaq_faq').' SET counter=counter+1 WHERE faqid = '.$faqid; |
|
| 1527 | 1527 | if ($this->db->queryF($sql)) { |
| 1528 | 1528 | return true; |
| 1529 | 1529 | } else { |
@@ -1579,8 +1579,8 @@ discard block |
||
| 1579 | 1579 | $criteriaKeywords = new CriteriaCompo(); |
| 1580 | 1580 | for ($i = 0, $iMax = count($queryarray); $i < $iMax; ++$i) { |
| 1581 | 1581 | $criteriaKeyword = new CriteriaCompo(); |
| 1582 | - $criteriaKeyword->add(new Criteria('faq.question', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); |
|
| 1583 | - $criteriaKeyword->add(new Criteria('answer.answer', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); |
|
| 1582 | + $criteriaKeyword->add(new Criteria('faq.question', '%'.$queryarray[$i].'%', 'LIKE'), 'OR'); |
|
| 1583 | + $criteriaKeyword->add(new Criteria('answer.answer', '%'.$queryarray[$i].'%', 'LIKE'), 'OR'); |
|
| 1584 | 1584 | $criteriaKeywords->add($criteriaKeyword, $andor); |
| 1585 | 1585 | unset($criteriaKeyword); |
| 1586 | 1586 | } |
@@ -1598,9 +1598,9 @@ discard block |
||
| 1598 | 1598 | if (!$faqsGranted) { |
| 1599 | 1599 | return $ret; |
| 1600 | 1600 | } |
| 1601 | - $grantedCategories = new Criteria('faq.categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'); |
|
| 1601 | + $grantedCategories = new Criteria('faq.categoryid', '('.implode(',', $categoriesGranted).')', 'IN'); |
|
| 1602 | 1602 | $grantedFaq = new CriteriaCompo(); |
| 1603 | - $grantedFaq->add(new Criteria('faq.faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR'); |
|
| 1603 | + $grantedFaq->add(new Criteria('faq.faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR'); |
|
| 1604 | 1604 | // If user is anonymous, check if the FAQ allow partialview |
| 1605 | 1605 | if (!is_object($xoopsUser)) { |
| 1606 | 1606 | $grantedFaq->add(new Criteria('partialview', '1'), 'OR'); |
@@ -1646,15 +1646,15 @@ discard block |
||
| 1646 | 1646 | $criteria->setSort('faq.datesub'); |
| 1647 | 1647 | $criteria->setOrder('DESC'); |
| 1648 | 1648 | |
| 1649 | - $sql = 'SELECT faq.faqid, faq.question, faq.datesub, faq.uid FROM ' . $this->db->prefix('smartfaq_faq') . ' AS faq INNER JOIN ' . $this->db->prefix('smartfaq_answers') . ' AS answer ON faq.faqid = answer.faqid'; |
|
| 1649 | + $sql = 'SELECT faq.faqid, faq.question, faq.datesub, faq.uid FROM '.$this->db->prefix('smartfaq_faq').' AS faq INNER JOIN '.$this->db->prefix('smartfaq_answers').' AS answer ON faq.faqid = answer.faqid'; |
|
| 1650 | 1650 | |
| 1651 | 1651 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
| 1652 | 1652 | $whereClause = $criteria->renderWhere(); |
| 1653 | 1653 | |
| 1654 | 1654 | if ('WHERE ()' !== $whereClause) { |
| 1655 | - $sql .= ' ' . $criteria->renderWhere(); |
|
| 1655 | + $sql .= ' '.$criteria->renderWhere(); |
|
| 1656 | 1656 | if ('' != $criteria->getSort()) { |
| 1657 | - $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 1657 | + $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder(); |
|
| 1658 | 1658 | } |
| 1659 | 1659 | $limit = $criteria->getLimit(); |
| 1660 | 1660 | $start = $criteria->getStart(); |
@@ -1677,7 +1677,7 @@ discard block |
||
| 1677 | 1677 | while ($myrow = $this->db->fetchArray($result)) { |
| 1678 | 1678 | $faq = new sfFaq(); |
| 1679 | 1679 | $faq->assignVars($myrow); |
| 1680 | - $ret[] =& $faq; |
|
| 1680 | + $ret[] = & $faq; |
|
| 1681 | 1681 | unset($faq); |
| 1682 | 1682 | } |
| 1683 | 1683 | |
@@ -1693,19 +1693,19 @@ discard block |
||
| 1693 | 1693 | { |
| 1694 | 1694 | global $xoopsUser; |
| 1695 | 1695 | $ret = []; |
| 1696 | - $sql = 'SELECT categoryid, COUNT(*) AS count FROM ' . $this->db->prefix('smartfaq_faq'); |
|
| 1697 | - if ((int)$cat_id > 0) { |
|
| 1698 | - $sql .= ' WHERE categoryid = ' . (int)$cat_id; |
|
| 1699 | - $sql .= ' AND status IN (' . implode(',', $status) . ')'; |
|
| 1696 | + $sql = 'SELECT categoryid, COUNT(*) AS count FROM '.$this->db->prefix('smartfaq_faq'); |
|
| 1697 | + if ((int) $cat_id > 0) { |
|
| 1698 | + $sql .= ' WHERE categoryid = '.(int) $cat_id; |
|
| 1699 | + $sql .= ' AND status IN ('.implode(',', $status).')'; |
|
| 1700 | 1700 | } else { |
| 1701 | - $sql .= ' WHERE status IN (' . implode(',', $status) . ')'; |
|
| 1701 | + $sql .= ' WHERE status IN ('.implode(',', $status).')'; |
|
| 1702 | 1702 | if (!sf_userIsAdmin()) { |
| 1703 | 1703 | $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq'); |
| 1704 | 1704 | $items = $smartPermHandler->getPermissions('item'); |
| 1705 | 1705 | if (is_object($xoopsUser)) { |
| 1706 | - $sql .= ' AND faqid IN (' . implode(',', $items) . ')'; |
|
| 1706 | + $sql .= ' AND faqid IN ('.implode(',', $items).')'; |
|
| 1707 | 1707 | } else { |
| 1708 | - $sql .= ' AND (faqid IN (' . implode(',', $items) . ') OR partialview = 1)'; |
|
| 1708 | + $sql .= ' AND (faqid IN ('.implode(',', $items).') OR partialview = 1)'; |
|
| 1709 | 1709 | } |
| 1710 | 1710 | } |
| 1711 | 1711 | } |
@@ -1718,7 +1718,7 @@ discard block |
||
| 1718 | 1718 | return $ret; |
| 1719 | 1719 | } |
| 1720 | 1720 | while ($row = $this->db->fetchArray($result)) { |
| 1721 | - $ret[$row['categoryid']] = (int)$row['count']; |
|
| 1721 | + $ret[$row['categoryid']] = (int) $row['count']; |
|
| 1722 | 1722 | } |
| 1723 | 1723 | |
| 1724 | 1724 | return $ret; |