Passed
Push — master ( 2744eb...81ba93 )
by Michael
02:46
created
include/displayfaqs.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 /** @var Smartfaq\Helper $helper */
12 12
 $helper = Smartfaq\Helper::getInstance();
13 13
 
14
-global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB,  $xoopsModule;
14
+global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $xoopsModule;
15 15
 
16 16
 echo "<br>\n";
17 17
 if (!isset($categoryid) || ($categoryid < 1)) {
@@ -28,9 +28,9 @@  discard block
 block discarded – undo
28 28
 
29 29
 Smartfaq\Utility::collapsableBar('toptable', 'toptableicon');
30 30
 
31
-echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt=''></a>&nbsp;" . $faqs_title . '</h3>';
31
+echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt=''></a>&nbsp;".$faqs_title.'</h3>';
32 32
 echo "<div id='toptable'>";
33
-echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $faqs_info . '</span>';
33
+echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$faqs_info.'</span>';
34 34
 
35 35
 // Get the total number of published FAQs
36 36
 $totalfaqs = $faqHandler->getFaqsCount($sel_cat, [Constants::SF_STATUS_PUBLISHED, Constants::SF_STATUS_NEW_ANSWER]);
@@ -41,22 +41,22 @@  discard block
 block discarded – undo
41 41
 $allCats         = $categoryHandler->getObjects(null, true);
42 42
 echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
43 43
 echo '<tr>';
44
-echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
45
-echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
46
-echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
44
+echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
45
+echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
46
+echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
47 47
 
48
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
49
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
48
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
49
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
50 50
 
51
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
52
-echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
51
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
52
+echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
53 53
 echo '</tr>';
54 54
 if ($totalfaqs > 0) {
55 55
     global $pathIcon16, $smartModuleConfig;
56 56
     foreach ($faqsObj as $iValue) {
57 57
         $categoryObj = $allCats[$iValue->categoryid()];
58
-        $modify      = "<a href='faq.php?op=mod&amp;faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/edit.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_EDITART . "'></a>";
59
-        $delete      = "<a href='faq.php?op=del&amp;faqid=" . $iValue->faqid() . "'><img src='" . $pathIcon16 . '/delete.png' . "' title='" . _AM_SF_EDITART . "' alt='" . _AM_SF_DELETEART . "'></a>";
58
+        $modify      = "<a href='faq.php?op=mod&amp;faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/edit.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_EDITART."'></a>";
59
+        $delete      = "<a href='faq.php?op=del&amp;faqid=".$iValue->faqid()."'><img src='".$pathIcon16.'/delete.png'."' title='"._AM_SF_EDITART."' alt='"._AM_SF_DELETEART."'></a>";
60 60
 
61 61
         //adding name of the Question Submitter
62 62
         $requester = Smartfaq\Utility::getLinkedUnameFromId($iValue->uid(), $smartModuleConfig['userealname']);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $criteria->add(new \Criteria('faqid', $iValue->faqid()));
70 70
         $criteria->add(new \Criteria('status', true));
71 71
 
72
-        $answerObjects =& $answerHandler->getObjects($criteria, true);
72
+        $answerObjects = & $answerHandler->getObjects($criteria, true);
73 73
 
74 74
         foreach (array_keys($answerObjects) as $j) {
75 75
             $answerObj = $answerObjects[$j];
@@ -84,26 +84,26 @@  discard block
 block discarded – undo
84 84
         }
85 85
 
86 86
         echo '<tr>';
87
-        echo "<td class='head' align='center'>" . $iValue->faqid() . '</td>';
88
-        echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
89
-        echo "<td class='even' align='left'><a href='" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/faq.php?faqid=' . $iValue->faqid() . "'>" . $iValue->question(100) . '</a></td>';
87
+        echo "<td class='head' align='center'>".$iValue->faqid().'</td>';
88
+        echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
89
+        echo "<td class='even' align='left'><a href='".XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/faq.php?faqid='.$iValue->faqid()."'>".$iValue->question(100).'</a></td>';
90 90
 
91
-        echo "<td class='even' align='center'>" . $requester . '</td>';
92
-        echo "<td class='even' align='center'>" . $answerSubmitter . '</td>';
91
+        echo "<td class='even' align='center'>".$requester.'</td>';
92
+        echo "<td class='even' align='center'>".$answerSubmitter.'</td>';
93 93
 
94
-        echo "<td class='even' align='center'>" . $iValue->datesub('s') . '</td>';
94
+        echo "<td class='even' align='center'>".$iValue->datesub('s').'</td>';
95 95
         echo "<td class='even' align='center'> $modify $delete </td>";
96 96
         echo '</tr>';
97 97
     }
98 98
 } else {
99 99
     $faqid = -1;
100 100
     echo '<tr>';
101
-    echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . '</td>';
101
+    echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS.'</td>';
102 102
     echo '</tr>';
103 103
 }
104 104
 echo "</table>\n";
105 105
 echo "<br>\n";
106 106
 
107 107
 $pagenav = new \XoopsPageNav($totalfaqs, $helper->getConfig('perpage'), $startfaq, 'startfaq', $pagenav_extra_args);
108
-echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
108
+echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
109 109
 echo '</div>';
Please login to merge, or discard this patch.
open_category.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 /** @var Smartfaq\Helper $helper */
12 12
 $helper = Smartfaq\Helper::getInstance();
13 13
 
14
-require_once __DIR__ . '/header.php';
14
+require_once __DIR__.'/header.php';
15 15
 
16 16
 global $xoopsConfig, $xoopsModule;
17 17
 
18 18
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
19 19
 
20
-require_once XOOPS_ROOT_PATH . '/header.php';
21
-require_once __DIR__ . '/footer.php';
20
+require_once XOOPS_ROOT_PATH.'/header.php';
21
+require_once __DIR__.'/footer.php';
22 22
 
23 23
 $categoryid = \Xmf\Request::getInt('categoryid', 0, 'GET');
24 24
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 $last_qnaObj = $faqHandler->getLastPublishedByCat([Constants::SF_STATUS_OPENED]);
66 66
 if (isset($last_qnaObj[$categoryid])) {
67 67
     $categoryObj->setVar('last_faqid', $last_qnaObj[$categoryid]->getVar('faqid'));
68
-    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$categoryid]->getVar('faqid') . "'>" . $last_qnaObj[$categoryid]->question(50) . '</a>');
68
+    $categoryObj->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$categoryid]->getVar('faqid')."'>".$last_qnaObj[$categoryid]->question(50).'</a>');
69 69
 }
70 70
 // Populating the smarty variables with informations related to the selected category
71 71
 $category                 = $categoryObj->toArray(null, true);
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 $category['categoryPath'] = $categoryObj->getCategoryPath(false, true);
74 74
 
75 75
 // Creating the sub-categories objects that belong to the selected category
76
-$subcatsObj     =& $categoryHandler->getCategories(0, 0, $categoryid);
76
+$subcatsObj     = & $categoryHandler->getCategories(0, 0, $categoryid);
77 77
 $total_subcats  = count($subcatsObj);
78 78
 $catQnasWithSub = 0;
79 79
 if (0 != $total_subcats) {
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
85 85
             if (isset($last_qnaObj[$subcat_id])) {
86 86
                 $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
87
-                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
87
+                $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
88 88
             }
89 89
             $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
90 90
             $subcats[$subcat_id] = $subcat->toArray(null, true);
91
-            $catQnasWithSub      += $subcats[$subcat_id]['total'];
91
+            $catQnasWithSub += $subcats[$subcat_id]['total'];
92 92
         }
93 93
     }
94 94
     $xoopsTpl->assign('subcats', $subcats);
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     }
103 103
 
104 104
     $memberHandler = xoops_getHandler('member');
105
-    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
105
+    $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
106 106
     foreach ($faqsObj as $iValue) {
107 107
         $faq = $iValue->toArray(null, $allcategories);
108 108
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     }
115 115
 }
116 116
 // Language constants
117
-$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name')) . " > <a href='open_index.php'>" . _MD_SF_OPEN_SECTION . '</a>');
117
+$xoopsTpl->assign('whereInSection', $myts->htmlSpecialChars($xoopsModule->getVar('name'))." > <a href='open_index.php'>"._MD_SF_OPEN_SECTION.'</a>');
118 118
 $xoopsTpl->assign('modulename', $xoopsModule->dirname());
119 119
 
120 120
 $xoopsTpl->assign('displaylastfaqs', true);
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
132 132
 
133 133
 // The Navigation Bar
134
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
135
-$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $helper->getConfig('indexperpage'), $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
134
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
135
+$pagenav = new \XoopsPageNav($totalQnas[$categoryid], $helper->getConfig('indexperpage'), $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
136 136
 if (1 == $helper->getConfig('useimagenavpage')) {
137
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>';
137
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>';
138 138
 } else {
139
-    $category['navbar'] = '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
139
+    $category['navbar'] = '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
140 140
 }
141 141
 
142 142
 $xoopsTpl->assign('category', $category);
143 143
 
144 144
 // Page Title Hack by marcan
145 145
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
146
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
146
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
147 147
 // End Page Title Hack by marcan
148 148
 
149
-require_once XOOPS_ROOT_PATH . '/footer.php';
149
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.