Completed
Branch master (c92e39)
by Michael
02:32
created
include/notification.inc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,22 +34,22 @@
 block discarded – undo
34 34
 
35 35
     if ($category === 'category') {
36 36
         // Assume we have a valid category id
37
-        $sql          = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid  = ' . $item_id;
37
+        $sql          = 'SELECT name FROM '.$xoopsDB->prefix('smartfaq_categories').' WHERE categoryid  = '.$item_id;
38 38
         $result       = $xoopsDB->query($sql); // TODO: error check
39 39
         $result_array = $xoopsDB->fetchArray($result);
40 40
         $item['name'] = $result_array['name'];
41
-        $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id;
41
+        $item['url']  = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/category.php?categoryid='.$item_id;
42 42
 
43 43
         return $item;
44 44
     }
45 45
 
46 46
     if ($category === 'faq') {
47 47
         // Assume we have a valid story id
48
-        $sql          = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id;
48
+        $sql          = 'SELECT question FROM '.$xoopsDB->prefix('smartfaq_faq').' WHERE faqid = '.$item_id;
49 49
         $result       = $xoopsDB->query($sql); // TODO: error check
50 50
         $result_array = $xoopsDB->fetchArray($result);
51 51
         $item['name'] = $result_array['question'];
52
-        $item['url']  = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id;
52
+        $item['url']  = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/faq.php?faqid='.$item_id;
53 53
 
54 54
         return $item;
55 55
     }
Please login to merge, or discard this patch.
include/request.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@
 block discarded – undo
9 9
 
10 10
 global $_POST;
11 11
 
12
-include_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
13
-include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
14
-include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
12
+include_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
13
+include_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
14
+include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
15 15
 
16 16
 $form = new XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF'));
17 17
 // CATEGORY
Please login to merge, or discard this patch.
include/comment_functions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 function smartfaq_com_update($faq_id, $total_num)
12 12
 {
13 13
     $db  = XoopsDatabaseFactory::getDatabaseConnection();
14
-    $sql = 'UPDATE ' . $db->prefix('smartfaq_faq') . ' SET comments = ' . $total_num . ' WHERE faqid = ' . $faq_id;
14
+    $sql = 'UPDATE '.$db->prefix('smartfaq_faq').' SET comments = '.$total_num.' WHERE faqid = '.$faq_id;
15 15
     $db->query($sql);
16 16
 }
17 17
 
Please login to merge, or discard this patch.
class/faq.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
     }
244 244
 
245 245
     /**
246
-     * @return mixed
246
+     * @return integer
247 247
      */
248 248
     public function uid()
249 249
     {
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
     /**
755 755
      * insert a new faq in the database
756 756
      *
757
-     * @param  XoopsObject $faq reference to the {@link sfFaq} object
757
+     * @param  sfFaq $faq reference to the {@link sfFaq} object
758 758
      * @param  bool        $force
759 759
      * @return bool        FALSE if failed, TRUE if already present and unchanged or successful
760 760
      */
@@ -1143,7 +1143,7 @@  discard block
 block discarded – undo
1143 1143
      * @param  string $order
1144 1144
      * @param  string $notNullFields
1145 1145
      * @param  bool   $asobject
1146
-     * @param  null   $otherCriteria
1146
+     * @param  null|CriteriaCompo   $otherCriteria
1147 1147
      * @return array
1148 1148
      */
1149 1149
     public function getFaqs(
Please login to merge, or discard this patch.
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -647,16 +647,16 @@  discard block
 block discarded – undo
647 647
         }
648 648
 
649 649
         return $text
650
-               . $xoopsConfig['sitename']
651
-               . ' : <a href='
652
-               . XOOPS_URL
653
-               . '/modules/smartfaq/faq.php?faqid='
654
-               . $this->faqid()
655
-               . '>'
656
-               . XOOPS_URL
657
-               . '/modules/smartfaq/faq.php?faqid='
658
-               . $this->faqid()
659
-               . '</a>';
650
+                . $xoopsConfig['sitename']
651
+                . ' : <a href='
652
+                . XOOPS_URL
653
+                . '/modules/smartfaq/faq.php?faqid='
654
+                . $this->faqid()
655
+                . '>'
656
+                . XOOPS_URL
657
+                . '/modules/smartfaq/faq.php?faqid='
658
+                . $this->faqid()
659
+                . '</a>';
660 660
     }
661 661
 
662 662
     /**
@@ -778,14 +778,14 @@  discard block
 block discarded – undo
778 778
 
779 779
         if ($faq->isNew()) {
780 780
             $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)',
781
-                           $this->db->prefix('smartfaq_faq'), $categoryid, $this->db->quoteString($question), $this->db->quoteString($howdoi), $this->db->quoteString($diduno), $uid, time(), $status,
782
-                           $counter, $weight, $html, $smiley, $xcodes, $cancomment, $comments, $notifypub, $this->db->quoteString($modulelink), $this->db->quoteString($contextpage), $exacturl,
783
-                           $partialview);
781
+                            $this->db->prefix('smartfaq_faq'), $categoryid, $this->db->quoteString($question), $this->db->quoteString($howdoi), $this->db->quoteString($diduno), $uid, time(), $status,
782
+                            $counter, $weight, $html, $smiley, $xcodes, $cancomment, $comments, $notifypub, $this->db->quoteString($modulelink), $this->db->quoteString($contextpage), $exacturl,
783
+                            $partialview);
784 784
         } else {
785 785
             $sql = sprintf('UPDATE %s SET categoryid = %u, question = %s, howdoi = %s, diduno = %s, uid = %u, datesub = %u, `status` = %u, counter = %u, weight = %u, html = %u, smiley = %u, xcodes = %u, cancomment = %u, comments = %u, notifypub = %u, modulelink = %s, contextpage = %s, exacturl = %u, partialview = %u  WHERE faqid = %u',
786
-                           $this->db->prefix('smartfaq_faq'), $categoryid, $this->db->quoteString($question), $this->db->quoteString($howdoi), $this->db->quoteString($diduno), $uid, $datesub, $status,
787
-                           $counter, $weight, $html, $smiley, $xcodes, $cancomment, $comments, $notifypub, $this->db->quoteString($modulelink), $this->db->quoteString($contextpage), $exacturl,
788
-                           $partialview, $faqid);
786
+                            $this->db->prefix('smartfaq_faq'), $categoryid, $this->db->quoteString($question), $this->db->quoteString($howdoi), $this->db->quoteString($diduno), $uid, $datesub, $status,
787
+                            $counter, $weight, $html, $smiley, $xcodes, $cancomment, $comments, $notifypub, $this->db->quoteString($modulelink), $this->db->quoteString($contextpage), $exacturl,
788
+                            $partialview, $faqid);
789 789
         }
790 790
         if (false != $force) {
791 791
             $result = $this->db->queryF($sql);
@@ -1618,10 +1618,10 @@  discard block
 block discarded – undo
1618 1618
         $criteria->setOrder('DESC');
1619 1619
 
1620 1620
         $sql = 'SELECT faq.faqid, faq.question, faq.datesub, faq.uid FROM '
1621
-               . $this->db->prefix('smartfaq_faq')
1622
-               . ' AS faq INNER JOIN '
1623
-               . $this->db->prefix('smartfaq_answers')
1624
-               . ' AS answer ON faq.faqid = answer.faqid';
1621
+                . $this->db->prefix('smartfaq_faq')
1622
+                . ' AS faq INNER JOIN '
1623
+                . $this->db->prefix('smartfaq_answers')
1624
+                . ' AS answer ON faq.faqid = answer.faqid';
1625 1625
 
1626 1626
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
1627 1627
             $whereClause = $criteria->renderWhere();
Please login to merge, or discard this patch.
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
10 10
 
11
-require_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php';
11
+require_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php';
12 12
 
13 13
 // FAQ status
14 14
 define('_SF_STATUS_NOTSET', -1);
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      */
129 129
     public function checkPermission()
130 130
     {
131
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
131
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
132 132
 
133 133
         $userIsAdmin = sf_userIsAdmin();
134 134
         if ($userIsAdmin) {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         if ($maxLength != 0) {
205 205
             if (!XOOPS_USE_MULTIBYTES) {
206 206
                 if (strlen($ret) >= $maxLength) {
207
-                    $ret = substr($ret, 0, $maxLength - 1) . '...';
207
+                    $ret = substr($ret, 0, $maxLength-1).'...';
208 208
                 }
209 209
             }
210 210
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
490 490
         $tags['FAQ_NAME']      = $this->question();
491 491
         $tags['CATEGORY_NAME'] = $this->getCategoryName();
492
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $this->categoryid();
492
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$this->categoryid();
493 493
         $tags['FAQ_QUESTION']  = $this->question();
494 494
         $answerObj             = $this->answer();
495 495
         if (is_object($answerObj)) {
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
         foreach ($notifications as $notification) {
502 502
             switch ($notification) {
503 503
                 case _SF_NOT_FAQ_PUBLISHED:
504
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $this->faqid();
504
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$this->faqid();
505 505
 
506 506
                     $notificationHandler->triggerEvent('global_faq', 0, 'published', $tags);
507 507
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'published', $tags);
@@ -509,20 +509,20 @@  discard block
 block discarded – undo
509 509
                     break;
510 510
 
511 511
                 case _SF_NOT_FAQ_SUBMITTED:
512
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/faq.php?faqid=' . $this->faqid();
512
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/faq.php?faqid='.$this->faqid();
513 513
                     $notificationHandler->triggerEvent('global_faq', 0, 'submitted', $tags);
514 514
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'submitted', $tags);
515 515
                     break;
516 516
 
517 517
                 case _SF_NOT_QUESTION_PUBLISHED:
518
-                    $tags['FAQ_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/answer.php?faqid=' . $this->faqid();
518
+                    $tags['FAQ_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/answer.php?faqid='.$this->faqid();
519 519
                     $notificationHandler->triggerEvent('global_question', 0, 'published', $tags);
520 520
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'published', $tags);
521 521
                     $notificationHandler->triggerEvent('question', $this->faqid(), 'approved', $tags);
522 522
                     break;
523 523
 
524 524
                 case _SF_NOT_QUESTION_SUBMITTED:
525
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/question.php?op=mod&faqid=' . $this->faqid();
525
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/question.php?op=mod&faqid='.$this->faqid();
526 526
                     $notificationHandler->triggerEvent('global_question', 0, 'submitted', $tags);
527 527
                     $notificationHandler->triggerEvent('category_question', $this->categoryid(), 'submitted', $tags);
528 528
                     break;
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
                     break;
533 533
 
534 534
                 case _SF_NOT_NEW_ANSWER_PROPOSED:
535
-                    $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/admin/answer.php?op=mod&faqid=' . $this->faqid();
535
+                    $tags['WAITINGFILES_URL'] = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/admin/answer.php?op=mod&faqid='.$this->faqid();
536 536
                     $notificationHandler->triggerEvent('global_faq', 0, 'answer_proposed', $tags);
537 537
                     $notificationHandler->triggerEvent('category_faq', $this->categoryid(), 'answer_proposed', $tags);
538 538
                     break;
@@ -668,16 +668,16 @@  discard block
 block discarded – undo
668 668
     public function toArray($faq = array(), $category = null, $linkInQuestion = true)
669 669
     {
670 670
         global $xoopsModuleConfig;
671
-        $lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize'];
671
+        $lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize'];
672 672
 
673 673
         $faq['id']         = $this->faqid();
674 674
         $faq['categoryid'] = $this->categoryid();
675 675
         $faq['question']   = $this->question();
676 676
         $page              = ($this->status() == _SF_STATUS_OPENED) ? 'answer.php' : 'faq.php';
677 677
 
678
-        $faq['questionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question($lastfaqsize) . '</a>';
678
+        $faq['questionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question($lastfaqsize).'</a>';
679 679
         if ($linkInQuestion) {
680
-            $faq['fullquestionlink'] = "<a href='$page?faqid=" . $this->faqid() . "'>" . $this->question() . '</a>';
680
+            $faq['fullquestionlink'] = "<a href='$page?faqid=".$this->faqid()."'>".$this->question().'</a>';
681 681
         } else {
682 682
             $faq['fullquestionlink'] = $this->question();
683 683
         }
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
                 $categoryObj = $category[$this->categoryid()];
694 694
             }
695 695
             $faq['categoryname'] = $categoryObj->getVar('name');
696
-            $faq['categorylink'] = "<a href='" . XOOPS_URL . '/modules/smartfaq/category.php?categoryid=' . $this->categoryid() . "'>" . $categoryObj->getVar('name') . '</a>';
696
+            $faq['categorylink'] = "<a href='".XOOPS_URL.'/modules/smartfaq/category.php?categoryid='.$this->categoryid()."'>".$categoryObj->getVar('name').'</a>';
697 697
         }
698 698
 
699 699
         return $faq;
@@ -733,8 +733,8 @@  discard block
 block discarded – undo
733 733
      */
734 734
     public function & get($id)
735 735
     {
736
-        if ((int)$id > 0) {
737
-            $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq') . ' WHERE faqid=' . $id;
736
+        if ((int) $id > 0) {
737
+            $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_faq').' WHERE faqid='.$id;
738 738
             if (!$result = $this->db->query($sql)) {
739 739
                 return false;
740 740
             }
@@ -857,26 +857,26 @@  discard block
 block discarded – undo
857 857
     {
858 858
         $ret   = array();
859 859
         $limit = $start = 0;
860
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('smartfaq_faq');
860
+        $sql   = 'SELECT * FROM '.$this->db->prefix('smartfaq_faq');
861 861
 
862 862
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
863 863
             $whereClause = $criteria->renderWhere();
864 864
 
865 865
             if ($whereClause !== 'WHERE ()') {
866
-                $sql .= ' ' . $criteria->renderWhere();
866
+                $sql .= ' '.$criteria->renderWhere();
867 867
                 if (!empty($notNullFields)) {
868 868
                     $sql .= $this->NotNullFieldClause($notNullFields, true);
869 869
                 }
870 870
             } elseif (!empty($notNullFields)) {
871
-                $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
871
+                $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
872 872
             }
873 873
             if ($criteria->getSort() != '') {
874
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
874
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
875 875
             }
876 876
             $limit = $criteria->getLimit();
877 877
             $start = $criteria->getStart();
878 878
         } elseif (!empty($notNullFields)) {
879
-            $sql .= $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
879
+            $sql .= $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
880 880
         }
881 881
 
882 882
         //echo "<br>" . $sql . "<br>";
@@ -936,26 +936,26 @@  discard block
 block discarded – undo
936 936
                             faq.modulelink AS modulelink,
937 937
                             faq.contextpage AS contextpage,
938 938
                             faq.exacturl AS exacturl
939
-                FROM ' . $this->db->prefix('smartfaq_faq') . ' AS faq INNER JOIN ' . $this->db->prefix('smartfaq_categories') . ' AS category ON faq.categoryid = category.categoryid ';
939
+                FROM ' . $this->db->prefix('smartfaq_faq').' AS faq INNER JOIN '.$this->db->prefix('smartfaq_categories').' AS category ON faq.categoryid = category.categoryid ';
940 940
 
941 941
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
942 942
             $whereClause = $criteria->renderWhere();
943 943
 
944 944
             if ($whereClause !== 'WHERE ()') {
945
-                $sql .= ' ' . $criteria->renderWhere();
945
+                $sql .= ' '.$criteria->renderWhere();
946 946
                 if (!empty($notNullFields)) {
947 947
                     $sql .= $this->NotNullFieldClause($notNullFields, true);
948 948
                 }
949 949
             } elseif (!empty($notNullFields)) {
950
-                $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
950
+                $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
951 951
             }
952 952
             if ($criteria->getSort() != '') {
953
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
953
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
954 954
             }
955 955
             $limit = $criteria->getLimit();
956 956
             $start = $criteria->getStart();
957 957
         } elseif (!empty($notNullFields)) {
958
-            $sql .= $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
958
+            $sql .= $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
959 959
         }
960 960
 
961 961
         //echo "<br>" . $sql . "<br>";
@@ -1005,19 +1005,19 @@  discard block
 block discarded – undo
1005 1005
      */
1006 1006
     public function getCount($criteria = null, $notNullFields = '')
1007 1007
     {
1008
-        $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_faq');
1008
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_faq');
1009 1009
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
1010 1010
             $whereClause = $criteria->renderWhere();
1011 1011
             if ($whereClause !== 'WHERE ()') {
1012
-                $sql .= ' ' . $criteria->renderWhere();
1012
+                $sql .= ' '.$criteria->renderWhere();
1013 1013
                 if (!empty($notNullFields)) {
1014 1014
                     $sql .= $this->NotNullFieldClause($notNullFields, true);
1015 1015
                 }
1016 1016
             } elseif (!empty($notNullFields)) {
1017
-                $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
1017
+                $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
1018 1018
             }
1019 1019
         } elseif (!empty($notNullFields)) {
1020
-            $sql .= ' WHERE ' . $this->NotNullFieldClause($notNullFields);
1020
+            $sql .= ' WHERE '.$this->NotNullFieldClause($notNullFields);
1021 1021
         }
1022 1022
 
1023 1023
         //echo "<br>" . $sql . "<br>";
@@ -1050,11 +1050,11 @@  discard block
 block discarded – undo
1050 1050
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
1051 1051
 
1052 1052
             $categoriesGranted = $smartPermHandler->getPermissions('category');
1053
-            $grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN');
1053
+            $grantedCategories = new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN');
1054 1054
 
1055 1055
             $faqsGranted = $smartPermHandler->getPermissions('item');
1056 1056
             $grantedFaq  = new CriteriaCompo();
1057
-            $grantedFaq->add(new Criteria('faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR');
1057
+            $grantedFaq->add(new Criteria('faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR');
1058 1058
             // If user is anonymous, check if the FAQ allow partialview
1059 1059
             if (!is_object($xoopsUser)) {
1060 1060
                 $grantedFaq->add(new Criteria('partialview', '1'), 'OR');
@@ -1101,7 +1101,7 @@  discard block
 block discarded – undo
1101 1101
      */
1102 1102
     public function getFaqsCountByStatus()
1103 1103
     {
1104
-        $sql    = 'SELECT status, COUNT(*) FROM ' . $this->db->prefix('smartfaq_faq') . ' GROUP BY status';
1104
+        $sql    = 'SELECT status, COUNT(*) FROM '.$this->db->prefix('smartfaq_faq').' GROUP BY status';
1105 1105
         $result = $this->db->query($sql);
1106 1106
         if (!$result) {
1107 1107
             return array();
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
         $otherCriteria = null
1159 1159
     ) {
1160 1160
         global $xoopsUser;
1161
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
1161
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
1162 1162
 
1163 1163
         //if ( ($categoryid == -1) && (empty($status) || ($status == -1)) && ($limit == 0) && ($start ==0) ) {
1164 1164
         //  return $this->getObjects();
@@ -1170,11 +1170,11 @@  discard block
 block discarded – undo
1170 1170
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
1171 1171
 
1172 1172
             $categoriesGranted = $smartPermHandler->getPermissions('category');
1173
-            $grantedCategories = new Criteria('categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN');
1173
+            $grantedCategories = new Criteria('categoryid', '('.implode(',', $categoriesGranted).')', 'IN');
1174 1174
 
1175 1175
             $faqsGranted = $smartPermHandler->getPermissions('item');
1176 1176
             $grantedFaq  = new CriteriaCompo();
1177
-            $grantedFaq->add(new Criteria('faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR');
1177
+            $grantedFaq->add(new Criteria('faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR');
1178 1178
             // If user is anonymous, check if the FAQ allow partialview
1179 1179
             if (!is_object($xoopsUser)) {
1180 1180
                 $grantedFaq->add(new Criteria('partialview', '1'), 'OR');
@@ -1183,9 +1183,9 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
         if (isset($categoryid) && ($categoryid != -1)) {
1185 1185
             if (is_array($categoryid)) {
1186
-                $criteriaCategory = new Criteria('categoryid', '(' . implode(',', $categoryid) . ')', 'IN');
1186
+                $criteriaCategory = new Criteria('categoryid', '('.implode(',', $categoryid).')', 'IN');
1187 1187
             } else {
1188
-                $criteriaCategory = new Criteria('categoryid', (int)$categoryid);
1188
+                $criteriaCategory = new Criteria('categoryid', (int) $categoryid);
1189 1189
             }
1190 1190
         }
1191 1191
 
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
         $asobject = true,
1253 1253
         $otherCriteria = null
1254 1254
     ) {
1255
-        include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
1255
+        include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
1256 1256
 
1257 1257
         $smartModule = sf_getModuleInfo();
1258 1258
 
@@ -1311,7 +1311,7 @@  discard block
 block discarded – undo
1311 1311
 
1312 1312
         if ($totalFaqs > 0) {
1313 1313
             --$totalFaqs;
1314
-            mt_srand((double)microtime() * 1000000);
1314
+            mt_srand((double) microtime() * 1000000);
1315 1315
             $entrynumber = mt_rand(0, $totalFaqs);
1316 1316
             $faq         = $this->getFaqs(1, $entrynumber, $status, -1, 'datesub', 'DESC', $notNullFields);
1317 1317
             if ($faq) {
@@ -1346,10 +1346,10 @@  discard block
 block discarded – undo
1346 1346
                 $httphost    = $_SERVER['HTTP_HOST'];
1347 1347
                 $querystring = $_SERVER['QUERY_STRING'];
1348 1348
                 if ($querystring != '') {
1349
-                    $querystring = '?' . $querystring;
1349
+                    $querystring = '?'.$querystring;
1350 1350
                 }
1351
-                $currenturl     = $http . $httphost . $phpself . $querystring;
1352
-                $fullcontexturl = XOOPS_URL . '/' . $faqsObj[$i]->contextpage();
1351
+                $currenturl     = $http.$httphost.$phpself.$querystring;
1352
+                $fullcontexturl = XOOPS_URL.'/'.$faqsObj[$i]->contextpage();
1353 1353
                 switch ($faqsObj[$i]->modulelink()) {
1354 1354
                     case '':
1355 1355
                         $display = false;
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
                         }
1369 1369
                         break;
1370 1370
                     default:
1371
-                        if (strpos($currenturl, XOOPS_URL . '/modules/') === false) {
1371
+                        if (strpos($currenturl, XOOPS_URL.'/modules/') === false) {
1372 1372
                             $display = false;
1373 1373
                         } else {
1374 1374
                             if (strpos($currenturl, $faqsObj[$i]->modulelink()) === false) {
@@ -1386,7 +1386,7 @@  discard block
 block discarded – undo
1386 1386
         }
1387 1387
 
1388 1388
         if (count($randomFaqs) > $limit) {
1389
-            mt_srand((float)microtime() * 10000000);
1389
+            mt_srand((float) microtime() * 10000000);
1390 1390
             $rand_keys = array_rand($randomFaqs, $limit);
1391 1391
             for ($j = 0, $jMax = count($rand_keys); $j < $jMax; ++$j) {
1392 1392
                 $ret[] = &$randomFaqs[$rand_keys[$j]];
@@ -1409,14 +1409,14 @@  discard block
 block discarded – undo
1409 1409
         if (!sf_userIsAdmin()) {
1410 1410
             $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
1411 1411
             $items            = $smartPermHandler->getPermissions('item');
1412
-            $faqclause        = ' AND faqid IN (' . implode(',', $items) . ')';
1412
+            $faqclause        = ' AND faqid IN ('.implode(',', $items).')';
1413 1413
         }
1414 1414
 
1415 1415
         $sql  = "CREATE TEMPORARY TABLE tmp (categoryid INT(8) UNSIGNED NOT NULL,datesub INT(11) DEFAULT '0' NOT NULL);";
1416
-        $sql2 = ' LOCK TABLES ' . $this->db->prefix('smartfaq_faq') . ' READ;';
1417
-        $sql3 = ' INSERT INTO tmp SELECT categoryid, MAX(datesub) FROM ' . $this->db->prefix('smartfaq_faq') . ' WHERE status IN (' . implode(',', $status) . ") $faqclause GROUP BY categoryid;";
1418
-        $sql4 = ' SELECT ' . $this->db->prefix('smartfaq_faq') . '.categoryid, faqid, question, uid, ' . $this->db->prefix('smartfaq_faq') . '.datesub FROM ' . $this->db->prefix('smartfaq_faq') . ', tmp
1419
-                              WHERE ' . $this->db->prefix('smartfaq_faq') . '.categoryid=tmp.categoryid AND ' . $this->db->prefix('smartfaq_faq') . '.datesub=tmp.datesub;';
1416
+        $sql2 = ' LOCK TABLES '.$this->db->prefix('smartfaq_faq').' READ;';
1417
+        $sql3 = ' INSERT INTO tmp SELECT categoryid, MAX(datesub) FROM '.$this->db->prefix('smartfaq_faq').' WHERE status IN ('.implode(',', $status).") $faqclause GROUP BY categoryid;";
1418
+        $sql4 = ' SELECT '.$this->db->prefix('smartfaq_faq').'.categoryid, faqid, question, uid, '.$this->db->prefix('smartfaq_faq').'.datesub FROM '.$this->db->prefix('smartfaq_faq').', tmp
1419
+                              WHERE ' . $this->db->prefix('smartfaq_faq').'.categoryid=tmp.categoryid AND '.$this->db->prefix('smartfaq_faq').'.datesub=tmp.datesub;';
1420 1420
         /*
1421 1421
         //Old implementation
1422 1422
         $sql = "SELECT categoryid, faqid, question, uid, MAX(datesub) AS datesub FROM ".$this->db->prefix("smartfaq_faq")."
@@ -1431,7 +1431,7 @@  discard block
 block discarded – undo
1431 1431
         $this->db->queryF('UNLOCK TABLES;');
1432 1432
         $this->db->queryF('DROP TABLE tmp;');
1433 1433
         if (!$result) {
1434
-            trigger_error('Error in getLastPublishedByCat SQL: ' . $error);
1434
+            trigger_error('Error in getLastPublishedByCat SQL: '.$error);
1435 1435
 
1436 1436
             return $ret;
1437 1437
         }
@@ -1453,9 +1453,9 @@  discard block
 block discarded – undo
1453 1453
      */
1454 1454
     public function deleteAll($criteria = null)
1455 1455
     {
1456
-        $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_faq');
1456
+        $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_faq');
1457 1457
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
1458
-            $sql .= ' ' . $criteria->renderWhere();
1458
+            $sql .= ' '.$criteria->renderWhere();
1459 1459
         }
1460 1460
         if (!$this->db->query($sql)) {
1461 1461
             return false;
@@ -1476,10 +1476,10 @@  discard block
 block discarded – undo
1476 1476
      **/
1477 1477
     public function updateAll($fieldname, $fieldvalue, $criteria = null)
1478 1478
     {
1479
-        $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue);
1480
-        $sql        = 'UPDATE ' . $this->db->prefix('smartfaq_faq') . ' SET ' . $set_clause;
1479
+        $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
1480
+        $sql        = 'UPDATE '.$this->db->prefix('smartfaq_faq').' SET '.$set_clause;
1481 1481
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
1482
-            $sql .= ' ' . $criteria->renderWhere();
1482
+            $sql .= ' '.$criteria->renderWhere();
1483 1483
         }
1484 1484
         if (!$this->db->queryF($sql)) {
1485 1485
             return false;
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
      */
1495 1495
     public function updateCounter($faqid)
1496 1496
     {
1497
-        $sql = 'UPDATE ' . $this->db->prefix('smartfaq_faq') . ' SET counter=counter+1 WHERE faqid = ' . $faqid;
1497
+        $sql = 'UPDATE '.$this->db->prefix('smartfaq_faq').' SET counter=counter+1 WHERE faqid = '.$faqid;
1498 1498
         if ($this->db->queryF($sql)) {
1499 1499
             return true;
1500 1500
         } else {
@@ -1550,8 +1550,8 @@  discard block
 block discarded – undo
1550 1550
             $criteriaKeywords = new CriteriaCompo();
1551 1551
             for ($i = 0, $iMax = count($queryarray); $i < $iMax; ++$i) {
1552 1552
                 $criteriaKeyword = new CriteriaCompo();
1553
-                $criteriaKeyword->add(new Criteria('faq.question', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
1554
-                $criteriaKeyword->add(new Criteria('answer.answer', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
1553
+                $criteriaKeyword->add(new Criteria('faq.question', '%'.$queryarray[$i].'%', 'LIKE'), 'OR');
1554
+                $criteriaKeyword->add(new Criteria('answer.answer', '%'.$queryarray[$i].'%', 'LIKE'), 'OR');
1555 1555
                 $criteriaKeywords->add($criteriaKeyword, $andor);
1556 1556
                 unset($criteriaKeyword);
1557 1557
             }
@@ -1569,9 +1569,9 @@  discard block
 block discarded – undo
1569 1569
             if (!$faqsGranted) {
1570 1570
                 return $ret;
1571 1571
             }
1572
-            $grantedCategories = new Criteria('faq.categoryid', '(' . implode(',', $categoriesGranted) . ')', 'IN');
1572
+            $grantedCategories = new Criteria('faq.categoryid', '('.implode(',', $categoriesGranted).')', 'IN');
1573 1573
             $grantedFaq        = new CriteriaCompo();
1574
-            $grantedFaq->add(new Criteria('faq.faqid', '(' . implode(',', $faqsGranted) . ')', 'IN'), 'OR');
1574
+            $grantedFaq->add(new Criteria('faq.faqid', '('.implode(',', $faqsGranted).')', 'IN'), 'OR');
1575 1575
             // If user is anonymous, check if the FAQ allow partialview
1576 1576
             if (!is_object($xoopsUser)) {
1577 1577
                 $grantedFaq->add(new Criteria('partialview', '1'), 'OR');
@@ -1627,9 +1627,9 @@  discard block
 block discarded – undo
1627 1627
             $whereClause = $criteria->renderWhere();
1628 1628
 
1629 1629
             if ($whereClause !== 'WHERE ()') {
1630
-                $sql .= ' ' . $criteria->renderWhere();
1630
+                $sql .= ' '.$criteria->renderWhere();
1631 1631
                 if ($criteria->getSort() != '') {
1632
-                    $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
1632
+                    $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
1633 1633
                 }
1634 1634
                 $limit = $criteria->getLimit();
1635 1635
                 $start = $criteria->getStart();
@@ -1668,19 +1668,19 @@  discard block
 block discarded – undo
1668 1668
     {
1669 1669
         global $xoopsUser;
1670 1670
         $ret = array();
1671
-        $sql = 'SELECT categoryid, COUNT(*) AS count FROM ' . $this->db->prefix('smartfaq_faq');
1672
-        if ((int)$cat_id > 0) {
1673
-            $sql .= ' WHERE categoryid = ' . (int)$cat_id;
1674
-            $sql .= ' AND status IN (' . implode(',', $status) . ')';
1671
+        $sql = 'SELECT categoryid, COUNT(*) AS count FROM '.$this->db->prefix('smartfaq_faq');
1672
+        if ((int) $cat_id > 0) {
1673
+            $sql .= ' WHERE categoryid = '.(int) $cat_id;
1674
+            $sql .= ' AND status IN ('.implode(',', $status).')';
1675 1675
         } else {
1676
-            $sql .= ' WHERE status IN (' . implode(',', $status) . ')';
1676
+            $sql .= ' WHERE status IN ('.implode(',', $status).')';
1677 1677
             if (!sf_userIsAdmin()) {
1678 1678
                 $smartPermHandler = xoops_getModuleHandler('permission', 'smartfaq');
1679 1679
                 $items            = $smartPermHandler->getPermissions('item');
1680 1680
                 if (is_object($xoopsUser)) {
1681
-                    $sql .= ' AND faqid IN (' . implode(',', $items) . ')';
1681
+                    $sql .= ' AND faqid IN ('.implode(',', $items).')';
1682 1682
                 } else {
1683
-                    $sql .= ' AND (faqid IN (' . implode(',', $items) . ') OR partialview = 1)';
1683
+                    $sql .= ' AND (faqid IN ('.implode(',', $items).') OR partialview = 1)';
1684 1684
                 }
1685 1685
             }
1686 1686
         }
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
             return $ret;
1694 1694
         }
1695 1695
         while ($row = $this->db->fetchArray($result)) {
1696
-            $ret[$row['categoryid']] = (int)$row['count'];
1696
+            $ret[$row['categoryid']] = (int) $row['count'];
1697 1697
         }
1698 1698
 
1699 1699
         return $ret;
Please login to merge, or discard this patch.
open_category.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,16 +6,16 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include_once __DIR__ . '/header.php';
9
+include_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
13 13
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
14 14
 
15
-include_once XOOPS_ROOT_PATH . '/header.php';
16
-include_once __DIR__ . '/footer.php';
15
+include_once XOOPS_ROOT_PATH.'/header.php';
16
+include_once __DIR__.'/footer.php';
17 17
 
18
-$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
18
+$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
19 19
 
20 20
 // Creating the category object for the selected category
21 21
 $categoryObj = new sfCategory($categoryid);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 $categoryHandler = sf_gethandler('category');
35 35
 
36 36
 // At which record shall we start
37
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
37
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
38 38
 
39 39
 // Creating the faq handler object
40 40
 $faqHandler = sf_gethandler('faq');
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 $last_qnaObj = $faqHandler->getLastPublishedByCat(array(_SF_STATUS_OPENED));
59 59
 if (isset($last_qnaObj[$categoryid])) {
60 60
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
61
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
61
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
62 62
 }
63 63
 // Populating the smarty variables with informations related to the selected category
64 64
 $category                 = $categoryObj->toArray(null, true);
@@ -77,16 +77,16 @@  discard block
 block discarded – undo
77 77
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
78 78
             if (isset($last_qnaObj[$subcat_id])) {
79 79
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
80
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
80
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
81 81
             }
82 82
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
83 83
             $subcats[$subcat_id] = $subcat->toArray(null, true);
84
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
84
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
85 85
         }
86 86
     }
87 87
     $xoopsTpl->assign('subcats', $subcats);
88 88
 }
89
-$category['total'] = $catQnasWithSub + $totalQnas[$categoryid];
89
+$category['total'] = $catQnasWithSub+$totalQnas[$categoryid];
90 90
 if ($faqsObj) {
91 91
     $userids = array();
92 92
     foreach ($faqsObj as $key => $thisfaq) {
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
     }
96 96
 
97 97
     $memberHandler = xoops_getHandler('member');
98
-    $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
98
+    $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
99 99
     for ($i = 0; $i < $totalQnasOnPage; ++$i) {
100 100
         $faq = $faqsObj[$i]->toArray(null, $allcategories);
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 // Language constants
110
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
110
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
111 111
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
112 112
 
113 113
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -124,19 +124,19 @@  discard block
 block discarded – undo
124 124
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
125 125
 
126 126
 // The Navigation Bar
127
-include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
128
-$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
127
+include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
128
+$pagenav = new XoopsPageNav($totalQnas[$categoryid], $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
129 129
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
130
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
130
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
131 131
 } else {
132
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
132
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
133 133
 }
134 134
 
135 135
 $xoopsTpl->assign('category', $category);
136 136
 
137 137
 // Page Title Hack by marcan
138 138
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
139
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
139
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
140 140
 // End Page Title Hack by marcan
141 141
 
142
-include_once XOOPS_ROOT_PATH . '/footer.php';
142
+include_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
open_index.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -116,13 +116,13 @@
 block discarded – undo
116 116
 // Language constants
117 117
 $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
118 118
 $xoopsTpl->assign(array(
119
-                      'lang_on'       => _MD_SF_ON,
120
-                      'lang_postedby' => _MD_SF_POSTEDBY,
121
-                      'lang_total'    => $totalQnasOnPage,
122
-                      'lang_faq'      => _MD_SF_FAQ,
123
-                      'lang_datesub'  => _MD_SF_DATESUB,
124
-                      'lang_hits'     => _MD_SF_HITS
125
-                  ));
119
+                        'lang_on'       => _MD_SF_ON,
120
+                        'lang_postedby' => _MD_SF_POSTEDBY,
121
+                        'lang_total'    => $totalQnasOnPage,
122
+                        'lang_faq'      => _MD_SF_FAQ,
123
+                        'lang_datesub'  => _MD_SF_DATESUB,
124
+                        'lang_hits'     => _MD_SF_HITS
125
+                    ));
126 126
 
127 127
 $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
128 128
 $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename']));
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include_once __DIR__ . '/header.php';
9
+include_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
13 13
 // At which record shall we start for the Categories
14
-$catstart = isset($_GET['catstart']) ? (int)$_GET['catstart'] : 0;
14
+$catstart = isset($_GET['catstart']) ? (int) $_GET['catstart'] : 0;
15 15
 
16 16
 // At which record shall we start for the FAQs
17
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
17
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
18 18
 
19 19
 // Creating the category handler object
20 20
 $categoryHandler = sf_gethandler('category');
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
 
43 43
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl';
44 44
 
45
-include_once XOOPS_ROOT_PATH . '/header.php';
46
-include_once __DIR__ . '/footer.php';
45
+include_once XOOPS_ROOT_PATH.'/header.php';
46
+include_once __DIR__.'/footer.php';
47 47
 
48 48
 //get all categories for future reference
49 49
 $allcategories = $categoryHandler->getObjects(null, true);
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
             if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
66 66
                 if (isset($last_qnaObj[$subcat_id])) {
67 67
                     $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
68
-                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
68
+                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
69 69
                 }
70 70
                 $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
71 71
                 $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true);
72
-                $total                                      += $totalQnas[$subcat_id];
72
+                $total += $totalQnas[$subcat_id];
73 73
             }
74 74
         }
75 75
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
         }
102 102
 
103 103
         $memberHandler = xoops_getHandler('member');
104
-        $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
104
+        $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
105 105
         for ($i = 0; $i < $totalQnasOnPage; ++$i) {
106 106
             $faq = $faqsObj[$i]->toArray(null, $allcategories);
107 107
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     }
115 115
 }
116 116
 // Language constants
117
-$moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
117
+$moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
118 118
 $xoopsTpl->assign(array(
119 119
                       'lang_on'       => _MD_SF_ON,
120 120
                       'lang_postedby' => _MD_SF_POSTEDBY,
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                       'lang_hits'     => _MD_SF_HITS
125 125
                   ));
126 126
 
127
-$moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
127
+$moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
128 128
 $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename']));
129 129
 $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1));
130 130
 $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS);
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION);
133 133
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
134 134
 $xoopsTpl->assign('sectionname', $moduleName);
135
-$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION);
135
+$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION);
136 136
 
137 137
 $xoopsTpl->assign('displayFull', false);
138 138
 $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']);
@@ -148,25 +148,25 @@  discard block
 block discarded – undo
148 148
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
149 149
 
150 150
 // Category Navigation Bar
151
-include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
151
+include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
152 152
 $pagenav = new XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', '');
153 153
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
154
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
154
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
155 155
 } else {
156
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
156
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
157 157
 }
158 158
 
159 159
 // FAQ Navigation Bar
160 160
 $pagenav = new XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', '');
161 161
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
162
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
162
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
163 163
 } else {
164
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
164
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
165 165
 }
166 166
 
167 167
 // Page Title Hack by marcan
168 168
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
169
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name'));
169
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name'));
170 170
 // End Page Title Hack by marcan
171 171
 
172
-include_once XOOPS_ROOT_PATH . '/footer.php';
172
+include_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
footer.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@
 block discarded – undo
15 15
 $xoopsTpl->assign('isAdmin', $isAdmin);
16 16
 
17 17
 $xoopsTpl->assign(array(
18
-                      'lang_on'       => _MD_SF_ON,
19
-                      'lang_postedby' => _MD_SF_POSTEDBY,
20
-                      'lang_faq'      => _MD_SF_QUESTION,
21
-                      'lang_datesub'  => _MD_SF_DATESUB,
22
-                      'lang_hits'     => _MD_SF_HITS
23
-                  ));
18
+                        'lang_on'       => _MD_SF_ON,
19
+                        'lang_postedby' => _MD_SF_POSTEDBY,
20
+                        'lang_faq'      => _MD_SF_QUESTION,
21
+                        'lang_datesub'  => _MD_SF_DATESUB,
22
+                        'lang_hits'     => _MD_SF_HITS
23
+                    ));
24 24
 $xoopsTpl->assign('sectionname', $myts->displayTarea($xoopsModule->getVar('name')));
25 25
 
26 26
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $uid     = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
12 12
 $isAdmin = (sf_userIsAdmin() || sf_moderator());
13 13
 
14
-$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>');
14
+$xoopsTpl->assign('sf_adminpage', "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE.'</a>');
15 15
 $xoopsTpl->assign('isAdmin', $isAdmin);
16 16
 
17 17
 $xoopsTpl->assign(array(
@@ -34,4 +34,4 @@  discard block
 block discarded – undo
34 34
 
35 35
 $xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)');
36 36
 
37
-$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'/>");
37
+$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='".XOOPS_URL."/modules/smartfaq/assets/css/smartfaq.css'/>");
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
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
12
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php';
13
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php';
14
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php';
11
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
12
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php';
13
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php';
14
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php';
15 15
 
16 16
 $myts = MyTextSanitizer::getInstance();
Please login to merge, or discard this patch.
category.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,10 +136,10 @@
 block discarded – undo
136 136
     if (isset($last_qnaObj) && $last_qnaObj) {
137 137
         $category['last_faqid']         = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid');
138 138
         $category['last_question_link'] = "<a href='faq.php?faqid="
139
-                                          . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')
140
-                                          . "'>"
141
-                                          . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize)
142
-                                          . '</a>';
139
+                                            . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')
140
+                                            . "'>"
141
+                                            . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize)
142
+                                            . '</a>';
143 143
     }
144 144
 }
145 145
 
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 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
-include_once __DIR__ . '/header.php';
9
+include_once __DIR__.'/header.php';
10 10
 
11
-$categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
11
+$categoryid = isset($_GET['categoryid']) ? (int) $_GET['categoryid'] : 0;
12 12
 
13 13
 // Creating the category handler object
14 14
 $categoryHandler = sf_gethandler('category');
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 }
33 33
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
34 34
 
35
-include_once XOOPS_ROOT_PATH . '/header.php';
36
-include_once __DIR__ . '/footer.php';
35
+include_once XOOPS_ROOT_PATH.'/header.php';
36
+include_once __DIR__.'/footer.php';
37 37
 
38 38
 // At which record shall we start
39
-$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
39
+$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
40 40
 
41 41
 // Creating the faq handler object
42 42
 $faqHandler = sf_gethandler('faq');
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     // Get the last smartfaq
71 71
     $last_qnaObj = $faqHandler->getLastPublishedByCat();
72 72
 }
73
-$lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize'];
73
+$lastfaqsize = (int) $xoopsModuleConfig['lastfaqsize'];
74 74
 // Creating the sub-categories objects that belong to the selected category
75 75
 $subcatsObj    = $categoryHandler->getCategories(0, 0, $categoryid);
76 76
 $total_subcats = count($subcatsObj);
@@ -82,18 +82,18 @@  discard block
 block discarded – undo
82 82
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
83 83
             if (isset($last_qnaObj[$subcat_id])) {
84 84
                 $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
85
-                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>');
85
+                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>');
86 86
             }
87 87
         }
88 88
         $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]);
89 89
         $subcats[$subcat_id] = $subcatsObj[$i]->toArray();
90
-        $total_faqs          += $totalQnas[$subcat_id];
90
+        $total_faqs += $totalQnas[$subcat_id];
91 91
         //}replacé ligne 92
92 92
     }
93 93
     $xoopsTpl->assign('subcats', $subcats);
94 94
 }
95 95
 $thiscategory_faqcount = isset($totalQnas[$categoryid]) ? $totalQnas[$categoryid] : 0;
96
-$category['total']     = $thiscategory_faqcount + $total_faqs;
96
+$category['total']     = $thiscategory_faqcount+$total_faqs;
97 97
 
98 98
 if (count($faqsObj) > 0) {
99 99
     $userids = array();
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     }
110 110
 
111 111
     $memberHandler = xoops_getHandler('member');
112
-    $users         = $memberHandler->getUsers(new Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
112
+    $users         = $memberHandler->getUsers(new Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
113 113
     // Adding the Q&As of the selected category
114 114
     for ($i = 0; $i < $totalQnasOnPage; ++$i) {
115 115
         $faq = $faqsObj[$i]->toArray(null, $categoryObj);
@@ -164,26 +164,26 @@  discard block
 block discarded – undo
164 164
 $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS);
165 165
 
166 166
 // The Navigation Bar
167
-include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
168
-$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
167
+include_once XOOPS_ROOT_PATH.'/class/pagenav.php';
168
+$pagenav = new XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
169 169
 if ($xoopsModuleConfig['useimagenavpage'] == 1) {
170
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
170
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
171 171
 } else {
172
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
172
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
173 173
 }
174 174
 
175 175
 $xoopsTpl->assign('category', $category);
176 176
 
177 177
 // Page Title Hack by marcan
178 178
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
179
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
179
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
180 180
 // End Page Title Hack by marcan
181 181
 
182 182
 //code to include smartie
183
-if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
184
-    include_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
183
+if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) {
184
+    include_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php';
185 185
     $xoopsTpl->assign('smarttie', 1);
186 186
 }
187 187
 //end code for smarttie
188 188
 
189
-include_once XOOPS_ROOT_PATH . '/footer.php';
189
+include_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.