@@ -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 |
@@ -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 ($maxLength != 0) { |
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 = ($this->status() == _SF_STATUS_OPENED) ? '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 ($whereClause !== 'WHERE ()') { |
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 ($whereClause !== 'WHERE ()') { |
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 ($whereClause !== 'WHERE ()') { |
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 (strpos($currenturl, XOOPS_URL . '/modules/') === false) { |
|
1400 | + if (strpos($currenturl, XOOPS_URL.'/modules/') === false) { |
|
1401 | 1401 | $display = false; |
1402 | 1402 | } else { |
1403 | 1403 | if (strpos($currenturl, $faqsObj[$i]->modulelink()) === false) { |
@@ -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 ($whereClause !== 'WHERE ()') { |
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; |
@@ -15,12 +15,12 @@ |
||
15 | 15 | $xoopsTpl->assign('isAdmin', $isAdmin); |
16 | 16 | |
17 | 17 | $xoopsTpl->assign([ |
18 | - 'lang_on' => _MD_SF_ON, |
|
19 | - 'lang_postedby' => _MD_SF_POSTEDBY, |
|
20 | - 'lang_faq' => _MD_SF_QUESTION, |
|
21 | - 'lang_datesub' => _MD_SF_DATESUB, |
|
22 | - 'lang_hits' => _MD_SF_HITS |
|
23 | - ]); |
|
18 | + 'lang_on' => _MD_SF_ON, |
|
19 | + 'lang_postedby' => _MD_SF_POSTEDBY, |
|
20 | + 'lang_faq' => _MD_SF_QUESTION, |
|
21 | + 'lang_datesub' => _MD_SF_DATESUB, |
|
22 | + 'lang_hits' => _MD_SF_HITS |
|
23 | + ]); |
|
24 | 24 | $xoopsTpl->assign('sectionname', $myts->displayTarea($xoopsModule->getVar('name'))); |
25 | 25 | |
26 | 26 | $xoopsTpl->assign('modulename', $xoopsModule->dirname()); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $uid = $xoopsUser ? $xoopsUser->getVar('uid') : 0; |
12 | 12 | $isAdmin = (sf_userIsAdmin() || sf_moderator()); |
13 | 13 | |
14 | -$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>'); |
|
14 | +$xoopsTpl->assign('sf_adminpage', "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE.'</a>'); |
|
15 | 15 | $xoopsTpl->assign('isAdmin', $isAdmin); |
16 | 16 | |
17 | 17 | $xoopsTpl->assign([ |
@@ -34,4 +34,4 @@ discard block |
||
34 | 34 | |
35 | 35 | $xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)'); |
36 | 36 | |
37 | -$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'>"); |
|
37 | +$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='".XOOPS_URL."/modules/smartfaq/assets/css/smartfaq.css'>"); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | function b_faqs_random_how_show() |
11 | 11 | { |
12 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
12 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
13 | 13 | |
14 | 14 | $block = []; |
15 | 15 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_recent_questions_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | |
@@ -60,44 +60,44 @@ discard block |
||
60 | 60 | */ |
61 | 61 | function b_faqs_recent_questions_edit($options) |
62 | 62 | { |
63 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
63 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
64 | 64 | |
65 | 65 | $form = sf_createCategorySelect($options[0]); |
66 | 66 | |
67 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
67 | + $form .= ' <br>'._MB_SF_ORDER." <select name='options[]'>"; |
|
68 | 68 | |
69 | 69 | $form .= "<option value='datesub'"; |
70 | 70 | if ($options[1] === 'datesub') { |
71 | 71 | $form .= ' selected'; |
72 | 72 | } |
73 | - $form .= '>' . _MB_SF_DATE . "</option>\n"; |
|
73 | + $form .= '>'._MB_SF_DATE."</option>\n"; |
|
74 | 74 | |
75 | 75 | $form .= "<option value='counter'"; |
76 | 76 | if ($options[1] === 'counter') { |
77 | 77 | $form .= ' selected'; |
78 | 78 | } |
79 | - $form .= '>' . _MB_SF_HITS . "</option>\n"; |
|
79 | + $form .= '>'._MB_SF_HITS."</option>\n"; |
|
80 | 80 | |
81 | 81 | $form .= "<option value='weight'"; |
82 | 82 | if ($options[1] === 'weight') { |
83 | 83 | $form .= ' selected'; |
84 | 84 | } |
85 | - $form .= '>' . _MB_SF_WEIGHT . "</option>\n"; |
|
85 | + $form .= '>'._MB_SF_WEIGHT."</option>\n"; |
|
86 | 86 | |
87 | 87 | $form .= "</select>\n"; |
88 | 88 | |
89 | - $form .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_QUESTIONS . ''; |
|
90 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
89 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_QUESTIONS.''; |
|
90 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
91 | 91 | |
92 | - $form .= '<br>' . _MB_SF_SHOW_DATE . " <input type='radio' id='options[]' name='options[]' value='1'"; |
|
92 | + $form .= '<br>'._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
|
93 | 93 | if ($options[4] == 1) { |
94 | 94 | $form .= ' checked'; |
95 | 95 | } |
96 | - $form .= '> ' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'"; |
|
96 | + $form .= '> '._YES."<input type='radio' id='options[]' name='options[]' value='0'"; |
|
97 | 97 | if ($options[4] == 0) { |
98 | 98 | $form .= ' checked'; |
99 | 99 | } |
100 | - $form .= '> ' . _NO . ''; |
|
100 | + $form .= '> '._NO.''; |
|
101 | 101 | |
102 | 102 | return $form; |
103 | 103 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_new_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | |
@@ -57,44 +57,44 @@ discard block |
||
57 | 57 | function b_faqs_new_edit($options) |
58 | 58 | { |
59 | 59 | global $xoopsDB, $xoopsModule, $xoopsUser; |
60 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
60 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
61 | 61 | |
62 | 62 | $form = sf_createCategorySelect($options[0]); |
63 | 63 | |
64 | - $form .= ' <br>' . _MB_SF_ORDER . " <select name='options[]'>"; |
|
64 | + $form .= ' <br>'._MB_SF_ORDER." <select name='options[]'>"; |
|
65 | 65 | |
66 | 66 | $form .= "<option value='datesub'"; |
67 | 67 | if ($options[1] === 'datesub') { |
68 | 68 | $form .= ' selected'; |
69 | 69 | } |
70 | - $form .= '>' . _MB_SF_DATE . "</option>\n"; |
|
70 | + $form .= '>'._MB_SF_DATE."</option>\n"; |
|
71 | 71 | |
72 | 72 | $form .= "<option value='counter'"; |
73 | 73 | if ($options[1] === 'counter') { |
74 | 74 | $form .= ' selected'; |
75 | 75 | } |
76 | - $form .= '>' . _MB_SF_HITS . "</option>\n"; |
|
76 | + $form .= '>'._MB_SF_HITS."</option>\n"; |
|
77 | 77 | |
78 | 78 | $form .= "<option value='weight'"; |
79 | 79 | if ($options[1] === 'weight') { |
80 | 80 | $form .= ' selected'; |
81 | 81 | } |
82 | - $form .= '>' . _MB_SF_WEIGHT . "</option>\n"; |
|
82 | + $form .= '>'._MB_SF_WEIGHT."</option>\n"; |
|
83 | 83 | |
84 | 84 | $form .= "</select>\n"; |
85 | 85 | |
86 | - $form .= ' ' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_FAQS . ''; |
|
87 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[3] . "'> " . _MB_SF_LENGTH . ''; |
|
86 | + $form .= ' '._MB_SF_DISP." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_FAQS.''; |
|
87 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[3]."'> "._MB_SF_LENGTH.''; |
|
88 | 88 | |
89 | - $form .= '<br>' . _MB_SF_SHOW_DATE . " <input type='radio' id='options[]' name='options[]' value='1'"; |
|
89 | + $form .= '<br>'._MB_SF_SHOW_DATE." <input type='radio' id='options[]' name='options[]' value='1'"; |
|
90 | 90 | if ($options[4] == 1) { |
91 | 91 | $form .= ' checked'; |
92 | 92 | } |
93 | - $form .= '> ' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'"; |
|
93 | + $form .= '> '._YES."<input type='radio' id='options[]' name='options[]' value='0'"; |
|
94 | 94 | if ($options[4] == 0) { |
95 | 95 | $form .= ' checked'; |
96 | 96 | } |
97 | - $form .= '> ' . _NO . ''; |
|
97 | + $form .= '> '._NO.''; |
|
98 | 98 | |
99 | 99 | return $form; |
100 | 100 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | |
10 | 10 | function b_faqs_random_diduno_show() |
11 | 11 | { |
12 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
12 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
13 | 13 | |
14 | 14 | $block = []; |
15 | 15 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_most_viewed_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | if ($options[0] == 0) { |
@@ -48,12 +48,12 @@ discard block |
||
48 | 48 | function b_faqs_most_viewed_edit($options) |
49 | 49 | { |
50 | 50 | global $xoopsDB, $xoopsModule, $xoopsUser; |
51 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
51 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
52 | 52 | |
53 | 53 | $form = sf_createCategorySelect($options[0]); |
54 | 54 | |
55 | - $form .= ' <br>' . _MB_SF_DISP . " <input type='text' name='options[]' value='" . $options[1] . "'> " . _MB_SF_FAQS . ''; |
|
56 | - $form .= ' <br>' . _MB_SF_CHARS . " <input type='text' name='options[]' value='" . $options[2] . "'> " . _MB_SF_LENGTH . ''; |
|
55 | + $form .= ' <br>'._MB_SF_DISP." <input type='text' name='options[]' value='".$options[1]."'> "._MB_SF_FAQS.''; |
|
56 | + $form .= ' <br>'._MB_SF_CHARS." <input type='text' name='options[]' value='".$options[2]."'> "._MB_SF_LENGTH.''; |
|
57 | 57 | |
58 | 58 | return $form; |
59 | 59 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | function b_faqs_context_show($options) |
13 | 13 | { |
14 | - require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
14 | + require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
15 | 15 | |
16 | 16 | $block = []; |
17 | 17 | |
@@ -48,8 +48,8 @@ discard block |
||
48 | 48 | */ |
49 | 49 | function b_faqs_context_edit($options) |
50 | 50 | { |
51 | - $form = '' . _MB_SF_DISP . ' '; |
|
52 | - $form .= "<input type='text' name='options[]' value='" . $options[0] . "'> " . _MB_SF_FAQS . ''; |
|
51 | + $form = ''._MB_SF_DISP.' '; |
|
52 | + $form .= "<input type='text' name='options[]' value='".$options[0]."'> "._MB_SF_FAQS.''; |
|
53 | 53 | |
54 | 54 | return $form; |
55 | 55 | } |