Completed
Push — master ( 65a58d...61df55 )
by Michael
08:26 queued 04:14
created
comment_delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,5 +7,5 @@
 block discarded – undo
7 7
 * Licence: GNU
8 8
 */
9 9
 
10
-include dirname(dirname(__DIR__)) . '/mainfile.php';
11
-include_once XOOPS_ROOT_PATH . '/include/comment_delete.php';
10
+include dirname(dirname(__DIR__)).'/mainfile.php';
11
+include_once XOOPS_ROOT_PATH.'/include/comment_delete.php';
Please login to merge, or discard this patch.
open_index.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -7,28 +7,28 @@  discard block
 block discarded – undo
7 7
 * Licence: GNU
8 8
 */
9 9
 
10
-include_once __DIR__ . '/header.php';
10
+include_once __DIR__.'/header.php';
11 11
 
12 12
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
13 13
 
14 14
 // At which record shall we start for the Categories
15
-$catstart = isset($_GET['catstart'])? intval($_GET['catstart']) : 0;
15
+$catstart = isset($_GET['catstart']) ? intval($_GET['catstart']) : 0;
16 16
 
17 17
 // At which record shall we start for the FAQs
18
-$start = isset($_GET['start'])? intval($_GET['start']) : 0;
18
+$start = isset($_GET['start']) ? intval($_GET['start']) : 0;
19 19
 
20 20
 // Creating the category handler object
21
-$category_handler =& sf_gethandler('category');
21
+$category_handler = & sf_gethandler('category');
22 22
 
23 23
 // Get the total number of categories
24 24
 $totalCategories = count($category_handler->getCategories());
25 25
 
26 26
 // Creating the faq handler object
27
-$faq_handler =& sf_gethandler('faq');
27
+$faq_handler = & sf_gethandler('faq');
28 28
 
29 29
 // Total number of published FAQ in the module
30 30
 $totalFaqs = $faq_handler->getFaqsCount(-1, _SF_STATUS_OPENED);
31
-if ($totalFaqs  == 0) {
31
+if ($totalFaqs == 0) {
32 32
     redirect_header("request.php", 2, _MD_SF_NO_OPEN_QUESTION);
33 33
     exit;
34 34
 }
@@ -38,15 +38,15 @@  discard block
 block discarded – undo
38 38
 
39 39
 // If no categories are found, exit
40 40
 $totalCategoriesOnPage = count($categoriesObj);
41
-if ($totalCategoriesOnPage  == 0) {
41
+if ($totalCategoriesOnPage == 0) {
42 42
     redirect_header("javascript:history.go(-1)", 2, _AM_SF_NO_CAT_EXISTS);
43 43
     exit;
44 44
 }
45 45
 
46 46
 $xoopsOption['template_main'] = 'smartfaq_index.tpl';
47 47
 
48
-include_once(XOOPS_ROOT_PATH . "/header.php");
49
-include_once __DIR__ . '/footer.php';
48
+include_once(XOOPS_ROOT_PATH."/header.php");
49
+include_once __DIR__.'/footer.php';
50 50
 
51 51
 //get all categories for future reference
52 52
 $allcategories = $category_handler->getObjects(null, true);
@@ -57,18 +57,18 @@  discard block
 block discarded – undo
57 57
 $subcats = $category_handler->getSubCats($categoriesObj);
58 58
 $totalQnas = $category_handler->faqsCount(0, array(_SF_STATUS_OPENED));
59 59
 
60
-$faq_handler =& sf_gethandler('faq');
60
+$faq_handler = & sf_gethandler('faq');
61 61
 $last_qnaObj = $faq_handler->getLastPublishedByCat(array(_SF_STATUS_OPENED));
62 62
 
63 63
 foreach ($categoriesObj as $cat_id => $category) {
64 64
     $total = 0;
65
-    if (isset($subcats[$cat_id]) && count($subcats[$cat_id])>0) {
65
+    if (isset($subcats[$cat_id]) && count($subcats[$cat_id]) > 0) {
66 66
         foreach ($subcats[$cat_id] as $key => $subcat) {
67 67
             $subcat_id = $subcat->getVar('categoryid');
68 68
             if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
69 69
                 if (isset($last_qnaObj[$subcat_id])) {
70 70
                     $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
71
-                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . "</a>");
71
+                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50)."</a>");
72 72
                 }
73 73
                 $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
74 74
                 $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION);
130 130
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
131 131
 $xoopsTpl->assign('sectionname', $moduleName);
132
-$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . "</a> > " . _MD_SF_OPEN_SECTION);
132
+$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName."</a> > "._MD_SF_OPEN_SECTION);
133 133
 
134 134
 $xoopsTpl->assign('displayFull', false);
135 135
 $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']);
@@ -145,25 +145,25 @@  discard block
 block discarded – undo
145 145
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
146 146
 
147 147
 // Category Navigation Bar
148
-include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
148
+include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
149 149
 $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', '');
150 150
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
151
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
151
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
152 152
 } else {
153
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
153
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
154 154
 }
155 155
 
156 156
 // FAQ Navigation Bar
157 157
 $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', '');
158 158
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
159
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
159
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
160 160
 } else {
161
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
161
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
162 162
 }
163 163
 
164 164
 // Page Title Hack by marcan
165 165
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
166
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name'));
166
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name'));
167 167
 // End Page Title Hack by marcan
168 168
 
169
-include_once(XOOPS_ROOT_PATH . "/footer.php");
169
+include_once(XOOPS_ROOT_PATH."/footer.php");
Please login to merge, or discard this patch.
answer.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 * Licence: GNU
8 8
 */
9 9
 
10
-include_once __DIR__ . '/header.php';
10
+include_once __DIR__.'/header.php';
11 11
 
12 12
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
13 13
 
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 if (isset($_POST['op'])) $op = $_POST['op'];
25 25
 
26 26
 // Getting the faqid
27
-$faqid = isset($_GET['faqid'])? intval($_GET['faqid']) : 0;
28
-$faqid = isset($_POST['faqid'])? intval($_POST['faqid']) : $faqid;
27
+$faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0;
28
+$faqid = isset($_POST['faqid']) ? intval($_POST['faqid']) : $faqid;
29 29
 
30 30
 // If no FAQ is selected, exit
31 31
 if ($faqid == 0) {
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 // Creating the FAQ handler object
37
-$faq_handler =& sf_gethandler('faq');
37
+$faq_handler = & sf_gethandler('faq');
38 38
 
39 39
 // Creating the answer handler object
40
-$answer_handler =& sf_gethandler('answer');
40
+$answer_handler = & sf_gethandler('answer');
41 41
 
42 42
 switch ($op) {
43 43
     // The answer is posted
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
     }
68 68
 
69 69
     // Get the category object related to that FAQ
70
-    $categoryObj =& $faqObj->category();
70
+    $categoryObj = & $faqObj->category();
71 71
 
72 72
     // Create the answer object
73 73
     $newAnswerObj = $answer_handler->create();
74 74
 
75 75
     // Putting the values in the answer object
76 76
     $newAnswerObj->setVar('faqid', $faqObj->faqid());
77
-    $newAnswerObj->setVar('answer',$_POST['answer']);
77
+    $newAnswerObj->setVar('answer', $_POST['answer']);
78 78
     $newAnswerObj->setVar('uid', $uid);
79 79
 
80 80
     // Depending of the status of the FAQ, some values need to be set
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
     }
128 128
 
129 129
     // Storing the FAQ object in the database
130
-    if ( !$faqObj->store() ) {
131
-        redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($faqObj->getErrors()));
130
+    if (!$faqObj->store()) {
131
+        redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($faqObj->getErrors()));
132 132
         exit();
133 133
     }
134 134
 
135 135
     // Storing the answer object in the database
136
-    if ( !$newAnswerObj->store() ) {
137
-        redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($newAnswerObj->getErrors()));
136
+    if (!$newAnswerObj->store()) {
137
+        redirect_header("javascript:history.go(-1)", 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($newAnswerObj->getErrors()));
138 138
         exit();
139 139
     }
140 140
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         case 2 :
152 152
         // Answer for an open question submitted, auto-approved; became Q&A, need approbation
153 153
         if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
154
-            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
154
+            include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
155 155
             $notification_handler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
156 156
         }
157 157
         // Send notifications
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         case 3 :
162 162
         // Answer submitted, needs approbation
163 163
         if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
164
-            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
164
+            include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
165 165
             $notification_handler->subscribe('question', $newAnswerObj->answerid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
166 166
         }
167 167
         // Send notifications
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         // New answer submitted for a published Q&A, need approbation
176 176
         // Send notifications
177 177
         if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
178
-            include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
178
+            include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
179 179
             $notification_handler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
180 180
         }
181 181
 
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
     }
205 205
 
206 206
     // Creating the category object that holds the selected FAQ
207
-    $categoryObj =& $faqObj->category();
207
+    $categoryObj = & $faqObj->category();
208 208
 
209 209
     // Creating the answer object
210
-    $answerObj =& $faqObj->answer();
210
+    $answerObj = & $faqObj->answer();
211 211
 
212 212
     // Check user permissions to access that category of the selected FAQ
213 213
     if (faqAccessGranted($faqObj) < 0) {
@@ -216,20 +216,20 @@  discard block
 block discarded – undo
216 216
     }
217 217
 
218 218
     $xoopsOption['template_main'] = 'smartfaq_submit.tpl';
219
-    include_once(XOOPS_ROOT_PATH . "/header.php");
220
-    include_once __DIR__ . '/footer.php';
219
+    include_once(XOOPS_ROOT_PATH."/header.php");
220
+    include_once __DIR__.'/footer.php';
221 221
 
222
-    $name = ($xoopsUser)? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous';
222
+    $name = ($xoopsUser) ? (ucwords($xoopsUser->getVar("uname"))) : 'Anonymous';
223 223
 
224 224
     $moduleName = $myts->displayTarea($xoopsModule->getVar('name'));
225 225
     $xoopsTpl->assign('whereInSection', $moduleName);
226 226
     $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER);
227 227
 
228 228
     $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name())));
229
-    $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUBMITANSWER_INTRO);
229
+    $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUBMITANSWER_INTRO);
230 230
 
231 231
     include_once 'include/answer.inc.php';
232 232
 
233
-    include_once XOOPS_ROOT_PATH . '/footer.php';
233
+    include_once XOOPS_ROOT_PATH.'/footer.php';
234 234
     break;
235 235
 }
Please login to merge, or discard this patch.
faq.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 * Licence: GNU
8 8
 */
9 9
 
10
-include_once __DIR__ . '/header.php';
10
+include_once __DIR__.'/header.php';
11 11
 
12 12
 $faqid = isset($_GET['faqid']) ? intval($_GET['faqid']) : 0;
13 13
 
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 }
18 18
 
19 19
 // Creating the FAQ handler object
20
-$faq_handler =& sf_gethandler('faq');
20
+$faq_handler = & sf_gethandler('faq');
21 21
 
22 22
 // Creating the FAQ object for the selected FAQ
23 23
 $faqObj = new sfFaq($faqid);
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     $faqObj->updateCounter();
47 47
 }
48 48
 $xoopsOption['template_main'] = 'smartfaq_faq.tpl';
49
-include_once(XOOPS_ROOT_PATH . "/header.php");
50
-include_once __DIR__ . '/footer.php';
49
+include_once(XOOPS_ROOT_PATH."/header.php");
50
+include_once __DIR__.'/footer.php';
51 51
 
52 52
 $faq = $faqObj->toArray(null, $categoryObj, false);
53 53
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 $xoopsTpl->assign('display_categoryname', false);
83 83
 
84 84
 $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes'));
85
-$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid'));
85
+$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid'));
86 86
 $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY);
87 87
 $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY);
88 88
 $xoopsTpl->assign('faqid', $faqObj->getVar('faqid'));
@@ -98,19 +98,19 @@  discard block
 block discarded – undo
98 98
 
99 99
 // Page Title Hack by marcan
100 100
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
101
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']);
101
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']);
102 102
 // End Page Title Hack by marcan
103 103
 
104 104
 // Include the comments if the selected FAQ supports comments
105 105
 if ($faqObj->cancomment() == 1) {
106
-    include_once XOOPS_ROOT_PATH . "/include/comment_view.php";
106
+    include_once XOOPS_ROOT_PATH."/include/comment_view.php";
107 107
 }
108 108
 
109 109
 //code to include smartie
110
-if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
111
-    include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
112
-        $xoopsTpl->assign('smarttie',1);
110
+if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) {
111
+    include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php';
112
+        $xoopsTpl->assign('smarttie', 1);
113 113
 }
114 114
 //end code for smarttie
115 115
 
116
-include_once XOOPS_ROOT_PATH . '/footer.php';
116
+include_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     if (!isset($smartModule)) {
19 19
         global $xoopsModule;
20 20
         if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == 'smartfaq') {
21
-            $smartModule =& $xoopsModule;
21
+            $smartModule = & $xoopsModule;
22 22
         } else {
23 23
             $hModule = &xoops_gethandler('module');
24 24
             $smartModule = $hModule->getByDirname('smartfaq');
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
         global $xoopsModule;
36 36
         if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == 'smartfaq') {
37 37
             global $xoopsModuleConfig;
38
-            $smartConfig =& $xoopsModuleConfig;
38
+            $smartConfig = & $xoopsModuleConfig;
39 39
         } else {
40
-            $smartModule =& sf_getModuleInfo();
40
+            $smartModule = & sf_getModuleInfo();
41 41
             $hModConfig = &xoops_gethandler('config');
42 42
             $smartConfig = $hModConfig->getConfigsByCat(0, $smartModule->getVar('mid'));
43 43
         }
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 
49 49
 function sf_getHelpPath()
50 50
 {
51
-    $smartConfig =& sf_getModuleConfig();
51
+    $smartConfig = & sf_getModuleConfig();
52 52
     switch ($smartConfig['helppath_select']) {
53 53
         case 'docs.xoops.org' :
54 54
             return 'http://docs.xoops.org/help/sfaqh/index.htm';
55 55
         break;
56 56
 
57 57
         case 'inside' :
58
-            return XOOPS_URL . "/modules/smartfaq/doc/";
58
+            return XOOPS_URL."/modules/smartfaq/doc/";
59 59
         break;
60 60
 
61 61
         case 'custom' :
@@ -64,31 +64,31 @@  discard block
 block discarded – undo
64 64
     }
65 65
 }
66 66
 
67
-function sf_formatErrors($errors=array())
67
+function sf_formatErrors($errors = array())
68 68
 {
69 69
     $ret = '';
70 70
     foreach ($errors as $key=>$value) {
71
-        $ret .= "<br /> - " . $value;
71
+        $ret .= "<br /> - ".$value;
72 72
     }
73 73
 
74 74
     return $ret;
75 75
 }
76 76
 
77
-function sf_addCategoryOption($categoryObj, $selectedid=0, $level = 0, $ret='')
77
+function sf_addCategoryOption($categoryObj, $selectedid = 0, $level = 0, $ret = '')
78 78
 {
79 79
     // Creating the category handler object
80
-    $category_handler =& sf_gethandler('category');
80
+    $category_handler = & sf_gethandler('category');
81 81
 
82 82
     $spaces = '';
83 83
     for ($j = 0; $j < $level; ++$j) {
84 84
         $spaces .= '--';
85 85
     }
86 86
 
87
-    $ret .= "<option value='" . $categoryObj->categoryid() . "'";
87
+    $ret .= "<option value='".$categoryObj->categoryid()."'";
88 88
     if ($selectedid == $categoryObj->categoryid()) {
89 89
         $ret .= " selected='selected'";
90 90
     }
91
-    $ret .= ">" . $spaces . $categoryObj->name() . "</option>\n";
91
+    $ret .= ">".$spaces.$categoryObj->name()."</option>\n";
92 92
 
93 93
     $subCategoriesObj = $category_handler->getCategories(0, 0, $categoryObj->categoryid());
94 94
     if (count($subCategoriesObj) > 0) {
@@ -101,16 +101,16 @@  discard block
 block discarded – undo
101 101
     return $ret;
102 102
 }
103 103
 
104
-function sf_createCategorySelect($selectedid=0, $parentcategory=0, $allCatOption=true)
104
+function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true)
105 105
 {
106
-    $ret = "" . _MB_SF_SELECTCAT . "&nbsp;<select name='options[]'>";
106
+    $ret = ""._MB_SF_SELECTCAT."&nbsp;<select name='options[]'>";
107 107
     if ($allCatOption) {
108 108
         $ret .= "<option value='0'";
109
-        $ret .= ">" . _MB_SF_ALLCAT . "</option>\n";
109
+        $ret .= ">"._MB_SF_ALLCAT."</option>\n";
110 110
     }
111 111
 
112 112
     // Creating the category handler object
113
-    $category_handler =& sf_gethandler('category');
113
+    $category_handler = & sf_gethandler('category');
114 114
 
115 115
     // Creating category objects
116 116
     $categoriesObj = $category_handler->getCategories(0, 0, $parentcategory);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     return $ret;
126 126
 }
127 127
 
128
-function sf_getStatusArray ()
128
+function sf_getStatusArray()
129 129
 {
130 130
     $result = array("1" => _AM_SF_STATUS1,
131 131
     "2" => _AM_SF_STATUS2,
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
     return $result;
140 140
 }
141 141
 
142
-function sf_moderator ()
142
+function sf_moderator()
143 143
 {
144 144
     global $xoopsUser;
145 145
 
146 146
     if (!$xoopsUser) {
147 147
         $result = false;
148 148
     } else {
149
-        $smartPermHandler =& xoops_getmodulehandler('permission', 'smartfaq');
149
+        $smartPermHandler = & xoops_getmodulehandler('permission', 'smartfaq');
150 150
 
151 151
         $categories = $smartPermHandler->getPermissions('moderation');
152 152
         if (count($categories) == 0) {
@@ -159,13 +159,13 @@  discard block
 block discarded – undo
159 159
     return $result;
160 160
 }
161 161
 
162
-function sf_modFooter ()
162
+function sf_modFooter()
163 163
 {
164
-    $smartModule =& sf_getModuleInfo();
164
+    $smartModule = & sf_getModuleInfo();
165 165
 
166
-    $modfootertxt = "Module " . $smartModule->getInfo('name') . " - Version " . $smartModule->getInfo('version') . "";
166
+    $modfootertxt = "Module ".$smartModule->getInfo('name')." - Version ".$smartModule->getInfo('version')."";
167 167
 
168
-    $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'/></a>";
168
+    $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'/></a>";
169 169
 
170 170
     return $modfooter;
171 171
 }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
     $result = false;
185 185
 
186
-    $smartModule =& sf_getModuleInfo();
186
+    $smartModule = & sf_getModuleInfo();
187 187
     $module_id = $smartModule->getVar('mid');
188 188
 
189 189
     if (!empty($xoopsUser)) {
@@ -216,10 +216,10 @@  discard block
 block discarded – undo
216 216
     } else {
217 217
         $result = -1;
218 218
 
219
-        $groups = ($xoopsUser)? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
219
+        $groups = ($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
220 220
 
221 221
         $gperm_handler = &xoops_gethandler('groupperm');
222
-        $smartModule =& sf_getModuleInfo();
222
+        $smartModule = & sf_getModuleInfo();
223 223
         $module_id = $smartModule->getVar('mid');
224 224
 
225 225
         // Do we have access to the parent category
@@ -255,12 +255,12 @@  discard block
 block discarded – undo
255 255
     Global $xoopsDB;
256 256
 
257 257
     $result = true;
258
-    $smartModule =& sf_getModuleInfo();
258
+    $smartModule = & sf_getModuleInfo();
259 259
     $module_id = $smartModule->getVar('mid');
260 260
 
261 261
     $gperm_handler = &xoops_gethandler('groupperm');
262 262
 
263
-    $sql = "SELECT faqid FROM " . $xoopsDB->prefix("smartfaq_faq") . " WHERE categoryid = '$categoryid' ";
263
+    $sql = "SELECT faqid FROM ".$xoopsDB->prefix("smartfaq_faq")." WHERE categoryid = '$categoryid' ";
264 264
     $result = $xoopsDB->query($sql);
265 265
 
266 266
     if (count($result) > 0) {
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 function sf_saveItemPermissions($groups, $itemID)
293 293
 {
294 294
     $result = true;
295
-    $smartModule =& sf_getModuleInfo();
295
+    $smartModule = & sf_getModuleInfo();
296 296
     $module_id = $smartModule->getVar('mid');
297 297
 
298 298
     $gperm_handler = &xoops_gethandler('groupperm');
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 function sf_saveCategory_Permissions($groups, $categoryid, $perm_name)
323 323
 {
324 324
     $result = true;
325
-    $smartModule =& sf_getModuleInfo();
325
+    $smartModule = & sf_getModuleInfo();
326 326
     $module_id = $smartModule->getVar('mid');
327 327
 
328 328
     $gperm_handler = &xoops_gethandler('groupperm');
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 function sf_saveModerators($moderators, $categoryid)
352 352
 {
353 353
     $result = true;
354
-    $smartModule =& sf_getModuleInfo();
354
+    $smartModule = & sf_getModuleInfo();
355 355
     $module_id = $smartModule->getVar('mid');
356 356
 
357 357
     $gperm_handler = &xoops_gethandler('groupperm');
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
     $ret = array();
373 373
     global $xoopsDB;
374 374
 
375
-    $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("smartfaq_faq") . " WHERE faqid = '$faqid'");
375
+    $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("smartfaq_faq")." WHERE faqid = '$faqid'");
376 376
     $ret = $xoopsDB->fetcharray($result);
377 377
 
378 378
     return $ret;
@@ -386,30 +386,30 @@  discard block
 block discarded – undo
386 386
 */
387 387
 
388 388
 // TODO : Move this to the sfFaq class
389
-function sf_getAdminLinks($faqid = 0, $open=false)
389
+function sf_getAdminLinks($faqid = 0, $open = false)
390 390
 {
391 391
     global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
392 392
     $adminLinks = '';
393
-    $modulePath = XOOPS_URL . "/modules/" . $xoopsModule->dirname() . "/";
394
-    $page = $open? 'question.php' : 'faq.php';
393
+    $modulePath = XOOPS_URL."/modules/".$xoopsModule->dirname()."/";
394
+    $page = $open ? 'question.php' : 'faq.php';
395 395
     if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
396 396
         // Edit button
397
-        $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'/></a>";
397
+        $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'/></a>";
398 398
         $adminLinks .= " ";
399 399
         // Delete button
400
-        $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'/></a>";
400
+        $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'/></a>";
401 401
         $adminLinks .= " ";
402 402
     }
403 403
     // Print button
404
-    $adminLinks .= "<a href='" . $modulePath . "print.php?faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'/></a>";
404
+    $adminLinks .= "<a href='".$modulePath."print.php?faqid=".$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'/></a>";
405 405
     $adminLinks .= " ";
406 406
     // Email button
407
-    $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
408
-    $adminLinks .= "<a href=\"" . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>";
407
+    $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.$modulePath.'faq.php?faqid='.$faqid;
408
+    $adminLinks .= "<a href=\"".$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'/></a>";
409 409
     $adminLinks .= " ";
410 410
     // Submit New Answer button
411 411
     if (($xoopsModuleConfig['allownewanswer']) && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) {
412
-        $adminLinks .= "<a href='" . $modulePath . "answer.php?faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'/></a>";
412
+        $adminLinks .= "<a href='".$modulePath."answer.php?faqid=".$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'/></a>";
413 413
         $adminLinks .= " ";
414 414
     }
415 415
 
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
             if (!isset($users[$userid])) {
440 440
                 return $GLOBALS['xoopsConfig']['anonymous'];
441 441
             }
442
-            $user =& $users[$userid];
442
+            $user = & $users[$userid];
443 443
         }
444 444
 
445 445
         if (is_object($user)) {
@@ -453,9 +453,9 @@  discard block
 block discarded – undo
453 453
                 $fullname = $user->getVar('name');
454 454
             }
455 455
             if (!empty($fullname)) {
456
-                $linkeduser = "$fullname [<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $userid . "'>" . $ts->htmlSpecialChars($username) . "</a>]";
456
+                $linkeduser = "$fullname [<a href='".XOOPS_URL."/userinfo.php?uid=".$userid."'>".$ts->htmlSpecialChars($username)."</a>]";
457 457
             } else {
458
-                $linkeduser = "<a href='" . XOOPS_URL . "/userinfo.php?uid=" . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . "</a>";
458
+                $linkeduser = "<a href='".XOOPS_URL."/userinfo.php?uid=".$userid."'>".ucwords($ts->htmlSpecialChars($username))."</a>";
459 459
             }
460 460
 
461 461
             return $linkeduser;
@@ -479,18 +479,18 @@  discard block
 block discarded – undo
479 479
     return $xurl;
480 480
 }
481 481
 
482
-function sf_adminMenu ($currentoption = 0, $breadcrumb = '')
482
+function sf_adminMenu($currentoption = 0, $breadcrumb = '')
483 483
 {
484 484
 
485 485
     /* Nice buttons styles */
486 486
     echo "
487 487
         <style type='text/css'>
488 488
         #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; }
489
-        #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/smartfaq/assets/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; }
489
+        #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL."/modules/smartfaq/assets/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px; }
490 490
         #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; }
491 491
         #buttonbar li { display:inline; margin:0; padding:0; }
492
-        #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/smartfaq/assets/images/left_both.gif') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
493
-        #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/smartfaq/assets/images/right_both.gif') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
492
+        #buttonbar a { float:left; background:url('" . XOOPS_URL."/modules/smartfaq/assets/images/left_both.gif') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; }
493
+        #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL."/modules/smartfaq/assets/images/right_both.gif') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; }
494 494
         /* Commented Backslash Hack hides rule from IE5-Mac \*/
495 495
         #buttonbar a span {float:none;}
496 496
         /* End IE5-Mac hack */
@@ -509,27 +509,27 @@  discard block
 block discarded – undo
509 509
     $tblColors = Array();
510 510
     $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = '';
511 511
     $tblColors[$currentoption] = 'current';
512
-    if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) {
513
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/language/' . $xoopsConfig['language'] . '/modinfo.php';
512
+    if (file_exists(XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname').'/language/'.$xoopsConfig['language'].'/modinfo.php')) {
513
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/language/'.$xoopsConfig['language'].'/modinfo.php';
514 514
     } else {
515
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/english/modinfo.php';
515
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/english/modinfo.php';
516 516
     }
517 517
 
518 518
     echo "<div id='buttontop'>";
519 519
     echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>";
520 520
     //echo "<td style=\"width: 45%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&amp;op=showmod&amp;mod=" . $xoopsModule->getVar('mid') . "\">" . _AM_SF_OPTS . "</a> | <a href=\"import.php\">" . _AM_SF_IMPORT . "</a> | <a href=\"../index.php\">" . _AM_SF_GOMOD . "</a> | <a href=\"../help/index.html\" target=\"_blank\">" . _AM_SF_HELP . "</a> | <a href=\"about.php\">" . _AM_SF_ABOUT . "</a></td>";
521
-    echo "<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'><a class='nobutton' href='" . XOOPS_URL . "/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=" . $xoopsModule->getVar('mid') . "'>" . _AM_SF_OPTS . "</a> | <a href='" . XOOPS_URL . "/modules/smartfaq/admin/import.php'>" . _AM_SF_IMPORT . "</a> | <a href='" . XOOPS_URL . "/modules/smartfaq/index.php'>" . _AM_SF_GOMOD . "</a> | <a href='" . XOOPS_URL . "/modules/system/admin.php?fct=modulesadmin&op=update&module=" . $xoopsModule->getVar('dirname') . "'>" . _AM_SF_UPDATE . "</a> | <a href='" . sf_getHelpPath() . "' target='_blank'>" . _AM_SF_HELP . "</a> | <a href='" . XOOPS_URL . "/modules/smartfaq/admin/about.php'>" . _AM_SF_ABOUT . "</a></td>";
522
-    echo "<td style='font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;'><b>" . $myts->displayTarea($xoopsModule->name()) . " " . _AM_SF_MODADMIN . "</b> " . $breadcrumb . "</td>";
521
+    echo "<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'><a class='nobutton' href='".XOOPS_URL."/modules/system/admin.php?fct=preferences&amp;op=showmod&amp;mod=".$xoopsModule->getVar('mid')."'>"._AM_SF_OPTS."</a> | <a href='".XOOPS_URL."/modules/smartfaq/admin/import.php'>"._AM_SF_IMPORT."</a> | <a href='".XOOPS_URL."/modules/smartfaq/index.php'>"._AM_SF_GOMOD."</a> | <a href='".XOOPS_URL."/modules/system/admin.php?fct=modulesadmin&op=update&module=".$xoopsModule->getVar('dirname')."'>"._AM_SF_UPDATE."</a> | <a href='".sf_getHelpPath()."' target='_blank'>"._AM_SF_HELP."</a> | <a href='".XOOPS_URL."/modules/smartfaq/admin/about.php'>"._AM_SF_ABOUT."</a></td>";
522
+    echo "<td style='font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;'><b>".$myts->displayTarea($xoopsModule->name())." "._AM_SF_MODADMIN."</b> ".$breadcrumb."</td>";
523 523
     echo "</tr></table>";
524 524
     echo "</div>";
525 525
 
526 526
     echo "<div id='buttonbar'>";
527 527
     echo "<ul>";
528
-    echo "<li id='" . $tblColors[0] . "'><a href=\"" . XOOPS_URL . "/modules/smartfaq/admin/index.php\"><span>" . _AM_SF_INDEX . "</span></a></li>";
529
-    echo "<li id='" . $tblColors[1] . "'><a href=\"" . XOOPS_URL . "/modules/smartfaq/admin/category.php\"><span>" . _AM_SF_CATEGORIES . "</span></a></li>";
530
-    echo "<li id='" . $tblColors[2] . "'><a href=\"" . XOOPS_URL . "/modules/smartfaq/admin/faq.php\"><span>" . _AM_SF_SMARTFAQS . "</span></a></li>";
531
-    echo "<li id='" . $tblColors[3] . "'><a href=\"" . XOOPS_URL . "/modules/smartfaq/admin/question.php\"><span>" . _AM_SF_OPEN_QUESTIONS . "</span></a></li>";
532
-    echo "<li id='" . $tblColors[4] . "'><a href=\"" . XOOPS_URL . "/modules/smartfaq/admin/permissions.php\"><span>" . _AM_SF_PERMISSIONS . "</span></a></li>";
528
+    echo "<li id='".$tblColors[0]."'><a href=\"".XOOPS_URL."/modules/smartfaq/admin/index.php\"><span>"._AM_SF_INDEX."</span></a></li>";
529
+    echo "<li id='".$tblColors[1]."'><a href=\"".XOOPS_URL."/modules/smartfaq/admin/category.php\"><span>"._AM_SF_CATEGORIES."</span></a></li>";
530
+    echo "<li id='".$tblColors[2]."'><a href=\"".XOOPS_URL."/modules/smartfaq/admin/faq.php\"><span>"._AM_SF_SMARTFAQS."</span></a></li>";
531
+    echo "<li id='".$tblColors[3]."'><a href=\"".XOOPS_URL."/modules/smartfaq/admin/question.php\"><span>"._AM_SF_OPEN_QUESTIONS."</span></a></li>";
532
+    echo "<li id='".$tblColors[4]."'><a href=\"".XOOPS_URL."/modules/smartfaq/admin/permissions.php\"><span>"._AM_SF_PERMISSIONS."</span></a></li>";
533 533
     echo "</ul></div>";
534 534
 }
535 535
 
@@ -578,15 +578,15 @@  discard block
 block discarded – undo
578 578
     //-->
579 579
     </script>
580 580
     <?php
581
-    echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
581
+    echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">";
582 582
 }
583 583
 
584
-function sf_gethandler($name, $optional = false )
584
+function sf_gethandler($name, $optional = false)
585 585
 {
586 586
     static $handlers;
587 587
     $name = strtolower(trim($name));
588 588
     if (!isset($handlers[$name])) {
589
-        if ( file_exists( $hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php' ) ) {
589
+        if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) {
590 590
             require_once $hnd_file;
591 591
         }
592 592
         $class = 'sf'.ucfirst($name).'Handler';
@@ -594,10 +594,10 @@  discard block
 block discarded – undo
594 594
             $handlers[$name] = new $class($GLOBALS['xoopsDB']);
595 595
         }
596 596
     }
597
-    if (!isset($handlers[$name]) && !$optional ) {
597
+    if (!isset($handlers[$name]) && !$optional) {
598 598
         trigger_error('Class <b>'.$class.'</b> does not exist<br />Handler Name: '.$name, E_USER_ERROR);
599 599
     }
600 600
     $false = false;
601 601
 
602
-    return isset($handlers[$name])? $handlers[$name] : $false;
602
+    return isset($handlers[$name]) ? $handlers[$name] : $false;
603 603
 }
Please login to merge, or discard this patch.
include/searchform.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
 * Licence: GNU
8 8
 */
9 9
 
10
-$categoryID = isset($categoryID)? intval($categoryID) : 0;
11
-$type = isset($type)? intval($type) : 3;
12
-$term = isset($term)? ($type) : '';
10
+$categoryID = isset($categoryID) ? intval($categoryID) : 0;
11
+$type = isset($type) ? intval($type) : 3;
12
+$term = isset($term) ? ($type) : '';
13 13
 
14 14
 $sform = new XoopsThemeForm(_MD_WB_SEARCHFORM, "searchform", "search.php");
15 15
 $sform->setExtra('enctype="multipart/form-data"');
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 
21 21
 if ($xoopsModuleConfig['multicats'] == 1) {
22 22
     $searchcat = new XoopsFormSelect(_MD_WB_CATEGORY, 'categoryID', $categoryID);
23
-    $searchcat->addOption ("0", _MD_WB_ALLOFTHEM);
23
+    $searchcat->addOption("0", _MD_WB_ALLOFTHEM);
24 24
 
25
-    $resultcat = $xoopsDB->query ("SELECT categoryID, name FROM " . $xoopsDB->prefix ("wbcategories") . " ORDER BY categoryID");
25
+    $resultcat = $xoopsDB->query("SELECT categoryID, name FROM ".$xoopsDB->prefix("wbcategories")." ORDER BY categoryID");
26 26
 
27 27
     while (list($categoryID, $name) = $xoopsDB->fetchRow($resultcat)) {
28
-        $searchcat->addOption ("categoryID", "$categoryID : $name");
28
+        $searchcat->addOption("categoryID", "$categoryID : $name");
29 29
     }
30 30
     $sform->addElement($searchcat, true);
31 31
 }
Please login to merge, or discard this patch.
include/answer.inc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@  discard block
 block discarded – undo
10 10
 
11 11
 global $_POST;
12 12
 
13
-include_once XOOPS_ROOT_PATH . "/class/xoopstree.php";
14
-include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
15
-include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
13
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
14
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
15
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
16 16
 //include_once 'functions.php';
17 17
 
18 18
 $mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid");
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
            $options['width'] = '100%';
33 33
            $options['height'] = '200px';
34 34
        $answerEditor  = new XoopsFormEditor('', $xoopsModuleConfig['form_editorOptionsUser'], $options, $nohtml = false, $onfailure = 'textarea');
35
-           $editorTray->addElement($answerEditor,true );
35
+           $editorTray->addElement($answerEditor, true);
36 36
        } else {
37 37
        $answerEditor  = new XoopsFormDhtmlTextArea(_MD_SF_ANSWER_FAQ, 'answer', '', '100%', '100%');
38
-       $editorTray->addElement($answerEditor, true );
38
+       $editorTray->addElement($answerEditor, true);
39 39
    }
40 40
 $form->addElement($editorTray);
41 41
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     $form->addElement($notify_checkbox);
47 47
 }
48 48
 
49
-if (($faqObj->status() == _SF_STATUS_PUBLISHED) || ($faqObj->status() == _SF_STATUS_NEW_ANSWER) ) {
50
-    $answerObj =& $faqObj->answer();
49
+if (($faqObj->status() == _SF_STATUS_PUBLISHED) || ($faqObj->status() == _SF_STATUS_NEW_ANSWER)) {
50
+    $answerObj = & $faqObj->answer();
51 51
     $form->addElement(new XoopsFormLabel(_MD_SF_ORIGINAL_ANSWER, $answerObj->answer()), false);
52 52
 }
53 53
 
Please login to merge, or discard this patch.
include/functions.render.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     if ($br != 0) {
54 54
         $text = $myts->nl2Br($text);
55 55
     }
56
-    $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
56
+    $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18)
57 57
 
58 58
     return $text;
59 59
 }
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
     // START hacked by irmtfan
101 101
     // to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set
102 102
     global $xoopsModuleConfig;
103
-    if (func_num_args()== 2) {
103
+    if (func_num_args() == 2) {
104 104
         // overall setting
105
-        if ( !empty($xoopsModuleConfig['display_text_links']) ) {
106
-            $display=false;
105
+        if (!empty($xoopsModuleConfig['display_text_links'])) {
106
+            $display = false;
107 107
         }
108 108
         // if set for each link => overwrite $display
109 109
         if (isset($xoopsModuleConfig['display_text_each_link'][$image])) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     }
131 131
 
132 132
     $icon_handler = NewbbIconHandler::instance();
133
-    $icon_handler->template =& $xoTheme->template;
133
+    $icon_handler->template = & $xoTheme->template;
134 134
     $icon_handler->init($xoopsConfig["language"]);
135 135
 
136 136
     return $icon_handler;
Please login to merge, or discard this patch.
include/request.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@
 block discarded – undo
10 10
 
11 11
 global $_POST;
12 12
 
13
-include_once XOOPS_ROOT_PATH . "/class/xoopstree.php";
14
-include_once XOOPS_ROOT_PATH . "/class/xoopslists.php";
15
-include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php";
13
+include_once XOOPS_ROOT_PATH."/class/xoopstree.php";
14
+include_once XOOPS_ROOT_PATH."/class/xoopslists.php";
15
+include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
16 16
 
17 17
 $form = new XoopsThemeForm(_MD_SF_REQUEST, "form", xoops_getenv('PHP_SELF'));
18 18
 // CATEGORY
19
-$mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid" , "parentid");
19
+$mytree = new XoopsTree($xoopsDB->prefix("smartfaq_categories"), "categoryid", "parentid");
20 20
 ob_start();
21 21
 $form->addElement(new XoopsFormHidden('categoryid', ''));
22 22
 $mytree->makeMySelBox("name", "weight", '');
Please login to merge, or discard this patch.