Passed
Push — master ( 4e30dc...deff52 )
by Michael
02:16
created
class/SmartDbTable.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     //Verifies that a MySQL table exists
23 23
     $xoopsDB  = \XoopsDatabaseFactory::getDatabaseConnection();
24 24
     $realname = $xoopsDB->prefix($table);
25
-    $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
25
+    $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
26 26
     $ret      = $xoopsDB->queryF($sql);
27 27
     while (list($m_table) = $xoopsDB->fetchRow($ret)) {
28 28
         if ($m_table == $realname) {
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
     public function getExistingFieldsArray()
164 164
     {
165 165
         global $xoopsDB;
166
-        $result = $xoopsDB->queryF('SHOW COLUMNS FROM ' . $this->name());
166
+        $result = $xoopsDB->queryF('SHOW COLUMNS FROM '.$this->name());
167 167
         while ($existing_field = $xoopsDB->fetchArray($result)) {
168 168
             $fields[$existing_field['Field']] = $existing_field['Type'];
169 169
             if ('YES' !== $existing_field['Null']) {
170 170
                 $fields[$existing_field['Field']] .= ' NOT NULL';
171 171
             }
172 172
             if ($existing_field['Extra']) {
173
-                $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra'];
173
+                $fields[$existing_field['Field']] .= ' '.$existing_field['Extra'];
174 174
             }
175 175
         }
176 176
 
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
             $query = sprintf('INSERT INTO `%s` VALUES ("%s")', $this->name(), $data);
247 247
             $ret   = $xoopsDB->queryF($query);
248 248
             if (!$ret) {
249
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br>';
249
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br>';
250 250
             } else {
251
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br>';
251
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br>';
252 252
             }
253 253
         }
254 254
 
@@ -413,9 +413,9 @@  discard block
 block discarded – undo
413 413
 
414 414
         $ret = $xoopsDB->queryF($query);
415 415
         if (!$ret) {
416
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '<br>';
416
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).'<br>';
417 417
         } else {
418
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br>';
418
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br>';
419 419
         }
420 420
 
421 421
         return $ret;
@@ -434,11 +434,11 @@  discard block
 block discarded – undo
434 434
         $query = sprintf('DROP TABLE `%s`', $this->name());
435 435
         $ret   = $xoopsDB->queryF($query);
436 436
         if (!$ret) {
437
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '<br>';
437
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).'<br>';
438 438
 
439 439
             return false;
440 440
         } else {
441
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br>';
441
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br>';
442 442
 
443 443
             return true;
444 444
         }
@@ -462,9 +462,9 @@  discard block
 block discarded – undo
462 462
             $ret = $ret && $xoopsDB->queryF($query);
463 463
             if ($alteredField['showerror']) {
464 464
                 if (!$ret) {
465
-                    echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '<br>';
465
+                    echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).'<br>';
466 466
                 } else {
467
-                    echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br>';
467
+                    echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br>';
468 468
                 }
469 469
             }
470 470
         }
@@ -488,9 +488,9 @@  discard block
 block discarded – undo
488 488
             //echo $query;
489 489
             $ret = $ret && $xoopsDB->queryF($query);
490 490
             if (!$ret) {
491
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br>';
491
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br>';
492 492
             } else {
493
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br>';
493
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br>';
494 494
             }
495 495
         }
496 496
 
@@ -513,9 +513,9 @@  discard block
 block discarded – undo
513 513
             $query = sprintf('UPDATE `%s` SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']);
514 514
             $ret   = $ret && $xoopsDB->queryF($query);
515 515
             if (!$ret) {
516
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>';
516
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>';
517 517
             } else {
518
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>';
518
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>';
519 519
             }
520 520
         }
521 521
 
@@ -538,9 +538,9 @@  discard block
 block discarded – undo
538 538
             //echo $query."<br>";
539 539
             $ret = $ret && $xoopsDB->queryF($query);
540 540
             if (!$ret) {
541
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br>';
541
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br>';
542 542
             } else {
543
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br>';
543
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br>';
544 544
             }
545 545
         }
546 546
 
@@ -564,9 +564,9 @@  discard block
 block discarded – undo
564 564
 
565 565
             $ret = $ret && $xoopsDB->queryF($query);
566 566
             if (!$ret) {
567
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br>';
567
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).'<br>';
568 568
             } else {
569
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>';
569
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br>';
570 570
             }
571 571
         }
572 572
 
Please login to merge, or discard this patch.
class/CategoryHandler.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $sql = sprintf(
93 93
                 'INSERT INTO `%s` (parentid, name, description, total, weight, created) VALUES (%u, %s, %s, %u, %u, %u)',
94 94
                 $this->db->prefix('smartfaq_categories'),
95
-                           $parentid,
95
+                            $parentid,
96 96
                 $this->db->quoteString($name),
97 97
                 $this->db->quoteString($description),
98 98
                 $total,
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
                 'UPDATE `%s` SET parentid = %u, name = %s, description = %s, total = %s, weight = %u, created = %u WHERE categoryid = %u',
105 105
                 $this->db->prefix('smartfaq_categories'),
106 106
                 $parentid,
107
-                           $this->db->quoteString($name),
107
+                            $this->db->quoteString($name),
108 108
                 $this->db->quoteString($description),
109 109
                 $total,
110 110
                 $weight,
Please login to merge, or discard this patch.
class/Tree.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $selectId = (int)$selectId;
71 71
         $arr      = [];
72
-        $sql      = 'SELECT * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $selectId . ' ';
72
+        $sql      = 'SELECT * FROM '.$this->table.' WHERE '.$this->pid.'='.$selectId.' ';
73 73
         if ('' !== $order) {
74 74
             $sql .= " ORDER BY $order";
75 75
         }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     {
97 97
         $selectId = (int)$selectId;
98 98
         $idarray  = [];
99
-        $result   = $this->db->query('SELECT ' . $this->id . ' FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $selectId . '');
99
+        $result   = $this->db->query('SELECT '.$this->id.' FROM '.$this->table.' WHERE '.$this->pid.'='.$selectId.'');
100 100
         $count    = $this->db->getRowsNum($result);
101 101
         if (0 == $count) {
102 102
             return $idarray;
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     public function getAllChildId($selectId, $order = '', array $idarray = [])
121 121
     {
122 122
         $selectId = (int)$selectId;
123
-        $sql      = 'SELECT ' . $this->id . ' FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $selectId . '';
123
+        $sql      = 'SELECT '.$this->id.' FROM '.$this->table.' WHERE '.$this->pid.'='.$selectId.'';
124 124
         if ('' !== $order) {
125 125
             $sql .= " ORDER BY $order";
126 126
         }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public function getAllParentId($selectId, $order = '', array $idarray = [])
150 150
     {
151 151
         $selectId = (int)$selectId;
152
-        $sql      = 'SELECT ' . $this->pid . ' FROM ' . $this->table . ' WHERE ' . $this->id . '=' . $selectId . '';
152
+        $sql      = 'SELECT '.$this->pid.' FROM '.$this->table.' WHERE '.$this->id.'='.$selectId.'';
153 153
         if ('' !== $order) {
154 154
             $sql .= " ORDER BY $order";
155 155
         }
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
     public function getPathFromId($selectId, $title, $path = '')
177 177
     {
178 178
         $selectId = (int)$selectId;
179
-        $result   = $this->db->query('SELECT ' . $this->pid . ', ' . $title . ' FROM ' . $this->table . ' WHERE ' . $this->id . "=$selectId");
179
+        $result   = $this->db->query('SELECT '.$this->pid.', '.$title.' FROM '.$this->table.' WHERE '.$this->id."=$selectId");
180 180
         if (0 == $this->db->getRowsNum($result)) {
181 181
             return $path;
182 182
         }
183 183
         list($parentid, $name) = $this->db->fetchRow($result);
184 184
         $myts = \MyTextSanitizer::getInstance();
185 185
         $name = $myts->htmlspecialchars($name);
186
-        $path = '/' . $name . $path . '';
186
+        $path = '/'.$name.$path.'';
187 187
         if (0 == $parentid) {
188 188
             return $path;
189 189
         }
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
             $sel_name = $this->id;
210 210
         }
211 211
         $myts = \MyTextSanitizer::getInstance();
212
-        echo "<select name='" . $sel_name . "'";
212
+        echo "<select name='".$sel_name."'";
213 213
         if ('' !== $onchange) {
214
-            echo " onchange='" . $onchange . "'";
214
+            echo " onchange='".$onchange."'";
215 215
         }
216 216
         echo ">\n";
217
-        $sql = 'SELECT ' . $this->id . ', ' . $title . ' FROM ' . $this->table . ' WHERE ' . $this->pid . '=0';
217
+        $sql = 'SELECT '.$this->id.', '.$title.' FROM '.$this->table.' WHERE '.$this->pid.'=0';
218 218
         if ('' !== $order) {
219 219
             $sql .= " ORDER BY $order";
220 220
         }
@@ -232,11 +232,11 @@  discard block
 block discarded – undo
232 232
             $arr = $this->getChildTreeArray($catid, $order);
233 233
             foreach ($arr as $option) {
234 234
                 $option['prefix'] = str_replace('.', '--', $option['prefix']);
235
-                $catpath          = $option['prefix'] . '&nbsp;' . $myts->htmlspecialchars($option[$title]);
235
+                $catpath          = $option['prefix'].'&nbsp;'.$myts->htmlspecialchars($option[$title]);
236 236
                 if ($option[$this->id] == $preset_id) {
237 237
                     $sel = " selected='selected'";
238 238
                 }
239
-                echo "<option value='" . $option[$this->id] . "'$sel>$catpath</option>\n";
239
+                echo "<option value='".$option[$this->id]."'$sel>$catpath</option>\n";
240 240
                 $sel = '';
241 241
             }
242 242
         }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     {
258 258
         $path     = !empty($path) ? $path : $path;
259 259
         $selectId = (int)$selectId;
260
-        $sql      = 'SELECT ' . $this->pid . ', ' . $title . ' FROM ' . $this->table . ' WHERE ' . $this->id . "=$selectId";
260
+        $sql      = 'SELECT '.$this->pid.', '.$title.' FROM '.$this->table.' WHERE '.$this->id."=$selectId";
261 261
         $result   = $this->db->query($sql);
262 262
         if (0 == $this->db->getRowsNum($result)) {
263 263
             return $path;
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
         list($parentid, $name) = $this->db->fetchRow($result);
266 266
         $myts = \MyTextSanitizer::getInstance();
267 267
         $name = $myts->htmlspecialchars($name);
268
-        $path = "<li><a href='" . $funcURL . '&amp;' . $this->id . '=' . $selectId . "'>" . $name . '</a></li>' . $path . '';
268
+        $path = "<li><a href='".$funcURL.'&amp;'.$this->id.'='.$selectId."'>".$name.'</a></li>'.$path.'';
269 269
         if (0 == $parentid) {
270 270
             return $path;
271 271
         }
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
     public function getIdPathFromId($selectId, $path = '')
286 286
     {
287 287
         $selectId = (int)$selectId;
288
-        $result   = $this->db->query('SELECT ' . $this->pid . ' FROM ' . $this->table . ' WHERE ' . $this->id . "=$selectId");
288
+        $result   = $this->db->query('SELECT '.$this->pid.' FROM '.$this->table.' WHERE '.$this->id."=$selectId");
289 289
         if (0 == $this->db->getRowsNum($result)) {
290 290
             return $path;
291 291
         }
292 292
         list($parentid) = $this->db->fetchRow($result);
293
-        $path = '/' . $selectId . $path . '';
293
+        $path = '/'.$selectId.$path.'';
294 294
         if (0 == $parentid) {
295 295
             return $path;
296 296
         }
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
     public function getAllChild($selectId = 0, $order = '', array $parray = [])
312 312
     {
313 313
         $selectId = (int)$selectId;
314
-        $sql      = 'SELECT * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $selectId . ' ';
314
+        $sql      = 'SELECT * FROM '.$this->table.' WHERE '.$this->pid.'='.$selectId.' ';
315 315
         if ('' !== $order) {
316 316
             $sql .= " ORDER BY $order";
317 317
         }
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
     public function getChildTreeArray($selectId = 0, $order = '', array $parray = [], $r_prefix = '')
342 342
     {
343 343
         $selectId = (int)$selectId;
344
-        $sql      = 'SELECT * FROM ' . $this->table . ' WHERE ' . $this->pid . '=' . $selectId . ' ';
344
+        $sql      = 'SELECT * FROM '.$this->table.' WHERE '.$this->pid.'='.$selectId.' ';
345 345
         if ('' !== $order) {
346 346
             $sql .= " ORDER BY $order";
347 347
         }
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
             return $parray;
352 352
         }
353 353
         while (false !== ($row = $this->db->fetchArray($result))) {
354
-            $row['prefix'] = $r_prefix . '.';
354
+            $row['prefix'] = $r_prefix.'.';
355 355
             array_push($parray, $row);
356 356
             $parray = $this->getChildTreeArray($row[$this->id], $order, $parray, $row['prefix']);
357 357
         }
Please login to merge, or discard this patch.
class/FaqHandler.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 
94 94
         if ($faq->isNew()) {
95 95
             $sql = sprintf('INSERT INTO `%s` (faqid, categoryid, question, howdoi, diduno, uid, datesub, status, counter, weight, html, smiley, xcodes, cancomment, comments, notifypub, modulelink, contextpage, exacturl, partialview) VALUES (NULL, %u, %s, %s, %s, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %s, %s, %u, %u)',
96
-                           $this->db->prefix('smartfaq_faq'),
96
+                            $this->db->prefix('smartfaq_faq'),
97 97
                 $categoryid,
98 98
                 $this->db->quoteString($question),
99 99
                 $this->db->quoteString($howdoi),
Please login to merge, or discard this patch.
class/SmartobjectDbupdater.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
         $query = sprintf('ALTER TABLE `%s` RENAME %s', $from, $to);
62 62
         $ret   = $xoopsDB->queryF($query);
63 63
         if (!$ret) {
64
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>';
64
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>';
65 65
 
66 66
             return false;
67 67
         } else {
68
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>';
68
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>';
69 69
 
70 70
             return true;
71 71
         }
Please login to merge, or discard this patch.
include/blocksadmin.inc.php 1 patch
Spacing   +20 added lines, -20 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)) {
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
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
-    $xoopsTpl->caching= 0;
54
+    $xoopsTpl->caching = 0;
55 55
     if (isset($bid)) {
56 56
         $block['bid']        = $bid;
57 57
         $block['form_title'] = _AM_EDITBLOCK;
@@ -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 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';
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);
@@ -254,24 +254,24 @@  discard block
 block discarded – undo
254 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
-        $xoopsTpl->caching= 2;
259
+        $xoopsTpl->caching = 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.
submit.php 2 patches
Switch Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -52,153 +52,153 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 switch ($op) {
55
-    case 'preview':
55
+        case 'preview':
56 56
 
57
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
57
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
58 58
 
59
-        $faqObj      = $faqHandler->create();
60
-        $answerObj   = $answerHandler->create();
61
-        $categoryObj = $categoryHandler->get($_POST['categoryid']);
59
+            $faqObj      = $faqHandler->create();
60
+            $answerObj   = $answerHandler->create();
61
+            $categoryObj = $categoryHandler->get($_POST['categoryid']);
62 62
 
63
-        if (!$xoopsUser) {
64
-            if (1 == $xoopsModuleConfig['anonpost']) {
65
-                $uid = 0;
63
+            if (!$xoopsUser) {
64
+                if (1 == $xoopsModuleConfig['anonpost']) {
65
+                    $uid = 0;
66
+                } else {
67
+                    redirect_header('index.php', 3, _NOPERM);
68
+                }
66 69
             } else {
67
-                redirect_header('index.php', 3, _NOPERM);
70
+                $uid = $xoopsUser->uid();
68 71
             }
69
-        } else {
70
-            $uid = $xoopsUser->uid();
71
-        }
72 72
 
73
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
73
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
74 74
 
75
-        // Putting the values about the FAQ in the FAQ object
76
-        $faqObj->setVar('categoryid', $_POST['categoryid']);
77
-        $faqObj->setVar('uid', $uid);
78
-        $faqObj->setVar('question', $_POST['question']);
79
-        $faqObj->setVar('howdoi', $_POST['howdoi']);
80
-        $faqObj->setVar('diduno', $_POST['diduno']);
81
-        $faqObj->setVar('datesub', time());
75
+            // Putting the values about the FAQ in the FAQ object
76
+            $faqObj->setVar('categoryid', $_POST['categoryid']);
77
+            $faqObj->setVar('uid', $uid);
78
+            $faqObj->setVar('question', $_POST['question']);
79
+            $faqObj->setVar('howdoi', $_POST['howdoi']);
80
+            $faqObj->setVar('diduno', $_POST['diduno']);
81
+            $faqObj->setVar('datesub', time());
82 82
 
83
-        // Putting the values in the answer object
84
-        $answerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
85
-        $answerObj->setVar('faqid', $faqObj->faqid());
86
-        $answerObj->setVar('answer', $_POST['answer']);
87
-        $answerObj->setVar('uid', $uid);
83
+            // Putting the values in the answer object
84
+            $answerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
85
+            $answerObj->setVar('faqid', $faqObj->faqid());
86
+            $answerObj->setVar('answer', $_POST['answer']);
87
+            $answerObj->setVar('uid', $uid);
88 88
 
89
-        global $xoopsUser, $myts;
89
+            global $xoopsUser, $myts;
90 90
 
91
-        $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
92
-        require_once XOOPS_ROOT_PATH . '/header.php';
93
-        require_once __DIR__ . '/footer.php';
91
+            $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
92
+            require_once XOOPS_ROOT_PATH . '/header.php';
93
+            require_once __DIR__ . '/footer.php';
94 94
 
95
-        $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
95
+            $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
96 96
 
97
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
98
-        $faq                 = $faqObj->toArray(null, $categoryObj, false);
99
-        $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
100
-        $faq['answer']       = $answerObj->answer();
101
-        $faq['who_when']     = $faqObj->getWhoAndWhen();
97
+            $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
98
+            $faq                 = $faqObj->toArray(null, $categoryObj, false);
99
+            $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
100
+            $faq['answer']       = $answerObj->answer();
101
+            $faq['who_when']     = $faqObj->getWhoAndWhen();
102 102
 
103
-        $faq['comments'] = -1;
104
-        $xoopsTpl->assign('faq', $faq);
105
-        $xoopsTpl->assign('op', 'preview');
106
-        $xoopsTpl->assign('whereInSection', $moduleName);
107
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
103
+            $faq['comments'] = -1;
104
+            $xoopsTpl->assign('faq', $faq);
105
+            $xoopsTpl->assign('op', 'preview');
106
+            $xoopsTpl->assign('whereInSection', $moduleName);
107
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
108 108
 
109
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
110
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
109
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
110
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
111 111
 
112
-        require_once __DIR__ . '/include/submit.inc.php';
112
+            require_once __DIR__ . '/include/submit.inc.php';
113 113
 
114
-        require_once XOOPS_ROOT_PATH . '/footer.php';
114
+            require_once XOOPS_ROOT_PATH . '/footer.php';
115 115
 
116
-        exit();
117
-        break;
116
+            exit();
117
+            break;
118 118
 
119
-    case 'post':
119
+        case 'post':
120 120
 
121
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
121
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
122 122
 
123
-        $newFaqObj    = $faqHandler->create();
124
-        $newAnswerObj = $answerHandler->create();
123
+            $newFaqObj    = $faqHandler->create();
124
+            $newAnswerObj = $answerHandler->create();
125 125
 
126
-        if (!$xoopsUser) {
127
-            if (1 == $xoopsModuleConfig['anonpost']) {
128
-                $uid = 0;
126
+            if (!$xoopsUser) {
127
+                if (1 == $xoopsModuleConfig['anonpost']) {
128
+                    $uid = 0;
129
+                } else {
130
+                    redirect_header('index.php', 3, _NOPERM);
131
+                }
129 132
             } else {
130
-                redirect_header('index.php', 3, _NOPERM);
133
+                $uid = $xoopsUser->uid();
131 134
             }
132
-        } else {
133
-            $uid = $xoopsUser->uid();
134
-        }
135
-
136
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
137
-
138
-        // Putting the values about the FAQ in the FAQ object
139
-        $newFaqObj->setVar('categoryid', $_POST['categoryid']);
140
-        $newFaqObj->setVar('uid', $uid);
141
-        $newFaqObj->setVar('question', $_POST['question']);
142
-        $newFaqObj->setVar('howdoi', $_POST['howdoi']);
143
-        $newFaqObj->setVar('diduno', $_POST['diduno']);
144
-        $newFaqObj->setVar('notifypub', $notifypub);
145
-        //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
146
-        //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
147 135
 
148
-        // Setting the status of the FAQ
149
-
150
-        // if user is admin, FAQ are automatically published
151
-        $isAdmin = Smartfaq\Utility::userIsAdmin();
152
-        if ($isAdmin) {
153
-            $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED);
154
-        } elseif (1 == $xoopsModuleConfig['autoapprove_submitted_faq']) {
155
-            $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED);
156
-        } else {
157
-            $newFaqObj->setVar('status', Constants::SF_STATUS_SUBMITTED);
158
-        }
136
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
137
+
138
+            // Putting the values about the FAQ in the FAQ object
139
+            $newFaqObj->setVar('categoryid', $_POST['categoryid']);
140
+            $newFaqObj->setVar('uid', $uid);
141
+            $newFaqObj->setVar('question', $_POST['question']);
142
+            $newFaqObj->setVar('howdoi', $_POST['howdoi']);
143
+            $newFaqObj->setVar('diduno', $_POST['diduno']);
144
+            $newFaqObj->setVar('notifypub', $notifypub);
145
+            //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
146
+            //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
147
+
148
+            // Setting the status of the FAQ
149
+
150
+            // if user is admin, FAQ are automatically published
151
+            $isAdmin = Smartfaq\Utility::userIsAdmin();
152
+            if ($isAdmin) {
153
+                $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED);
154
+            } elseif (1 == $xoopsModuleConfig['autoapprove_submitted_faq']) {
155
+                $newFaqObj->setVar('status', Constants::SF_STATUS_PUBLISHED);
156
+            } else {
157
+                $newFaqObj->setVar('status', Constants::SF_STATUS_SUBMITTED);
158
+            }
159 159
 
160
-        // Storing the FAQ object in the database
161
-        if (!$newFaqObj->store()) {
162
-            redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
163
-        }
160
+            // Storing the FAQ object in the database
161
+            if (!$newFaqObj->store()) {
162
+                redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
163
+            }
164 164
 
165
-        // Putting the values in the answer object
166
-        $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
167
-        $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
168
-        $newAnswerObj->setVar('answer', $_POST['answer']);
169
-        $newAnswerObj->setVar('uid', $uid);
170
-
171
-        //====================================================================================
172
-        //TODO post Attachment
173
-        $attachments_tmp = [];
174
-        if (!empty($_POST['attachments_tmp'])) {
175
-            $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
176
-            if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
177
-                foreach ($_POST['delete_tmp'] as $key) {
178
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
179
-                    unset($attachments_tmp[$key]);
165
+            // Putting the values in the answer object
166
+            $newAnswerObj->setVar('status', Constants::SF_AN_STATUS_APPROVED);
167
+            $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
168
+            $newAnswerObj->setVar('answer', $_POST['answer']);
169
+            $newAnswerObj->setVar('uid', $uid);
170
+
171
+            //====================================================================================
172
+            //TODO post Attachment
173
+            $attachments_tmp = [];
174
+            if (!empty($_POST['attachments_tmp'])) {
175
+                $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
176
+                if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
177
+                    foreach ($_POST['delete_tmp'] as $key) {
178
+                        unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
179
+                        unset($attachments_tmp[$key]);
180
+                    }
180 181
                 }
181 182
             }
182
-        }
183
-        if (count($attachments_tmp)) {
184
-            foreach ($attachments_tmp as $key => $attach) {
185
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
186
-                    $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
183
+            if (count($attachments_tmp)) {
184
+                foreach ($attachments_tmp as $key => $attach) {
185
+                    if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
186
+                        $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
187
+                    }
187 188
                 }
188 189
             }
189
-        }
190
-        $error_upload = '';
190
+            $error_upload = '';
191 191
 
192
-        if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name']
193
-            && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
194
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
195
-            $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
196
-            $uploaddir   = XOOPS_CACHE_PATH;
192
+            if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name']
193
+                && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
194
+                require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
195
+                $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
196
+                $uploaddir   = XOOPS_CACHE_PATH;
197 197
 
198
-            $uploader = new Smartfaq\Uploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
198
+                $uploader = new Smartfaq\Uploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
199 199
 
200
-            if ($_FILES['userfile']['error'] > 0) {
201
-                switch ($_FILES['userfile']['error']) {
200
+                if ($_FILES['userfile']['error'] > 0) {
201
+                    switch ($_FILES['userfile']['error']) {
202 202
                     case 1:
203 203
                         $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI;
204 204
                         break;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
                     default:
209 209
                         $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF;
210 210
                         break;
211
-                }
211
+                    }
212 212
             } else {
213 213
                 $uploader->setCheckMediaTypeByExt();
214 214
 
@@ -271,30 +271,30 @@  discard block
 block discarded – undo
271 271
         redirect_header('index.php', 2, $redirect_msg);
272 272
         break;
273 273
 
274
-    case 'form':
275
-    default:
274
+        case 'form':
275
+        default:
276 276
 
277
-        global $xoopsUser, $myts;
277
+            global $xoopsUser, $myts;
278 278
 
279
-        $faqObj      = $faqHandler->create();
280
-        $answerObj   = $answerHandler->create();
281
-        $categoryObj = $categoryHandler->create();
279
+            $faqObj      = $faqHandler->create();
280
+            $answerObj   = $answerHandler->create();
281
+            $categoryObj = $categoryHandler->create();
282 282
 
283
-        $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
284
-        require_once XOOPS_ROOT_PATH . '/header.php';
285
-        require_once __DIR__ . '/footer.php';
283
+            $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
284
+            require_once XOOPS_ROOT_PATH . '/header.php';
285
+            require_once __DIR__ . '/footer.php';
286 286
 
287
-        $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
288
-        $notifypub  = 1;
289
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
290
-        $xoopsTpl->assign('whereInSection', $moduleName);
291
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
287
+            $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
288
+            $notifypub  = 1;
289
+            $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
290
+            $xoopsTpl->assign('whereInSection', $moduleName);
291
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
292 292
 
293
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
294
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
293
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
294
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
295 295
 
296
-        require_once __DIR__ . '/include/submit.inc.php';
296
+            require_once __DIR__ . '/include/submit.inc.php';
297 297
 
298
-        require_once XOOPS_ROOT_PATH . '/footer.php';
299
-        break;
298
+            require_once XOOPS_ROOT_PATH . '/footer.php';
299
+            break;
300 300
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 
14 14
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
15 15
 
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
         global $xoopsUser, $myts;
90 90
 
91 91
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
92
-        require_once XOOPS_ROOT_PATH . '/header.php';
93
-        require_once __DIR__ . '/footer.php';
92
+        require_once XOOPS_ROOT_PATH.'/header.php';
93
+        require_once __DIR__.'/footer.php';
94 94
 
95 95
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
96 96
 
97
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
97
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
98 98
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
99 99
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
100 100
         $faq['answer']       = $answerObj->answer();
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
108 108
 
109 109
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
110
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
110
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
111 111
 
112
-        require_once __DIR__ . '/include/submit.inc.php';
112
+        require_once __DIR__.'/include/submit.inc.php';
113 113
 
114
-        require_once XOOPS_ROOT_PATH . '/footer.php';
114
+        require_once XOOPS_ROOT_PATH.'/footer.php';
115 115
 
116 116
         exit();
117 117
         break;
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
176 176
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
177 177
                 foreach ($_POST['delete_tmp'] as $key) {
178
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
178
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
179 179
                     unset($attachments_tmp[$key]);
180 180
                 }
181 181
             }
182 182
         }
183 183
         if (count($attachments_tmp)) {
184 184
             foreach ($attachments_tmp as $key => $attach) {
185
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
185
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
186 186
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
187 187
                 }
188 188
             }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name']
193 193
             && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
194
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
194
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
195 195
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
196 196
             $uploaddir   = XOOPS_CACHE_PATH;
197 197
 
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
                 $uploader->setCheckMediaTypeByExt();
214 214
 
215 215
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
216
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
216
+                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid().'_' : 'newbb_';
217 217
                     $uploader->setPrefix($prefix);
218 218
                     if (!$uploader->upload()) {
219
-                        $error_message[] = $error_upload =& $uploader->getErrors();
219
+                        $error_message[] = $error_upload = & $uploader->getErrors();
220 220
                     } else {
221 221
                         if (is_file($uploader->getSavedDestination())) {
222
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
222
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
223 223
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
224 224
                             }
225 225
                         }
226 226
                     }
227 227
                 } else {
228
-                    $error_message[] = $error_upload =& $uploader->getErrors();
228
+                    $error_message[] = $error_upload = & $uploader->getErrors();
229 229
                 }
230 230
             }
231 231
         }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         } else {
259 259
             // Subscribe the user to On Published notification, if requested
260 260
             if (1 == $notifypub) {
261
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
261
+                require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
262 262
                 $notificationHandler = xoops_getHandler('notification');
263 263
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
264 264
             }
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
         $categoryObj = $categoryHandler->create();
282 282
 
283 283
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
284
-        require_once XOOPS_ROOT_PATH . '/header.php';
285
-        require_once __DIR__ . '/footer.php';
284
+        require_once XOOPS_ROOT_PATH.'/header.php';
285
+        require_once __DIR__.'/footer.php';
286 286
 
287 287
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
288 288
         $notifypub  = 1;
289
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
289
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
290 290
         $xoopsTpl->assign('whereInSection', $moduleName);
291 291
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
292 292
 
293 293
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
294
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
294
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
295 295
 
296
-        require_once __DIR__ . '/include/submit.inc.php';
296
+        require_once __DIR__.'/include/submit.inc.php';
297 297
 
298
-        require_once XOOPS_ROOT_PATH . '/footer.php';
298
+        require_once XOOPS_ROOT_PATH.'/footer.php';
299 299
         break;
300 300
 }
Please login to merge, or discard this patch.