Completed
Push — master ( 48b96e...454ebd )
by Michael
02:08
created
blocks/faqs_random_faq.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 function b_faqs_random_faq_show()
11 11
 {
12
-    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
12
+    require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
13 13
 
14 14
     $block = [];
15 15
 
Please login to merge, or discard this patch.
admin/question.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-require_once __DIR__ . '/admin_header.php';
9
+require_once __DIR__.'/admin_header.php';
10 10
 
11 11
 // Creating the faq handler object
12 12
 $faqHandler = sf_gethandler('faq');
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 }
24 24
 
25 25
 // Where shall we start?
26
-$startfaq = isset($_GET['startfaq']) ? (int)$_GET['startfaq'] : 0;
26
+$startfaq = isset($_GET['startfaq']) ? (int) $_GET['startfaq'] : 0;
27 27
 
28 28
 /**
29 29
  * @param bool $showmenu
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 {
34 34
     global $faqHandler, $categoryHandler, $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL, $myts;
35 35
 
36
-    require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
36
+    require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
37 37
     // If there is a parameter, and the id exists, retrieve data: we're editing a faq
38 38
     if ($faqid != -1) {
39 39
         // Creating the FAQ object
@@ -65,9 +65,9 @@  discard block
 block discarded – undo
65 65
 
66 66
         echo "<br>\n";
67 67
         sf_collapsableBar('bottomtable', 'bottomtableicon');
68
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $collapsableBar_title . '</h3>';
68
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$collapsableBar_title.'</h3>';
69 69
         echo "<div id='bottomtable'>";
70
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $collapsableBar_info . '</span>';
70
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$collapsableBar_info.'</span>';
71 71
     } else {
72 72
         // there's no parameter, so we're adding a faq
73 73
         $faqObj = $faqHandler->create();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $button_caption    = _AM_SF_CREATE;
79 79
 
80 80
         sf_collapsableBar('bottomtable', 'bottomtableicon');
81
-        echo "<img id='bottomtableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_CREATEQUESTION . '</h3>';
81
+        echo "<img id='bottomtableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_CREATEQUESTION.'</h3>';
82 82
         echo "<div id='bottomtable'>";
83 83
     }
84 84
     $sform = new XoopsThemeForm(_AM_SF_OPEN_QUESTION, 'op', xoops_getenv('PHP_SELF'), 'post', true);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $button_tray->addElement($butt_create);
153 153
 
154 154
         $butt_edit = new XoopsFormButton('', '', _AM_SF_OPEN_QUESTION_EDIT, 'button');
155
-        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=" . $faqid . "'\"");
155
+        $butt_edit->setExtra("onclick=\"location='faq.php?op=mod&amp;faqid=".$faqid."'\"");
156 156
         $button_tray->addElement($butt_edit);
157 157
 
158 158
         $butt_cancel = new XoopsFormButton('', '', _AM_SF_CANCEL, 'button');
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         xoops_cp_header();
185 185
 
186 186
         $adminObject->displayNavigation(basename(__FILE__));
187
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
187
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
188 188
 
189 189
         editfaq(true, $faqid);
190 190
         break;
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $uid = $xoopsUser->uid();
203 203
         }
204 204
 
205
-        $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : -1;
205
+        $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : -1;
206 206
 
207 207
         // Creating the FAQ
208 208
         if ($faqid != -1) {
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
 
214 214
         // Putting the values in the FAQ object
215 215
         $faqObj->setGroups_read(isset($_POST['groups']) ? $_POST['groups'] : []);
216
-        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int)$_POST['categoryid'] : 0);
216
+        $faqObj->setVar('categoryid', isset($_POST['categoryid']) ? (int) $_POST['categoryid'] : 0);
217 217
         $faqObj->setVar('question', $_POST['question']);
218
-        $faqObj->setVar('status', isset($_POST['status']) ? (int)$_POST['status'] : _SF_STATUS_ASKED);
218
+        $faqObj->setVar('status', isset($_POST['status']) ? (int) $_POST['status'] : _SF_STATUS_ASKED);
219 219
 
220 220
         $notifToDo = null;
221 221
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 
248 248
         // Storing the FAQ
249 249
         if (!$faqObj->store()) {
250
-            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR . sf_formatErrors($faqObj->getErrors()));
250
+            redirect_header('javascript:history.go(-1)', 3, _AM_SF_ERROR.sf_formatErrors($faqObj->getErrors()));
251 251
         }
252 252
 
253 253
         // Send notifications
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         $module_id    = $xoopsModule->getVar('mid');
266 266
         $gpermHandler = xoops_getHandler('groupperm');
267 267
 
268
-        $faqid = isset($_POST['faqid']) ? (int)$_POST['faqid'] : 0;
269
-        $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : $faqid;
268
+        $faqid = isset($_POST['faqid']) ? (int) $_POST['faqid'] : 0;
269
+        $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : $faqid;
270 270
 
271 271
         $faqObj = new sfFaq($faqid);
272 272
 
@@ -281,14 +281,14 @@  discard block
 block discarded – undo
281 281
             redirect_header('question.php', 2, sprintf(_AM_SF_QUESTIONISDELETED, $faqObj->question()));
282 282
         } else {
283 283
             // no confirm: show deletion condition
284
-            $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
284
+            $faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0;
285 285
             xoops_cp_header();
286 286
             xoops_confirm([
287 287
                               'op'      => 'del',
288 288
                               'faqid'   => $faqObj->faqid(),
289 289
                               'confirm' => 1,
290 290
                               'name'    => $faqObj->question()
291
-                          ], 'question.php', _AM_SF_DELETETHISQUESTION . " <br>'" . $faqObj->question() . "'. <br> <br>", _AM_SF_DELETE);
291
+                          ], 'question.php', _AM_SF_DELETETHISQUESTION." <br>'".$faqObj->question()."'. <br> <br>", _AM_SF_DELETE);
292 292
             xoops_cp_footer();
293 293
         }
294 294
 
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
         xoops_cp_header();
302 302
         $adminObject->displayNavigation(basename(__FILE__));
303 303
 
304
-        require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
305
-        require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
304
+        require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
305
+        require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
306 306
 
307 307
         global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModuleConfig, $xoopsModule, $smartModuleConfig;
308 308
 
@@ -310,9 +310,9 @@  discard block
 block discarded – undo
310 310
 
311 311
         sf_collapsableBar('toptable', 'toptableicon');
312 312
 
313
-        echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_OPENED_TITLE . '</h3>';
313
+        echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_OPENED_TITLE.'</h3>';
314 314
         echo "<div id='toptable'>";
315
-        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_OPENED_DSC . '</span>';
315
+        echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_OPENED_DSC.'</span>';
316 316
 
317 317
         // Get the total number of published FAQs
318 318
         $totalfaqs = $faqHandler->getFaqsCount(-1, [_SF_STATUS_OPENED]);
@@ -322,14 +322,14 @@  discard block
 block discarded – undo
322 322
         $allCats         = $categoryHandler->getObjects(null, true);
323 323
         echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
324 324
         echo '<tr>';
325
-        echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
326
-        echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
327
-        echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
325
+        echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
326
+        echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
327
+        echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
328 328
 
329
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
329
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
330 330
 
331
-        echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
332
-        echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
331
+        echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
332
+        echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
333 333
         echo '</tr>';
334 334
         //var_dump( $faqsObj);
335 335
         if ($totalfaqs > 0) {
@@ -337,33 +337,33 @@  discard block
 block discarded – undo
337 337
             foreach (array_keys($faqsObj) as $i) {
338 338
                 $categoryObj = $allCats[$faqsObj[$i]->categoryid()];
339 339
 
340
-                $modify = "<a href='question.php?op=mod&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>";
341
-                $delete = "<a href='question.php?op=del&amp;faqid=" . $faqsObj[$i]->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_DELETEART . "' alt='" . _AM_SF_DELETEART . "'></a>";
340
+                $modify = "<a href='question.php?op=mod&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>";
341
+                $delete = "<a href='question.php?op=del&amp;faqid=".$faqsObj[$i]->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_DELETEART."' alt='"._AM_SF_DELETEART."'></a>";
342 342
 
343 343
                 $requester = sf_getLinkedUnameFromId($faqsObj[$i]->uid(), $smartModuleConfig['userealname']);
344 344
 
345 345
                 echo '<tr>';
346
-                echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
347
-                echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
348
-                echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/answer.php?faqid=' . $faqsObj[$i]->faqid() . "'>" . $faqsObj[$i]->question(100) . '</a></td>';
346
+                echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
347
+                echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
348
+                echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/answer.php?faqid='.$faqsObj[$i]->faqid()."'>".$faqsObj[$i]->question(100).'</a></td>';
349 349
 
350
-                echo "<td class='even' align='center'>" . $requester . '</td>';
350
+                echo "<td class='even' align='center'>".$requester.'</td>';
351 351
 
352
-                echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
352
+                echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
353 353
                 echo "<td class='even' align='center'> $modify $delete </td>";
354 354
                 echo '</tr>';
355 355
             }
356 356
         } else {
357 357
             $faqid = -1;
358 358
             echo '<tr>';
359
-            echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOQUEUED . '</td>';
359
+            echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOQUEUED.'</td>';
360 360
             echo '</tr>';
361 361
         }
362 362
         echo "</table>\n";
363 363
         echo "<br>\n";
364 364
 
365 365
         $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq');
366
-        echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
366
+        echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
367 367
         echo '</div>';
368 368
 
369 369
         $totalcategories = $categoryHandler->getCategoriesCount(-1);
@@ -374,4 +374,4 @@  discard block
 block discarded – undo
374 374
         break;
375 375
 }
376 376
 
377
-require_once __DIR__ . '/admin_footer.php';
377
+require_once __DIR__.'/admin_footer.php';
Please login to merge, or discard this patch.
admin/myblocksadmin.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@  discard block
 block discarded – undo
12 12
 //                          GIJOE <http://www.peak.ne.jp>                   //
13 13
 // ------------------------------------------------------------------------- //
14 14
 
15
-require_once __DIR__ . '/../../../include/cp_header.php';
16
-require_once __DIR__ . '/mygrouppermform.php';
17
-require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
18
-require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() . '/include/functions.php';
15
+require_once __DIR__.'/../../../include/cp_header.php';
16
+require_once __DIR__.'/mygrouppermform.php';
17
+require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
18
+require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->dirname().'/include/functions.php';
19 19
 
20
-$xoops_system_path = XOOPS_ROOT_PATH . '/modules/system';
20
+$xoops_system_path = XOOPS_ROOT_PATH.'/modules/system';
21 21
 
22 22
 // language files
23 23
 $language = $xoopsConfig['language'];
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
 
28 28
 // to prevent from notice that constants already defined
29 29
 $error_reporting_level = error_reporting(0);
30
-require_once __DIR__ . '/../../system/constants.php';
31
-require_once __DIR__ . "/../../language/$language/admin.php";
32
-require_once __DIR__ . "/../../language/$language/admin/blocksadmin.php";
33
-require_once __DIR__ . '/../include/functions.php';
30
+require_once __DIR__.'/../../system/constants.php';
31
+require_once __DIR__."/../../language/$language/admin.php";
32
+require_once __DIR__."/../../language/$language/admin/blocksadmin.php";
33
+require_once __DIR__.'/../include/functions.php';
34 34
 error_reporting($error_reporting_level);
35 35
 
36 36
 $group_defs = file("$xoops_system_path/language/$language/admin/groups.php");
@@ -42,13 +42,13 @@  discard block
 block discarded – undo
42 42
 
43 43
 // check $xoopsModule
44 44
 if (!is_object($xoopsModule)) {
45
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
45
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
46 46
 }
47 47
 
48 48
 // check access right (needs system_admin of BLOCK)
49 49
 $syspermHandler = xoops_getHandler('groupperm');
50 50
 if (!$syspermHandler->checkRight('system_admin', XOOPS_SYSTEM_BLOCK, $xoopsUser->getGroups())) {
51
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
51
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
52 52
 }
53 53
 
54 54
 // get blocks owned by the module
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
 
76 76
     // displaying TH
77 77
     sf_collapsableBar('toptable', 'toptableicon');
78
-    echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . _AM_SF_BLOCKS . '</h3>';
78
+    echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;"._AM_SF_BLOCKS.'</h3>';
79 79
     echo "<div id='toptable'>";
80
-    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . _AM_SF_BLOCKSTXT . '</span>';
80
+    echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'._AM_SF_BLOCKSTXT.'</span>';
81 81
 
82 82
     echo "
83 83
     <form action='admin.php' name='blockadmin' method='post'>
84 84
         <table width='100%' class='outer' cellpadding='4' cellspacing='1'>
85 85
         <tr valign='middle'>
86
-            <th>" . _AM_TITLE . "</th>
87
-            <th align='center' nowrap='nowrap'>" . _AM_SF_POSITION . "</th>
88
-            <th align='center'>" . _AM_WEIGHT . "</th>
89
-            <th align='center'>" . _AM_VISIBLEIN . "</th>
90
-            <th align='center'>" . _AM_BCACHETIME . "</th>
91
-            <th align='center'>" . _AM_ACTION . "</th>
86
+            <th>" . _AM_TITLE."</th>
87
+            <th align='center' nowrap='nowrap'>" . _AM_SF_POSITION."</th>
88
+            <th align='center'>" . _AM_WEIGHT."</th>
89
+            <th align='center'>" . _AM_VISIBLEIN."</th>
90
+            <th align='center'>" . _AM_BCACHETIME."</th>
91
+            <th align='center'>" . _AM_ACTION."</th>
92 92
         </tr>\n";
93 93
 
94 94
     // blocks displaying loop
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 
139 139
         // target modules
140 140
         $db            = XoopsDatabaseFactory::getDatabaseConnection();
141
-        $result        = $db->query('SELECT module_id FROM ' . $db->prefix('block_module_link') . " WHERE block_id='$bid'");
141
+        $result        = $db->query('SELECT module_id FROM '.$db->prefix('block_module_link')." WHERE block_id='$bid'");
142 142
         $selected_mids = [];
143 143
         while (list($selected_mid) = $db->fetchRow($result)) {
144
-            $selected_mids[] = (int)$selected_mid;
144
+            $selected_mids[] = (int) $selected_mid;
145 145
         }
146 146
         /** @var XoopsModuleHandler $moduleHandler */
147 147
         $moduleHandler = xoops_getHandler('module');
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
         $myts           = MyTextSanitizer::getInstance();
156 156
         foreach ($module_list as $mid => $mname) {
157 157
             if (in_array($mid, $selected_mids)) {
158
-                $module_options .= "<option value='$mid' selected>" . $myts->displayTarea($mname) . "</option>\n";
158
+                $module_options .= "<option value='$mid' selected>".$myts->displayTarea($mname)."</option>\n";
159 159
             } else {
160
-                $module_options .= "<option value='$mid'>" . $myts->displayTarea($mname) . "</option>\n";
160
+                $module_options .= "<option value='$mid'>".$myts->displayTarea($mname)."</option>\n";
161 161
             }
162 162
         }
163 163
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             <td class='foot' align='center' colspan='6'>
218 218
                 <input type='hidden' name='fct' value='blocksadmin'>
219 219
                 <input type='hidden' name='op' value='order'>
220
-                <input type='submit' name='submit' value='" . _SUBMIT . "'>
220
+                <input type='submit' name='submit' value='" . _SUBMIT."'>
221 221
             </td>
222 222
         </tr>
223 223
         </table>
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
                                                           . "</h3><div id='bottomtable'><span style=\"color: #567; margin: 3px 0 0 0; font-size: small; display: block; \">"
246 246
                                                           . _AM_SF_GROUPSINFO
247 247
                                                           . '</span>');
248
-    $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACTIVERIGHTS);
249
-    $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name() . ' ' . _AM_ACCESSRIGHTS);
248
+    $form->addAppendix('module_admin', $xoopsModule->mid(), $xoopsModule->name().' '._AM_ACTIVERIGHTS);
249
+    $form->addAppendix('module_read', $xoopsModule->mid(), $xoopsModule->name().' '._AM_ACCESSRIGHTS);
250 250
     foreach ($item_list as $item_id => $item_name) {
251 251
         $form->addItem($item_id, $myts->displayTarea($item_name));
252 252
     }
@@ -255,14 +255,14 @@  discard block
 block discarded – undo
255 255
 }
256 256
 
257 257
 if (!empty($_POST['submit'])) {
258
-    include __DIR__ . '/mygroupperm.php';
258
+    include __DIR__.'/mygroupperm.php';
259 259
     require_once "$xoops_system_path/language/$language/admin.php";
260
-    redirect_header(XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/admin/myblocksadmin.php', 1, _AM_DBUPDATED);
260
+    redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/admin/myblocksadmin.php', 1, _AM_DBUPDATED);
261 261
 }
262 262
 
263 263
 xoops_cp_header();
264 264
 if (file_exists('./mymenu.php')) {
265
-    include __DIR__ . '/mymenu.php';
265
+    include __DIR__.'/mymenu.php';
266 266
 }
267 267
 
268 268
 list_blocks();
Please login to merge, or discard this patch.
print.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  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
-$faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
11
+$faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0;
12 12
 
13 13
 if (0 == $faqid) {
14 14
     redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED);
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
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
 
Please login to merge, or discard this patch.
submit.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  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 $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
         global $xoopsUser, $myts;
84 84
 
85 85
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
86
-        require_once XOOPS_ROOT_PATH . '/header.php';
87
-        require_once __DIR__ . '/footer.php';
86
+        require_once XOOPS_ROOT_PATH.'/header.php';
87
+        require_once __DIR__.'/footer.php';
88 88
 
89 89
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
90 90
 
91
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
91
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
92 92
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
93 93
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
94 94
         $faq['answer']       = $answerObj->answer();
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
102 102
 
103 103
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
104
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
104
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
105 105
 
106
-        require_once __DIR__ . '/include/submit.inc.php';
106
+        require_once __DIR__.'/include/submit.inc.php';
107 107
 
108
-        require_once XOOPS_ROOT_PATH . '/footer.php';
108
+        require_once XOOPS_ROOT_PATH.'/footer.php';
109 109
 
110 110
         exit();
111 111
         break;
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
170 170
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
171 171
                 foreach ($_POST['delete_tmp'] as $key) {
172
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
172
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
173 173
                     unset($attachments_tmp[$key]);
174 174
                 }
175 175
             }
176 176
         }
177 177
         if (count($attachments_tmp)) {
178 178
             foreach ($attachments_tmp as $key => $attach) {
179
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
179
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
180 180
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
181 181
                 }
182 182
             }
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 
186 186
         if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name']
187 187
             && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
188
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
188
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
189 189
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
190 190
             $uploaddir   = XOOPS_CACHE_PATH;
191 191
 
192
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
192
+            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int) $maxfilesize, (int) $xoopsModuleConfig['max_img_width'], (int) $xoopsModuleConfig['max_img_height']);
193 193
 
194 194
             if ($_FILES['userfile']['error'] > 0) {
195 195
                 switch ($_FILES['userfile']['error']) {
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
                 $uploader->setCheckMediaTypeByExt();
208 208
 
209 209
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
210
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
210
+                    $prefix = is_object($xoopsUser) ? (string) $xoopsUser->uid().'_' : 'newbb_';
211 211
                     $uploader->setPrefix($prefix);
212 212
                     if (!$uploader->upload()) {
213
-                        $error_message[] = $error_upload =& $uploader->getErrors();
213
+                        $error_message[] = $error_upload = & $uploader->getErrors();
214 214
                     } else {
215 215
                         if (is_file($uploader->getSavedDestination())) {
216
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
216
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
217 217
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
218 218
                             }
219 219
                         }
220 220
                     }
221 221
                 } else {
222
-                    $error_message[] = $error_upload =& $uploader->getErrors();
222
+                    $error_message[] = $error_upload = & $uploader->getErrors();
223 223
                 }
224 224
             }
225 225
         }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         } else {
253 253
             // Subscribe the user to On Published notification, if requested
254 254
             if (1 == $notifypub) {
255
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
255
+                require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
256 256
                 $notificationHandler = xoops_getHandler('notification');
257 257
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
258 258
             }
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
         $categoryObj = $categoryHandler->create();
276 276
 
277 277
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.html';
278
-        require_once XOOPS_ROOT_PATH . '/header.php';
279
-        require_once __DIR__ . '/footer.php';
278
+        require_once XOOPS_ROOT_PATH.'/header.php';
279
+        require_once __DIR__.'/footer.php';
280 280
 
281 281
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
282 282
         $notifypub  = 1;
283
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
283
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
284 284
         $xoopsTpl->assign('whereInSection', $moduleName);
285 285
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
286 286
 
287 287
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
288
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
288
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
289 289
 
290
-        require_once __DIR__ . '/include/submit.inc.php';
290
+        require_once __DIR__.'/include/submit.inc.php';
291 291
 
292
-        require_once XOOPS_ROOT_PATH . '/footer.php';
292
+        require_once XOOPS_ROOT_PATH.'/footer.php';
293 293
         break;
294 294
 }
Please login to merge, or discard this patch.
include/blocksadmin.inc.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
29 29
     exit('Access Denied');
30 30
 }
31
-require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
32
-include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php';
31
+require_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
32
+include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php';
33 33
 
34 34
 $op = 'list';
35 35
 if (isset($HTTP_POST_VARS)) {
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
         || 'clone' === $HTTP_GET_VARS['op']
44 44
         || 'previewpopup' === $HTTP_GET_VARS['op']) {
45 45
         $op  = $HTTP_GET_VARS['op'];
46
-        $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0;
46
+        $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0;
47 47
     }
48 48
 }
49 49
 
50 50
 if (isset($previewblock)) {
51 51
     xoops_cp_header();
52
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
52
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
53 53
     $xoopsTpl = new XoopsTpl();
54 54
     $xoopsTpl->xoops_setCaching(0);
55 55
     if (isset($bid)) {
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
                  . $myblock->getContent('S', $bctype)
84 84
                  . '</td></tr></table></body></html>';
85 85
 
86
-    $dummyfile = '_dummyfile_' . time() . '.html';
87
-    $fp        = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w');
86
+    $dummyfile = '_dummyfile_'.time().'.html';
87
+    $fp        = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w');
88 88
     fwrite($fp, $dummyhtml);
89 89
     fclose($fp);
90 90
     $block['edit_form'] = false;
@@ -95,24 +95,24 @@  discard block
 block discarded – undo
95 95
     $block['visible']   = $bvisible;
96 96
     $block['title']     = $myblock->getVar('title', 'E');
97 97
     $block['content']   = $myblock->getVar('content', 'E');
98
-    $block['modules']   =& $bmodule;
98
+    $block['modules']   = & $bmodule;
99 99
     $block['ctype']     = isset($bctype) ? $bctype : $myblock->getVar('c_type');
100 100
     $block['is_custom'] = true;
101
-    $block['cachetime'] = (int)$bcachetime;
102
-    echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . $block['form_title'] . '<br><br>';
103
-    include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php';
101
+    $block['cachetime'] = (int) $bcachetime;
102
+    echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$block['form_title'].'<br><br>';
103
+    include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
104 104
     $form->display();
105 105
     xoops_cp_footer();
106 106
     echo '<script type="text/javascript">
107 107
     <!--//
108
-    preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200);
108
+    preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
109 109
     //-->
110 110
     </script>';
111 111
     exit();
112 112
 }
113 113
 
114 114
 if ('previewpopup' === $op) {
115
-    $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file']));
115
+    $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file']));
116 116
     if (file_exists($file)) {
117 117
         include $file;
118 118
         @unlink($file);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 }
151 151
 
152 152
 if ('update' === $op) {
153
-    $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0;
153
+    $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0;
154 154
     $options    = isset($options) ? $options : [];
155 155
     $bcontent   = isset($bcontent) ? $bcontent : '';
156 156
     $bctype     = isset($bctype) ? $bctype : '';
@@ -251,27 +251,27 @@  discard block
 block discarded – undo
251 251
         $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid);
252 252
         $db->query($sql);
253 253
         foreach ($bmodule as $bmid) {
254
-            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid);
254
+            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid);
255 255
             $db->query($sql);
256 256
         }
257
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
257
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
258 258
         $xoopsTpl = new XoopsTpl();
259 259
         $xoopsTpl->xoops_setCaching(2);
260 260
         if ('' != $myblock->getVar('template')) {
261
-            if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) {
262
-                if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) {
263
-                    $msg = 'Unable to clear cache for block ID' . $bid;
261
+            if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) {
262
+                if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) {
263
+                    $msg = 'Unable to clear cache for block ID'.$bid;
264 264
                 }
265 265
             }
266 266
         } else {
267
-            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block' . $bid)) {
268
-                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block' . $bid)) {
269
-                    $msg = 'Unable to clear cache for block ID' . $bid;
267
+            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block'.$bid)) {
268
+                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block'.$bid)) {
269
+                    $msg = 'Unable to clear cache for block ID'.$bid;
270 270
                 }
271 271
             }
272 272
         }
273 273
     } else {
274
-        $msg = 'Failed update of block. ID:' . $bid;
274
+        $msg = 'Failed update of block. ID:'.$bid;
275 275
     }
276 276
 
277 277
     return $msg; // GIJ +
Please login to merge, or discard this patch.
include/functions.render.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // defined('XOOPS_ROOT_PATH') || exit('Restricted access.');
13 13
 
14
-defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php';
14
+defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php';
15 15
 define('NEWBB_FUNCTIONS_RENDER_LOADED', true);
16 16
 
17 17
 if (!defined('NEWBB_FUNCTIONS_RENDER')):
@@ -56,16 +56,16 @@  discard block
 block discarded – undo
56 56
             // decode xcode
57 57
             if (0 != $image) {
58 58
                 // image allowed
59
-                $text =& $myts->xoopsCodeDecode($text);
59
+                $text = & $myts->xoopsCodeDecode($text);
60 60
             } else {
61 61
                 // image not allowed
62
-                $text =& $myts->xoopsCodeDecode($text, 0);
62
+                $text = & $myts->xoopsCodeDecode($text, 0);
63 63
             }
64 64
         }
65 65
         if (0 != $br) {
66
-            $text =& $myts->nl2Br($text);
66
+            $text = & $myts->nl2Br($text);
67 67
         }
68
-        $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
68
+        $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18)
69 69
 
70 70
         return $text;
71 71
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}'>";
97 97
         if (empty($asImage)) {
98
-            $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>';
98
+            $button = "<a href='{$link}' title='{$alt}' {$extra}>".sf_displayImage($button, $alt, true).'</a>';
99 99
         }
100 100
 
101 101
         return $button;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         }
148 148
 
149 149
         if (!class_exists('NewbbIconHandler')) {
150
-            require_once __DIR__ . '/../class/icon.php';
150
+            require_once __DIR__.'/../class/icon.php';
151 151
         }
152 152
 
153 153
         $iconHandler           = NewbbIconHandler::getInstance();
Please login to merge, or discard this patch.
include/functions.image.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -28,24 +28,24 @@  discard block
 block discarded – undo
28 28
     {
29 29
         global $xoopsModuleConfig;
30 30
 
31
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
32
-        $img_url    = XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'];
33
-        $thumb_path = $img_path . '/thumbs';
34
-        $thumb_url  = $img_url . '/thumbs';
31
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
32
+        $img_url    = XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'];
33
+        $thumb_path = $img_path.'/thumbs';
34
+        $thumb_url  = $img_url.'/thumbs';
35 35
 
36
-        $thumb     = $thumb_path . '/' . $source;
37
-        $image     = $img_path . '/' . $source;
38
-        $thumb_url = $thumb_url . '/' . $source;
39
-        $image_url = $img_url . '/' . $source;
36
+        $thumb     = $thumb_path.'/'.$source;
37
+        $image     = $img_path.'/'.$source;
38
+        $thumb_url = $thumb_url.'/'.$source;
39
+        $image_url = $img_url.'/'.$source;
40 40
 
41 41
         $imginfo  = @getimagesize($image);
42
-        $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : '';
42
+        $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : '';
43 43
 
44 44
         if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) {
45 45
             if ($imginfo[0] > $xoopsModuleConfig['max_image_width']
46 46
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
47 47
                 //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) {
48
-                if (!file_exists($thumb_path . '/' . $source)) {
48
+                if (!file_exists($thumb_path.'/'.$source)) {
49 49
                     sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']);
50 50
                 }
51 51
             }
@@ -54,27 +54,27 @@  discard block
 block discarded – undo
54 54
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
55 55
                 $pseudo_width  = $xoopsModuleConfig['max_image_width'];
56 56
                 $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]);
57
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
57
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
58 58
             }
59 59
             // irmtfan to fix Undefined variable: pseudo_height
60 60
             if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0
61 61
                 && $pseudo_height > $xoopsModuleConfig['max_image_height']) {
62 62
                 $pseudo_height = $xoopsModuleConfig['max_image_height'];
63 63
                 $pseudo_width  = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]);
64
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
64
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
65 65
             }
66 66
         }
67 67
 
68 68
         if (file_exists($thumb)) {
69
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
70
-            $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '">';
69
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
70
+            $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'">';
71 71
             $attachmentImage .= '</a>';
72 72
         } elseif (!empty($pseudo_size)) {
73
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
74
-            $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '">';
73
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
74
+            $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'">';
75 75
             $attachmentImage .= '</a>';
76 76
         } elseif (file_exists($image)) {
77
-            $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '">';
77
+            $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'">';
78 78
         } else {
79 79
             $attachmentImage = '';
80 80
         }
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     {
92 92
         global $xoopsModuleConfig;
93 93
 
94
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
95
-        $thumb_path = $img_path . '/thumbs';
96
-        $src_file   = $img_path . '/' . $source;
97
-        $new_file   = $thumb_path . '/' . $source;
94
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
95
+        $thumb_path = $img_path.'/thumbs';
96
+        $src_file   = $img_path.'/'.$source;
97
+        $new_file   = $thumb_path.'/'.$source;
98 98
         //$imageLibs = sf_getImageLibs();
99 99
 
100 100
         if (!filesize($src_file) || !is_readable($src_file)) {
@@ -114,20 +114,20 @@  discard block
 block discarded – undo
114 114
             return false;
115 115
         }
116 116
 
117
-        $newWidth  = (int)min($imginfo[0], $thumb_width);
118
-        $newHeight = (int)($imginfo[1] * $newWidth / $imginfo[0]);
117
+        $newWidth  = (int) min($imginfo[0], $thumb_width);
118
+        $newHeight = (int) ($imginfo[1] * $newWidth / $imginfo[0]);
119 119
 
120 120
         if (1 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
121 121
             if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
122 122
                 $cur_dir     = __DIR__;
123
-                $src_file_im = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"';
124
-                $new_file_im = '"' . $cur_dir . '\\' . strtr($new_file, '/', '\\') . '"';
123
+                $src_file_im = '"'.$cur_dir.'\\'.strtr($src_file, '/', '\\').'"';
124
+                $new_file_im = '"'.$cur_dir.'\\'.strtr($new_file, '/', '\\').'"';
125 125
             } else {
126 126
                 $src_file_im = @escapeshellarg($src_file);
127 127
                 $new_file_im = @escapeshellarg($new_file);
128 128
             }
129
-            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/';
130
-            $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
129
+            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/';
130
+            $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).'';
131 131
 
132 132
             @passthru($magick_command);
133 133
             if (file_exists($new_file)) {
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
         }
137 137
 
138 138
         if (2 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
139
-            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/';
139
+            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/';
140 140
             if (preg_match("/\.png/i", $source)) {
141
-                $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file";
141
+                $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file";
142 142
             } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) {
143
-                $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file";
143
+                $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file";
144 144
             } elseif (preg_match("/\.gif/i", $source)) {
145
-                $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file";
145
+                $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file";
146 146
             }
147 147
 
148 148
             @exec($cmd, $output, $retval);
Please login to merge, or discard this patch.
include/submit.inc.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $_POST, $xoopsDB;
11 11
 
12
-require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
13
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
14
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
12
+require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
13
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
14
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
15 15
 
16
-require_once __DIR__ . '/functions.php';
16
+require_once __DIR__.'/functions.php';
17 17
 
18 18
 $mytree = new XoopsTree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
19 19
 $form   = new XoopsThemeForm(_MD_SF_SUB_SMNAME, 'form', xoops_getenv('PHP_SELF'), 'post', true);
@@ -70,18 +70,18 @@  discard block
 block discarded – undo
70 70
 //    $upload_tray->addElement(new XoopsFormFile('', 'userfile', ($forum_obj->getVar('attach_maxkb') * 1024)));
71 71
 $upload_tray->addElement(new XoopsFormFile('', 'userfile', $xoopsModuleConfig['max_image_size'] * 1024));
72 72
 $upload_tray->addElement(new XoopsFormButton('', 'contents_upload', _MD_SF_UPLOAD, 'submit'));
73
-$upload_tray->addElement(new XoopsFormLabel('<br><br>' . _MD_SF_MAX_FILESIZE . ':', $xoopsModuleConfig['max_image_size'] . 'Kb; '));
73
+$upload_tray->addElement(new XoopsFormLabel('<br><br>'._MD_SF_MAX_FILESIZE.':', $xoopsModuleConfig['max_image_size'].'Kb; '));
74 74
 $extensions = trim(str_replace('|', ' ', $xoopsModuleConfig['attach_ext']));
75 75
 $extensions = (empty($extensions) || '*' === $extensions) ? _ALL : $extensions;
76
-$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS . ':', $extensions));
77
-$upload_tray->addElement(new XoopsFormLabel('<br>' . sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
76
+$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS.':', $extensions));
77
+$upload_tray->addElement(new XoopsFormLabel('<br>'.sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
78 78
 $form->addElement($upload_tray);
79 79
 //}
80 80
 
81 81
 if (!empty($attachments) && is_array($attachments) && count($attachments)) {
82 82
     $delete_attach_checkbox = new XoopsFormCheckBox(_MD_SF_ATTACHED_FILES, 'delete_attach[]');
83 83
     foreach ($attachments as $key => $attachment) {
84
-        $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['name_display'] . '</a><br>';
84
+        $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['name_display'].'</a><br>';
85 85
         $delete_attach_checkbox->addOption($key, $attach);
86 86
     }
87 87
     $form->addElement($delete_attach_checkbox);
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     $delete_attach_checkbox = new XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]');
93 93
     $url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
94 94
     foreach ($attachments_tmp as $key => $attachment) {
95
-        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
95
+        $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>';
96 96
         $delete_attach_checkbox->addOption($key, $attach);
97 97
     }
98 98
     $form->addElement($delete_attach_checkbox);
Please login to merge, or discard this patch.