Completed
Push — master ( 48b96e...454ebd )
by Michael
02:08
created
blocks/faqs_new.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
64
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
65 65
 
66 66
     $form .= "<option value='datesub'";
67 67
     if ('datesub' === $options[1]) {
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 ('counter' === $options[1]) {
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 ('weight' === $options[1]) {
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 .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_FAQS . '';
87
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
86
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_FAQS.'';
87
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
88 88
 
89
-    $form .= '<br>' . _MB_SF_SHOW_DATE . "&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
89
+    $form .= '<br>'._MB_SF_SHOW_DATE."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
90 90
     if (1 == $options[4]) {
91 91
         $form .= ' checked';
92 92
     }
93
-    $form .= '>&nbsp;' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'";
93
+    $form .= '>&nbsp;'._YES."<input type='radio' id='options[]' name='options[]' value='0'";
94 94
     if (0 == $options[4]) {
95 95
         $form .= ' checked';
96 96
     }
97
-    $form .= '>&nbsp;' . _NO . '';
97
+    $form .= '>&nbsp;'._NO.'';
98 98
 
99 99
     return $form;
100 100
 }
Please login to merge, or discard this patch.
blocks/faqs_recent_questions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
67
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
68 68
 
69 69
     $form .= "<option value='datesub'";
70 70
     if ('datesub' === $options[1]) {
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 ('counter' === $options[1]) {
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 ('weight' === $options[1]) {
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 .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_QUESTIONS . '';
90
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
89
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_QUESTIONS.'';
90
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
91 91
 
92
-    $form .= '<br>' . _MB_SF_SHOW_DATE . "&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
92
+    $form .= '<br>'._MB_SF_SHOW_DATE."&nbsp;<input type='radio' id='options[]' name='options[]' value='1'";
93 93
     if (1 == $options[4]) {
94 94
         $form .= ' checked';
95 95
     }
96
-    $form .= '>&nbsp;' . _YES . "<input type='radio' id='options[]' name='options[]' value='0'";
96
+    $form .= '>&nbsp;'._YES."<input type='radio' id='options[]' name='options[]' value='0'";
97 97
     if (0 == $options[4]) {
98 98
         $form .= ' checked';
99 99
     }
100
-    $form .= '>&nbsp;' . _NO . '';
100
+    $form .= '>&nbsp;'._NO.'';
101 101
 
102 102
     return $form;
103 103
 }
Please login to merge, or discard this patch.
blocks/faqs_most_viewed.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
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 (0 == $options[0]) {
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
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 .= '&nbsp;<br>' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[1] . "'>&nbsp;" . _MB_SF_FAQS . '';
56
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_LENGTH . '';
55
+    $form .= '&nbsp;<br>'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[1]."'>&nbsp;"._MB_SF_FAQS.'';
56
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_LENGTH.'';
57 57
 
58 58
     return $form;
59 59
 }
Please login to merge, or discard this patch.
blocks/faqs_recent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 function b_faqs_recent_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
     $myts = MyTextSanitizer::getInstance();
16 16
 
17 17
     $smartModule       = sf_getModuleInfo();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         }
53 53
 
54 54
         $memberHandler = xoops_getHandler('member');
55
-        $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
55
+        $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
56 56
         for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) {
57 57
             $faqs['categoryid']   = $faqsObj[$i]->categoryid();
58 58
             $faqs['question']     = $faqsObj[$i]->question($maxQuestionLength);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $block['lang_poster']   = _MB_SF_ANSWEREDBY;
75 75
         $block['lang_date']     = _MB_SF_DATE;
76 76
         $modulename             = $myts->htmlSpecialChars($smartModule->getVar('name'));
77
-        $block['lang_visitfaq'] = _MB_SF_VISITFAQ . ' ' . $modulename;
77
+        $block['lang_visitfaq'] = _MB_SF_VISITFAQ.' '.$modulename;
78 78
     }
79 79
 
80 80
     return $block;
@@ -86,34 +86,34 @@  discard block
 block discarded – undo
86 86
  */
87 87
 function b_faqs_recent_edit($options)
88 88
 {
89
-    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
89
+    require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
90 90
 
91 91
     $form = sf_createCategorySelect($options[0]);
92 92
 
93
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
93
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
94 94
 
95 95
     $form .= "<option value='datesub'";
96 96
     if ('datesub' === $options[1]) {
97 97
         $form .= ' selected';
98 98
     }
99
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
99
+    $form .= '>'._MB_SF_DATE."</option>\n";
100 100
 
101 101
     $form .= "<option value='counter'";
102 102
     if ('counter' === $options[1]) {
103 103
         $form .= ' selected';
104 104
     }
105
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
105
+    $form .= '>'._MB_SF_HITS."</option>\n";
106 106
 
107 107
     $form .= "<option value='weight'";
108 108
     if ('weight' === $options[1]) {
109 109
         $form .= ' selected';
110 110
     }
111
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
111
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
112 112
 
113 113
     $form .= "</select>\n";
114 114
 
115
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_FAQS . '';
116
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
115
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_FAQS.'';
116
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
117 117
 
118 118
     return $form;
119 119
 }
Please login to merge, or discard this patch.
request.php 2 patches
Switch Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -44,94 +44,94 @@
 block discarded – undo
44 44
 }
45 45
 
46 46
 switch ($op) {
47
-    case 'post':
47
+        case 'post':
48 48
 
49
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
49
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
50 50
 
51
-        $newFaqObj = $faqHandler->create();
51
+            $newFaqObj = $faqHandler->create();
52 52
 
53
-        if (!$xoopsUser) {
54
-            if (1 == $xoopsModuleConfig['anonpost']) {
55
-                $uid = 0;
53
+            if (!$xoopsUser) {
54
+                if (1 == $xoopsModuleConfig['anonpost']) {
55
+                    $uid = 0;
56
+                } else {
57
+                    redirect_header('index.php', 3, _NOPERM);
58
+                }
56 59
             } else {
57
-                redirect_header('index.php', 3, _NOPERM);
60
+                $uid = $xoopsUser->uid();
58 61
             }
59
-        } else {
60
-            $uid = $xoopsUser->uid();
61
-        }
62
-
63
-        // Putting the values about the FAQ in the FAQ object
64
-        $newFaqObj->setVar('categoryid', $_POST['categoryid']);
65
-        $newFaqObj->setVar('uid', $uid);
66
-        $newFaqObj->setVar('question', $_POST['question']);
67
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
68
-        $newFaqObj->setVar('notifypub', $notifypub);
69
-
70
-        // Setting the status of the FAQ
71
-        if (1 == $xoopsModuleConfig['autoapprove_request']) {
72
-            $newFaqObj->setVar('status', _SF_STATUS_OPENED);
73
-        } else {
74
-            $newFaqObj->setVar('status', _SF_STATUS_ASKED);
75
-        }
76
-
77
-        // Storing the FAQ object in the database
78
-        if (!$newFaqObj->store()) {
79
-            redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors()));
80
-        }
81
-
82
-        // Get the cateopry object related to that FAQ
83
-        // If autoapprove_requested
84
-        if (1 == $xoopsModuleConfig['autoapprove_request']) {
85
-            // We do not not subscribe user to notification on publish since we publish it right away
86
-
87
-            // Send notifications
88
-            $newFaqObj->sendNotifications([_SF_NOT_QUESTION_PUBLISHED]);
89
-
90
-            $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED;
91
-        } else {
92
-            // Subscribe the user to On Published notification, if requested
93
-            if (1 == $notifypub) {
94
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
95
-                $notificationHandler = xoops_getHandler('notification');
96
-                $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
62
+
63
+            // Putting the values about the FAQ in the FAQ object
64
+            $newFaqObj->setVar('categoryid', $_POST['categoryid']);
65
+            $newFaqObj->setVar('uid', $uid);
66
+            $newFaqObj->setVar('question', $_POST['question']);
67
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
68
+            $newFaqObj->setVar('notifypub', $notifypub);
69
+
70
+            // Setting the status of the FAQ
71
+            if (1 == $xoopsModuleConfig['autoapprove_request']) {
72
+                $newFaqObj->setVar('status', _SF_STATUS_OPENED);
73
+            } else {
74
+                $newFaqObj->setVar('status', _SF_STATUS_ASKED);
75
+            }
76
+
77
+            // Storing the FAQ object in the database
78
+            if (!$newFaqObj->store()) {
79
+                redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors()));
97 80
             }
98
-            // Send notifications
99
-            $newFaqObj->sendNotifications([_SF_NOT_QUESTION_SUBMITTED]);
100 81
 
101
-            $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL;
102
-        }
82
+            // Get the cateopry object related to that FAQ
83
+            // If autoapprove_requested
84
+            if (1 == $xoopsModuleConfig['autoapprove_request']) {
85
+                // We do not not subscribe user to notification on publish since we publish it right away
86
+
87
+                // Send notifications
88
+                $newFaqObj->sendNotifications([_SF_NOT_QUESTION_PUBLISHED]);
89
+
90
+                $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED;
91
+            } else {
92
+                // Subscribe the user to On Published notification, if requested
93
+                if (1 == $notifypub) {
94
+                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
95
+                    $notificationHandler = xoops_getHandler('notification');
96
+                    $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
97
+                }
98
+                // Send notifications
99
+                $newFaqObj->sendNotifications([_SF_NOT_QUESTION_SUBMITTED]);
100
+
101
+                $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL;
102
+            }
103 103
 
104
-        //redirect_header("javascript:history.go(-2)", 3, $redirect_msg);
105
-        redirect_header('index.php', 2, $redirect_msg);
106
-        break;
104
+            //redirect_header("javascript:history.go(-2)", 3, $redirect_msg);
105
+            redirect_header('index.php', 2, $redirect_msg);
106
+            break;
107 107
 
108
-    case 'form':
109
-    default:
108
+        case 'form':
109
+        default:
110 110
 
111
-        global $xoopsUser, $myts;
111
+            global $xoopsUser, $myts;
112 112
 
113
-        $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
114
-        require_once XOOPS_ROOT_PATH . '/header.php';
115
-        require_once __DIR__ . '/footer.php';
113
+            $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
114
+            require_once XOOPS_ROOT_PATH . '/header.php';
115
+            require_once __DIR__ . '/footer.php';
116 116
 
117
-        $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
117
+            $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
118 118
 
119
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
120
-        $xoopsTpl->assign('whereInSection', $moduleName);
121
-        $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST);
119
+            $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
120
+            $xoopsTpl->assign('whereInSection', $moduleName);
121
+            $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST);
122 122
 
123
-        $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST);
124
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg']));
123
+            $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST);
124
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg']));
125 125
 
126
-        require_once __DIR__ . '/include/request.inc.php';
126
+            require_once __DIR__ . '/include/request.inc.php';
127 127
 
128
-        $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
128
+            $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
129 129
 
130
-        $sectionname = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
130
+            $sectionname = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
131 131
 
132
-        require_once __DIR__ . '/include/request.inc.php';
132
+            require_once __DIR__ . '/include/request.inc.php';
133 133
 
134
-        require_once XOOPS_ROOT_PATH . '/footer.php';
134
+            require_once XOOPS_ROOT_PATH . '/footer.php';
135 135
 
136
-        break;
136
+            break;
137 137
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/header.php';
10
-require_once XOOPS_ROOT_PATH . '/header.php';
9
+require_once __DIR__.'/header.php';
10
+require_once XOOPS_ROOT_PATH.'/header.php';
11 11
 
12 12
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
13 13
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         // Storing the FAQ object in the database
78 78
         if (!$newFaqObj->store()) {
79
-            redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors()));
79
+            redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR.sf_formatErrors($newFaqObj->getErrors()));
80 80
         }
81 81
 
82 82
         // Get the cateopry object related to that FAQ
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         } else {
92 92
             // Subscribe the user to On Published notification, if requested
93 93
             if (1 == $notifypub) {
94
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
94
+                require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
95 95
                 $notificationHandler = xoops_getHandler('notification');
96 96
                 $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
97 97
             }
@@ -111,27 +111,27 @@  discard block
 block discarded – undo
111 111
         global $xoopsUser, $myts;
112 112
 
113 113
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
114
-        require_once XOOPS_ROOT_PATH . '/header.php';
115
-        require_once __DIR__ . '/footer.php';
114
+        require_once XOOPS_ROOT_PATH.'/header.php';
115
+        require_once __DIR__.'/footer.php';
116 116
 
117 117
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
118 118
 
119
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
119
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
120 120
         $xoopsTpl->assign('whereInSection', $moduleName);
121 121
         $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST);
122 122
 
123 123
         $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST);
124
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg']));
124
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, ".$myts->displayTarea($xoopsModuleConfig['requestintromsg']));
125 125
 
126
-        require_once __DIR__ . '/include/request.inc.php';
126
+        require_once __DIR__.'/include/request.inc.php';
127 127
 
128 128
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
129 129
 
130 130
         $sectionname = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
131 131
 
132
-        require_once __DIR__ . '/include/request.inc.php';
132
+        require_once __DIR__.'/include/request.inc.php';
133 133
 
134
-        require_once XOOPS_ROOT_PATH . '/footer.php';
134
+        require_once XOOPS_ROOT_PATH.'/footer.php';
135 135
 
136 136
         break;
137 137
 }
Please login to merge, or discard this patch.
open_category.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/header.php';
9
+require_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
13 13
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
14 14
 
15
-require_once XOOPS_ROOT_PATH . '/header.php';
16
-require_once __DIR__ . '/footer.php';
15
+require_once XOOPS_ROOT_PATH.'/header.php';
16
+require_once __DIR__.'/footer.php';
17 17
 
18
-$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
18
+$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
19 19
 
20 20
 // Creating the category object for the selected category
21 21
 $categoryObj = new sfCategory($categoryid);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $categoryHandler = sf_gethandler('category');
35 35
 
36 36
 // At which record shall we start
37
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
37
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
38 38
 
39 39
 // Creating the faq handler object
40 40
 $faqHandler = sf_gethandler('faq');
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 $last_qnaObj = $faqHandler->getLastPublishedByCat([_SF_STATUS_OPENED]);
59 59
 if (isset($last_qnaObj[$categoryid])) {
60 60
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
61
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
61
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
62 62
 }
63 63
 // Populating the smarty variables with informations related to the selected category
64 64
 $category                 = $categoryObj->toArray(null, true);
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
78 78
             if (isset($last_qnaObj[$subcat_id])) {
79 79
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
80
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
80
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
81 81
             }
82 82
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
83 83
             $subcats[$subcat_id] = $subcat->toArray(null, true);
84
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
84
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
85 85
         }
86 86
     }
87 87
     $xoopsTpl->assign('subcats', $subcats);
88 88
 }
89
-$category['total'] = $catQnasWithSub + $totalQnas[$categoryid];
89
+$category['total'] = $catQnasWithSub+$totalQnas[$categoryid];
90 90
 if ($faqsObj) {
91 91
     $userids = [];
92 92
     foreach ($faqsObj as $key => $thisfaq) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     $memberHandler = xoops_getHandler('member');
98
-    $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
98
+    $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
99 99
     for ($i = 0; $i < $totalQnasOnPage; ++$i) {
100 100
         $faq = $faqsObj[$i]->toArray(null, $allcategories);
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 // Language constants
110
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
110
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
111 111
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
112 112
 
113 113
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
125 125
 
126 126
 // The Navigation Bar
127
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
128
-$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
127
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
128
+$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
129 129
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
130
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
130
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
131 131
 } else {
132
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
132
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
133 133
 }
134 134
 
135 135
 $xoopsTpl->assign('category', $category);
136 136
 
137 137
 // Page Title Hack by marcan
138 138
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
139
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
139
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
140 140
 // End Page Title Hack by marcan
141 141
 
142
-require_once XOOPS_ROOT_PATH . '/footer.php';
142
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.