@@ -41,94 +41,94 @@ |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | switch ($op) { |
| 44 | - case 'post': |
|
| 44 | + case 'post': |
|
| 45 | 45 | |
| 46 | - global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB; |
|
| 46 | + global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB; |
|
| 47 | 47 | |
| 48 | - $newFaqObj = $faqHandler->create(); |
|
| 48 | + $newFaqObj = $faqHandler->create(); |
|
| 49 | 49 | |
| 50 | - if (!$xoopsUser) { |
|
| 51 | - if ($xoopsModuleConfig['anonpost'] == 1) { |
|
| 52 | - $uid = 0; |
|
| 50 | + if (!$xoopsUser) { |
|
| 51 | + if ($xoopsModuleConfig['anonpost'] == 1) { |
|
| 52 | + $uid = 0; |
|
| 53 | + } else { |
|
| 54 | + redirect_header('index.php', 3, _NOPERM); |
|
| 55 | + } |
|
| 53 | 56 | } else { |
| 54 | - redirect_header('index.php', 3, _NOPERM); |
|
| 57 | + $uid = $xoopsUser->uid(); |
|
| 55 | 58 | } |
| 56 | - } else { |
|
| 57 | - $uid = $xoopsUser->uid(); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - // Putting the values about the FAQ in the FAQ object |
|
| 61 | - $newFaqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 62 | - $newFaqObj->setVar('uid', $uid); |
|
| 63 | - $newFaqObj->setVar('question', $_POST['question']); |
|
| 64 | - $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0; |
|
| 65 | - $newFaqObj->setVar('notifypub', $notifypub); |
|
| 66 | - |
|
| 67 | - // Setting the status of the FAQ |
|
| 68 | - if ($xoopsModuleConfig['autoapprove_request'] == 1) { |
|
| 69 | - $newFaqObj->setVar('status', _SF_STATUS_OPENED); |
|
| 70 | - } else { |
|
| 71 | - $newFaqObj->setVar('status', _SF_STATUS_ASKED); |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - // Storing the FAQ object in the database |
|
| 75 | - if (!$newFaqObj->store()) { |
|
| 76 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors())); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - // Get the cateopry object related to that FAQ |
|
| 80 | - // If autoapprove_requested |
|
| 81 | - if ($xoopsModuleConfig['autoapprove_request'] == 1) { |
|
| 82 | - // We do not not subscribe user to notification on publish since we publish it right away |
|
| 83 | - |
|
| 84 | - // Send notifications |
|
| 85 | - $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_PUBLISHED)); |
|
| 86 | - |
|
| 87 | - $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED; |
|
| 88 | - } else { |
|
| 89 | - // Subscribe the user to On Published notification, if requested |
|
| 90 | - if ($notifypub == 1) { |
|
| 91 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 92 | - $notificationHandler = xoops_getHandler('notification'); |
|
| 93 | - $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
|
| 59 | + |
|
| 60 | + // Putting the values about the FAQ in the FAQ object |
|
| 61 | + $newFaqObj->setVar('categoryid', $_POST['categoryid']); |
|
| 62 | + $newFaqObj->setVar('uid', $uid); |
|
| 63 | + $newFaqObj->setVar('question', $_POST['question']); |
|
| 64 | + $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0; |
|
| 65 | + $newFaqObj->setVar('notifypub', $notifypub); |
|
| 66 | + |
|
| 67 | + // Setting the status of the FAQ |
|
| 68 | + if ($xoopsModuleConfig['autoapprove_request'] == 1) { |
|
| 69 | + $newFaqObj->setVar('status', _SF_STATUS_OPENED); |
|
| 70 | + } else { |
|
| 71 | + $newFaqObj->setVar('status', _SF_STATUS_ASKED); |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + // Storing the FAQ object in the database |
|
| 75 | + if (!$newFaqObj->store()) { |
|
| 76 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors())); |
|
| 94 | 77 | } |
| 95 | - // Send notifications |
|
| 96 | - $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_SUBMITTED)); |
|
| 97 | 78 | |
| 98 | - $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL; |
|
| 99 | - } |
|
| 79 | + // Get the cateopry object related to that FAQ |
|
| 80 | + // If autoapprove_requested |
|
| 81 | + if ($xoopsModuleConfig['autoapprove_request'] == 1) { |
|
| 82 | + // We do not not subscribe user to notification on publish since we publish it right away |
|
| 83 | + |
|
| 84 | + // Send notifications |
|
| 85 | + $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_PUBLISHED)); |
|
| 86 | + |
|
| 87 | + $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED; |
|
| 88 | + } else { |
|
| 89 | + // Subscribe the user to On Published notification, if requested |
|
| 90 | + if ($notifypub == 1) { |
|
| 91 | + include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 92 | + $notificationHandler = xoops_getHandler('notification'); |
|
| 93 | + $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
|
| 94 | + } |
|
| 95 | + // Send notifications |
|
| 96 | + $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_SUBMITTED)); |
|
| 97 | + |
|
| 98 | + $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL; |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - //redirect_header("javascript:history.go(-2)", 3, $redirect_msg); |
|
| 102 | - redirect_header('index.php', 2, $redirect_msg); |
|
| 103 | - break; |
|
| 101 | + //redirect_header("javascript:history.go(-2)", 3, $redirect_msg); |
|
| 102 | + redirect_header('index.php', 2, $redirect_msg); |
|
| 103 | + break; |
|
| 104 | 104 | |
| 105 | - case 'form': |
|
| 106 | - default: |
|
| 105 | + case 'form': |
|
| 106 | + default: |
|
| 107 | 107 | |
| 108 | - global $xoopsUser, $myts; |
|
| 108 | + global $xoopsUser, $myts; |
|
| 109 | 109 | |
| 110 | - $xoopsOption['template_main'] = 'smartfaq_submit.tpl'; |
|
| 111 | - include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 112 | - include_once __DIR__ . '/footer.php'; |
|
| 110 | + $xoopsOption['template_main'] = 'smartfaq_submit.tpl'; |
|
| 111 | + include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 112 | + include_once __DIR__ . '/footer.php'; |
|
| 113 | 113 | |
| 114 | - $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 114 | + $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 115 | 115 | |
| 116 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 117 | - $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 118 | - $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST); |
|
| 116 | + $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 117 | + $xoopsTpl->assign('whereInSection', $moduleName); |
|
| 118 | + $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST); |
|
| 119 | 119 | |
| 120 | - $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST); |
|
| 121 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg'])); |
|
| 120 | + $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST); |
|
| 121 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg'])); |
|
| 122 | 122 | |
| 123 | - include_once 'include/request.inc.php'; |
|
| 123 | + include_once 'include/request.inc.php'; |
|
| 124 | 124 | |
| 125 | - $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 125 | + $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
|
| 126 | 126 | |
| 127 | - $sectionname = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
|
| 127 | + $sectionname = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
|
| 128 | 128 | |
| 129 | - include_once 'include/request.inc.php'; |
|
| 129 | + include_once 'include/request.inc.php'; |
|
| 130 | 130 | |
| 131 | - include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 131 | + include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 132 | 132 | |
| 133 | - break; |
|
| 133 | + break; |
|
| 134 | 134 | } |
@@ -6,8 +6,8 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/header.php'; |
|
| 10 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 9 | +include_once __DIR__.'/header.php'; |
|
| 10 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
| 11 | 11 | |
| 12 | 12 | global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 13 | 13 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // Storing the FAQ object in the database |
| 75 | 75 | if (!$newFaqObj->store()) { |
| 76 | - redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors())); |
|
| 76 | + redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR.sf_formatErrors($newFaqObj->getErrors())); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | // Get the cateopry object related to that FAQ |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } else { |
| 89 | 89 | // Subscribe the user to On Published notification, if requested |
| 90 | 90 | if ($notifypub == 1) { |
| 91 | - include_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
|
| 91 | + include_once XOOPS_ROOT_PATH.'/include/notification_constants.php'; |
|
| 92 | 92 | $notificationHandler = xoops_getHandler('notification'); |
| 93 | 93 | $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
| 94 | 94 | } |
@@ -108,17 +108,17 @@ discard block |
||
| 108 | 108 | global $xoopsUser, $myts; |
| 109 | 109 | |
| 110 | 110 | $xoopsOption['template_main'] = 'smartfaq_submit.tpl'; |
| 111 | - include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 112 | - include_once __DIR__ . '/footer.php'; |
|
| 111 | + include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
| 112 | + include_once __DIR__.'/footer.php'; |
|
| 113 | 113 | |
| 114 | 114 | $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous'; |
| 115 | 115 | |
| 116 | - $moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 116 | + $moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 117 | 117 | $xoopsTpl->assign('whereInSection', $moduleName); |
| 118 | 118 | $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST); |
| 119 | 119 | |
| 120 | 120 | $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST); |
| 121 | - $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg'])); |
|
| 121 | + $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, ".$myts->displayTarea($xoopsModuleConfig['requestintromsg'])); |
|
| 122 | 122 | |
| 123 | 123 | include_once 'include/request.inc.php'; |
| 124 | 124 | |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | include_once 'include/request.inc.php'; |
| 130 | 130 | |
| 131 | - include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 131 | + include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
| 132 | 132 | |
| 133 | 133 | break; |
| 134 | 134 | } |
@@ -272,7 +272,7 @@ |
||
| 272 | 272 | define('_AM_SF_STATUS_EXP', "Status<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the status of the Q&A.</span>"); |
| 273 | 273 | define('_AM_SF_SUBMISSIONSMNGMT', 'Submitted Q&A'); |
| 274 | 274 | define('_AM_SF_SPECIFIC_URL_SELECT', 'Specific URL...'); |
| 275 | -define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br />this module' to <i>" . _AM_SF_SPECIFIC_URL_SELECT . "</i>, please<br />specify the URL.<br />\n<b>Example :</b> modules/newbb</span>"); |
|
| 275 | +define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br />this module' to <i>"._AM_SF_SPECIFIC_URL_SELECT."</i>, please<br />specify the URL.<br />\n<b>Example :</b> modules/newbb</span>"); |
|
| 276 | 276 | define('_AM_SF_SUBMISSION_MODERATE', "Moderate this Q&A's submission"); |
| 277 | 277 | define('_AM_SF_SUBMITTED', 'Submitted'); |
| 278 | 278 | define('_AM_SF_SUBMITTED_EXP', '<b>Submitted Q&A</b> : Q&A that have been submitted by users. Once approved, they will be displayed in the Q&A section.'); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | define('_MD_SF_INTARTICLE', 'Have a look at this FAQ at %s'); |
| 75 | 75 | define('_MD_SF_MAIL', 'Send Q&A'); |
| 76 | 76 | define('_MD_SF_MAINHEAD', 'Welcome to the'); |
| 77 | -define('_MD_SF_MAININTRO', "In this area of the site, you will find the answers to the frequently asked questions. Each Q&A is placed in a category for easier finding. This is the section from where the random Q&As in the right column of the site come from. Should you not find the answer to a particular question, don't hesitate to <a href='" . XOOPS_URL . "/forms/askus/form.php'>Ask us a Question!</a>"); |
|
| 77 | +define('_MD_SF_MAININTRO', "In this area of the site, you will find the answers to the frequently asked questions. Each Q&A is placed in a category for easier finding. This is the section from where the random Q&As in the right column of the site come from. Should you not find the answer to a particular question, don't hesitate to <a href='".XOOPS_URL."/forms/askus/form.php'>Ask us a Question!</a>"); |
|
| 78 | 78 | define('_MD_SF_MAINNOSELECTCAT', 'You did not select a valid category'); |
| 79 | 79 | define('_MD_SF_MAINNOFAQS', 'There are no Q&As in this category'); |
| 80 | 80 | define('_MD_SF_MODERATION_MAIN_HEAD', 'Moderation section of '); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | define('_MD_SF_SPECIFIC_URL_SELECT', 'Specific URL...'); |
| 127 | 127 | define('_MD_SF_SENDSTORY', 'Send this Q&A to a friend'); |
| 128 | 128 | define('_MD_SF_SPECIFIC_URL', 'Specific URL'); |
| 129 | -define('_MD_SF_SPECIFIC_URL_DSC', "If you have set the 'Contextually link to this module' to <i>" . _MD_SF_SPECIFIC_URL_SELECT . "</i>, please specify the URL.<br />\n<b>Example :</b> modules/newbb"); |
|
| 129 | +define('_MD_SF_SPECIFIC_URL_DSC', "If you have set the 'Contextually link to this module' to <i>"._MD_SF_SPECIFIC_URL_SELECT."</i>, please specify the URL.<br />\n<b>Example :</b> modules/newbb"); |
|
| 130 | 130 | define('_MD_SF_SUB_INTRO', 'please fill this form to send your Q&A. The site administrator will review it and then publish it as soon as possible. Thank you in advance for your contribution.'); |
| 131 | 131 | define('_MD_SF_SUB_SNEWNAME', 'Submit a Q&A'); |
| 132 | 132 | define('_MD_SF_SUB_SMNAME', 'Submit a Q&A'); |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/header.php'; |
|
| 9 | +include_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | -$faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 11 | +$faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 12 | 12 | |
| 13 | 13 | if ($faqid == 0) { |
| 14 | 14 | redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED); |
@@ -43,23 +43,23 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n"; |
| 45 | 45 | echo "<html>\n<head>\n"; |
| 46 | -echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n"; |
|
| 47 | -echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n"; |
|
| 48 | -echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n"; |
|
| 49 | -echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "' />\n"; |
|
| 50 | -echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n"; |
|
| 51 | -echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n"; |
|
| 46 | +echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n"; |
|
| 47 | +echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."' />\n"; |
|
| 48 | +echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."' />\n"; |
|
| 49 | +echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."' />\n"; |
|
| 50 | +echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."' />\n"; |
|
| 51 | +echo "<meta name='GENERATOR' content='".XOOPS_VERSION."' />\n\n\n"; |
|
| 52 | 52 | |
| 53 | 53 | echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'> |
| 54 | 54 | <div style='width: 650px; border: 1px solid #000; padding: 20px;'> |
| 55 | - <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt='' /><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div> |
|
| 56 | - <div align='center'>" . $who_where . "</div> |
|
| 55 | + <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt='' /><h2 style='margin: 0;'>".$faqObj->question()."</h2></div> |
|
| 56 | + <div align='center'>" . $who_where."</div> |
|
| 57 | 57 | <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div> |
| 58 | 58 | <div></div> |
| 59 | - <b><p>" . $faqObj->question() . '</p></b> |
|
| 60 | - <p>' . $answerObj->answer() . "</p> |
|
| 59 | + <b><p>" . $faqObj->question().'</p></b> |
|
| 60 | + <p>' . $answerObj->answer()."</p> |
|
| 61 | 61 | <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div> |
| 62 | - <p>" . $comeFrom . '</p> |
|
| 62 | + <p>" . $comeFrom.'</p> |
|
| 63 | 63 | </div> |
| 64 | 64 | <br />'; |
| 65 | 65 | |
@@ -6,11 +6,11 @@ |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
| 9 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
| 10 | 10 | |
| 11 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 12 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
|
| 13 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php'; |
|
| 14 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php'; |
|
| 11 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 12 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
|
| 13 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php'; |
|
| 14 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php'; |
|
| 15 | 15 | |
| 16 | 16 | $myts = MyTextSanitizer::getInstance(); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | //about |
| 26 | 26 | $modversion['module_status'] = 'RC 1'; |
| 27 | 27 | $modversion['release_date'] = '2016/03/28'; |
| 28 | -$modversion['release_file'] = XOOPS_URL . '/modules/' . $modversion['dirname'] . '/docs/changelog.txt'; |
|
| 28 | +$modversion['release_file'] = XOOPS_URL.'/modules/'.$modversion['dirname'].'/docs/changelog.txt'; |
|
| 29 | 29 | $modversion['module_website_url'] = 'www.xoops.org'; |
| 30 | 30 | $modversion['module_website_name'] = 'XOOPS'; |
| 31 | 31 | $modversion['min_php'] = '5.5'; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $modversion['sub'][2]['url'] = 'request.php?op=add'; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
| 136 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
| 137 | 137 | |
| 138 | 138 | // Creating the FAQ handler object |
| 139 | 139 | $faqHandler = sf_gethandler('faq'); |
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/header.php'; |
|
| 9 | +include_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | -$faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0; |
|
| 11 | +$faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0; |
|
| 12 | 12 | |
| 13 | 13 | if ($faqid == 0) { |
| 14 | 14 | redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | $faqObj->updateCounter(); |
| 43 | 43 | } |
| 44 | 44 | $xoopsOption['template_main'] = 'smartfaq_faq.tpl'; |
| 45 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 46 | -include_once __DIR__ . '/footer.php'; |
|
| 45 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
| 46 | +include_once __DIR__.'/footer.php'; |
|
| 47 | 47 | |
| 48 | 48 | $faq = $faqObj->toArray(null, $categoryObj, false); |
| 49 | 49 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | $xoopsTpl->assign('display_categoryname', false); |
| 79 | 79 | |
| 80 | 80 | $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes')); |
| 81 | -$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid')); |
|
| 81 | +$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid')); |
|
| 82 | 82 | $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY); |
| 83 | 83 | $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY); |
| 84 | 84 | $xoopsTpl->assign('faqid', $faqObj->getVar('faqid')); |
@@ -94,19 +94,19 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | // Page Title Hack by marcan |
| 96 | 96 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 97 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']); |
|
| 97 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']); |
|
| 98 | 98 | // End Page Title Hack by marcan |
| 99 | 99 | |
| 100 | 100 | // Include the comments if the selected FAQ supports comments |
| 101 | 101 | if ($faqObj->cancomment() == 1) { |
| 102 | - include_once XOOPS_ROOT_PATH . '/include/comment_view.php'; |
|
| 102 | + include_once XOOPS_ROOT_PATH.'/include/comment_view.php'; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | //code to include smartie |
| 106 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 107 | - include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 106 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 107 | + include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 108 | 108 | $xoopsTpl->assign('smarttie', 1); |
| 109 | 109 | } |
| 110 | 110 | //end code for smarttie |
| 111 | 111 | |
| 112 | -include_once XOOPS_ROOT_PATH . '/footer.php'; |
|
| 112 | +include_once XOOPS_ROOT_PATH.'/footer.php'; |
|
@@ -6,15 +6,15 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/header.php'; |
|
| 9 | +include_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | 11 | global $xoopsConfig, $xoopsModuleConfig, $xoopsModule; |
| 12 | 12 | |
| 13 | 13 | // At which record shall we start for the Categories |
| 14 | -$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0; |
|
| 14 | +$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0; |
|
| 15 | 15 | |
| 16 | 16 | // At which record shall we start for the FAQs |
| 17 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
| 17 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
| 18 | 18 | |
| 19 | 19 | // Creating the category handler object |
| 20 | 20 | $categoryHandler = sf_gethandler('category'); |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | $xoopsOption['template_main'] = 'smartfaq_index.tpl'; |
| 44 | 44 | |
| 45 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 46 | -include_once __DIR__ . '/footer.php'; |
|
| 45 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
| 46 | +include_once __DIR__.'/footer.php'; |
|
| 47 | 47 | |
| 48 | 48 | //get all categories for future reference |
| 49 | 49 | $allcategories = $categoryHandler->getObjects(null, true); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 66 | 66 | if (isset($last_qnaObj[$subcat_id])) { |
| 67 | 67 | $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 68 | - $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>'); |
|
| 68 | + $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>'); |
|
| 69 | 69 | } |
| 70 | 70 | $subcat->setVar('faqcount', $totalQnas[$subcat_id]); |
| 71 | 71 | $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true); |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | $memberHandler = xoops_getHandler('member'); |
| 104 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 104 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 105 | 105 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 106 | 106 | $faq = $faqsObj[$i]->toArray(null, $allcategories); |
| 107 | 107 | |
@@ -114,10 +114,10 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | } |
| 116 | 116 | // Language constants |
| 117 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 117 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 118 | 118 | $xoopsTpl->assign(array('lang_on' => _MD_SF_ON, 'lang_postedby' => _MD_SF_POSTEDBY, 'lang_total' => $totalQnasOnPage, 'lang_faq' => _MD_SF_FAQ, 'lang_datesub' => _MD_SF_DATESUB, 'lang_hits' => _MD_SF_HITS)); |
| 119 | 119 | |
| 120 | -$moduleName =& $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 120 | +$moduleName = & $myts->displayTarea($xoopsModule->getVar('name')); |
|
| 121 | 121 | $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename'])); |
| 122 | 122 | $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1)); |
| 123 | 123 | $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION); |
| 126 | 126 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 127 | 127 | $xoopsTpl->assign('sectionname', $moduleName); |
| 128 | -$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION); |
|
| 128 | +$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION); |
|
| 129 | 129 | |
| 130 | 130 | $xoopsTpl->assign('displayFull', false); |
| 131 | 131 | $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']); |
@@ -141,25 +141,25 @@ discard block |
||
| 141 | 141 | $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY); |
| 142 | 142 | |
| 143 | 143 | // Category Navigation Bar |
| 144 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 144 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 145 | 145 | $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', ''); |
| 146 | 146 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 147 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 147 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 148 | 148 | } else { |
| 149 | - $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 149 | + $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // FAQ Navigation Bar |
| 153 | 153 | $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', ''); |
| 154 | 154 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 155 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 155 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 156 | 156 | } else { |
| 157 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 157 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | // Page Title Hack by marcan |
| 161 | 161 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 162 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name')); |
|
| 162 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name')); |
|
| 163 | 163 | // End Page Title Hack by marcan |
| 164 | 164 | |
| 165 | -include_once(XOOPS_ROOT_PATH . '/footer.php'); |
|
| 165 | +include_once(XOOPS_ROOT_PATH.'/footer.php'); |
|
@@ -6,9 +6,9 @@ discard block |
||
| 6 | 6 | * Licence: GNU |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -include_once __DIR__ . '/header.php'; |
|
| 9 | +include_once __DIR__.'/header.php'; |
|
| 10 | 10 | |
| 11 | -$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0; |
|
| 11 | +$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0; |
|
| 12 | 12 | |
| 13 | 13 | // Creating the category handler object |
| 14 | 14 | $categoryHandler = sf_gethandler('category'); |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | } |
| 33 | 33 | $xoopsOption['template_main'] = 'smartfaq_category.tpl'; |
| 34 | 34 | |
| 35 | -include_once(XOOPS_ROOT_PATH . '/header.php'); |
|
| 36 | -include_once __DIR__ . '/footer.php'; |
|
| 35 | +include_once(XOOPS_ROOT_PATH.'/header.php'); |
|
| 36 | +include_once __DIR__.'/footer.php'; |
|
| 37 | 37 | |
| 38 | 38 | // At which record shall we start |
| 39 | -$start = isset($_GET['start']) ? (int)$_GET['start'] : 0; |
|
| 39 | +$start = isset($_GET['start']) ? (int) $_GET['start'] : 0; |
|
| 40 | 40 | |
| 41 | 41 | // Creating the faq handler object |
| 42 | 42 | $faqHandler = sf_gethandler('faq'); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | // Get the last smartfaq |
| 71 | 71 | $last_qnaObj = $faqHandler->getLastPublishedByCat(); |
| 72 | 72 | } |
| 73 | -$lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize']; |
|
| 73 | +$lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize']; |
|
| 74 | 74 | // Creating the sub-categories objects that belong to the selected category |
| 75 | 75 | $subcatsObj = $categoryHandler->getCategories(0, 0, $categoryid); |
| 76 | 76 | $total_subcats = count($subcatsObj); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) { |
| 83 | 83 | if (isset($last_qnaObj[$subcat_id])) { |
| 84 | 84 | $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid')); |
| 85 | - $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>'); |
|
| 85 | + $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>'); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $xoopsTpl->assign('subcats', $subcats); |
| 94 | 94 | } |
| 95 | 95 | $thiscategory_faqcount = isset($totalQnas[$categoryid]) ? $totalQnas[$categoryid] : 0; |
| 96 | -$category['total'] = $thiscategory_faqcount + $total_faqs; |
|
| 96 | +$category['total'] = $thiscategory_faqcount+$total_faqs; |
|
| 97 | 97 | |
| 98 | 98 | if (count($faqsObj) > 0) { |
| 99 | 99 | $userids = array(); |
@@ -109,13 +109,13 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $memberHandler = xoops_getHandler('member'); |
| 112 | - $users = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true); |
|
| 112 | + $users = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true); |
|
| 113 | 113 | // Adding the Q&As of the selected category |
| 114 | 114 | for ($i = 0; $i < $totalQnasOnPage; ++$i) { |
| 115 | 115 | $faq = $faqsObj[$i]->toArray(null, $categoryObj); |
| 116 | 116 | |
| 117 | 117 | // Creating the answer object |
| 118 | - $answerObj =& $allanswers[$faqsObj[$i]->faqid()]; |
|
| 118 | + $answerObj = & $allanswers[$faqsObj[$i]->faqid()]; |
|
| 119 | 119 | |
| 120 | 120 | $answerObj->setVar('dohtml', $faqsObj[$i]->getVar('html')); |
| 121 | 121 | $answerObj->setVar('doxcode', $faqsObj[$i]->getVar('xcodes')); |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (isset($last_qnaObj) && $last_qnaObj) { |
| 137 | 137 | $category['last_faqid'] = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid'); |
| 138 | - $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>'; |
|
| 138 | + $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>'; |
|
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | |
@@ -160,26 +160,26 @@ discard block |
||
| 160 | 160 | $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS); |
| 161 | 161 | |
| 162 | 162 | // The Navigation Bar |
| 163 | -include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 164 | -$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid')); |
|
| 163 | +include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 164 | +$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid')); |
|
| 165 | 165 | if ($xoopsModuleConfig['useimagenavpage'] == 1) { |
| 166 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>'); |
|
| 166 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>'); |
|
| 167 | 167 | } else { |
| 168 | - $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>'); |
|
| 168 | + $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>'); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | $xoopsTpl->assign('category', $category); |
| 172 | 172 | |
| 173 | 173 | // Page Title Hack by marcan |
| 174 | 174 | $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name')); |
| 175 | -$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']); |
|
| 175 | +$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']); |
|
| 176 | 176 | // End Page Title Hack by marcan |
| 177 | 177 | |
| 178 | 178 | //code to include smartie |
| 179 | -if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) { |
|
| 180 | - include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php'; |
|
| 179 | +if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) { |
|
| 180 | + include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php'; |
|
| 181 | 181 | $xoopsTpl->assign('smarttie', 1); |
| 182 | 182 | } |
| 183 | 183 | //end code for smarttie |
| 184 | 184 | |
| 185 | -include_once(XOOPS_ROOT_PATH . '/footer.php'); |
|
| 185 | +include_once(XOOPS_ROOT_PATH.'/footer.php'); |
|