Completed
Push — master ( 0d7d1b...48b96e )
by Michael
02:08
created
notification_update.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include __DIR__ . '/../../mainfile.php';
10
-include XOOPS_ROOT_PATH . '/include/notification_update.php';
9
+include __DIR__.'/../../mainfile.php';
10
+include XOOPS_ROOT_PATH.'/include/notification_update.php';
Please login to merge, or discard this patch.
class/category.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      * create a new category
271 271
      *
272 272
      * @param  bool $isNew flag the new objects as "new"?
273
-     * @return object sfCategory
273
+     * @return sfCategory sfCategory
274 274
      */
275 275
     public function create($isNew = true)
276 276
     {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     /**
313 313
      * insert a new category in the database
314 314
      *
315
-     * @param  XoopsObject $category reference to the {@link sfCategory} object
315
+     * @param  sfCategory $category reference to the {@link sfCategory} object
316 316
      * @param  bool        $force
317 317
      * @return bool        FALSE if failed, TRUE if already present and unchanged or successful
318 318
      */
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
             $sql = sprintf(
337 337
                 'INSERT INTO %s (categoryid, parentid, name, description, total, weight, created) VALUES (NULL, %u, %s, %s, %u, %u, %u)',
338 338
                 $this->db->prefix('smartfaq_categories'),
339
-                           $parentid,
339
+                            $parentid,
340 340
                 $this->db->quoteString($name),
341 341
                 $this->db->quoteString($description),
342 342
                 $total,
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
                 'UPDATE %s SET parentid = %u, name = %s, description = %s, total = %s, weight = %u, created = %u WHERE categoryid = %u',
349 349
                 $this->db->prefix('smartfaq_categories'),
350 350
                 $parentid,
351
-                           $this->db->quoteString($name),
351
+                            $this->db->quoteString($name),
352 352
                 $this->db->quoteString($description),
353 353
                 $total,
354 354
                 $weight,
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 $this->assignVars($id);
49 49
             } else {
50 50
                 $categoryHandler = new sfCategoryHandler($this->db);
51
-                $category        =& $categoryHandler->get($id);
51
+                $category        = & $categoryHandler->get($id);
52 52
                 foreach ($category->vars as $k => $v) {
53 53
                     $this->assignVar($k, $v['value']);
54 54
                 }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function checkPermission()
83 83
     {
84
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
84
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
85 85
 
86 86
         $userIsAdmin = sf_userIsAdmin();
87 87
         if ($userIsAdmin) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $filename = 'open_category.php';
159 159
         }
160 160
         if ($withAllLink) {
161
-            $ret = "<a href='" . XOOPS_URL . '/modules/smartfaq/' . $filename . '?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
161
+            $ret = "<a href='".XOOPS_URL.'/modules/smartfaq/'.$filename.'?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
162 162
         } else {
163 163
             $ret = $this->name();
164 164
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 exit;
171 171
             }
172 172
             $parentid = $parentObj->parentid();
173
-            $ret      = $parentObj->getCategoryPath(true, $open) . ' > ' . $ret;
173
+            $ret      = $parentObj->getCategoryPath(true, $open).' > '.$ret;
174 174
         }
175 175
 
176 176
         return $ret;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         $tags                  = [];
225 225
         $tags['MODULE_NAME']   = $myts->htmlSpecialChars($smartModule->getVar('name'));
226 226
         $tags['CATEGORY_NAME'] = $this->name();
227
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid();
227
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid();
228 228
 
229 229
         $notificationHandler = xoops_getHandler('notification');
230 230
         $notificationHandler->triggerEvent('global_faq', 0, 'category_created', $tags);
@@ -240,9 +240,9 @@  discard block
 block discarded – undo
240 240
         $category['categoryid'] = $this->categoryid();
241 241
         $category['name']       = $this->name();
242 242
         if ($open !== false) {
243
-            $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/open_category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
243
+            $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/open_category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
244 244
         } else {
245
-            $category['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $this->name() . '</a>';
245
+            $category['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$this->name().'</a>';
246 246
         }
247 247
         $category['total']       = $this->getVar('faqcount');
248 248
         $category['description'] = $this->description();
@@ -291,8 +291,8 @@  discard block
 block discarded – undo
291 291
     public function get($id)
292 292
     {
293 293
         $false = false;
294
-        if ((int)$id > 0) {
295
-            $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories') . ' WHERE categoryid=' . $id;
294
+        if ((int) $id > 0) {
295
+            $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories').' WHERE categoryid='.$id;
296 296
             if (!$result = $this->db->query($sql)) {
297 297
                 return $false;
298 298
             }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
         }
394 394
 
395 395
         // Deleteing the sub categories
396
-        $subcats =& $this->getCategories(0, 0, $category->categoryid());
396
+        $subcats = & $this->getCategories(0, 0, $category->categoryid());
397 397
         foreach ($subcats as $subcat) {
398 398
             $this->delete($subcat);
399 399
         }
@@ -430,11 +430,11 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $ret   = [];
432 432
         $limit = $start = 0;
433
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories');
433
+        $sql   = 'SELECT * FROM '.$this->db->prefix('smartfaq_categories');
434 434
         if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) {
435
-            $sql .= ' ' . $criteria->renderWhere();
435
+            $sql .= ' '.$criteria->renderWhere();
436 436
             if ($criteria->getSort() != '') {
437
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
437
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
438 438
             }
439 439
             $limit = $criteria->getLimit();
440 440
             $start = $criteria->getStart();
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         $order = 'ASC',
477 477
         $id_as_key = true
478 478
     ) {
479
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
479
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
480 480
 
481 481
         $criteria = new CriteriaCompo();
482 482
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
491 491
 
492 492
             $categoriesGranted = $smartPermHandler->getPermissions('category');
493
-            $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
493
+            $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
494 494
         }
495 495
         $criteria->setStart($start);
496 496
         $criteria->setLimit($limit);
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
         $sort = 'weight',
515 515
         $order = 'ASC'
516 516
     ) {
517
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
517
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
518 518
 
519 519
         $criteria = new CriteriaCompo();
520 520
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
529 529
 
530 530
             $categoriesGranted = $smartPermHandler->getPermissions('category');
531
-            $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
531
+            $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
532 532
         }
533 533
 
534 534
         $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED));
@@ -537,11 +537,11 @@  discard block
 block discarded – undo
537 537
 
538 538
         $ret   = [];
539 539
         $limit = $start = 0;
540
-        $sql   = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid';
540
+        $sql   = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid';
541 541
         if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
542
-            $sql .= ' ' . $criteria->renderWhere();
542
+            $sql .= ' '.$criteria->renderWhere();
543 543
             if ($criteria->getSort() != '') {
544
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
544
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
545 545
             }
546 546
             $limit = $criteria->getLimit();
547 547
             $start = $criteria->getStart();
@@ -570,9 +570,9 @@  discard block
 block discarded – undo
570 570
      */
571 571
     public function getCount($criteria = null)
572 572
     {
573
-        $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_categories');
573
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_categories');
574 574
         if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
575
-            $sql .= ' ' . $criteria->renderWhere();
575
+            $sql .= ' '.$criteria->renderWhere();
576 576
         }
577 577
         $result = $this->db->query($sql);
578 578
         if (!$result) {
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
                 $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
600 600
 
601 601
                 $categoriesGranted = $smartPermHandler->getPermissions('category');
602
-                $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
602
+                $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
603 603
             }
604 604
         }
605 605
 
@@ -622,16 +622,16 @@  discard block
 block discarded – undo
622 622
                 $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
623 623
 
624 624
                 $categoriesGranted = $smartPermHandler->getPermissions('category');
625
-                $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
625
+                $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
626 626
             }
627 627
         }
628 628
 
629 629
         $criteria->add(new Criteria('f.status', _SF_STATUS_OPENED));
630 630
 
631
-        $sql = 'SELECT COUNT(c.categoryid) FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid';
631
+        $sql = 'SELECT COUNT(c.categoryid) FROM '.$this->db->prefix('smartfaq_categories').' AS c INNER JOIN '.$this->db->prefix('smartfaq_faq').' AS f ON c.categoryid = f.categoryid';
632 632
 
633 633
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
634
-            $sql .= ' ' . $criteria->renderWhere();
634
+            $sql .= ' '.$criteria->renderWhere();
635 635
         }
636 636
 
637 637
         $result = $this->db->query($sql);
@@ -649,13 +649,13 @@  discard block
 block discarded – undo
649 649
      */
650 650
     public function getSubCats($categories)
651 651
     {
652
-        $criteria = new CriteriaCompo(new Criteria('parentid', '(' . implode(',', array_keys($categories)) . ')'), 'IN');
652
+        $criteria = new CriteriaCompo(new Criteria('parentid', '('.implode(',', array_keys($categories)).')'), 'IN');
653 653
         $ret      = [];
654 654
         if (!sf_userIsAdmin()) {
655 655
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
656 656
 
657 657
             $categoriesGranted = $smartPermHandler->getPermissions('category');
658
-            $criteria->add(new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN'));
658
+            $criteria->add(new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN'));
659 659
         }
660 660
         $subcats = $this->getObjects($criteria, true);
661 661
         foreach ($subcats as $subcat_id => $subcat) {
@@ -673,9 +673,9 @@  discard block
 block discarded – undo
673 673
      */
674 674
     public function deleteAll($criteria = null)
675 675
     {
676
-        $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_categories');
676
+        $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_categories');
677 677
         if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
678
-            $sql .= ' ' . $criteria->renderWhere();
678
+            $sql .= ' '.$criteria->renderWhere();
679 679
         }
680 680
         if (!$this->db->query($sql)) {
681 681
             return false;
@@ -697,10 +697,10 @@  discard block
 block discarded – undo
697 697
      **/
698 698
     public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null)
699 699
     {
700
-        $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue);
701
-        $sql        = 'UPDATE ' . $this->db->prefix('smartfaq_categories') . ' SET ' . $set_clause;
700
+        $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
701
+        $sql        = 'UPDATE '.$this->db->prefix('smartfaq_categories').' SET '.$set_clause;
702 702
         if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
703
-            $sql .= ' ' . $criteria->renderWhere();
703
+            $sql .= ' '.$criteria->renderWhere();
704 704
         }
705 705
         if (!$this->db->queryF($sql)) {
706 706
             return false;
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
     public function faqsCount($cat_id = 0, $status = '')
727 727
     {
728 728
         global $xoopsUser;
729
-        require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
729
+        require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
730 730
 
731 731
         $faqHandler = sf_gethandler('faq');
732 732
 
Please login to merge, or discard this patch.
class/utility.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -649,7 +649,7 @@
 block discarded – undo
649 649
 
650 650
     /**
651 651
      * @param  string $url
652
-     * @return mixed|string
652
+     * @return string
653 653
      */
654 654
     public static function sf_getxoopslink($url = '')
655 655
     {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 if (!mkdir($folder) && !is_dir($folder)) {
30 30
                     throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
31 31
                 } else {
32
-                    file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
32
+                    file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>');
33 33
                 }
34 34
             }
35 35
         } catch (Exception $e) {
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
         //    @mkdir($dst);
68 68
         while (false !== ($file = readdir($dir))) {
69 69
             if (($file !== '.') && ($file !== '..')) {
70
-                if (is_dir($src . '/' . $file)) {
71
-                    self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
70
+                if (is_dir($src.'/'.$file)) {
71
+                    self::recurseCopy($src.'/'.$file, $dst.'/'.$file);
72 72
                 } else {
73
-                    copy($src . '/' . $file, $dst . '/' . $file);
73
+                    copy($src.'/'.$file, $dst.'/'.$file);
74 74
                 }
75 75
             }
76 76
         }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $currentVer = substr(XOOPS_VERSION, 6); // get the numeric part of string
98 98
         $currArray  = explode('.', $currentVer);
99 99
         if (null === $requiredVer) {
100
-            $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string
100
+            $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string
101 101
         }
102 102
         $reqArray = explode('.', $requiredVer);
103 103
         $success  = true;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     break;
113 113
                 }
114 114
             } else {
115
-                if ((int)$v > 0) { // handles versions like x.x.x.0_RC2
115
+                if ((int) $v > 0) { // handles versions like x.x.x.0_RC2
116 116
                     $success = false;
117 117
                     break;
118 118
                 }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 break;
204 204
 
205 205
             case 'inside':
206
-                return XOOPS_URL . '/modules/smartfaq/doc/';
206
+                return XOOPS_URL.'/modules/smartfaq/doc/';
207 207
                 break;
208 208
 
209 209
             case 'custom':
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
     {
221 221
         $ret = '';
222 222
         foreach ($errors as $key => $value) {
223
-            $ret .= '<br> - ' . $value;
223
+            $ret .= '<br> - '.$value;
224 224
         }
225 225
 
226 226
         return $ret;
@@ -243,11 +243,11 @@  discard block
 block discarded – undo
243 243
             $spaces .= '--';
244 244
         }
245 245
 
246
-        $ret .= "<option value='" . $categoryObj->categoryid() . "'";
246
+        $ret .= "<option value='".$categoryObj->categoryid()."'";
247 247
         if ($selectedid == $categoryObj->categoryid()) {
248 248
             $ret .= ' selected';
249 249
         }
250
-        $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n";
250
+        $ret .= '>'.$spaces.$categoryObj->name()."</option>\n";
251 251
 
252 252
         $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
253 253
         if (count($subCategoriesObj) > 0) {
@@ -268,10 +268,10 @@  discard block
 block discarded – undo
268 268
      */
269 269
     public static function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true)
270 270
     {
271
-        $ret = '' . _MB_SF_SELECTCAT . "&nbsp;<select name='options[]'>";
271
+        $ret = ''._MB_SF_SELECTCAT."&nbsp;<select name='options[]'>";
272 272
         if ($allCatOption) {
273 273
             $ret .= "<option value='0'";
274
-            $ret .= '>' . _MB_SF_ALLCAT . "</option>\n";
274
+            $ret .= '>'._MB_SF_ALLCAT."</option>\n";
275 275
         }
276 276
 
277 277
         // Creating the category handler object
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $smartModule = sf_getModuleInfo();
341 341
 
342
-        $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . '';
342
+        $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').'';
343 343
 
344
-        $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'></a>";
344
+        $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'></a>";
345 345
 
346 346
         return $modfooter;
347 347
     }
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 
438 438
         $gpermHandler = xoops_getHandler('groupperm');
439 439
 
440
-        $sql    = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' ";
440
+        $sql    = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' ";
441 441
         $result = $xoopsDB->queryF($sql);
442 442
 
443 443
         if (count($result) > 0) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
         $ret = [];
553 553
         global $xoopsDB;
554 554
 
555
-        $result = $xoopsDB->queryF('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'");
555
+        $result = $xoopsDB->queryF('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'");
556 556
         $ret    = $xoopsDB->fetcharray($result);
557 557
 
558 558
         return $ret;
@@ -571,26 +571,26 @@  discard block
 block discarded – undo
571 571
     {
572 572
         global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
573 573
         $adminLinks = '';
574
-        $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/';
574
+        $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/';
575 575
         $page       = $open ? 'question.php' : 'faq.php';
576 576
         if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
577 577
             // Edit button
578
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'></a>";
578
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'></a>";
579 579
             $adminLinks .= ' ';
580 580
             // Delete button
581
-            $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&amp;faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'></a>";
581
+            $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&amp;faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'></a>";
582 582
             $adminLinks .= ' ';
583 583
         }
584 584
         // Print button
585
-        $adminLinks .= "<a href='" . $modulePath . 'print.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'></a>";
585
+        $adminLinks .= "<a href='".$modulePath.'print.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'></a>";
586 586
         $adminLinks .= ' ';
587 587
         // Email button
588
-        $maillink   = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . $modulePath . 'faq.php?faqid=' . $faqid;
589
-        $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'></a>";
588
+        $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.$modulePath.'faq.php?faqid='.$faqid;
589
+        $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'></a>";
590 590
         $adminLinks .= ' ';
591 591
         // Submit New Answer button
592 592
         if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) {
593
-            $adminLinks .= "<a href='" . $modulePath . 'answer.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'></a>";
593
+            $adminLinks .= "<a href='".$modulePath.'answer.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'></a>";
594 594
             $adminLinks .= ' ';
595 595
         }
596 596
 
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
             return $userid;
612 612
         }
613 613
 
614
-        $userid = (int)$userid;
614
+        $userid = (int) $userid;
615 615
         if ($userid > 0) {
616 616
             if ($users == []) {
617 617
                 //fetching users
@@ -621,7 +621,7 @@  discard block
 block discarded – undo
621 621
                 if (!isset($users[$userid])) {
622 622
                     return $GLOBALS['xoopsConfig']['anonymous'];
623 623
                 }
624
-                $user =& $users[$userid];
624
+                $user = & $users[$userid];
625 625
             }
626 626
 
627 627
             if (is_object($user)) {
@@ -635,9 +635,9 @@  discard block
 block discarded – undo
635 635
                     $fullname = $user->getVar('name');
636 636
                 }
637 637
                 if (!empty($fullname)) {
638
-                    $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
638
+                    $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
639 639
                 } else {
640
-                    $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
640
+                    $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
641 641
                 }
642 642
 
643 643
                 return $linkeduser;
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
             //-->
720 720
         </script>
721 721
         <?php
722
-        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
722
+        echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">";
723 723
     }
724 724
 
725 725
     /**
@@ -732,16 +732,16 @@  discard block
 block discarded – undo
732 732
         static $handlers;
733 733
         $name = strtolower(trim($name));
734 734
         if (!isset($handlers[$name])) {
735
-            if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) {
735
+            if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) {
736 736
                 require_once $hnd_file;
737 737
             }
738
-            $class = 'sf' . ucfirst($name) . 'Handler';
738
+            $class = 'sf'.ucfirst($name).'Handler';
739 739
             if (class_exists($class)) {
740 740
                 $handlers[$name] = new $class($GLOBALS['xoopsDB']);
741 741
             }
742 742
         }
743 743
         if (!$optional && !isset($handlers[$name])) {
744
-            trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
744
+            trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
745 745
         }
746 746
         $false = false;
747 747
 
Please login to merge, or discard this patch.
comment_reply.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include __DIR__ . '/../../mainfile.php';
10
-require_once XOOPS_ROOT_PATH . '/include/comment_reply.php';
9
+include __DIR__.'/../../mainfile.php';
10
+require_once XOOPS_ROOT_PATH.'/include/comment_reply.php';
Please login to merge, or discard this patch.
blocks/faqs_recent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 function b_faqs_recent_show($options)
13 13
 {
14
-    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
14
+    require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
15 15
     $myts = MyTextSanitizer::getInstance();
16 16
 
17 17
     $smartModule       = sf_getModuleInfo();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         }
53 53
 
54 54
         $memberHandler = xoops_getHandler('member');
55
-        $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
55
+        $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
56 56
         for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) {
57 57
             $faqs['categoryid']   = $faqsObj[$i]->categoryid();
58 58
             $faqs['question']     = $faqsObj[$i]->question($maxQuestionLength);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $block['lang_poster']   = _MB_SF_ANSWEREDBY;
75 75
         $block['lang_date']     = _MB_SF_DATE;
76 76
         $modulename             = $myts->htmlSpecialChars($smartModule->getVar('name'));
77
-        $block['lang_visitfaq'] = _MB_SF_VISITFAQ . ' ' . $modulename;
77
+        $block['lang_visitfaq'] = _MB_SF_VISITFAQ.' '.$modulename;
78 78
     }
79 79
 
80 80
     return $block;
@@ -86,34 +86,34 @@  discard block
 block discarded – undo
86 86
  */
87 87
 function b_faqs_recent_edit($options)
88 88
 {
89
-    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
89
+    require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
90 90
 
91 91
     $form = sf_createCategorySelect($options[0]);
92 92
 
93
-    $form .= '&nbsp;<br>' . _MB_SF_ORDER . "&nbsp;<select name='options[]'>";
93
+    $form .= '&nbsp;<br>'._MB_SF_ORDER."&nbsp;<select name='options[]'>";
94 94
 
95 95
     $form .= "<option value='datesub'";
96 96
     if ($options[1] === 'datesub') {
97 97
         $form .= ' selected';
98 98
     }
99
-    $form .= '>' . _MB_SF_DATE . "</option>\n";
99
+    $form .= '>'._MB_SF_DATE."</option>\n";
100 100
 
101 101
     $form .= "<option value='counter'";
102 102
     if ($options[1] === 'counter') {
103 103
         $form .= ' selected';
104 104
     }
105
-    $form .= '>' . _MB_SF_HITS . "</option>\n";
105
+    $form .= '>'._MB_SF_HITS."</option>\n";
106 106
 
107 107
     $form .= "<option value='weight'";
108 108
     if ($options[1] === 'weight') {
109 109
         $form .= ' selected';
110 110
     }
111
-    $form .= '>' . _MB_SF_WEIGHT . "</option>\n";
111
+    $form .= '>'._MB_SF_WEIGHT."</option>\n";
112 112
 
113 113
     $form .= "</select>\n";
114 114
 
115
-    $form .= '&nbsp;' . _MB_SF_DISP . "&nbsp;<input type='text' name='options[]' value='" . $options[2] . "'>&nbsp;" . _MB_SF_FAQS . '';
116
-    $form .= '&nbsp;<br>' . _MB_SF_CHARS . "&nbsp;<input type='text' name='options[]' value='" . $options[3] . "'>&nbsp;" . _MB_SF_LENGTH . '';
115
+    $form .= '&nbsp;'._MB_SF_DISP."&nbsp;<input type='text' name='options[]' value='".$options[2]."'>&nbsp;"._MB_SF_FAQS.'';
116
+    $form .= '&nbsp;<br>'._MB_SF_CHARS."&nbsp;<input type='text' name='options[]' value='".$options[3]."'>&nbsp;"._MB_SF_LENGTH.'';
117 117
 
118 118
     return $form;
119 119
 }
Please login to merge, or discard this patch.
faq.php 1 patch
Spacing   +10 added lines, -10 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 ($faqid == 0) {
14 14
     redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED);
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
     $faqObj->updateCounter();
45 45
 }
46 46
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_faq.tpl';
47
-require_once XOOPS_ROOT_PATH . '/header.php';
48
-require_once __DIR__ . '/footer.php';
47
+require_once XOOPS_ROOT_PATH.'/header.php';
48
+require_once __DIR__.'/footer.php';
49 49
 
50 50
 $faq = $faqObj->toArray(null, $categoryObj, false);
51 51
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 $xoopsTpl->assign('display_categoryname', false);
81 81
 
82 82
 $xoopsTpl->assign('xcodes', $faqObj->getVar('xcodes'));
83
-$xoopsTpl->assign('mail_link', 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&amp;body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $faqObj->getVar('faqid'));
83
+$xoopsTpl->assign('mail_link', 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&amp;body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).':  '.XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$faqObj->getVar('faqid'));
84 84
 $xoopsTpl->assign('lang_printerpage', _MD_SF_PRINTERFRIENDLY);
85 85
 $xoopsTpl->assign('lang_sendstory', _MD_SF_SENDSTORY);
86 86
 $xoopsTpl->assign('faqid', $faqObj->getVar('faqid'));
@@ -96,19 +96,19 @@  discard block
 block discarded – undo
96 96
 
97 97
 // Page Title Hack by marcan
98 98
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
99
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $categoryObj->name() . ' - ' . $faq['question']);
99
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$categoryObj->name().' - '.$faq['question']);
100 100
 // End Page Title Hack by marcan
101 101
 
102 102
 // Include the comments if the selected FAQ supports comments
103 103
 if ($faqObj->cancomment() == 1) {
104
-    require_once XOOPS_ROOT_PATH . '/include/comment_view.php';
104
+    require_once XOOPS_ROOT_PATH.'/include/comment_view.php';
105 105
 }
106 106
 
107 107
 //code to include smartie
108
-if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
109
-    require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
108
+if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) {
109
+    require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php';
110 110
     $xoopsTpl->assign('smarttie', 1);
111 111
 }
112 112
 //end code for smarttie
113 113
 
114
-require_once XOOPS_ROOT_PATH . '/footer.php';
114
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include __DIR__ . '/../../mainfile.php';
9
+include __DIR__.'/../../mainfile.php';
10 10
 
11
-require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
12
-require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php';
13
-require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php';
14
-require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php';
11
+require_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
12
+require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php';
13
+require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php';
14
+require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php';
15 15
 
16 16
 $myts = MyTextSanitizer::getInstance();
Please login to merge, or discard this patch.
comment_edit.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include __DIR__ . '/../../mainfile.php';
10
-require_once XOOPS_ROOT_PATH . '/include/comment_edit.php';
9
+include __DIR__.'/../../mainfile.php';
10
+require_once XOOPS_ROOT_PATH.'/include/comment_edit.php';
Please login to merge, or discard this patch.
answer.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use Xmf\Request;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
14 14
 
@@ -129,12 +129,12 @@  discard block
 block discarded – undo
129 129
 
130 130
         // Storing the FAQ object in the database
131 131
         if (!$faqObj->store()) {
132
-            redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($faqObj->getErrors()));
132
+            redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($faqObj->getErrors()));
133 133
         }
134 134
 
135 135
         // Storing the answer object in the database
136 136
         if (!$newAnswerObj->store()) {
137
-            redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR . sf_formatErrors($newAnswerObj->getErrors()));
137
+            redirect_header('javascript:history.go(-1)', 3, _MD_SF_SUBMIT_ERROR.sf_formatErrors($newAnswerObj->getErrors()));
138 138
         }
139 139
 
140 140
         $notificationHandler = xoops_getHandler('notification');
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             case 2:
151 151
                 // Answer for an open question submitted, auto-approved; became Q&A, need approbation
152 152
                 if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
153
-                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
153
+                    require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
154 154
                     $notificationHandler->subscribe('faq', $faqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
155 155
                 }
156 156
                 // Send notifications
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             case 3:
161 161
                 // Answer submitted, needs approbation
162 162
                 if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
163
-                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
163
+                    require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
164 164
                     $notificationHandler->subscribe('question', $newAnswerObj->answerid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
165 165
                 }
166 166
                 // Send notifications
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 // New answer submitted for a published Q&A, need approbation
176 176
                 // Send notifications
177 177
                 if (isset($_POST['notifypub']) && $_POST['notifypub'] == 1) {
178
-                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
178
+                    require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
179 179
                     $notificationHandler->subscribe('faq', $newAnswerObj->answerid(), 'answer_approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
180 180
                 }
181 181
 
@@ -212,20 +212,20 @@  discard block
 block discarded – undo
212 212
         }
213 213
 
214 214
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
215
-        require_once XOOPS_ROOT_PATH . '/header.php';
216
-        require_once __DIR__ . '/footer.php';
215
+        require_once XOOPS_ROOT_PATH.'/header.php';
216
+        require_once __DIR__.'/footer.php';
217 217
 
218 218
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
219 219
 
220
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
220
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
221 221
         $xoopsTpl->assign('whereInSection', $moduleName);
222 222
         $xoopsTpl->assign('lang_submit', _MD_SF_SUBMITANSWER);
223 223
 
224 224
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUBMITANSWERTO, ucwords($xoopsModule->name())));
225
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUBMITANSWER_INTRO);
225
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUBMITANSWER_INTRO);
226 226
 
227
-        require_once __DIR__ . '/include/answer.inc.php';
227
+        require_once __DIR__.'/include/answer.inc.php';
228 228
 
229
-        require_once XOOPS_ROOT_PATH . '/footer.php';
229
+        require_once XOOPS_ROOT_PATH.'/footer.php';
230 230
         break;
231 231
 }
Please login to merge, or discard this patch.