Completed
Branch master (1b2f30)
by Michael
06:29 queued 03:22
created
footer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $uid     = $xoopsUser ? $xoopsUser->getVar('uid') : 0;
12 12
 $isAdmin = (sf_userIsAdmin() || sf_moderator());
13 13
 
14
-$xoopsTpl->assign('sf_adminpage', "<a href='" . XOOPS_URL . "/modules/smartfaq/admin/index.php'>" . _MD_SF_ADMIN_PAGE . '</a>');
14
+$xoopsTpl->assign('sf_adminpage', "<a href='".XOOPS_URL."/modules/smartfaq/admin/index.php'>"._MD_SF_ADMIN_PAGE.'</a>');
15 15
 $xoopsTpl->assign('isAdmin', $isAdmin);
16 16
 
17 17
 $xoopsTpl->assign(array('lang_on' => _MD_SF_ON, 'lang_postedby' => _MD_SF_POSTEDBY, 'lang_faq' => _MD_SF_QUESTION, 'lang_datesub' => _MD_SF_DATESUB, 'lang_hits' => _MD_SF_HITS));
@@ -28,4 +28,4 @@  discard block
 block discarded – undo
28 28
 
29 29
 $xoopsTpl->assign('ref_smartfaq', 'SmartFAQ is developed by The SmartFactory (http://www.smartfactory.ca), a division of InBox Solutions (http://www.inboxsolutions.net)');
30 30
 
31
-$xoopsTpl->assign('xoops_module_header', "<link rel='stylesheet' type='text/css' href='" . XOOPS_URL . "/modules/smartfaq/assets/css/smartfaq.css'/>");
31
+$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.
request.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include_once __DIR__ . '/header.php';
10
-include_once(XOOPS_ROOT_PATH . '/header.php');
9
+include_once __DIR__.'/header.php';
10
+include_once(XOOPS_ROOT_PATH.'/header.php');
11 11
 
12 12
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
13 13
 
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // Storing the FAQ object in the database
75 75
         if (!$newFaqObj->store()) {
76
-            redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR . sf_formatErrors($newFaqObj->getErrors()));
76
+            redirect_header('javascript:history.go(-1)', 3, _MD_SF_REQUEST_ERROR.sf_formatErrors($newFaqObj->getErrors()));
77 77
         }
78 78
 
79 79
         // Get the cateopry object related to that FAQ
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         } else {
89 89
             // Subscribe the user to On Published notification, if requested
90 90
             if ($notifypub == 1) {
91
-                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
91
+                include_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
92 92
                 $notificationHandler = xoops_getHandler('notification');
93 93
                 $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
94 94
             }
@@ -108,17 +108,17 @@  discard block
 block discarded – undo
108 108
         global $xoopsUser, $myts;
109 109
 
110 110
         $xoopsOption['template_main'] = 'smartfaq_submit.tpl';
111
-        include_once(XOOPS_ROOT_PATH . '/header.php');
112
-        include_once __DIR__ . '/footer.php';
111
+        include_once(XOOPS_ROOT_PATH.'/header.php');
112
+        include_once __DIR__.'/footer.php';
113 113
 
114 114
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
115 115
 
116
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
116
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
117 117
         $xoopsTpl->assign('whereInSection', $moduleName);
118 118
         $xoopsTpl->assign('lang_submit', _MD_SF_REQUEST);
119 119
 
120 120
         $xoopsTpl->assign('lang_intro_title', _MD_SF_REQUEST);
121
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . $myts->displayTarea($xoopsModuleConfig['requestintromsg']));
121
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, ".$myts->displayTarea($xoopsModuleConfig['requestintromsg']));
122 122
 
123 123
         include_once 'include/request.inc.php';
124 124
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         include_once 'include/request.inc.php';
130 130
 
131
-        include_once XOOPS_ROOT_PATH . '/footer.php';
131
+        include_once XOOPS_ROOT_PATH.'/footer.php';
132 132
 
133 133
         break;
134 134
 }
Please login to merge, or discard this patch.
language/english/admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
 define('_AM_SF_STATUS_EXP', "Status<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the status of the Q&amp;A.</span>");
273 273
 define('_AM_SF_SUBMISSIONSMNGMT', 'Submitted Q&amp;A');
274 274
 define('_AM_SF_SPECIFIC_URL_SELECT', 'Specific URL...');
275
-define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br />this module' to <i>" . _AM_SF_SPECIFIC_URL_SELECT . "</i>, please<br />specify the URL.<br />\n<b>Example :</b> modules/newbb</span>");
275
+define('_AM_SF_SPECIFIC_URL', "Specific URL</span><span style='font-size: xx-small; font-weight: normal; display: block;'>If you have set the 'Contextually link to<br />this module' to <i>"._AM_SF_SPECIFIC_URL_SELECT."</i>, please<br />specify the URL.<br />\n<b>Example :</b> modules/newbb</span>");
276 276
 define('_AM_SF_SUBMISSION_MODERATE', "Moderate this Q&amp;A's submission");
277 277
 define('_AM_SF_SUBMITTED', 'Submitted');
278 278
 define('_AM_SF_SUBMITTED_EXP', '<b>Submitted Q&amp;A</b> : Q&amp;A that have been submitted by users. Once approved, they will be displayed in the Q&amp;A section.');
Please login to merge, or discard this patch.
language/english/main.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 define('_MD_SF_INTARTICLE', 'Have a look at this FAQ at %s');
75 75
 define('_MD_SF_MAIL', 'Send Q&amp;A');
76 76
 define('_MD_SF_MAINHEAD', 'Welcome to the');
77
-define('_MD_SF_MAININTRO', "In this area of the site, you will find the answers to the frequently asked questions. Each Q&amp;A is placed in a category for easier finding. This is the section from where the random Q&amp;As in the right column of the site come from. Should you not find the answer to a particular question, don't hesitate to <a href='" . XOOPS_URL . "/forms/askus/form.php'>Ask us a Question!</a>");
77
+define('_MD_SF_MAININTRO', "In this area of the site, you will find the answers to the frequently asked questions. Each Q&amp;A is placed in a category for easier finding. This is the section from where the random Q&amp;As in the right column of the site come from. Should you not find the answer to a particular question, don't hesitate to <a href='".XOOPS_URL."/forms/askus/form.php'>Ask us a Question!</a>");
78 78
 define('_MD_SF_MAINNOSELECTCAT', 'You did not select a valid category');
79 79
 define('_MD_SF_MAINNOFAQS', 'There are no Q&amp;As in this category');
80 80
 define('_MD_SF_MODERATION_MAIN_HEAD', 'Moderation section of ');
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 define('_MD_SF_SPECIFIC_URL_SELECT', 'Specific URL...');
127 127
 define('_MD_SF_SENDSTORY', 'Send this Q&amp;A to a friend');
128 128
 define('_MD_SF_SPECIFIC_URL', 'Specific URL');
129
-define('_MD_SF_SPECIFIC_URL_DSC', "If you have set the 'Contextually link to this module' to <i>" . _MD_SF_SPECIFIC_URL_SELECT . "</i>, please specify the URL.<br />\n<b>Example :</b> modules/newbb");
129
+define('_MD_SF_SPECIFIC_URL_DSC', "If you have set the 'Contextually link to this module' to <i>"._MD_SF_SPECIFIC_URL_SELECT."</i>, please specify the URL.<br />\n<b>Example :</b> modules/newbb");
130 130
 define('_MD_SF_SUB_INTRO', 'please fill this form to send your Q&amp;A. The site administrator will review it and then publish it as soon as possible. Thank you in advance for your contribution.');
131 131
 define('_MD_SF_SUB_SNEWNAME', 'Submit a Q&amp;A');
132 132
 define('_MD_SF_SUB_SMNAME', 'Submit a Q&amp;A');
Please login to merge, or discard this patch.
print.php 1 patch
Spacing   +13 added lines, -13 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
-$faqid = isset($_GET['faqid']) ? (int)$_GET['faqid'] : 0;
11
+$faqid = isset($_GET['faqid']) ? (int) $_GET['faqid'] : 0;
12 12
 
13 13
 if ($faqid == 0) {
14 14
     redirect_header('javascript:history.go(-1)', 1, _MD_SF_NOFAQSELECTED);
@@ -43,23 +43,23 @@  discard block
 block discarded – undo
43 43
 
44 44
 echo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>\n";
45 45
 echo "<html>\n<head>\n";
46
-echo '<title>' . _MD_SF_FAQCOMEFROM . ' ' . $xoopsConfig['sitename'] . "</title>\n";
47
-echo "<meta http-equiv='Content-Type' content='text/html; charset=" . _CHARSET . "' />\n";
48
-echo "<meta name='AUTHOR' content='" . $xoopsConfig['sitename'] . "' />\n";
49
-echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by " . $xoopsConfig['sitename'] . "' />\n";
50
-echo "<meta name='DESCRIPTION' content='" . $xoopsConfig['slogan'] . "' />\n";
51
-echo "<meta name='GENERATOR' content='" . XOOPS_VERSION . "' />\n\n\n";
46
+echo '<title>'._MD_SF_FAQCOMEFROM.' '.$xoopsConfig['sitename']."</title>\n";
47
+echo "<meta http-equiv='Content-Type' content='text/html; charset="._CHARSET."' />\n";
48
+echo "<meta name='AUTHOR' content='".$xoopsConfig['sitename']."' />\n";
49
+echo "<meta name='COPYRIGHT' content='Copyright (c) 2001 by ".$xoopsConfig['sitename']."' />\n";
50
+echo "<meta name='DESCRIPTION' content='".$xoopsConfig['slogan']."' />\n";
51
+echo "<meta name='GENERATOR' content='".XOOPS_VERSION."' />\n\n\n";
52 52
 
53 53
 echo "<body bgcolor='#ffffff' text='#000000' onload='window.print()'>
54 54
      <div style='width: 650px; border: 1px solid #000; padding: 20px;'>
55
-     <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>
56
-     <div align='center'>" . $who_where . "</div>
55
+     <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>
56
+     <div align='center'>" . $who_where."</div>
57 57
                 <div style='text-align: center; display: block; padding-bottom: 12px; margin: 0 0 6px 0; border-bottom: 2px solid #ccc;'></div>
58 58
                 <div></div>
59
-                <b><p>" . $faqObj->question() . '</p></b>
60
-                <p>' . $answerObj->answer() . "</p>
59
+                <b><p>" . $faqObj->question().'</p></b>
60
+                <p>' . $answerObj->answer()."</p>
61 61
                 <div style='padding-top: 12px; border-top: 2px solid #ccc;'></div>
62
-                <p>" . $comeFrom . '</p>
62
+                <p>" . $comeFrom.'</p>
63 63
             </div>
64 64
     <br />';
65 65
 
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -6,11 +6,11 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include dirname(dirname(__DIR__)) . '/mainfile.php';
9
+include dirname(dirname(__DIR__)).'/mainfile.php';
10 10
 
11
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
12
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php';
13
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php';
14
-include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php';
11
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php';
12
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php';
13
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php';
14
+include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php';
15 15
 
16 16
 $myts = MyTextSanitizer::getInstance();
Please login to merge, or discard this patch.
class/answer.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -91,9 +91,9 @@  discard block
 block discarded – undo
91 91
         if (!$attach_key) {
92 92
             return false;
93 93
         }
94
-        $this->attachment_array[(string)$attach_key]['num_download']++;
94
+        $this->attachment_array[(string) $attach_key]['num_download']++;
95 95
 
96
-        return $this->attachment_array[(string)$attach_key]['num_download'];
96
+        return $this->attachment_array[(string) $attach_key]['num_download'];
97 97
     }
98 98
 
99 99
     /**
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $attachment_save = base64_encode(serialize($this->attachment_array));
107 107
         }
108 108
         $this->setVar('attachment', $attachment_save);
109
-        $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('smartfaq_answers') . ' SET attachment=' . $GLOBALS['xoopsDB']->quoteString($attachment_save) . ' WHERE post_id = ' . $this->getVar('answerid');
109
+        $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('smartfaq_answers').' SET attachment='.$GLOBALS['xoopsDB']->quoteString($attachment_save).' WHERE post_id = '.$this->getVar('answerid');
110 110
         if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
111 111
             //xoops_error($GLOBALS["xoopsDB"]->error());
112 112
             return false;
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
 
139 139
         foreach ($attach_old as $key => $attach) {
140 140
             if (in_array($key, $attach_array)) {
141
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attach['name_saved']);
142
-                @unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/thumbs/' . $attach['name_saved']); // delete thumbnails
141
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attach['name_saved']);
142
+                @unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/thumbs/'.$attach['name_saved']); // delete thumbnails
143 143
                 continue;
144 144
             }
145 145
             $this->attachment_array[$key] = $attach;
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
         static $counter = 0;
166 166
         $this->attachment_array = $this->getAttachment();
167 167
         if ($name_saved) {
168
-            $key                          = (string)(time() + ($counter++));
168
+            $key                          = (string) (time()+($counter++));
169 169
             $this->attachment_array[$key] = array(
170 170
                 'name_saved'   => $name_saved,
171 171
                 'name_display' => isset($name_display) ? $name_display : $name_saved,
172 172
                 'mimetype'     => $mimetype,
173
-                'num_download' => isset($num_download) ? (int)$num_download : 0
173
+                'num_download' => isset($num_download) ? (int) $num_download : 0
174 174
             );
175 175
         }
176 176
         $attachment_save = null;
@@ -196,30 +196,30 @@  discard block
 block discarded – undo
196 196
         if (is_array($attachments) && count($attachments) > 0) {
197 197
             $iconHandler = sf_getIconHandler();
198 198
             $mime_path   = $iconHandler->getPath('mime');
199
-            include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/include/functions.image.php';
199
+            include_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/include/functions.image.php';
200 200
             $image_extensions = array('jpg', 'jpeg', 'gif', 'png', 'bmp'); // need improve !!!
201
-            $post_attachment .= '<br /><strong>' . _MD_ATTACHMENT . '</strong>:';
201
+            $post_attachment .= '<br /><strong>'._MD_ATTACHMENT.'</strong>:';
202 202
             $post_attachment .= '<br /><hr size="1" noshade="noshade" /><br />';
203 203
             foreach ($attachments as $key => $att) {
204 204
                 $file_extension = ltrim(strrchr($att['name_saved'], '.'), '.');
205 205
                 $filetype       = $file_extension;
206
-                if (file_exists(XOOPS_ROOT_PATH . '/' . $mime_path . '/' . $filetype . '.gif')) {
207
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/' . $filetype . '.gif';
206
+                if (file_exists(XOOPS_ROOT_PATH.'/'.$mime_path.'/'.$filetype.'.gif')) {
207
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/'.$filetype.'.gif';
208 208
                 } else {
209
-                    $icon_filetype = XOOPS_URL . '/' . $mime_path . '/unknown.gif';
209
+                    $icon_filetype = XOOPS_URL.'/'.$mime_path.'/unknown.gif';
210 210
                 }
211
-                $file_size = @filesize(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $att['name_saved']);
212
-                $file_size = number_format($file_size / 1024, 2) . ' KB';
211
+                $file_size = @filesize(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$att['name_saved']);
212
+                $file_size = number_format($file_size / 1024, 2).' KB';
213 213
                 if ($xoopsModuleConfig['media_allowed'] && in_array(strtolower($file_extension), $image_extensions)) {
214
-                    $post_attachment .= '<br /><img src="' . $icon_filetype . '" alt="' . $filetype . '" /><strong>&nbsp; ' . $att['name_display'] . '</strong> <small>(' . $file_size . ')</small>';
215
-                    $post_attachment .= '<br />' . sf_attachmentImage($att['name_saved']);
214
+                    $post_attachment .= '<br /><img src="'.$icon_filetype.'" alt="'.$filetype.'" /><strong>&nbsp; '.$att['name_display'].'</strong> <small>('.$file_size.')</small>';
215
+                    $post_attachment .= '<br />'.sf_attachmentImage($att['name_saved']);
216 216
                     $isDisplayed = true;
217 217
                 } else {
218 218
                     global $xoopsUser;
219 219
                     if (empty($xoopsModuleConfig['show_userattach'])) {
220
-                        $post_attachment .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/dl_attachment.php?attachid=' . $key . '&amp;post_id=' . $this->getVar('post_id') . '"> <img src="' . $icon_filetype . '" alt="' . $filetype . '" /> ' . $att['name_display'] . '</a> ' . _MD_FILESIZE . ': ' . $file_size . '; ' . _MD_HITS . ': ' . $att['num_download'];
220
+                        $post_attachment .= '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/dl_attachment.php?attachid='.$key.'&amp;post_id='.$this->getVar('post_id').'"> <img src="'.$icon_filetype.'" alt="'.$filetype.'" /> '.$att['name_display'].'</a> '._MD_FILESIZE.': '.$file_size.'; '._MD_HITS.': '.$att['num_download'];
221 221
                     } elseif ($xoopsUser && $xoopsUser->uid() > 0 && $xoopsUser->isactive()) {
222
-                        $post_attachment .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/dl_attachment.php?attachid=' . $key . '&amp;post_id=' . $this->getVar('post_id') . '"> <img src="' . $icon_filetype . '" alt="' . $filetype . '" /> ' . $att['name_display'] . '</a> ' . _MD_FILESIZE . ': ' . $file_size . '; ' . _MD_HITS . ': ' . $att['num_download'];
222
+                        $post_attachment .= '<a href="'.XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/dl_attachment.php?attachid='.$key.'&amp;post_id='.$this->getVar('post_id').'"> <img src="'.$icon_filetype.'" alt="'.$filetype.'" /> '.$att['name_display'].'</a> '._MD_FILESIZE.': '.$file_size.'; '._MD_HITS.': '.$att['num_download'];
223 223
                     } else {
224 224
                         $post_attachment .= _MD_NEWBB_SEENOTGUEST;
225 225
                     }
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
         $tags                  = array();
329 329
         $tags['MODULE_NAME']   = $myts->displayTarea($smartModule->getVar('name'));
330 330
         $tags['FAQ_NAME']      = $faqObj->question();
331
-        $tags['FAQ_URL']       = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/faq.php?faqid=' . $faqObj->faqid();
331
+        $tags['FAQ_URL']       = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/faq.php?faqid='.$faqObj->faqid();
332 332
         $tags['CATEGORY_NAME'] = $faqObj->getCategoryName();
333
-        $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $smartModule->getVar('dirname') . '/category.php?categoryid=' . $faqObj->categoryid();
333
+        $tags['CATEGORY_URL']  = XOOPS_URL.'/modules/'.$smartModule->getVar('dirname').'/category.php?categoryid='.$faqObj->categoryid();
334 334
         $tags['FAQ_QUESTION']  = $faqObj->question();
335 335
 
336 336
         // TODO : Not sure about the 'formpreview' ...
@@ -389,8 +389,8 @@  discard block
 block discarded – undo
389 389
      */
390 390
     public function get($id = null, $fields = null)
391 391
     {
392
-        if ((int)$id > 0) {
393
-            $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers') . ' WHERE answerid=' . $id;
392
+        if ((int) $id > 0) {
393
+            $sql = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers').' WHERE answerid='.$id;
394 394
             if (!$result = $this->db->query($sql)) {
395 395
                 return false;
396 396
             }
@@ -518,11 +518,11 @@  discard block
 block discarded – undo
518 518
     {
519 519
         $ret   = array();
520 520
         $limit = $start = 0;
521
-        $sql   = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers');
521
+        $sql   = 'SELECT * FROM '.$this->db->prefix('smartfaq_answers');
522 522
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
523
-            $sql .= ' ' . $criteria->renderWhere();
523
+            $sql .= ' '.$criteria->renderWhere();
524 524
             if ($criteria->getSort() != '') {
525
-                $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder();
525
+                $sql .= ' ORDER BY '.$criteria->getSort().' '.$criteria->getOrder();
526 526
             }
527 527
             $limit = $criteria->getLimit();
528 528
             $start = $criteria->getStart();
@@ -536,9 +536,9 @@  discard block
 block discarded – undo
536 536
             $answer = new sfAnswer();
537 537
             $answer->assignVars($myrow);
538 538
             if (!$id_as_key) {
539
-                $ret[] =& $answer;
539
+                $ret[] = & $answer;
540 540
             } else {
541
-                $ret[$myrow['answerid']] =& $answer;
541
+                $ret[$myrow['answerid']] = & $answer;
542 542
             }
543 543
             unset($answer);
544 544
         }
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
         $criteria->setOrder($order);
601 601
         $criteria->setLimit($limit);
602 602
         $criteria->setStart($start);
603
-        $ret =& $this->getObjects($criteria);
603
+        $ret = & $this->getObjects($criteria);
604 604
 
605 605
         return $ret;
606 606
     }
@@ -613,9 +613,9 @@  discard block
 block discarded – undo
613 613
      */
614 614
     public function getCount(CriteriaElement $criteria = null)
615 615
     {
616
-        $sql = 'SELECT COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers');
616
+        $sql = 'SELECT COUNT(*) FROM '.$this->db->prefix('smartfaq_answers');
617 617
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
618
-            $sql .= ' ' . $criteria->renderWhere();
618
+            $sql .= ' '.$criteria->renderWhere();
619 619
         }
620 620
         $result = $this->db->query($sql);
621 621
         if (!$result) {
@@ -634,10 +634,10 @@  discard block
 block discarded – undo
634 634
      */
635 635
     public function getCountByFAQ($criteria = null)
636 636
     {
637
-        $sql = 'SELECT faqid, COUNT(*) FROM ' . $this->db->prefix('smartfaq_answers');
637
+        $sql = 'SELECT faqid, COUNT(*) FROM '.$this->db->prefix('smartfaq_answers');
638 638
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
639
-            $sql .= ' ' . $criteria->renderWhere();
640
-            $sql .= ' ' . $criteria->getGroupby();
639
+            $sql .= ' '.$criteria->renderWhere();
640
+            $sql .= ' '.$criteria->getGroupby();
641 641
         }
642 642
 
643 643
         //echo "<br />$sql<br />";
@@ -664,9 +664,9 @@  discard block
 block discarded – undo
664 664
      */
665 665
     public function deleteAll(CriteriaElement $criteria = null, $force = true, $asObject = false)
666 666
     {
667
-        $sql = 'DELETE FROM ' . $this->db->prefix('smartfaq_answers');
667
+        $sql = 'DELETE FROM '.$this->db->prefix('smartfaq_answers');
668 668
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
669
-            $sql .= ' ' . $criteria->renderWhere();
669
+            $sql .= ' '.$criteria->renderWhere();
670 670
         }
671 671
         if (!$this->db->query($sql)) {
672 672
             return false;
@@ -686,10 +686,10 @@  discard block
 block discarded – undo
686 686
      */
687 687
     public function updateAll($fieldname, $fieldvalue, CriteriaElement $criteria = null, $force = false)
688 688
     {
689
-        $set_clause = is_numeric($fieldvalue) ? $fieldname . ' = ' . $fieldvalue : $fieldname . ' = ' . $this->db->quoteString($fieldvalue);
690
-        $sql        = 'UPDATE ' . $this->db->prefix('smartfaq_answers') . ' SET ' . $set_clause;
689
+        $set_clause = is_numeric($fieldvalue) ? $fieldname.' = '.$fieldvalue : $fieldname.' = '.$this->db->quoteString($fieldvalue);
690
+        $sql        = 'UPDATE '.$this->db->prefix('smartfaq_answers').' SET '.$set_clause;
691 691
         if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) {
692
-            $sql .= ' ' . $criteria->renderWhere();
692
+            $sql .= ' '.$criteria->renderWhere();
693 693
         }
694 694
         //echo "<br />" . $sql . "<br />";
695 695
         if (!$this->db->queryF($sql)) {
@@ -706,8 +706,8 @@  discard block
 block discarded – undo
706 706
     public function getLastPublishedByFaq($faqids)
707 707
     {
708 708
         $ret    = array();
709
-        $sql    = 'SELECT faqid, answer, uid, datesub FROM ' . $this->db->prefix('smartfaq_answers') . '
710
-               WHERE faqid IN (' . implode(',', $faqids) . ') AND status = ' . _SF_AN_STATUS_APPROVED . ' GROUP BY faqid';
709
+        $sql    = 'SELECT faqid, answer, uid, datesub FROM '.$this->db->prefix('smartfaq_answers').'
710
+               WHERE faqid IN (' . implode(',', $faqids).') AND status = '._SF_AN_STATUS_APPROVED.' GROUP BY faqid';
711 711
         $result = $this->db->query($sql);
712 712
         if (!$result) {
713 713
             return $ret;
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
         while ($row = $this->db->fetchArray($result)) {
716 716
             $answer = new sfAnswer();
717 717
             $answer->assignVars($row);
718
-            $ret[$row['faqid']] =& $answer;
718
+            $ret[$row['faqid']] = & $answer;
719 719
             unset($answer);
720 720
         }
721 721
 
Please login to merge, or discard this patch.
class/uploader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 
12 12
 // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
13 13
 
14
-include_once XOOPS_ROOT_PATH . '/class/uploader.php';
14
+include_once XOOPS_ROOT_PATH.'/class/uploader.php';
15 15
 
16 16
 /**
17 17
  * Class sfUploader
Please login to merge, or discard this patch.
class/smartdbupdater.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     //Verifies that a MySQL table exists
17 17
     $xoopsDB  = XoopsDatabaseFactory::getDatabaseConnection();
18 18
     $realname = $xoopsDB->prefix($table);
19
-    $sql      = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;
19
+    $sql      = 'SHOW TABLES FROM '.XOOPS_DB_NAME;
20 20
     $ret      = $xoopsDB->queryF($sql);
21 21
     while (list($m_table) = $xoopsDB->fetchRow($ret)) {
22 22
         if ($m_table == $realname) {
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
  * Include the language constants for the SmartObjectDBUpdater
54 54
  */
55 55
 global $xoopsConfig;
56
-$common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/' . $xoopsConfig['language'] . '/smartdbupdater.php';
56
+$common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/'.$xoopsConfig['language'].'/smartdbupdater.php';
57 57
 if (!file_exists($common_file)) {
58
-    $common_file = XOOPS_ROOT_PATH . '/modules/smartfaq/language/english/smartdbupdater.php';
58
+    $common_file = XOOPS_ROOT_PATH.'/modules/smartfaq/language/english/smartdbupdater.php';
59 59
 }
60 60
 
61 61
 include($common_file);
@@ -152,14 +152,14 @@  discard block
 block discarded – undo
152 152
     public function getExistingFieldsArray()
153 153
     {
154 154
         global $xoopsDB;
155
-        $result = $xoopsDB->query('SHOW COLUMNS FROM ' . $this->name());
155
+        $result = $xoopsDB->query('SHOW COLUMNS FROM '.$this->name());
156 156
         while ($existing_field = $xoopsDB->fetchArray($result)) {
157 157
             $fields[$existing_field['Field']] = $existing_field['Type'];
158 158
             if ($existing_field['Null'] !== 'YES') {
159 159
                 $fields[$existing_field['Field']] .= ' NOT NULL';
160 160
             }
161 161
             if ($existing_field['Extra']) {
162
-                $fields[$existing_field['Field']] .= ' ' . $existing_field['Extra'];
162
+                $fields[$existing_field['Field']] .= ' '.$existing_field['Extra'];
163 163
             }
164 164
         }
165 165
 
@@ -235,9 +235,9 @@  discard block
 block discarded – undo
235 235
             $query = sprintf('INSERT INTO %s VALUES (%s)', $this->name(), $data);
236 236
             $ret   = $xoopsDB->query($query);
237 237
             if (!$ret) {
238
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()) . '<br />';
238
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_ADD_DATA_ERR, $this->name()).'<br />';
239 239
             } else {
240
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_ADD_DATA, $this->name()) . '<br />';
240
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_ADD_DATA, $this->name()).'<br />';
241 241
             }
242 242
         }
243 243
 
@@ -393,9 +393,9 @@  discard block
 block discarded – undo
393 393
 
394 394
         $ret = $xoopsDB->query($query);
395 395
         if (!$ret) {
396
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()) . '<br />';
396
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CREATE_TABLE_ERR, $this->name()).'<br />';
397 397
         } else {
398
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CREATE_TABLE, $this->name()) . '<br />';
398
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CREATE_TABLE, $this->name()).'<br />';
399 399
         }
400 400
 
401 401
         return $ret;
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
         $query = sprintf('DROP TABLE %s', $this->name());
415 415
         $ret   = $xoopsDB->query($query);
416 416
         if (!$ret) {
417
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()) . '<br />';
417
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROP_TABLE_ERR, $this->name()).'<br />';
418 418
 
419 419
             return false;
420 420
         } else {
421
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROP_TABLE, $this->name()) . '<br />';
421
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROP_TABLE, $this->name()).'<br />';
422 422
 
423 423
             return true;
424 424
         }
@@ -442,9 +442,9 @@  discard block
 block discarded – undo
442 442
             $ret = $ret && $xoopsDB->query($query);
443 443
             if ($alteredField['showerror']) {
444 444
                 if (!$ret) {
445
-                    echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()) . '<br />';
445
+                    echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CHGFIELD_ERR, $alteredField['name'], $this->name()).'<br />';
446 446
                 } else {
447
-                    echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()) . '<br />';
447
+                    echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_CHGFIELD, $alteredField['name'], $this->name()).'<br />';
448 448
                 }
449 449
             }
450 450
         }
@@ -468,9 +468,9 @@  discard block
 block discarded – undo
468 468
             //echo $query;
469 469
             $ret = $ret && $xoopsDB->query($query);
470 470
             if (!$ret) {
471
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()) . '<br />';
471
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_NEWFIELD_ERR, $newField['name'], $this->name()).'<br />';
472 472
             } else {
473
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()) . '<br />';
473
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_NEWFIELD, $newField['name'], $this->name()).'<br />';
474 474
             }
475 475
         }
476 476
 
@@ -493,9 +493,9 @@  discard block
 block discarded – undo
493 493
             $query = sprintf('UPDATE %s SET %s = %s', $this->name(), $updatedField['name'], $updatedField['value']);
494 494
             $ret   = $ret && $xoopsDB->query($query);
495 495
             if (!$ret) {
496
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br />';
496
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br />';
497 497
             } else {
498
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br />';
498
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br />';
499 499
             }
500 500
         }
501 501
 
@@ -518,9 +518,9 @@  discard block
 block discarded – undo
518 518
             //echo $query."<br>";
519 519
             $ret = $ret && $xoopsDB->query($query);
520 520
             if (!$ret) {
521
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()) . '<br />';
521
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE_ERR, $this->name()).'<br />';
522 522
             } else {
523
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()) . '<br />';
523
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_UPDATE_TABLE, $this->name()).'<br />';
524 524
             }
525 525
         }
526 526
 
@@ -544,9 +544,9 @@  discard block
 block discarded – undo
544 544
 
545 545
             $ret = $ret && $xoopsDB->query($query);
546 546
             if (!$ret) {
547
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br />';
547
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()).'<br />';
548 548
             } else {
549
-                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br />';
549
+                echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()).'<br />';
550 550
             }
551 551
         }
552 552
 
@@ -615,11 +615,11 @@  discard block
 block discarded – undo
615 615
         $query = sprintf('ALTER TABLE %s RENAME %s', $from, $to);
616 616
         $ret   = $xoopsDB->query($query);
617 617
         if (!$ret) {
618
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from) . '<br />';
618
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE_ERR, $from).'<br />';
619 619
 
620 620
             return false;
621 621
         } else {
622
-            echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_RENAME_TABLE, $from, $to) . '<br />';
622
+            echo '&nbsp;&nbsp;'.sprintf(_SDU_MSG_RENAME_TABLE, $from, $to).'<br />';
623 623
 
624 624
             return true;
625 625
         }
Please login to merge, or discard this patch.