Completed
Push — master ( 80219e...2744eb )
by Michael
08:05
created
open_index.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 
14 14
 global $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
15 15
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_index.tpl';
48 48
 
49
-require_once XOOPS_ROOT_PATH . '/header.php';
50
-require_once __DIR__ . '/footer.php';
49
+require_once XOOPS_ROOT_PATH.'/header.php';
50
+require_once __DIR__.'/footer.php';
51 51
 
52 52
 //get all categories for future reference
53 53
 $allcategories = $categoryHandler->getObjects(null, true);
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
             if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
70 70
                 if (isset($last_qnaObj[$subcat_id])) {
71 71
                     $subcat->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
72
-                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question(50) . '</a>');
72
+                    $subcat->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question(50).'</a>');
73 73
                 }
74 74
                 $subcat->setVar('faqcount', $totalQnas[$subcat_id]);
75 75
                 $categories[$cat_id]['subcats'][$subcat_id] = $subcat->toArray(null, true);
76
-                $total                                      += $totalQnas[$subcat_id];
76
+                $total += $totalQnas[$subcat_id];
77 77
             }
78 78
         }
79 79
     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
         }
106 106
 
107 107
         $memberHandler = xoops_getHandler('member');
108
-        $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
108
+        $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
109 109
         for ($i = 0; $i < $totalQnasOnPage; ++$i) {
110 110
             $faq = $faqsObj[$i]->toArray(null, $allcategories);
111 111
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     }
119 119
 }
120 120
 // Language constants
121
-$moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
121
+$moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
122 122
 $xoopsTpl->assign([
123 123
                       'lang_on'       => _MD_SF_ON,
124 124
                       'lang_postedby' => _MD_SF_POSTEDBY,
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
                       'lang_hits'     => _MD_SF_HITS
129 129
                   ]);
130 130
 
131
-$moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
131
+$moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
132 132
 $xoopsTpl->assign('lang_mainhead', sprintf(_MD_SF_OPEN_WELCOME, $xoopsConfig['sitename']));
133 133
 $xoopsTpl->assign('lang_mainintro', $myts->displayTarea($xoopsModuleConfig['openquestionintromsg'], 1));
134 134
 $xoopsTpl->assign('lang_total', _MD_SF_TOTAL_QUESTIONS);
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 $xoopsTpl->assign('lang_description', _MD_SF_DESCRIPTION);
137 137
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
138 138
 $xoopsTpl->assign('sectionname', $moduleName);
139
-$xoopsTpl->assign('whereInSection', "<a href='index.php'>" . $moduleName . '</a> > ' . _MD_SF_OPEN_SECTION);
139
+$xoopsTpl->assign('whereInSection', "<a href='index.php'>".$moduleName.'</a> > '._MD_SF_OPEN_SECTION);
140 140
 
141 141
 $xoopsTpl->assign('displayFull', false);
142 142
 $xoopsTpl->assign('displaylastfaqs', $xoopsModuleConfig['displaylastfaqs']);
@@ -152,25 +152,25 @@  discard block
 block discarded – undo
152 152
 $xoopsTpl->assign('lang_category', _MD_SF_CATEGORY);
153 153
 
154 154
 // Category Navigation Bar
155
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
155
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
156 156
 $pagenav = new \XoopsPageNav($totalCategories, $xoopsModuleConfig['catperpage'], $catstart, 'catstart', '');
157 157
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
158
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
158
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
159 159
 } else {
160
-    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
160
+    $xoopsTpl->assign('catnavbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
161 161
 }
162 162
 
163 163
 // FAQ Navigation Bar
164 164
 $pagenav = new \XoopsPageNav($totalFaqs, $xoopsModuleConfig['indexperpage'], $start, 'start', '');
165 165
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
166
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
166
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
167 167
 } else {
168
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
168
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
169 169
 }
170 170
 
171 171
 // Page Title Hack by marcan
172 172
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
173
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category->getVar('name'));
173
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category->getVar('name'));
174 174
 // End Page Title Hack by marcan
175 175
 
176
-require_once XOOPS_ROOT_PATH . '/footer.php';
176
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
print.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 XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 $faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
14 14
 
@@ -46,23 +46,23 @@  discard block
 block discarded – undo
46 46
 
47 47
 echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
48 48
 echo "<html>\n<head>\n";
49
-echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n";
50
-echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "'>\n";
51
-echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "'>\n";
52
-echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "'>\n";
53
-echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "'>\n";
54
-echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "'>\n\n\n";
49
+echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n";
50
+echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."'>\n";
51
+echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."'>\n";
52
+echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."'>\n";
53
+echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."'>\n";
54
+echo "<meta name='GENERATOR' content='".XOOPS_VERSION."'>\n\n\n";
55 55
 
56 56
 echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'>
57 57
      <div style='width: 650px; border: 1px solid #000; padding: 20px;'>
58
-     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>" . $faqObj->question() . "</h2></div>
59
-     <div align='center'>" . $who_where . "</div>
58
+     <div style='text-align: center; display: block; margin: 0 0 6px 0;'><img src='" . XOOPS_URL."/modules/smartfaq/assets/images/logo_module.png' border='0' alt=''><h2 style='margin: 0;'>".$faqObj->question()."</h2></div>
59
+     <div align='center'>" . $who_where."</div>
60 60
                 <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>
61 61
                 <div></div>
62
-                <b><p>" . $faqObj->question() . '</p></b>
63
-                <p>' . $answerObj->answer() . "</p>
62
+                <b><p>" . $faqObj->question().'</p></b>
63
+                <p>' . $answerObj->answer()."</p>
64 64
                 <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div>
65
-                <p>" . $comeFrom . '</p>
65
+                <p>" . $comeFrom.'</p>
66 66
             </div>
67 67
     <br>';
68 68
 
Please login to merge, or discard this patch.
include/functions.image.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -28,24 +28,24 @@  discard block
 block discarded – undo
28 28
     {
29 29
         global $xoopsModuleConfig;
30 30
 
31
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
32
-        $img_url    = XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'];
33
-        $thumb_path = $img_path . '/thumbs';
34
-        $thumb_url  = $img_url . '/thumbs';
31
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
32
+        $img_url    = XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'];
33
+        $thumb_path = $img_path.'/thumbs';
34
+        $thumb_url  = $img_url.'/thumbs';
35 35
 
36
-        $thumb     = $thumb_path . '/' . $source;
37
-        $image     = $img_path . '/' . $source;
38
-        $thumb_url = $thumb_url . '/' . $source;
39
-        $image_url = $img_url . '/' . $source;
36
+        $thumb     = $thumb_path.'/'.$source;
37
+        $image     = $img_path.'/'.$source;
38
+        $thumb_url = $thumb_url.'/'.$source;
39
+        $image_url = $img_url.'/'.$source;
40 40
 
41 41
         $imginfo  = @getimagesize($image);
42
-        $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : '';
42
+        $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : '';
43 43
 
44 44
         if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) {
45 45
             if ($imginfo[0] > $xoopsModuleConfig['max_image_width']
46 46
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
47 47
                 //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) {
48
-                if (!file_exists($thumb_path . '/' . $source)) {
48
+                if (!file_exists($thumb_path.'/'.$source)) {
49 49
                     sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']);
50 50
                 }
51 51
             }
@@ -54,27 +54,27 @@  discard block
 block discarded – undo
54 54
                 || $imginfo[1] > $xoopsModuleConfig['max_image_height']) {
55 55
                 $pseudo_width  = $xoopsModuleConfig['max_image_width'];
56 56
                 $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]);
57
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
57
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
58 58
             }
59 59
             // irmtfan to fix Undefined variable: pseudo_height
60 60
             if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0
61 61
                 && $pseudo_height > $xoopsModuleConfig['max_image_height']) {
62 62
                 $pseudo_height = $xoopsModuleConfig['max_image_height'];
63 63
                 $pseudo_width  = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]);
64
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
64
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
65 65
             }
66 66
         }
67 67
 
68 68
         if (file_exists($thumb)) {
69
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
70
-            $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '">';
69
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
70
+            $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'">';
71 71
             $attachmentImage .= '</a>';
72 72
         } elseif (!empty($pseudo_size)) {
73
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
74
-            $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '">';
73
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
74
+            $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'">';
75 75
             $attachmentImage .= '</a>';
76 76
         } elseif (file_exists($image)) {
77
-            $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '">';
77
+            $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'">';
78 78
         } else {
79 79
             $attachmentImage = '';
80 80
         }
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
     {
92 92
         global $xoopsModuleConfig;
93 93
 
94
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
95
-        $thumb_path = $img_path . '/thumbs';
96
-        $src_file   = $img_path . '/' . $source;
97
-        $new_file   = $thumb_path . '/' . $source;
94
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
95
+        $thumb_path = $img_path.'/thumbs';
96
+        $src_file   = $img_path.'/'.$source;
97
+        $new_file   = $thumb_path.'/'.$source;
98 98
         //$imageLibs = sf_getImageLibs();
99 99
 
100 100
         if (!filesize($src_file) || !is_readable($src_file)) {
@@ -120,14 +120,14 @@  discard block
 block discarded – undo
120 120
         if (1 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
121 121
             if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
122 122
                 $cur_dir     = __DIR__;
123
-                $src_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $src_file) . '"';
124
-                $new_file_im = '"' . $cur_dir . '\\' . str_replace('/', '\\', $new_file) . '"';
123
+                $src_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $src_file).'"';
124
+                $new_file_im = '"'.$cur_dir.'\\'.str_replace('/', '\\', $new_file).'"';
125 125
             } else {
126 126
                 $src_file_im = @escapeshellarg($src_file);
127 127
                 $new_file_im = @escapeshellarg($new_file);
128 128
             }
129
-            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/';
130
-            $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
129
+            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/';
130
+            $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).'';
131 131
 
132 132
             @passthru($magick_command);
133 133
             if (file_exists($new_file)) {
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
         }
137 137
 
138 138
         if (2 == $xoopsModuleConfig['image_lib'] or 0 == $xoopsModuleConfig['image_lib']) {
139
-            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/';
139
+            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/';
140 140
             if (preg_match("/\.png/i", $source)) {
141
-                $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file";
141
+                $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file";
142 142
             } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) {
143
-                $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file";
143
+                $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file";
144 144
             } elseif (preg_match("/\.gif/i", $source)) {
145
-                $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file";
145
+                $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file";
146 146
             }
147 147
 
148 148
             @exec($cmd, $output, $retval);
Please login to merge, or discard this patch.
include/config.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,25 +22,25 @@  discard block
 block discarded – undo
22 22
     $moduleDirName      = basename(dirname(__DIR__));
23 23
     $moduleDirNameUpper = strtoupper($moduleDirName);
24 24
     return (object)[
25
-        'name'           => strtoupper($moduleDirName) . ' Module Configurator',
25
+        'name'           => strtoupper($moduleDirName).' Module Configurator',
26 26
         'paths'          => [
27 27
             'dirname'    => $moduleDirName,
28
-            'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
29
-            'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
30
-            'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
31
-            'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
32
-            'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
28
+            'admin'      => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin',
29
+            'modPath'    => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName,
30
+            'modUrl'     => XOOPS_URL.'/modules/'.$moduleDirName,
31
+            'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
32
+            'uploadUrl'  => XOOPS_UPLOAD_URL.'/'.$moduleDirName,
33 33
         ],
34 34
         'uploadFolders'  => [
35
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
36
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
37
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
35
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
36
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
37
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
38 38
             //XOOPS_UPLOAD_PATH . '/flags'
39 39
         ],
40 40
         'copyBlankFiles' => [
41
-            constant($moduleDirNameUpper . '_UPLOAD_PATH'),
42
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/category',
43
-            constant($moduleDirNameUpper . '_UPLOAD_PATH') . '/screenshots',
41
+            constant($moduleDirNameUpper.'_UPLOAD_PATH'),
42
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/category',
43
+            constant($moduleDirNameUpper.'_UPLOAD_PATH').'/screenshots',
44 44
             //XOOPS_UPLOAD_PATH . '/flags'
45 45
         ],
46 46
 
@@ -75,6 +75,6 @@  discard block
 block discarded – undo
75 75
             '/images',
76 76
         ],
77 77
         'modCopyright'    => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
78
-                     <img src='" . constant($moduleDirNameUpper . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>',
78
+                     <img src='" . constant($moduleDirNameUpper.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>',
79 79
     ];
80 80
 }
Please login to merge, or discard this patch.
category.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
 use XoopsModules\Smartfaq;
10 10
 
11
-require_once __DIR__ . '/header.php';
11
+require_once __DIR__.'/header.php';
12 12
 
13 13
 $categoryid = isset($_GET['categoryid']) ? (int)$_GET['categoryid'] : 0;
14 14
 
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
 }
36 36
 $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_category.tpl';
37 37
 
38
-require_once XOOPS_ROOT_PATH . '/header.php';
39
-require_once __DIR__ . '/footer.php';
38
+require_once XOOPS_ROOT_PATH.'/header.php';
39
+require_once __DIR__.'/footer.php';
40 40
 
41 41
 // At which record shall we start
42 42
 $start = isset($_GET['start']) ? (int)$_GET['start'] : 0;
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 }
77 77
 $lastfaqsize = (int)$xoopsModuleConfig['lastfaqsize'];
78 78
 // Creating the sub-categories objects that belong to the selected category
79
-$subcatsObj    =& $categoryHandler->getCategories(0, 0, $categoryid);
79
+$subcatsObj    = & $categoryHandler->getCategories(0, 0, $categoryid);
80 80
 $total_subcats = count($subcatsObj);
81 81
 $total_faqs    = 0;
82 82
 if (0 != $total_subcats) {
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
         if (isset($totalQnas[$subcat_id]) && $totalQnas[$subcat_id] > 0) {
87 87
             if (isset($last_qnaObj[$subcat_id])) {
88 88
                 $subcatsObj[$i]->setVar('last_faqid', $last_qnaObj[$subcat_id]->getVar('faqid'));
89
-                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=" . $last_qnaObj[$subcat_id]->getVar('faqid') . "'>" . $last_qnaObj[$subcat_id]->question($lastfaqsize) . '</a>');
89
+                $subcatsObj[$i]->setVar('last_question_link', "<a href='faq.php?faqid=".$last_qnaObj[$subcat_id]->getVar('faqid')."'>".$last_qnaObj[$subcat_id]->question($lastfaqsize).'</a>');
90 90
             }
91 91
         }
92 92
         $subcatsObj[$i]->setVar('faqcount', $totalQnas[$subcat_id]);
93 93
         $subcats[$subcat_id] = $subcatsObj[$i]->toArray();
94
-        $total_faqs          += $totalQnas[$subcat_id];
94
+        $total_faqs += $totalQnas[$subcat_id];
95 95
         //}replacé ligne 92
96 96
     }
97 97
     $xoopsTpl->assign('subcats', $subcats);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     }
115 115
 
116 116
     $memberHandler = xoops_getHandler('member');
117
-    $users         = $memberHandler->getUsers(new \Criteria('uid', '(' . implode(',', array_keys($userids)) . ')', 'IN'), true);
117
+    $users         = $memberHandler->getUsers(new \Criteria('uid', '('.implode(',', array_keys($userids)).')', 'IN'), true);
118 118
     // Adding the Q&As of the selected category
119 119
     foreach ($faqsObj as $iValue) {
120 120
         $faq = $iValue->toArray(null, $categoryObj);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
     if (isset($last_qnaObj) && $last_qnaObj) {
142 142
         $category['last_faqid']         = $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid');
143
-        $category['last_question_link'] = "<a href='faq.php?faqid=" . $last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid') . "'>" . $last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize) . '</a>';
143
+        $category['last_question_link'] = "<a href='faq.php?faqid=".$last_qnaObj[$categoryObj->getVar('categoryid')]->getVar('faqid')."'>".$last_qnaObj[$categoryObj->getVar('categoryid')]->question($lastfaqsize).'</a>';
144 144
     }
145 145
 }
146 146
 
@@ -165,26 +165,26 @@  discard block
 block discarded – undo
165 165
 $xoopsTpl->assign('lang_comments', _MD_SF_COMMENTS);
166 166
 
167 167
 // The Navigation Bar
168
-require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
169
-$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid=' . $categoryObj->getVar('categoryid'));
168
+require_once XOOPS_ROOT_PATH.'/class/pagenav.php';
169
+$pagenav = new \XoopsPageNav($thiscategory_faqcount, $xoopsModuleConfig['indexperpage'], $start, 'start', 'categoryid='.$categoryObj->getVar('categoryid'));
170 170
 if (1 == $xoopsModuleConfig['useimagenavpage']) {
171
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderImageNav() . '</div>');
171
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderImageNav().'</div>');
172 172
 } else {
173
-    $xoopsTpl->assign('navbar', '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>');
173
+    $xoopsTpl->assign('navbar', '<div style="text-align:right;">'.$pagenav->renderNav().'</div>');
174 174
 }
175 175
 
176 176
 $xoopsTpl->assign('category', $category);
177 177
 
178 178
 // Page Title Hack by marcan
179 179
 $module_name = $myts->htmlSpecialChars($xoopsModule->getVar('name'));
180
-$xoopsTpl->assign('xoops_pagetitle', $module_name . ' - ' . $category['name']);
180
+$xoopsTpl->assign('xoops_pagetitle', $module_name.' - '.$category['name']);
181 181
 // End Page Title Hack by marcan
182 182
 
183 183
 //code to include smartie
184
-if (file_exists(XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php')) {
185
-    require_once XOOPS_ROOT_PATH . '/modules/smarttie/smarttie_links.php';
184
+if (file_exists(XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php')) {
185
+    require_once XOOPS_ROOT_PATH.'/modules/smarttie/smarttie_links.php';
186 186
     $xoopsTpl->assign('smarttie', 1);
187 187
 }
188 188
 //end code for smarttie
189 189
 
190
-require_once XOOPS_ROOT_PATH . '/footer.php';
190
+require_once XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.
class/SmartobjectDbupdater.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,11 +61,11 @@
 block discarded – undo
61 61
         $query = sprintf('ALTER TABLE `%s` RENAME %s', $from, $to);
62 62
         $ret   = $xoopsDB->queryF($query);
63 63
         if (!$ret) {
64
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br>';
64
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br>';
65 65
 
66 66
             return false;
67 67
         } else {
68
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br>';
68
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br>';
69 69
 
70 70
             return true;
71 71
         }
Please login to merge, or discard this patch.
submit.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use XoopsModules\Smartfaq;
10 10
 use XoopsModules\Smartfaq\Constants;
11 11
 
12
-require_once __DIR__ . '/header.php';
12
+require_once __DIR__.'/header.php';
13 13
 
14 14
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
15 15
 
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
         global $xoopsUser, $myts;
90 90
 
91 91
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
92
-        require_once XOOPS_ROOT_PATH . '/header.php';
93
-        require_once __DIR__ . '/footer.php';
92
+        require_once XOOPS_ROOT_PATH.'/header.php';
93
+        require_once __DIR__.'/footer.php';
94 94
 
95 95
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
96 96
 
97
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
97
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
98 98
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
99 99
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
100 100
         $faq['answer']       = $answerObj->answer();
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
108 108
 
109 109
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
110
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
110
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
111 111
 
112
-        require_once __DIR__ . '/include/submit.inc.php';
112
+        require_once __DIR__.'/include/submit.inc.php';
113 113
 
114
-        require_once XOOPS_ROOT_PATH . '/footer.php';
114
+        require_once XOOPS_ROOT_PATH.'/footer.php';
115 115
 
116 116
         exit();
117 117
         break;
@@ -175,14 +175,14 @@  discard block
 block discarded – undo
175 175
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
176 176
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
177 177
                 foreach ($_POST['delete_tmp'] as $key) {
178
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
178
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
179 179
                     unset($attachments_tmp[$key]);
180 180
                 }
181 181
             }
182 182
         }
183 183
         if (count($attachments_tmp)) {
184 184
             foreach ($attachments_tmp as $key => $attach) {
185
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
185
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
186 186
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
187 187
                 }
188 188
             }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         if (isset($_FILES['userfile']['name']) && '' != $_FILES['userfile']['name']
193 193
             && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
194
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
194
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
195 195
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
196 196
             $uploaddir   = XOOPS_CACHE_PATH;
197 197
 
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
                 $uploader->setCheckMediaTypeByExt();
214 214
 
215 215
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
216
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
216
+                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid().'_' : 'newbb_';
217 217
                     $uploader->setPrefix($prefix);
218 218
                     if (!$uploader->upload()) {
219
-                        $error_message[] = $error_upload =& $uploader->getErrors();
219
+                        $error_message[] = $error_upload = & $uploader->getErrors();
220 220
                     } else {
221 221
                         if (is_file($uploader->getSavedDestination())) {
222
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
222
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
223 223
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
224 224
                             }
225 225
                         }
226 226
                     }
227 227
                 } else {
228
-                    $error_message[] = $error_upload =& $uploader->getErrors();
228
+                    $error_message[] = $error_upload = & $uploader->getErrors();
229 229
                 }
230 230
             }
231 231
         }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         } else {
259 259
             // Subscribe the user to On Published notification, if requested
260 260
             if (1 == $notifypub) {
261
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
261
+                require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
262 262
                 $notificationHandler = xoops_getHandler('notification');
263 263
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
264 264
             }
@@ -281,20 +281,20 @@  discard block
 block discarded – undo
281 281
         $categoryObj = $categoryHandler->create();
282 282
 
283 283
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
284
-        require_once XOOPS_ROOT_PATH . '/header.php';
285
-        require_once __DIR__ . '/footer.php';
284
+        require_once XOOPS_ROOT_PATH.'/header.php';
285
+        require_once __DIR__.'/footer.php';
286 286
 
287 287
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
288 288
         $notifypub  = 1;
289
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
289
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
290 290
         $xoopsTpl->assign('whereInSection', $moduleName);
291 291
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
292 292
 
293 293
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
294
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
294
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
295 295
 
296
-        require_once __DIR__ . '/include/submit.inc.php';
296
+        require_once __DIR__.'/include/submit.inc.php';
297 297
 
298
-        require_once XOOPS_ROOT_PATH . '/footer.php';
298
+        require_once XOOPS_ROOT_PATH.'/footer.php';
299 299
         break;
300 300
 }
Please login to merge, or discard this patch.
footer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 $uid     = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
14 14
 $isAdmin = (Smartfaq\Utility::userIsAdmin() || Smartfaq\Utility::hasModerator());
15 15
 
16
-$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>');
16
+$xoopsTpl->assign('sf_adminpage', "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE.'</a>');
17 17
 $xoopsTpl->assign('isAdmin', $isAdmin);
18 18
 
19 19
 $xoopsTpl->assign([
@@ -36,4 +36,4 @@  discard block
 block discarded – undo
36 36
 
37 37
 $xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)');
38 38
 
39
-$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'>");
39
+$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.
admin/mygroupperm.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
             $criteria->add(new \Criteria('gperm_itemid', (int)$gperm_itemid));
23 23
         }
24 24
     }
25
-    $sql = 'DELETE FROM ' . $db->prefix('group_permission') . ' ' . $criteria->renderWhere();
25
+    $sql = 'DELETE FROM '.$db->prefix('group_permission').' '.$criteria->renderWhere();
26 26
     if (!$result = $db->query($sql)) {
27 27
         return false;
28 28
     }
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
34 34
 $modid = isset($_POST['modid']) ? (int)$_POST['modid'] : 1;
35 35
 // we dont want system module permissions to be changed here ( 1 -> 0 GIJ)
36 36
 if ($modid <= 0 || !is_object($xoopsUser) || !$xoopsUser->isAdmin($modid)) {
37
-    redirect_header(XOOPS_URL . '/user.php', 1, _NOPERM);
37
+    redirect_header(XOOPS_URL.'/user.php', 1, _NOPERM);
38 38
 }
39 39
 /** @var XoopsModuleHandler $moduleHandler */
40 40
 $moduleHandler = xoops_getHandler('module');
41 41
 $module        = $moduleHandler->get($modid);
42 42
 if (!is_object($module) || !$module->getVar('isactive')) {
43
-    redirect_header(XOOPS_URL . '/admin.php', 1, _MODULENOEXIST);
43
+    redirect_header(XOOPS_URL.'/admin.php', 1, _MODULENOEXIST);
44 44
 }
45 45
 $memberHandler = xoops_getHandler('member');
46
-$group_list    =& $memberHandler->getGroupList();
46
+$group_list    = & $memberHandler->getGroupList();
47 47
 if (is_array($_POST['perms']) && !empty($_POST['perms'])) {
48 48
     $gpermHandler = xoops_getHandler('groupperm');
49 49
     foreach ($_POST['perms'] as $perm_name => $perm_data) {
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
                             foreach ($parent_ids as $pid) {
67 67
                                 if (0 != $pid && !in_array($pid, array_keys($item_ids))) {
68 68
                                     // one of the parent items were not selected, so skip this item
69
-                                    $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>') . ' (' . _MD_AM_PERMADDNGP . ')';
69
+                                    $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>').' ('._MD_AM_PERMADDNGP.')';
70 70
                                     continue 2;
71 71
                                 }
72 72
                             }
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
                         $gperm->setVar('gperm_modid', $modid);
78 78
                         $gperm->setVar('gperm_itemid', $item_id);
79 79
                         if (!$gpermHandler->insert($gperm)) {
80
-                            $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>');
80
+                            $msg[] = sprintf(_MD_AM_PERMADDNG, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
81 81
                         } else {
82
-                            $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>' . $perm_name . '</b>', '<b>' . $perm_data['itemname'][$item_id] . '</b>', '<b>' . $group_list[$group_id] . '</b>');
82
+                            $msg[] = sprintf(_MD_AM_PERMADDOK, '<b>'.$perm_name.'</b>', '<b>'.$perm_data['itemname'][$item_id].'</b>', '<b>'.$group_list[$group_id].'</b>');
83 83
                         }
84 84
                         unset($gperm);
85 85
                     }
Please login to merge, or discard this patch.