Completed
Branch master (c92e39)
by Michael
02:32
created
category.php 1 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.
submit.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  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 $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
@@ -84,12 +84,12 @@  discard block
 block discarded – undo
84 84
         global $xoopsUser, $myts;
85 85
 
86 86
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
87
-        include_once XOOPS_ROOT_PATH . '/header.php';
88
-        include_once __DIR__ . '/footer.php';
87
+        include_once XOOPS_ROOT_PATH.'/header.php';
88
+        include_once __DIR__.'/footer.php';
89 89
 
90 90
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
91 91
 
92
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
92
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
93 93
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
94 94
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
95 95
         $faq['answer']       = $answerObj->answer();
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
103 103
 
104 104
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
105
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
105
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
106 106
 
107
-        include_once __DIR__ . '/include/submit.inc.php';
107
+        include_once __DIR__.'/include/submit.inc.php';
108 108
 
109
-        include_once XOOPS_ROOT_PATH . '/footer.php';
109
+        include_once XOOPS_ROOT_PATH.'/footer.php';
110 110
 
111 111
         exit();
112 112
         break;
@@ -170,14 +170,14 @@  discard block
 block discarded – undo
170 170
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
171 171
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
172 172
                 foreach ($_POST['delete_tmp'] as $key) {
173
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
173
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
174 174
                     unset($attachments_tmp[$key]);
175 175
                 }
176 176
             }
177 177
         }
178 178
         if (count($attachments_tmp)) {
179 179
             foreach ($attachments_tmp as $key => $attach) {
180
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
180
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
181 181
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
182 182
                 }
183 183
             }
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
         if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != ''
188 188
             && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')
189 189
         ) {
190
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
190
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
191 191
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
192 192
             $uploaddir   = XOOPS_CACHE_PATH;
193 193
 
194
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
194
+            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int) $maxfilesize, (int) $xoopsModuleConfig['max_img_width'], (int) $xoopsModuleConfig['max_img_height']);
195 195
 
196 196
             if ($_FILES['userfile']['error'] > 0) {
197 197
                 switch ($_FILES['userfile']['error']) {
@@ -209,19 +209,19 @@  discard block
 block discarded – undo
209 209
                 $uploader->setCheckMediaTypeByExt();
210 210
 
211 211
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
212
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
212
+                    $prefix = is_object($xoopsUser) ? (string) $xoopsUser->uid().'_' : 'newbb_';
213 213
                     $uploader->setPrefix($prefix);
214 214
                     if (!$uploader->upload()) {
215
-                        $error_message[] = $error_upload =& $uploader->getErrors();
215
+                        $error_message[] = $error_upload = & $uploader->getErrors();
216 216
                     } else {
217 217
                         if (is_file($uploader->getSavedDestination())) {
218
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
218
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
219 219
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
220 220
                             }
221 221
                         }
222 222
                     }
223 223
                 } else {
224
-                    $error_message[] = $error_upload =& $uploader->getErrors();
224
+                    $error_message[] = $error_upload = & $uploader->getErrors();
225 225
                 }
226 226
             }
227 227
         }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         } else {
255 255
             // Subscribe the user to On Published notification, if requested
256 256
             if ($notifypub == 1) {
257
-                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
257
+                include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
258 258
                 $notificationHandler = xoops_getHandler('notification');
259 259
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
260 260
             }
@@ -277,20 +277,20 @@  discard block
 block discarded – undo
277 277
         $categoryObj = $categoryHandler->create();
278 278
 
279 279
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.html';
280
-        include_once XOOPS_ROOT_PATH . '/header.php';
281
-        include_once __DIR__ . '/footer.php';
280
+        include_once XOOPS_ROOT_PATH.'/header.php';
281
+        include_once __DIR__.'/footer.php';
282 282
 
283 283
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
284 284
         $notifypub  = 1;
285
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
285
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
286 286
         $xoopsTpl->assign('whereInSection', $moduleName);
287 287
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
288 288
 
289 289
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
290
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
290
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
291 291
 
292
-        include_once __DIR__ . '/include/submit.inc.php';
292
+        include_once __DIR__.'/include/submit.inc.php';
293 293
 
294
-        include_once XOOPS_ROOT_PATH . '/footer.php';
294
+        include_once XOOPS_ROOT_PATH.'/footer.php';
295 295
         break;
296 296
 }
Please login to merge, or discard this patch.
include/functions.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -7,9 +7,9 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
9 9
 
10
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php';
11
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php';
12
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php';
10
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php';
11
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php';
12
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php';
13 13
 
14 14
 /**
15 15
  * @return mixed|null
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             break;
64 64
 
65 65
         case 'inside':
66
-            return XOOPS_URL . '/modules/smartfaq/doc/';
66
+            return XOOPS_URL.'/modules/smartfaq/doc/';
67 67
             break;
68 68
 
69 69
         case 'custom':
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 {
81 81
     $ret = '';
82 82
     foreach ($errors as $key => $value) {
83
-        $ret .= '<br> - ' . $value;
83
+        $ret .= '<br> - '.$value;
84 84
     }
85 85
 
86 86
     return $ret;
@@ -103,11 +103,11 @@  discard block
 block discarded – undo
103 103
         $spaces .= '--';
104 104
     }
105 105
 
106
-    $ret .= "<option value='" . $categoryObj->categoryid() . "'";
106
+    $ret .= "<option value='".$categoryObj->categoryid()."'";
107 107
     if ($selectedid == $categoryObj->categoryid()) {
108 108
         $ret .= ' selected';
109 109
     }
110
-    $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n";
110
+    $ret .= '>'.$spaces.$categoryObj->name()."</option>\n";
111 111
 
112 112
     $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid());
113 113
     if (count($subCategoriesObj) > 0) {
@@ -128,10 +128,10 @@  discard block
 block discarded – undo
128 128
  */
129 129
 function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true)
130 130
 {
131
-    $ret = '' . _MB_SF_SELECTCAT . "&nbsp;<select name='options[]'>";
131
+    $ret = ''._MB_SF_SELECTCAT."&nbsp;<select name='options[]'>";
132 132
     if ($allCatOption) {
133 133
         $ret .= "<option value='0'";
134
-        $ret .= '>' . _MB_SF_ALLCAT . "</option>\n";
134
+        $ret .= '>'._MB_SF_ALLCAT."</option>\n";
135 135
     }
136 136
 
137 137
     // Creating the category handler object
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 {
200 200
     $smartModule = sf_getModuleInfo();
201 201
 
202
-    $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . '';
202
+    $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').'';
203 203
 
204 204
     $modfooter = "<a href='"
205 205
                  . $smartModule->getInfo('support_site_url')
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
     $gpermHandler = xoops_getHandler('groupperm');
307 307
 
308
-    $sql    = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' ";
308
+    $sql    = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' ";
309 309
     $result = $xoopsDB->query($sql);
310 310
 
311 311
     if (count($result) > 0) {
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
     $ret = array();
421 421
     global $xoopsDB;
422 422
 
423
-    $result = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'");
423
+    $result = $xoopsDB->query('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'");
424 424
     $ret    = $xoopsDB->fetcharray($result);
425 425
 
426 426
     return $ret;
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 {
440 440
     global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig;
441 441
     $adminLinks = '';
442
-    $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/';
442
+    $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/';
443 443
     $page       = $open ? 'question.php' : 'faq.php';
444 444
     if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) {
445 445
         // Edit button
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
                    . "'/></a>";
486 486
     $adminLinks .= ' ';
487 487
     // Email button
488
-    $maillink   = 'mailto:?subject='
488
+    $maillink = 'mailto:?subject='
489 489
                   . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename'])
490 490
                   . '&amp;body='
491 491
                   . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename'])
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
                   . $modulePath
494 494
                   . 'faq.php?faqid='
495 495
                   . $faqid;
496
-    $adminLinks .= '<a href="' . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>";
496
+    $adminLinks .= '<a href="'.$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'/></a>";
497 497
     $adminLinks .= ' ';
498 498
     // Submit New Answer button
499 499
     if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) {
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
         return $userid;
529 529
     }
530 530
 
531
-    $userid = (int)$userid;
531
+    $userid = (int) $userid;
532 532
     if ($userid > 0) {
533 533
         if ($users == array()) {
534 534
             //fetching users
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
             if (!isset($users[$userid])) {
539 539
                 return $GLOBALS['xoopsConfig']['anonymous'];
540 540
             }
541
-            $user =& $users[$userid];
541
+            $user = & $users[$userid];
542 542
         }
543 543
 
544 544
         if (is_object($user)) {
@@ -552,9 +552,9 @@  discard block
 block discarded – undo
552 552
                 $fullname = $user->getVar('name');
553 553
             }
554 554
             if (!empty($fullname)) {
555
-                $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]';
555
+                $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]';
556 556
             } else {
557
-                $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>';
557
+                $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>';
558 558
             }
559 559
 
560 560
             return $linkeduser;
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
         //-->
636 636
     </script>
637 637
     <?php
638
-    echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">";
638
+    echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">";
639 639
 }
640 640
 
641 641
 /**
@@ -648,16 +648,16 @@  discard block
 block discarded – undo
648 648
     static $handlers;
649 649
     $name = strtolower(trim($name));
650 650
     if (!isset($handlers[$name])) {
651
-        if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) {
651
+        if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) {
652 652
             require_once $hnd_file;
653 653
         }
654
-        $class = 'sf' . ucfirst($name) . 'Handler';
654
+        $class = 'sf'.ucfirst($name).'Handler';
655 655
         if (class_exists($class)) {
656 656
             $handlers[$name] = new $class($GLOBALS['xoopsDB']);
657 657
         }
658 658
     }
659 659
     if (!$optional && !isset($handlers[$name])) {
660
-        trigger_error('Class <b>' . $class . '</b> does not exist<br>Handler Name: ' . $name, E_USER_ERROR);
660
+        trigger_error('Class <b>'.$class.'</b> does not exist<br>Handler Name: '.$name, E_USER_ERROR);
661 661
     }
662 662
     $false = false;
663 663
 
Please login to merge, or discard this patch.
include/blocksadmin.inc.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) {
29 29
     exit('Access Denied');
30 30
 }
31
-include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
32
-include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php';
31
+include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
32
+include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php';
33 33
 
34 34
 $op = 'list';
35 35
 if (isset($HTTP_POST_VARS)) {
@@ -44,13 +44,13 @@  discard block
 block discarded – undo
44 44
         || $HTTP_GET_VARS['op'] === 'previewpopup'
45 45
     ) {
46 46
         $op  = $HTTP_GET_VARS['op'];
47
-        $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0;
47
+        $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0;
48 48
     }
49 49
 }
50 50
 
51 51
 if (isset($previewblock)) {
52 52
     xoops_cp_header();
53
-    include_once XOOPS_ROOT_PATH . '/class/template.php';
53
+    include_once XOOPS_ROOT_PATH.'/class/template.php';
54 54
     $xoopsTpl = new XoopsTpl();
55 55
     $xoopsTpl->xoops_setCaching(0);
56 56
     if (isset($bid)) {
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
                  . $myblock->getContent('S', $bctype)
85 85
                  . '</td></tr></table></body></html>';
86 86
 
87
-    $dummyfile = '_dummyfile_' . time() . '.html';
88
-    $fp        = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w');
87
+    $dummyfile = '_dummyfile_'.time().'.html';
88
+    $fp        = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w');
89 89
     fwrite($fp, $dummyhtml);
90 90
     fclose($fp);
91 91
     $block['edit_form'] = false;
@@ -96,24 +96,24 @@  discard block
 block discarded – undo
96 96
     $block['visible']   = $bvisible;
97 97
     $block['title']     = $myblock->getVar('title', 'E');
98 98
     $block['content']   = $myblock->getVar('content', 'E');
99
-    $block['modules']   =& $bmodule;
99
+    $block['modules']   = & $bmodule;
100 100
     $block['ctype']     = isset($bctype) ? $bctype : $myblock->getVar('c_type');
101 101
     $block['is_custom'] = true;
102
-    $block['cachetime'] = (int)$bcachetime;
103
-    echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . $block['form_title'] . '<br><br>';
104
-    include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php';
102
+    $block['cachetime'] = (int) $bcachetime;
103
+    echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;'.$block['form_title'].'<br><br>';
104
+    include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
105 105
     $form->display();
106 106
     xoops_cp_footer();
107 107
     echo '<script type="text/javascript">
108 108
     <!--//
109
-    preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200);
109
+    preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
110 110
     //-->
111 111
     </script>';
112 112
     exit();
113 113
 }
114 114
 
115 115
 if ($op === 'previewpopup') {
116
-    $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file']));
116
+    $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file']));
117 117
     if (file_exists($file)) {
118 118
         include $file;
119 119
         @unlink($file);
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 }
152 152
 
153 153
 if ($op === 'update') {
154
-    $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0;
154
+    $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0;
155 155
     $options    = isset($options) ? $options : array();
156 156
     $bcontent   = isset($bcontent) ? $bcontent : '';
157 157
     $bctype     = isset($bctype) ? $bctype : '';
@@ -252,27 +252,27 @@  discard block
 block discarded – undo
252 252
         $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid);
253 253
         $db->query($sql);
254 254
         foreach ($bmodule as $bmid) {
255
-            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid);
255
+            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid);
256 256
             $db->query($sql);
257 257
         }
258
-        include_once XOOPS_ROOT_PATH . '/class/template.php';
258
+        include_once XOOPS_ROOT_PATH.'/class/template.php';
259 259
         $xoopsTpl = new XoopsTpl();
260 260
         $xoopsTpl->xoops_setCaching(2);
261 261
         if ($myblock->getVar('template') != '') {
262
-            if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) {
263
-                if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) {
264
-                    $msg = 'Unable to clear cache for block ID' . $bid;
262
+            if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) {
263
+                if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) {
264
+                    $msg = 'Unable to clear cache for block ID'.$bid;
265 265
                 }
266 266
             }
267 267
         } else {
268
-            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block' . $bid)) {
269
-                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block' . $bid)) {
270
-                    $msg = 'Unable to clear cache for block ID' . $bid;
268
+            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block'.$bid)) {
269
+                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block'.$bid)) {
270
+                    $msg = 'Unable to clear cache for block ID'.$bid;
271 271
                 }
272 272
             }
273 273
         }
274 274
     } else {
275
-        $msg = 'Failed update of block. ID:' . $bid;
275
+        $msg = 'Failed update of block. ID:'.$bid;
276 276
     }
277 277
 
278 278
     return $msg; // GIJ +
Please login to merge, or discard this patch.
include/onupdate.inc.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
 function xoops_module_update_smartfaq($module)
10 10
 {
11 11
     // Load SmartDbUpdater from the SmartObject Framework if present
12
-    $smartdbupdater = XOOPS_ROOT_PATH . '/modules/smartobject/class/smartdbupdater.php';
12
+    $smartdbupdater = XOOPS_ROOT_PATH.'/modules/smartobject/class/smartdbupdater.php';
13 13
     if (!file_exists($smartdbupdater)) {
14
-        $smartdbupdater = XOOPS_ROOT_PATH . '/modules/smartfaq/class/smartdbupdater.php';
14
+        $smartdbupdater = XOOPS_ROOT_PATH.'/modules/smartfaq/class/smartdbupdater.php';
15 15
     }
16 16
     include_once $smartdbupdater;
17 17
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
     ob_start();
21 21
 
22
-    echo '<code>' . _SDU_UPDATE_UPDATING_DATABASE . '<br>';
22
+    echo '<code>'._SDU_UPDATE_UPDATING_DATABASE.'<br>';
23 23
 
24 24
     // Adding partialview field
25 25
     $table = new SmartDbTable('smartfaq_faq');
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * Check for items with categoryid=0
72 72
      */
73
-    include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
73
+    include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
74 74
     $smartfaq_faqHandler      = $answerHandler = sf_gethandler('faq');
75 75
     $smartfaq_categoryHandler = $answerHandler = sf_gethandler('category');
76 76
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 {
105 105
     ob_start();
106 106
 
107
-    include_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/include/functions.php';
107
+    include_once XOOPS_ROOT_PATH.'/modules/'.$module->getVar('dirname').'/include/functions.php';
108 108
 
109 109
     $feedback = ob_get_clean();
110 110
     if (method_exists($module, 'setMessage')) {
Please login to merge, or discard this patch.
include/answer.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
 //include_once __DIR__ . '/functions.php';
16 16
 
17 17
 $mytree = new XoopsTree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
Please login to merge, or discard this patch.
include/displayfaqs.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 sf_collapsableBar('toptable', 'toptableicon');
25 25
 
26
-echo "<img id='toptableicon' src=" . XOOPS_URL . '/modules/' . $xoopsModule->dirname() . "/assets/images/icon/close12.gif alt='' /></a>&nbsp;" . $faqs_title . '</h3>';
26
+echo "<img id='toptableicon' src=".XOOPS_URL.'/modules/'.$xoopsModule->dirname()."/assets/images/icon/close12.gif alt='' /></a>&nbsp;".$faqs_title.'</h3>';
27 27
 echo "<div id='toptable'>";
28
-echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">' . $faqs_info . '</span>';
28
+echo '<span style="color: #567; margin: 3px 0 12px 0; font-size: small; display: block; ">'.$faqs_info.'</span>';
29 29
 
30 30
 // Get the total number of published FAQs
31 31
 $totalfaqs = $faqHandler->getFaqsCount($sel_cat, array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER));
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 // creating the FAQ objects that are published
34 34
 $faqsObj         = $faqHandler->getAllPublished($xoopsModuleConfig['perpage'], $startfaq, $sel_cat);
35 35
 $totalFaqsOnPage = count($faqsObj);
36
-$allCats         =& $categoryHandler->getObjects(null, true);
36
+$allCats         = & $categoryHandler->getObjects(null, true);
37 37
 echo "<table width='100%' cellspacing=1 cellpadding=3 border=0 class = outer>";
38 38
 echo '<tr>';
39
-echo "<th width='40' class='bg3' align='center'><b>" . _AM_SF_ARTID . '</b></td>';
40
-echo "<th width='20%' class='bg3' align='left'><b>" . _AM_SF_ARTCOLNAME . '</b></td>';
41
-echo "<th class='bg3' align='left'><b>" . _AM_SF_QUESTION . '</b></td>';
39
+echo "<th width='40' class='bg3' align='center'><b>"._AM_SF_ARTID.'</b></td>';
40
+echo "<th width='20%' class='bg3' align='left'><b>"._AM_SF_ARTCOLNAME.'</b></td>';
41
+echo "<th class='bg3' align='left'><b>"._AM_SF_QUESTION.'</b></td>';
42 42
 
43
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ASKED . '</b></td>';
44
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_ANSWERED . '</b></td>';
43
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ASKED.'</b></td>';
44
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_ANSWERED.'</b></td>';
45 45
 
46
-echo "<th width='90' class='bg3' align='center'><b>" . _AM_SF_CREATED . '</b></td>';
47
-echo "<th width='60' class='bg3' align='center'><b>" . _AM_SF_ACTION . '</b></td>';
46
+echo "<th width='90' class='bg3' align='center'><b>"._AM_SF_CREATED.'</b></td>';
47
+echo "<th width='60' class='bg3' align='center'><b>"._AM_SF_ACTION.'</b></td>';
48 48
 echo '</tr>';
49 49
 if ($totalfaqs > 0) {
50 50
     global $pathIcon16, $smartModuleConfig;
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                        . "' alt='"
61 61
                        . _AM_SF_EDITART
62 62
                        . "' /></a>";
63
-        $delete      = "<a href='faq.php?op=del&amp;faqid="
63
+        $delete = "<a href='faq.php?op=del&amp;faqid="
64 64
                        . $faqsObj[$i]->faqid()
65 65
                        . "'><img src='"
66 66
                        . $pathIcon16
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
         }
98 98
 
99 99
         echo '<tr>';
100
-        echo "<td class='head' align='center'>" . $faqsObj[$i]->faqid() . '</td>';
101
-        echo "<td class='even' align='left'>" . $categoryObj->name() . '</td>';
100
+        echo "<td class='head' align='center'>".$faqsObj[$i]->faqid().'</td>';
101
+        echo "<td class='even' align='left'>".$categoryObj->name().'</td>';
102 102
         echo "<td class='even' align='left'><a href='"
103 103
              . XOOPS_URL
104 104
              . '/modules/'
@@ -109,22 +109,22 @@  discard block
 block discarded – undo
109 109
              . $faqsObj[$i]->question(100)
110 110
              . '</a></td>';
111 111
 
112
-        echo "<td class='even' align='center'>" . $requester . '</td>';
113
-        echo "<td class='even' align='center'>" . $answerSubmitter . '</td>';
112
+        echo "<td class='even' align='center'>".$requester.'</td>';
113
+        echo "<td class='even' align='center'>".$answerSubmitter.'</td>';
114 114
 
115
-        echo "<td class='even' align='center'>" . $faqsObj[$i]->datesub('s') . '</td>';
115
+        echo "<td class='even' align='center'>".$faqsObj[$i]->datesub('s').'</td>';
116 116
         echo "<td class='even' align='center'> $modify $delete </td>";
117 117
         echo '</tr>';
118 118
     }
119 119
 } else {
120 120
     $faqid = -1;
121 121
     echo '<tr>';
122
-    echo "<td class='head' align='center' colspan= '7'>" . _AM_SF_NOFAQS . '</td>';
122
+    echo "<td class='head' align='center' colspan= '7'>"._AM_SF_NOFAQS.'</td>';
123 123
     echo '</tr>';
124 124
 }
125 125
 echo "</table>\n";
126 126
 echo "<br>\n";
127 127
 
128 128
 $pagenav = new XoopsPageNav($totalfaqs, $xoopsModuleConfig['perpage'], $startfaq, 'startfaq', $pagenav_extra_args);
129
-echo '<div style="text-align:right;">' . $pagenav->renderNav() . '</div>';
129
+echo '<div style="text-align:right;">'.$pagenav->renderNav().'</div>';
130 130
 echo '</div>';
Please login to merge, or discard this patch.
include/submit.inc.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $_POST, $xoopsDB;
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
-include_once __DIR__ . '/functions.php';
16
+include_once __DIR__.'/functions.php';
17 17
 
18 18
 $mytree = new XoopsTree($xoopsDB->prefix('smartfaq_categories'), 'categoryid', 'parentid');
19 19
 $form   = new XoopsThemeForm(_MD_SF_SUB_SMNAME, 'form', xoops_getenv('PHP_SELF'));
@@ -70,11 +70,11 @@  discard block
 block discarded – undo
70 70
 //    $upload_tray->addElement(new XoopsFormFile('', 'userfile', ($forum_obj->getVar('attach_maxkb') * 1024)));
71 71
 $upload_tray->addElement(new XoopsFormFile('', 'userfile', $xoopsModuleConfig['max_image_size'] * 1024));
72 72
 $upload_tray->addElement(new XoopsFormButton('', 'contents_upload', _MD_SF_UPLOAD, 'submit'));
73
-$upload_tray->addElement(new XoopsFormLabel('<br><br>' . _MD_SF_MAX_FILESIZE . ':', $xoopsModuleConfig['max_image_size'] . 'Kb; '));
73
+$upload_tray->addElement(new XoopsFormLabel('<br><br>'._MD_SF_MAX_FILESIZE.':', $xoopsModuleConfig['max_image_size'].'Kb; '));
74 74
 $extensions = trim(str_replace('|', ' ', $xoopsModuleConfig['attach_ext']));
75 75
 $extensions = (empty($extensions) || $extensions === '*') ? _ALL : $extensions;
76
-$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS . ':', $extensions));
77
-$upload_tray->addElement(new XoopsFormLabel('<br>' . sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
76
+$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS.':', $extensions));
77
+$upload_tray->addElement(new XoopsFormLabel('<br>'.sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width'])));
78 78
 $form->addElement($upload_tray);
79 79
 //}
80 80
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     $delete_attach_checkbox = new XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]');
103 103
     $url_prefix             = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH);
104 104
     foreach ($attachments_tmp as $key => $attachment) {
105
-        $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br>';
105
+        $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br>';
106 106
         $delete_attach_checkbox->addOption($key, $attach);
107 107
     }
108 108
     $form->addElement($delete_attach_checkbox);
Please login to merge, or discard this patch.
include/functions.image.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -28,25 +28,25 @@  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
             ) {
48 48
                 //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) {
49
-                if (!file_exists($thumb_path . '/' . $source)) {
49
+                if (!file_exists($thumb_path.'/'.$source)) {
50 50
                     sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']);
51 51
                 }
52 52
             }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             ) {
57 57
                 $pseudo_width  = $xoopsModuleConfig['max_image_width'];
58 58
                 $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]);
59
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
59
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
60 60
             }
61 61
             // irmtfan to fix Undefined variable: pseudo_height
62 62
             if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0
@@ -64,20 +64,20 @@  discard block
 block discarded – undo
64 64
             ) {
65 65
                 $pseudo_height = $xoopsModuleConfig['max_image_height'];
66 66
                 $pseudo_width  = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]);
67
-                $pseudo_size   = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'";
67
+                $pseudo_size   = "width='".$pseudo_width."px' height='".$pseudo_height."px'";
68 68
             }
69 69
         }
70 70
 
71 71
         if (file_exists($thumb)) {
72
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
73
-            $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '" />';
72
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
73
+            $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'" />';
74 74
             $attachmentImage .= '</a>';
75 75
         } elseif (!empty($pseudo_size)) {
76
-            $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">';
77
-            $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" />';
76
+            $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">';
77
+            $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'" />';
78 78
             $attachmentImage .= '</a>';
79 79
         } elseif (file_exists($image)) {
80
-            $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '" />';
80
+            $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'" />';
81 81
         } else {
82 82
             $attachmentImage = '';
83 83
         }
@@ -94,10 +94,10 @@  discard block
 block discarded – undo
94 94
     {
95 95
         global $xoopsModuleConfig;
96 96
 
97
-        $img_path   = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'];
98
-        $thumb_path = $img_path . '/thumbs';
99
-        $src_file   = $img_path . '/' . $source;
100
-        $new_file   = $thumb_path . '/' . $source;
97
+        $img_path   = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'];
98
+        $thumb_path = $img_path.'/thumbs';
99
+        $src_file   = $img_path.'/'.$source;
100
+        $new_file   = $thumb_path.'/'.$source;
101 101
         //$imageLibs = sf_getImageLibs();
102 102
 
103 103
         if (!filesize($src_file) || !is_readable($src_file)) {
@@ -117,20 +117,20 @@  discard block
 block discarded – undo
117 117
             return false;
118 118
         }
119 119
 
120
-        $newWidth  = (int)min($imginfo[0], $thumb_width);
121
-        $newHeight = (int)($imginfo[1] * $newWidth / $imginfo[0]);
120
+        $newWidth  = (int) min($imginfo[0], $thumb_width);
121
+        $newHeight = (int) ($imginfo[1] * $newWidth / $imginfo[0]);
122 122
 
123 123
         if ($xoopsModuleConfig['image_lib'] == 1 or $xoopsModuleConfig['image_lib'] == 0) {
124 124
             if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) {
125 125
                 $cur_dir     = __DIR__;
126
-                $src_file_im = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"';
127
-                $new_file_im = '"' . $cur_dir . '\\' . strtr($new_file, '/', '\\') . '"';
126
+                $src_file_im = '"'.$cur_dir.'\\'.strtr($src_file, '/', '\\').'"';
127
+                $new_file_im = '"'.$cur_dir.'\\'.strtr($new_file, '/', '\\').'"';
128 128
             } else {
129 129
                 $src_file_im = @escapeshellarg($src_file);
130 130
                 $new_file_im = @escapeshellarg($new_file);
131 131
             }
132
-            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/';
133
-            $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . '';
132
+            $path           = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/';
133
+            $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).'';
134 134
 
135 135
             @passthru($magick_command);
136 136
             if (file_exists($new_file)) {
@@ -139,13 +139,13 @@  discard block
 block discarded – undo
139 139
         }
140 140
 
141 141
         if ($xoopsModuleConfig['image_lib'] == 2 or $xoopsModuleConfig['image_lib'] == 0) {
142
-            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/';
142
+            $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/';
143 143
             if (preg_match("/\.png/i", $source)) {
144
-                $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file";
144
+                $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file";
145 145
             } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) {
146
-                $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file";
146
+                $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file";
147 147
             } elseif (preg_match("/\.gif/i", $source)) {
148
-                $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file";
148
+                $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file";
149 149
             }
150 150
 
151 151
             @exec($cmd, $output, $retval);
Please login to merge, or discard this patch.