Completed
Push — master ( 0d7d1b...48b96e )
by Michael
02:08
created
include/blocksadmin.inc.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -70,18 +70,18 @@
 block discarded – undo
70 70
     $myblock->setVar('title', $myts->stripSlashesGPC($btitle));
71 71
     $myblock->setVar('content', $myts->stripSlashesGPC($bcontent));
72 72
     $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset='
73
-                 . _CHARSET
74
-                 . '"><meta http-equiv="content-language" content="'
75
-                 . _LANGCODE
76
-                 . '"><title>'
77
-                 . $xoopsConfig['sitename']
78
-                 . '</title><link rel="stylesheet" type="text/css" media="all" href="'
79
-                 . getcss($xoopsConfig['theme_set'])
80
-                 . '"></head><body><table><tr><th>'
81
-                 . $myblock->getVar('title')
82
-                 . '</th></tr><tr><td>'
83
-                 . $myblock->getContent('S', $bctype)
84
-                 . '</td></tr></table></body></html>';
73
+                    . _CHARSET
74
+                    . '"><meta http-equiv="content-language" content="'
75
+                    . _LANGCODE
76
+                    . '"><title>'
77
+                    . $xoopsConfig['sitename']
78
+                    . '</title><link rel="stylesheet" type="text/css" media="all" href="'
79
+                    . getcss($xoopsConfig['theme_set'])
80
+                    . '"></head><body><table><tr><th>'
81
+                    . $myblock->getVar('title')
82
+                    . '</th></tr><tr><td>'
83
+                    . $myblock->getContent('S', $bctype)
84
+                    . '</td></tr></table></body></html>';
85 85
 
86 86
     $dummyfile = '_dummyfile_' . time() . '.html';
87 87
     $fp        = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w');
Please login to merge, or discard this 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
-require_once XOOPS_ROOT_PATH . '/class/xoopsblock.php';
32
-include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php';
31
+require_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)) {
@@ -43,13 +43,13 @@  discard block
 block discarded – undo
43 43
         || $HTTP_GET_VARS['op'] === 'clone'
44 44
         || $HTTP_GET_VARS['op'] === 'previewpopup') {
45 45
         $op  = $HTTP_GET_VARS['op'];
46
-        $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0;
46
+        $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0;
47 47
     }
48 48
 }
49 49
 
50 50
 if (isset($previewblock)) {
51 51
     xoops_cp_header();
52
-    require_once XOOPS_ROOT_PATH . '/class/template.php';
52
+    require_once XOOPS_ROOT_PATH.'/class/template.php';
53 53
     $xoopsTpl = new XoopsTpl();
54 54
     $xoopsTpl->xoops_setCaching(0);
55 55
     if (isset($bid)) {
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
                  . $myblock->getContent('S', $bctype)
84 84
                  . '</td></tr></table></body></html>';
85 85
 
86
-    $dummyfile = '_dummyfile_' . time() . '.html';
87
-    $fp        = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w');
86
+    $dummyfile = '_dummyfile_'.time().'.html';
87
+    $fp        = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w');
88 88
     fwrite($fp, $dummyhtml);
89 89
     fclose($fp);
90 90
     $block['edit_form'] = false;
@@ -95,24 +95,24 @@  discard block
 block discarded – undo
95 95
     $block['visible']   = $bvisible;
96 96
     $block['title']     = $myblock->getVar('title', 'E');
97 97
     $block['content']   = $myblock->getVar('content', 'E');
98
-    $block['modules']   =& $bmodule;
98
+    $block['modules']   = & $bmodule;
99 99
     $block['ctype']     = isset($bctype) ? $bctype : $myblock->getVar('c_type');
100 100
     $block['is_custom'] = true;
101
-    $block['cachetime'] = (int)$bcachetime;
102
-    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>';
103
-    include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php';
101
+    $block['cachetime'] = (int) $bcachetime;
102
+    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>';
103
+    include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php';
104 104
     $form->display();
105 105
     xoops_cp_footer();
106 106
     echo '<script type="text/javascript">
107 107
     <!--//
108
-    preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200);
108
+    preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200);
109 109
     //-->
110 110
     </script>';
111 111
     exit();
112 112
 }
113 113
 
114 114
 if ($op === 'previewpopup') {
115
-    $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file']));
115
+    $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file']));
116 116
     if (file_exists($file)) {
117 117
         include $file;
118 118
         @unlink($file);
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 }
151 151
 
152 152
 if ($op === 'update') {
153
-    $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0;
153
+    $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0;
154 154
     $options    = isset($options) ? $options : [];
155 155
     $bcontent   = isset($bcontent) ? $bcontent : '';
156 156
     $bctype     = isset($bctype) ? $bctype : '';
@@ -251,27 +251,27 @@  discard block
 block discarded – undo
251 251
         $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid);
252 252
         $db->query($sql);
253 253
         foreach ($bmodule as $bmid) {
254
-            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid);
254
+            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid);
255 255
             $db->query($sql);
256 256
         }
257
-        require_once XOOPS_ROOT_PATH . '/class/template.php';
257
+        require_once XOOPS_ROOT_PATH.'/class/template.php';
258 258
         $xoopsTpl = new XoopsTpl();
259 259
         $xoopsTpl->xoops_setCaching(2);
260 260
         if ($myblock->getVar('template') != '') {
261
-            if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) {
262
-                if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) {
263
-                    $msg = 'Unable to clear cache for block ID' . $bid;
261
+            if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) {
262
+                if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) {
263
+                    $msg = 'Unable to clear cache for block ID'.$bid;
264 264
                 }
265 265
             }
266 266
         } else {
267
-            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block' . $bid)) {
268
-                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block' . $bid)) {
269
-                    $msg = 'Unable to clear cache for block ID' . $bid;
267
+            if ($xoopsTpl->is_cached('db:system_dummy.tpl', 'block'.$bid)) {
268
+                if (!$xoopsTpl->clear_cache('db:system_dummy.tpl', 'block'.$bid)) {
269
+                    $msg = 'Unable to clear cache for block ID'.$bid;
270 270
                 }
271 271
             }
272 272
         }
273 273
     } else {
274
-        $msg = 'Failed update of block. ID:' . $bid;
274
+        $msg = 'Failed update of block. ID:'.$bid;
275 275
     }
276 276
 
277 277
     return $msg; // GIJ +
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
-require_once XOOPS_ROOT_PATH . '/class/xoopstree.php';
13
-require_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
14
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
12
+require_once XOOPS_ROOT_PATH.'/class/xoopstree.php';
13
+require_once XOOPS_ROOT_PATH.'/class/xoopslists.php';
14
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
15 15
 //require_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/searchform.php 1 patch
Spacing   +3 added lines, -3 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
-$categoryID = isset($categoryID) ? (int)$categoryID : 0;
10
-$type       = isset($type) ? (int)$type : 3;
9
+$categoryID = isset($categoryID) ? (int) $categoryID : 0;
10
+$type       = isset($type) ? (int) $type : 3;
11 11
 $term       = isset($term) ? $type : '';
12 12
 
13 13
 $sform = new XoopsThemeForm(_MD_WB_SEARCHFORM, 'searchform', 'search.php');
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     $searchcat = new XoopsFormSelect(_MD_WB_CATEGORY, 'categoryID', $categoryID);
22 22
     $searchcat->addOption('0', _MD_WB_ALLOFTHEM);
23 23
 
24
-    $resultcat = $xoopsDB->queryF('SELECT categoryID, name FROM ' . $xoopsDB->prefix('wbcategories') . ' ORDER BY categoryID');
24
+    $resultcat = $xoopsDB->queryF('SELECT categoryID, name FROM '.$xoopsDB->prefix('wbcategories').' ORDER BY categoryID');
25 25
 
26 26
     while (list($categoryID, $name) = $xoopsDB->fetchRow($resultcat)) {
27 27
         $searchcat->addOption('categoryID', "$categoryID : $name");
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
     require_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
-    require_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php';
73
+    require_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
-    require_once XOOPS_ROOT_PATH . '/modules/' . $module->getVar('dirname') . '/include/functions.php';
107
+    require_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.
comment_new.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
  * Licence: GNU
7 7
  */
8 8
 
9
-include __DIR__ . '/../../mainfile.php';
10
-require_once XOOPS_ROOT_PATH . '/include/comment_new.php';
9
+include __DIR__.'/../../mainfile.php';
10
+require_once XOOPS_ROOT_PATH.'/include/comment_new.php';
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
-require_once __DIR__ . '/header.php';
9
+require_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.
language/english/admin.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
 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>");
275 275
 define('_AM_SF_SUBMISSIONSMNGMT', 'Submitted Q&amp;A');
276 276
 define('_AM_SF_SPECIFIC_URL_SELECT', 'Specific URL...');
277
-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>");
277
+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>");
278 278
 define('_AM_SF_SUBMISSION_MODERATE', "Moderate this Q&amp;A's submission");
279 279
 define('_AM_SF_SUBMITTED', 'Submitted');
280 280
 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.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 define('_AM_SF_CONTEXTMODULELINK', 'Contextually linked to this module');
79 79
 define(
80 80
     '_AM_SF_CONTEXTMODULELINK_FAQ',
81
-       "Contextually linked to this module<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the module to which this Q&amp;A will be<br>linked. If the Contextual FAQ block is visible<br>on that module, the 'How do I' statement of<br>this Q&amp;A will be displayed.</span>"
81
+        "Contextually linked to this module<span style='font-size: xx-small; font-weight: normal; display: block;'>Select the module to which this Q&amp;A will be<br>linked. If the Contextual FAQ block is visible<br>on that module, the 'How do I' statement of<br>this Q&amp;A will be displayed.</span>"
82 82
 );
83 83
 define('_AM_SF_CONTEXTOPTIONS', 'Contextual options');
84 84
 define('_AM_SF_CONTEXTPAGE', 'Contextually linked to this URL');
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 define('_AM_SF_ERROR_FAQ_NOT_SAVED', 'An error occured. The Q&amp;A was not saved in the database.');
122 122
 define(
123 123
     '_AM_SF_EXACTURL',
124
-       "Exact URL?<span style='font-size: xx-small; font-weight: normal; display: block;'>If set to 'Yes', the Q&amp;A will only display in the'Specific URL set above'. If set to 'No', the Q&amp;A will be displayed in all pages that match a part of the root of the specific URL. ie; modules/newbb/*.php</span>"
124
+        "Exact URL?<span style='font-size: xx-small; font-weight: normal; display: block;'>If set to 'Yes', the Q&amp;A will only display in the'Specific URL set above'. If set to 'No', the Q&amp;A will be displayed in all pages that match a part of the root of the specific URL. ie; modules/newbb/*.php</span>"
125 125
 );
126 126
 define('_AM_SF_FAQ_EDIT', 'Edit this Q&amp;A');
127 127
 define('_AM_SF_FAQ_NEW_ANSWER_PUBLISHED', 'The original answer was replaced by this answer.');
Please login to merge, or discard this patch.
language/english/modinfo.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -385,7 +385,7 @@
 block discarded – undo
385 385
 
386 386
 //Help
387 387
 define('_MI_SF_DIRNAME', basename(dirname(dirname(__DIR__))));
388
-define('_MI_SF_HELP_HEADER', __DIR__ . '/help/helpheader.tpl');
388
+define('_MI_SF_HELP_HEADER', __DIR__.'/help/helpheader.tpl');
389 389
 define('_MI_SF_BACK_2_ADMIN', 'Back to Administration of ');
390 390
 define('_MI_SF_OVERVIEW', 'Overview');
391 391
 
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 define('_MI_SF_REQUESTINTROMSGDSC', 'Introduction message to be displayed in the Request a Q&amp;A page of the module.');
116 116
 define(
117 117
     '_MI_SF_REQUESTINTROMSGDEF',
118
-       'You did not find the answer to the question you were looking for? No problem! Simply fill the following form in order to request the answer for a new question. The site administrator will review your request and publish this new question in the Open Questions section for someone to answer it!'
118
+        'You did not find the answer to the question you were looking for? No problem! Simply fill the following form in order to request the answer for a new question. The site administrator will review your request and publish this new question in the Open Questions section for someone to answer it!'
119 119
 );
120 120
 
121 121
 define('_MI_SF_OPENINTROMSG', 'Open Questions section introduction message:');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 define('_MI_SF_HELP_PATH_SELECT', "Path of SmartFAQ's help files");
129 129
 define(
130 130
     '_MI_SF_HELP_PATH_SELECT_DSC',
131
-       "SELECT FROM where you would LIKE TO access SmartFAQ's help files. If you downloaded the 'SmartFAQ's Help Package' AND uploaded it IN 'modules/smartfaq/doc/', you can SELECT 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartFAQ's help files'"
131
+        "SELECT FROM where you would LIKE TO access SmartFAQ's help files. If you downloaded the 'SmartFAQ's Help Package' AND uploaded it IN 'modules/smartfaq/doc/', you can SELECT 'Inside the module'. Alternatively, you can access the module's help file directly from docs.xoops.org by chosing this in the selector. You can also select 'Custom Path' and specify yourself the path of the help files in the next config option 'Custom path of SmartFAQ's help files'"
132 132
 );
133 133
 
134 134
 define('_MI_SF_HELP_PATH_CUSTOM', "Custom path of SmartFAQ's help files");
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 define('_MI_SF_DIR_ATTACHMENT', 'Attachments physical path.');
352 352
 define(
353 353
     '_MI_SF_DIR_ATTACHMENT_DESC',
354
-       "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'"
354
+        "Physical path only needs to be set from your xoops root and not before, for example you may have attachments uploaded to www.yoururl.com/uploads/newbb the path entered would then be '/uploads/newbb' never include a trailing slash '/' the thumbnails path becomes '/uploads/newbb/thumbs'"
355 355
 );
356 356
 define('_MI_SF_PATH_MAGICK', 'Path for ImageMagick');
357 357
 define('_MI_SF_PATH_MAGICK_DESC', "Usually it is '/usr/bin/X11'. Leave it BLANK if you do not have ImageMagicK installed or for autodetecting.");
Please login to merge, or discard this patch.
submit.php 2 patches
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
-require_once __DIR__ . '/header.php';
9
+require_once __DIR__.'/header.php';
10 10
 
11 11
 global $xoopsUser, $xoopsConfig, $xoopsModuleConfig, $xoopsModule;
12 12
 
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
         global $xoopsUser, $myts;
84 84
 
85 85
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
86
-        require_once XOOPS_ROOT_PATH . '/header.php';
87
-        require_once __DIR__ . '/footer.php';
86
+        require_once XOOPS_ROOT_PATH.'/header.php';
87
+        require_once __DIR__.'/footer.php';
88 88
 
89 89
         $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
90 90
 
91
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
91
+        $moduleName          = & $myts->displayTarea($xoopsModule->getVar('name'));
92 92
         $faq                 = $faqObj->toArray(null, $categoryObj, false);
93 93
         $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
94 94
         $faq['answer']       = $answerObj->answer();
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
102 102
 
103 103
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
104
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
104
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
105 105
 
106
-        require_once __DIR__ . '/include/submit.inc.php';
106
+        require_once __DIR__.'/include/submit.inc.php';
107 107
 
108
-        require_once XOOPS_ROOT_PATH . '/footer.php';
108
+        require_once XOOPS_ROOT_PATH.'/footer.php';
109 109
 
110 110
         exit();
111 111
         break;
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
             $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
170 170
             if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
171 171
                 foreach ($_POST['delete_tmp'] as $key) {
172
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
172
+                    unlink(XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0]);
173 173
                     unset($attachments_tmp[$key]);
174 174
                 }
175 175
             }
176 176
         }
177 177
         if (count($attachments_tmp)) {
178 178
             foreach ($attachments_tmp as $key => $attach) {
179
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
179
+                if (rename(XOOPS_CACHE_PATH.'/'.$attachments_tmp[$key][0], XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachments_tmp[$key][0])) {
180 180
                     $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
181 181
                 }
182 182
             }
@@ -185,11 +185,11 @@  discard block
 block discarded – undo
185 185
 
186 186
         if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != ''
187 187
             && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
188
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
188
+            require_once XOOPS_ROOT_PATH.'/modules/'.$xoopsModule->getVar('dirname', 'n').'/class/uploader.php';
189 189
             $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
190 190
             $uploaddir   = XOOPS_CACHE_PATH;
191 191
 
192
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
192
+            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int) $maxfilesize, (int) $xoopsModuleConfig['max_img_width'], (int) $xoopsModuleConfig['max_img_height']);
193 193
 
194 194
             if ($_FILES['userfile']['error'] > 0) {
195 195
                 switch ($_FILES['userfile']['error']) {
@@ -207,19 +207,19 @@  discard block
 block discarded – undo
207 207
                 $uploader->setCheckMediaTypeByExt();
208 208
 
209 209
                 if ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {
210
-                    $prefix = is_object($xoopsUser) ? (string)$xoopsUser->uid() . '_' : 'newbb_';
210
+                    $prefix = is_object($xoopsUser) ? (string) $xoopsUser->uid().'_' : 'newbb_';
211 211
                     $uploader->setPrefix($prefix);
212 212
                     if (!$uploader->upload()) {
213
-                        $error_message[] = $error_upload =& $uploader->getErrors();
213
+                        $error_message[] = $error_upload = & $uploader->getErrors();
214 214
                     } else {
215 215
                         if (is_file($uploader->getSavedDestination())) {
216
-                            if (rename(XOOPS_CACHE_PATH . '/' . $uploader->getSavedFileName(), XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $uploader->getSavedFileName())) {
216
+                            if (rename(XOOPS_CACHE_PATH.'/'.$uploader->getSavedFileName(), XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$uploader->getSavedFileName())) {
217 217
                                 $post_obj->setAttachment($uploader->getSavedFileName(), $uploader->getMediaName(), $uploader->getMediaType());
218 218
                             }
219 219
                         }
220 220
                     }
221 221
                 } else {
222
-                    $error_message[] = $error_upload =& $uploader->getErrors();
222
+                    $error_message[] = $error_upload = & $uploader->getErrors();
223 223
                 }
224 224
             }
225 225
         }
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
         } else {
253 253
             // Subscribe the user to On Published notification, if requested
254 254
             if ($notifypub == 1) {
255
-                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
255
+                require_once XOOPS_ROOT_PATH.'/include/notification_constants.php';
256 256
                 $notificationHandler = xoops_getHandler('notification');
257 257
                 $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
258 258
             }
@@ -275,20 +275,20 @@  discard block
 block discarded – undo
275 275
         $categoryObj = $categoryHandler->create();
276 276
 
277 277
         $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.html';
278
-        require_once XOOPS_ROOT_PATH . '/header.php';
279
-        require_once __DIR__ . '/footer.php';
278
+        require_once XOOPS_ROOT_PATH.'/header.php';
279
+        require_once __DIR__.'/footer.php';
280 280
 
281 281
         $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
282 282
         $notifypub  = 1;
283
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
283
+        $moduleName = & $myts->displayTarea($xoopsModule->getVar('name'));
284 284
         $xoopsTpl->assign('whereInSection', $moduleName);
285 285
         $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
286 286
 
287 287
         $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
288
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
288
+        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY."<b>$name</b>, "._MD_SF_SUB_INTRO);
289 289
 
290
-        require_once __DIR__ . '/include/submit.inc.php';
290
+        require_once __DIR__.'/include/submit.inc.php';
291 291
 
292
-        require_once XOOPS_ROOT_PATH . '/footer.php';
292
+        require_once XOOPS_ROOT_PATH.'/footer.php';
293 293
         break;
294 294
 }
Please login to merge, or discard this patch.
Switch Indentation   +134 added lines, -134 removed lines patch added patch discarded remove patch
@@ -46,153 +46,153 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 switch ($op) {
49
-    case 'preview':
49
+        case 'preview':
50 50
 
51
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
51
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
52 52
 
53
-        $faqObj      = $faqHandler->create();
54
-        $answerObj   = $answerHandler->create();
55
-        $categoryObj = $categoryHandler->get($_POST['categoryid']);
53
+            $faqObj      = $faqHandler->create();
54
+            $answerObj   = $answerHandler->create();
55
+            $categoryObj = $categoryHandler->get($_POST['categoryid']);
56 56
 
57
-        if (!$xoopsUser) {
58
-            if ($xoopsModuleConfig['anonpost'] == 1) {
59
-                $uid = 0;
57
+            if (!$xoopsUser) {
58
+                if ($xoopsModuleConfig['anonpost'] == 1) {
59
+                    $uid = 0;
60
+                } else {
61
+                    redirect_header('index.php', 3, _NOPERM);
62
+                }
60 63
             } else {
61
-                redirect_header('index.php', 3, _NOPERM);
64
+                $uid = $xoopsUser->uid();
62 65
             }
63
-        } else {
64
-            $uid = $xoopsUser->uid();
65
-        }
66 66
 
67
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
67
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
68 68
 
69
-        // Putting the values about the FAQ in the FAQ object
70
-        $faqObj->setVar('categoryid', $_POST['categoryid']);
71
-        $faqObj->setVar('uid', $uid);
72
-        $faqObj->setVar('question', $_POST['question']);
73
-        $faqObj->setVar('howdoi', $_POST['howdoi']);
74
-        $faqObj->setVar('diduno', $_POST['diduno']);
75
-        $faqObj->setVar('datesub', time());
69
+            // Putting the values about the FAQ in the FAQ object
70
+            $faqObj->setVar('categoryid', $_POST['categoryid']);
71
+            $faqObj->setVar('uid', $uid);
72
+            $faqObj->setVar('question', $_POST['question']);
73
+            $faqObj->setVar('howdoi', $_POST['howdoi']);
74
+            $faqObj->setVar('diduno', $_POST['diduno']);
75
+            $faqObj->setVar('datesub', time());
76 76
 
77
-        // Putting the values in the answer object
78
-        $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
79
-        $answerObj->setVar('faqid', $faqObj->faqid());
80
-        $answerObj->setVar('answer', $_POST['answer']);
81
-        $answerObj->setVar('uid', $uid);
77
+            // Putting the values in the answer object
78
+            $answerObj->setVar('status', _SF_AN_STATUS_APPROVED);
79
+            $answerObj->setVar('faqid', $faqObj->faqid());
80
+            $answerObj->setVar('answer', $_POST['answer']);
81
+            $answerObj->setVar('uid', $uid);
82 82
 
83
-        global $xoopsUser, $myts;
83
+            global $xoopsUser, $myts;
84 84
 
85
-        $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
86
-        require_once XOOPS_ROOT_PATH . '/header.php';
87
-        require_once __DIR__ . '/footer.php';
85
+            $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.tpl';
86
+            require_once XOOPS_ROOT_PATH . '/header.php';
87
+            require_once __DIR__ . '/footer.php';
88 88
 
89
-        $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
89
+            $name = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
90 90
 
91
-        $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
92
-        $faq                 = $faqObj->toArray(null, $categoryObj, false);
93
-        $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
94
-        $faq['answer']       = $answerObj->answer();
95
-        $faq['who_when']     = $faqObj->getWhoAndWhen();
91
+            $moduleName          =& $myts->displayTarea($xoopsModule->getVar('name'));
92
+            $faq                 = $faqObj->toArray(null, $categoryObj, false);
93
+            $faq['categoryPath'] = $categoryObj->getCategoryPath(true);
94
+            $faq['answer']       = $answerObj->answer();
95
+            $faq['who_when']     = $faqObj->getWhoAndWhen();
96 96
 
97
-        $faq['comments'] = -1;
98
-        $xoopsTpl->assign('faq', $faq);
99
-        $xoopsTpl->assign('op', 'preview');
100
-        $xoopsTpl->assign('whereInSection', $moduleName);
101
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
97
+            $faq['comments'] = -1;
98
+            $xoopsTpl->assign('faq', $faq);
99
+            $xoopsTpl->assign('op', 'preview');
100
+            $xoopsTpl->assign('whereInSection', $moduleName);
101
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
102 102
 
103
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
104
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
103
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
104
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
105 105
 
106
-        require_once __DIR__ . '/include/submit.inc.php';
106
+            require_once __DIR__ . '/include/submit.inc.php';
107 107
 
108
-        require_once XOOPS_ROOT_PATH . '/footer.php';
108
+            require_once XOOPS_ROOT_PATH . '/footer.php';
109 109
 
110
-        exit();
111
-        break;
110
+            exit();
111
+            break;
112 112
 
113
-    case 'post':
113
+        case 'post':
114 114
 
115
-        global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
115
+            global $xoopsUser, $xoopsConfig, $xoopsModule, $xoopsModuleConfig, $xoopsDB;
116 116
 
117
-        $newFaqObj    = $faqHandler->create();
118
-        $newAnswerObj = $answerHandler->create();
117
+            $newFaqObj    = $faqHandler->create();
118
+            $newAnswerObj = $answerHandler->create();
119 119
 
120
-        if (!$xoopsUser) {
121
-            if ($xoopsModuleConfig['anonpost'] == 1) {
122
-                $uid = 0;
120
+            if (!$xoopsUser) {
121
+                if ($xoopsModuleConfig['anonpost'] == 1) {
122
+                    $uid = 0;
123
+                } else {
124
+                    redirect_header('index.php', 3, _NOPERM);
125
+                }
123 126
             } else {
124
-                redirect_header('index.php', 3, _NOPERM);
127
+                $uid = $xoopsUser->uid();
125 128
             }
126
-        } else {
127
-            $uid = $xoopsUser->uid();
128
-        }
129
-
130
-        $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
131
-
132
-        // Putting the values about the FAQ in the FAQ object
133
-        $newFaqObj->setVar('categoryid', $_POST['categoryid']);
134
-        $newFaqObj->setVar('uid', $uid);
135
-        $newFaqObj->setVar('question', $_POST['question']);
136
-        $newFaqObj->setVar('howdoi', $_POST['howdoi']);
137
-        $newFaqObj->setVar('diduno', $_POST['diduno']);
138
-        $newFaqObj->setVar('notifypub', $notifypub);
139
-        //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
140
-        //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
141 129
 
142
-        // Setting the status of the FAQ
143
-
144
-        // if user is admin, FAQ are automatically published
145
-        $isAdmin = sf_userIsAdmin();
146
-        if ($isAdmin) {
147
-            $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
148
-        } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) {
149
-            $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
150
-        } else {
151
-            $newFaqObj->setVar('status', _SF_STATUS_SUBMITTED);
152
-        }
130
+            $notifypub = isset($_POST['notifypub']) ? $_POST['notifypub'] : 0;
131
+
132
+            // Putting the values about the FAQ in the FAQ object
133
+            $newFaqObj->setVar('categoryid', $_POST['categoryid']);
134
+            $newFaqObj->setVar('uid', $uid);
135
+            $newFaqObj->setVar('question', $_POST['question']);
136
+            $newFaqObj->setVar('howdoi', $_POST['howdoi']);
137
+            $newFaqObj->setVar('diduno', $_POST['diduno']);
138
+            $newFaqObj->setVar('notifypub', $notifypub);
139
+            //$newFaqObj->setVar('modulelink', $_POST['modulelink']);
140
+            //$newFaqObj->setVar('contextpage', $_POST['contextpage']);
141
+
142
+            // Setting the status of the FAQ
143
+
144
+            // if user is admin, FAQ are automatically published
145
+            $isAdmin = sf_userIsAdmin();
146
+            if ($isAdmin) {
147
+                $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
148
+            } elseif ($xoopsModuleConfig['autoapprove_submitted_faq'] == 1) {
149
+                $newFaqObj->setVar('status', _SF_STATUS_PUBLISHED);
150
+            } else {
151
+                $newFaqObj->setVar('status', _SF_STATUS_SUBMITTED);
152
+            }
153 153
 
154
-        // Storing the FAQ object in the database
155
-        if (!$newFaqObj->store()) {
156
-            redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
157
-        }
154
+            // Storing the FAQ object in the database
155
+            if (!$newFaqObj->store()) {
156
+                redirect_header('javascript:history.go(-1)', 2, _MD_SF_SUBMIT_ERROR);
157
+            }
158 158
 
159
-        // Putting the values in the answer object
160
-        $newAnswerObj->setVar('status', _SF_AN_STATUS_APPROVED);
161
-        $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
162
-        $newAnswerObj->setVar('answer', $_POST['answer']);
163
-        $newAnswerObj->setVar('uid', $uid);
164
-
165
-        //====================================================================================
166
-        //TODO post Attachment
167
-        $attachments_tmp = [];
168
-        if (!empty($_POST['attachments_tmp'])) {
169
-            $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
170
-            if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
171
-                foreach ($_POST['delete_tmp'] as $key) {
172
-                    unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
173
-                    unset($attachments_tmp[$key]);
159
+            // Putting the values in the answer object
160
+            $newAnswerObj->setVar('status', _SF_AN_STATUS_APPROVED);
161
+            $newAnswerObj->setVar('faqid', $newFaqObj->faqid());
162
+            $newAnswerObj->setVar('answer', $_POST['answer']);
163
+            $newAnswerObj->setVar('uid', $uid);
164
+
165
+            //====================================================================================
166
+            //TODO post Attachment
167
+            $attachments_tmp = [];
168
+            if (!empty($_POST['attachments_tmp'])) {
169
+                $attachments_tmp = unserialize(base64_decode($_POST['attachments_tmp']));
170
+                if (isset($_POST['delete_tmp']) && count($_POST['delete_tmp'])) {
171
+                    foreach ($_POST['delete_tmp'] as $key) {
172
+                        unlink(XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0]);
173
+                        unset($attachments_tmp[$key]);
174
+                    }
174 175
                 }
175 176
             }
176
-        }
177
-        if (count($attachments_tmp)) {
178
-            foreach ($attachments_tmp as $key => $attach) {
179
-                if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
180
-                    $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
177
+            if (count($attachments_tmp)) {
178
+                foreach ($attachments_tmp as $key => $attach) {
179
+                    if (rename(XOOPS_CACHE_PATH . '/' . $attachments_tmp[$key][0], XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachments_tmp[$key][0])) {
180
+                        $post_obj->setAttachment($attach[0], $attach[1], $attach[2]);
181
+                    }
181 182
                 }
182 183
             }
183
-        }
184
-        $error_upload = '';
184
+            $error_upload = '';
185 185
 
186
-        if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != ''
187
-            && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
188
-            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
189
-            $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
190
-            $uploaddir   = XOOPS_CACHE_PATH;
186
+            if (isset($_FILES['userfile']['name']) && $_FILES['userfile']['name'] != ''
187
+                && $topicHandler->getPermission($forum_obj, $topic_status, 'attach')) {
188
+                require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/class/uploader.php';
189
+                $maxfilesize = $forum_obj->getVar('attach_maxkb') * 1024;
190
+                $uploaddir   = XOOPS_CACHE_PATH;
191 191
 
192
-            $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
192
+                $uploader = new sfUploader($uploaddir, $newAnswerObj->getVar('attach_ext'), (int)$maxfilesize, (int)$xoopsModuleConfig['max_img_width'], (int)$xoopsModuleConfig['max_img_height']);
193 193
 
194
-            if ($_FILES['userfile']['error'] > 0) {
195
-                switch ($_FILES['userfile']['error']) {
194
+                if ($_FILES['userfile']['error'] > 0) {
195
+                    switch ($_FILES['userfile']['error']) {
196 196
                     case 1:
197 197
                         $error_message[] = _MD_NEWBB_MAXUPLOADFILEINI;
198 198
                         break;
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                     default:
203 203
                         $error_message[] = _MD_NEWBB_UPLOAD_ERRNODEF;
204 204
                         break;
205
-                }
205
+                    }
206 206
             } else {
207 207
                 $uploader->setCheckMediaTypeByExt();
208 208
 
@@ -265,30 +265,30 @@  discard block
 block discarded – undo
265 265
         redirect_header('index.php', 2, $redirect_msg);
266 266
         break;
267 267
 
268
-    case 'form':
269
-    default:
268
+        case 'form':
269
+        default:
270 270
 
271
-        global $xoopsUser, $myts;
271
+            global $xoopsUser, $myts;
272 272
 
273
-        $faqObj      = $faqHandler->create();
274
-        $answerObj   = $answerHandler->create();
275
-        $categoryObj = $categoryHandler->create();
273
+            $faqObj      = $faqHandler->create();
274
+            $answerObj   = $answerHandler->create();
275
+            $categoryObj = $categoryHandler->create();
276 276
 
277
-        $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.html';
278
-        require_once XOOPS_ROOT_PATH . '/header.php';
279
-        require_once __DIR__ . '/footer.php';
277
+            $GLOBALS['xoopsOption']['template_main'] = 'smartfaq_submit.html';
278
+            require_once XOOPS_ROOT_PATH . '/header.php';
279
+            require_once __DIR__ . '/footer.php';
280 280
 
281
-        $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
282
-        $notifypub  = 1;
283
-        $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
284
-        $xoopsTpl->assign('whereInSection', $moduleName);
285
-        $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
281
+            $name       = $xoopsUser ? ucwords($xoopsUser->getVar('uname')) : 'Anonymous';
282
+            $notifypub  = 1;
283
+            $moduleName =& $myts->displayTarea($xoopsModule->getVar('name'));
284
+            $xoopsTpl->assign('whereInSection', $moduleName);
285
+            $xoopsTpl->assign('lang_submit', _MD_SF_SUB_SNEWNAME);
286 286
 
287
-        $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
288
-        $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
287
+            $xoopsTpl->assign('lang_intro_title', sprintf(_MD_SF_SUB_SNEWNAME, ucwords($xoopsModule->name())));
288
+            $xoopsTpl->assign('lang_intro_text', _MD_SF_GOODDAY . "<b>$name</b>, " . _MD_SF_SUB_INTRO);
289 289
 
290
-        require_once __DIR__ . '/include/submit.inc.php';
290
+            require_once __DIR__ . '/include/submit.inc.php';
291 291
 
292
-        require_once XOOPS_ROOT_PATH . '/footer.php';
293
-        break;
292
+            require_once XOOPS_ROOT_PATH . '/footer.php';
293
+            break;
294 294
 }
Please login to merge, or discard this patch.