@@ -5,9 +5,9 @@ discard block |
||
5 | 5 | function xoops_module_update_smartfaq($module) |
6 | 6 | { |
7 | 7 | // Load SmartDbUpdater from the SmartObject Framework if present |
8 | - $smartdbupdater = XOOPS_ROOT_PATH . "/modules/smartobject/class/smartdbupdater.php"; |
|
8 | + $smartdbupdater = XOOPS_ROOT_PATH."/modules/smartobject/class/smartdbupdater.php"; |
|
9 | 9 | if (!file_exists($smartdbupdater)) { |
10 | - $smartdbupdater = XOOPS_ROOT_PATH . "/modules/smartfaq/class/smartdbupdater.php"; |
|
10 | + $smartdbupdater = XOOPS_ROOT_PATH."/modules/smartfaq/class/smartdbupdater.php"; |
|
11 | 11 | } |
12 | 12 | include_once($smartdbupdater); |
13 | 13 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | ob_start(); |
17 | 17 | |
18 | - echo "<code>" . _SDU_UPDATE_UPDATING_DATABASE . "<br />"; |
|
18 | + echo "<code>"._SDU_UPDATE_UPDATING_DATABASE."<br />"; |
|
19 | 19 | |
20 | 20 | // Adding partialview field |
21 | 21 | $table = new SmartDbTable('smartfaq_faq'); |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * Check for items with categoryid=0 |
68 | 68 | */ |
69 | - include_once(XOOPS_ROOT_PATH . "/modules/smartfaq/include/functions.php"); |
|
70 | - $smartfaq_faq_handler = $answer_handler =& sf_gethandler('faq'); |
|
71 | - $smartfaq_category_handler = $answer_handler =& sf_gethandler('category'); |
|
69 | + include_once(XOOPS_ROOT_PATH."/modules/smartfaq/include/functions.php"); |
|
70 | + $smartfaq_faq_handler = $answer_handler = & sf_gethandler('faq'); |
|
71 | + $smartfaq_category_handler = $answer_handler = & sf_gethandler('category'); |
|
72 | 72 | |
73 | 73 | //find a valid categoryid |
74 | 74 | $categoriesObj = $smartfaq_category_handler->getCategories(1, 0, 0, 'weight', 'ASC', false); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | { |
97 | 97 | ob_start(); |
98 | 98 | |
99 | - include_once(XOOPS_ROOT_PATH . "/modules/" . $module->getVar('dirname') . "/include/functions.php"); |
|
99 | + include_once(XOOPS_ROOT_PATH."/modules/".$module->getVar('dirname')."/include/functions.php"); |
|
100 | 100 | |
101 | 101 | $feedback = ob_get_clean(); |
102 | 102 | if (method_exists($module, "setMessage")) { |
@@ -38,23 +38,23 @@ discard block |
||
38 | 38 | // ------------------------------------------------------------------------- // |
39 | 39 | // defined("XOOPS_ROOT_PATH") || exit("XOOPS root path not defined"); |
40 | 40 | |
41 | -if ( !is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid()) ) { |
|
41 | +if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
|
42 | 42 | exit("Access Denied"); |
43 | 43 | } |
44 | 44 | include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
45 | 45 | include XOOPS_ROOT_PATH."/modules/system/admin/blocksadmin/blocksadmin.php"; |
46 | 46 | |
47 | 47 | $op = "list"; |
48 | -if ( isset($HTTP_POST_VARS) ) { |
|
48 | +if (isset($HTTP_POST_VARS)) { |
|
49 | 49 | foreach ($HTTP_POST_VARS as $k => $v) { |
50 | 50 | $$k = $v; |
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | -if ( isset($HTTP_GET_VARS['op']) ) { |
|
54 | +if (isset($HTTP_GET_VARS['op'])) { |
|
55 | 55 | if ($HTTP_GET_VARS['op'] == "edit" || $HTTP_GET_VARS['op'] == "delete" || $HTTP_GET_VARS['op'] == "delete_ok" || $HTTP_GET_VARS['op'] == "clone" || $HTTP_GET_VARS['op'] == 'previewpopup') { |
56 | 56 | $op = $HTTP_GET_VARS['op']; |
57 | - $bid = isset($HTTP_GET_VARS['bid'])? intval($HTTP_GET_VARS['bid']) : 0; |
|
57 | + $bid = isset($HTTP_GET_VARS['bid']) ? intval($HTTP_GET_VARS['bid']) : 0; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $myblock = new XoopsBlock(); |
78 | 78 | $myblock->setVar('block_type', 'C'); |
79 | 79 | } |
80 | - $myts =& MyTextSanitizer::getInstance(); |
|
80 | + $myts = & MyTextSanitizer::getInstance(); |
|
81 | 81 | $myblock->setVar('title', $myts->stripSlashesGPC($btitle)); |
82 | 82 | $myblock->setVar('content', $myts->stripSlashesGPC($bcontent)); |
83 | 83 | $dummyhtml = '<html><head><meta http-equiv="content-type" content="text/html; charset='._CHARSET.'" /><meta http-equiv="content-language" content="'._LANGCODE.'" /><title>'.$xoopsConfig['sitename'].'</title><link rel="stylesheet" type="text/css" media="all" href="'.getcss($xoopsConfig['theme_set']).'" /></head><body><table><tr><th>'.$myblock->getVar('title').'</th></tr><tr><td>'.$myblock->getContent('S', $bctype).'</td></tr></table></body></html>'; |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | $block['visible'] = $bvisible; |
95 | 95 | $block['title'] = $myblock->getVar('title', 'E'); |
96 | 96 | $block['content'] = $myblock->getVar('content', 'E'); |
97 | - $block['modules'] =& $bmodule; |
|
98 | - $block['ctype'] = isset($bctype)? $bctype : $myblock->getVar('c_type'); |
|
97 | + $block['modules'] = & $bmodule; |
|
98 | + $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); |
|
99 | 99 | $block['is_custom'] = true; |
100 | 100 | $block['cachetime'] = intval($bcachetime); |
101 | - echo '<a href="admin.php?fct=blocksadmin">'. _AM_BADMIN .'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />'; |
|
101 | + echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />'; |
|
102 | 102 | include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; |
103 | 103 | $form->display(); |
104 | 104 | xoops_cp_footer(); |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | if ($op == "order") { |
130 | 130 | foreach (array_keys($bid) as $i) { |
131 | 131 | if ($side[$i] < 0) { |
132 | - $visible[$i] = 0 ; |
|
133 | - $side[$i] = -1 ; |
|
132 | + $visible[$i] = 0; |
|
133 | + $side[$i] = -1; |
|
134 | 134 | } else { |
135 | - $visible[$i] = 1 ; |
|
135 | + $visible[$i] = 1; |
|
136 | 136 | } |
137 | 137 | |
138 | - $bmodule[$i] = (isset($bmodule[$i]) && is_array($bmodule[$i]))? $bmodule[$i] : array(-1) ; |
|
138 | + $bmodule[$i] = (isset($bmodule[$i]) && is_array($bmodule[$i])) ? $bmodule[$i] : array(-1); |
|
139 | 139 | |
140 | 140 | myblocksadmin_update_block($i, $side[$i], $weight[$i], $visible[$i], $title[$i], '', '', $bcachetime[$i], $bmodule[$i], array()); |
141 | 141 | |
142 | 142 | } |
143 | 143 | |
144 | - redirect_header("myblocksadmin.php",1,_AM_DBUPDATED); |
|
144 | + redirect_header("myblocksadmin.php", 1, _AM_DBUPDATED); |
|
145 | 145 | exit(); |
146 | 146 | } |
147 | 147 | |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | if ($op == "update") { |
154 | - $bcachetime = isset($bcachetime)? intval($bcachetime) : 0; |
|
155 | - $options = isset($options)? $options : array(); |
|
156 | - $bcontent = isset($bcontent)? $bcontent : ''; |
|
157 | - $bctype = isset($bctype)? $bctype : ''; |
|
158 | - $bmodule = (isset($bmodule) && is_array($bmodule))? $bmodule : array(-1) ; // GIJ + |
|
154 | + $bcachetime = isset($bcachetime) ? intval($bcachetime) : 0; |
|
155 | + $options = isset($options) ? $options : array(); |
|
156 | + $bcontent = isset($bcontent) ? $bcontent : ''; |
|
157 | + $bctype = isset($bctype) ? $bctype : ''; |
|
158 | + $bmodule = (isset($bmodule) && is_array($bmodule)) ? $bmodule : array(-1); // GIJ + |
|
159 | 159 | $msg = myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options); // GIJ c |
160 | - redirect_header('myblocksadmin.php',1,$msg); // GIJ + |
|
160 | + redirect_header('myblocksadmin.php', 1, $msg); // GIJ + |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | if ($op == "delete_ok") { |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | // import from modules/system/admin/blocksadmin/blocksadmin.php |
183 | - function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options=array()) |
|
183 | + function myblocksadmin_update_block($bid, $bside, $bweight, $bvisible, $btitle, $bcontent, $bctype, $bcachetime, $bmodule, $options = array()) |
|
184 | 184 | { |
185 | 185 | global $xoopsConfig; |
186 | 186 | if (empty($bmodule)) { |
@@ -191,13 +191,13 @@ discard block |
||
191 | 191 | } |
192 | 192 | $myblock = new XoopsBlock($bid); |
193 | 193 | // $myblock->setVar('side', $bside); GIJ - |
194 | - if ( $bside >= 0 ) $myblock->setVar('side', $bside); // GIJ + |
|
194 | + if ($bside >= 0) $myblock->setVar('side', $bside); // GIJ + |
|
195 | 195 | $myblock->setVar('weight', $bweight); |
196 | 196 | $myblock->setVar('visible', $bvisible); |
197 | 197 | $myblock->setVar('title', $btitle); |
198 | 198 | $myblock->setVar('content', $bcontent); |
199 | 199 | $myblock->setVar('bcachetime', $bcachetime); |
200 | - if ( isset($options) && (count($options) > 0) ) { |
|
200 | + if (isset($options) && (count($options) > 0)) { |
|
201 | 201 | $options = implode('|', $options); |
202 | 202 | $myblock->setVar('options', $options); |
203 | 203 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } |
224 | 224 | $msg = _AM_DBUPDATED; |
225 | 225 | if ($myblock->store() != false) { |
226 | - $db =& XoopsDatabaseFactory::getDatabaseConnection(); |
|
226 | + $db = & XoopsDatabaseFactory::getDatabaseConnection(); |
|
227 | 227 | $sql = sprintf("DELETE FROM %s WHERE block_id = %u", $db->prefix('block_module_link'), $bid); |
228 | 228 | $db->query($sql); |
229 | 229 | foreach ($bmodule as $bmid) { |
@@ -250,5 +250,5 @@ discard block |
||
250 | 250 | $msg = 'Failed update of block. ID:'.$bid; |
251 | 251 | } |
252 | 252 | |
253 | - return $msg ; // GIJ + |
|
253 | + return $msg; // GIJ + |
|
254 | 254 | } |
@@ -32,22 +32,22 @@ |
||
32 | 32 | |
33 | 33 | if ($category == 'category') { |
34 | 34 | // Assume we have a valid category id |
35 | - $sql = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid = ' . $item_id; |
|
35 | + $sql = 'SELECT name FROM '.$xoopsDB->prefix('smartfaq_categories').' WHERE categoryid = '.$item_id; |
|
36 | 36 | $result = $xoopsDB->query($sql); // TODO: error check |
37 | 37 | $result_array = $xoopsDB->fetchArray($result); |
38 | 38 | $item['name'] = $result_array['name']; |
39 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id; |
|
39 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/category.php?categoryid='.$item_id; |
|
40 | 40 | |
41 | 41 | return $item; |
42 | 42 | } |
43 | 43 | |
44 | 44 | if ($category == 'faq') { |
45 | 45 | // Assume we have a valid story id |
46 | - $sql = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id; |
|
46 | + $sql = 'SELECT question FROM '.$xoopsDB->prefix('smartfaq_faq').' WHERE faqid = '.$item_id; |
|
47 | 47 | $result = $xoopsDB->query($sql); // TODO: error check |
48 | 48 | $result_array = $xoopsDB->fetchArray($result); |
49 | 49 | $item['name'] = $result_array['question']; |
50 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id; |
|
50 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/faq.php?faqid='.$item_id; |
|
51 | 51 | |
52 | 52 | return $item; |
53 | 53 | } |
@@ -10,9 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | global $_POST, $xoopsDB; |
12 | 12 | |
13 | -include_once XOOPS_ROOT_PATH . "/class/xoopstree.php"; |
|
14 | -include_once XOOPS_ROOT_PATH . "/class/xoopslists.php"; |
|
15 | -include_once XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; |
|
13 | +include_once XOOPS_ROOT_PATH."/class/xoopstree.php"; |
|
14 | +include_once XOOPS_ROOT_PATH."/class/xoopslists.php"; |
|
15 | +include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php"; |
|
16 | 16 | |
17 | 17 | include_once 'functions.php'; |
18 | 18 | |
@@ -71,18 +71,18 @@ discard block |
||
71 | 71 | // $upload_tray->addElement(new XoopsFormFile('', 'userfile', ($forum_obj->getVar('attach_maxkb') * 1024))); |
72 | 72 | $upload_tray->addElement(new XoopsFormFile('', 'userfile', ($xoopsModuleConfig['max_image_size'] * 1024))); |
73 | 73 | $upload_tray->addElement(new XoopsFormButton('', 'contents_upload', _MD_SF_UPLOAD, "submit")); |
74 | - $upload_tray->addElement(new XoopsFormLabel("<br /><br />" . _MD_SF_MAX_FILESIZE . ":", $xoopsModuleConfig['max_image_size'] . "Kb; ")); |
|
75 | - $extensions = trim(str_replace('|',' ',$xoopsModuleConfig['attach_ext'])); |
|
74 | + $upload_tray->addElement(new XoopsFormLabel("<br /><br />"._MD_SF_MAX_FILESIZE.":", $xoopsModuleConfig['max_image_size']."Kb; ")); |
|
75 | + $extensions = trim(str_replace('|', ' ', $xoopsModuleConfig['attach_ext'])); |
|
76 | 76 | $extensions = (empty($extensions) || $extensions == "*") ? _ALL : $extensions; |
77 | - $upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS . ":", $extensions)); |
|
78 | - $upload_tray->addElement(new XoopsFormLabel("<br />".sprintf(_MD_SF_MAXPIC,$xoopsModuleConfig['max_img_height'],$xoopsModuleConfig['max_img_width']))); |
|
77 | + $upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS.":", $extensions)); |
|
78 | + $upload_tray->addElement(new XoopsFormLabel("<br />".sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width']))); |
|
79 | 79 | $form->addElement($upload_tray); |
80 | 80 | //} |
81 | 81 | |
82 | 82 | if (!empty($attachments) && is_array($attachments) && count($attachments)) { |
83 | 83 | $delete_attach_checkbox = new XoopsFormCheckBox(_MD_SF_ATTACHED_FILES, 'delete_attach[]'); |
84 | 84 | foreach ($attachments as $key => $attachment) { |
85 | - $attach = " " . _DELETE . ' <a href=' . XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['name_display'] . '</a><br />'; |
|
85 | + $attach = " "._DELETE.' <a href='.XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['name_display'].'</a><br />'; |
|
86 | 86 | $delete_attach_checkbox->addOption($key, $attach); |
87 | 87 | } |
88 | 88 | $form->addElement($delete_attach_checkbox); |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | $delete_attach_checkbox = new XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]'); |
94 | 94 | $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
95 | 95 | foreach ($attachments_tmp as $key => $attachment) { |
96 | - $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br />'; |
|
96 | + $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br />'; |
|
97 | 97 | $delete_attach_checkbox->addOption($key, $attach); |
98 | 98 | } |
99 | 99 | $form->addElement($delete_attach_checkbox); |
100 | 100 | unset($delete_attach_checkbox); |
101 | - $attachments_tmp = base64_encode(serialize($attachments_tmp)); |
|
101 | + $attachments_tmp = base64_encode(serialize($attachments_tmp)); |
|
102 | 102 | $form->addElement(new XoopsFormHidden('attachments_tmp', $attachments_tmp)); |
103 | 103 | |
104 | 104 | } |
@@ -14,13 +14,13 @@ |
||
14 | 14 | |
15 | 15 | $ret = array(); |
16 | 16 | |
17 | - $faq_handler =& sf_gethandler('faq'); |
|
17 | + $faq_handler = & sf_gethandler('faq'); |
|
18 | 18 | |
19 | - $faqsObj =& $faq_handler->getFaqsFromSearch($queryarray, $andor, $limit, $offset, $userid); |
|
19 | + $faqsObj = & $faq_handler->getFaqsFromSearch($queryarray, $andor, $limit, $offset, $userid); |
|
20 | 20 | |
21 | 21 | for ($i = 0; $i < count($faqsObj); ++$i) { |
22 | 22 | $ret[$i]['image'] = "assets/images/smartfaq.gif"; |
23 | - $ret[$i]['link'] = "faq.php?faqid=" . $faqsObj[$i]->faqid(); |
|
23 | + $ret[$i]['link'] = "faq.php?faqid=".$faqsObj[$i]->faqid(); |
|
24 | 24 | $ret[$i]['title'] = $faqsObj[$i]->question(50); |
25 | 25 | $ret[$i]['time'] = $faqsObj[$i]->getVar('datesub'); |
26 | 26 | $ret[$i]['uid'] = $faqsObj[$i]->uid(); |
@@ -47,25 +47,25 @@ discard block |
||
47 | 47 | $image_url = $img_url.'/'.$source; |
48 | 48 | |
49 | 49 | $imginfo = @getimagesize($image); |
50 | - $img_info = ( count($imginfo)>0 ) ? $imginfo[0]."X".$imginfo[1].' px':""; |
|
50 | + $img_info = (count($imginfo) > 0) ? $imginfo[0]."X".$imginfo[1].' px' : ""; |
|
51 | 51 | |
52 | 52 | if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) { |
53 | 53 | if ($imginfo[0] > $xoopsModuleConfig['max_image_width'] || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
54 | 54 | //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) { |
55 | - if (!file_exists($thumb_path.'/'.$source) ) { |
|
55 | + if (!file_exists($thumb_path.'/'.$source)) { |
|
56 | 56 | sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']); |
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($imginfo[0] > $xoopsModuleConfig['max_image_width'] || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
61 | 61 | $pseudo_width = $xoopsModuleConfig['max_image_width']; |
62 | - $pseudo_height = $xoopsModuleConfig['max_image_width']*($imginfo[1]/$imginfo[0]); |
|
62 | + $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]); |
|
63 | 63 | $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
64 | 64 | } |
65 | 65 | // irmtfan to fix Undefined variable: pseudo_height |
66 | 66 | if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0 && $pseudo_height > $xoopsModuleConfig['max_image_height']) { |
67 | 67 | $pseudo_height = $xoopsModuleConfig['max_image_height']; |
68 | - $pseudo_width = $xoopsModuleConfig['max_image_height'] * ($imginfo[0]/$imginfo[1]); |
|
68 | + $pseudo_width = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]); |
|
69 | 69 | $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
70 | 70 | } |
71 | 71 | } |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | return false; |
113 | 113 | } |
114 | 114 | |
115 | - $newWidth = (int) (min($imginfo[0],$thumb_width)); |
|
115 | + $newWidth = (int) (min($imginfo[0], $thumb_width)); |
|
116 | 116 | $newHeight = (int) ($imginfo[1] * $newWidth / $imginfo[0]); |
117 | 117 | |
118 | 118 | if ($xoopsModuleConfig['image_lib'] == 1 or $xoopsModuleConfig['image_lib'] == 0) { |
119 | - if (preg_match("#[A-Z]:|\\\\#Ai",__FILE__)) { |
|
119 | + if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { |
|
120 | 120 | $cur_dir = __DIR__; |
121 | 121 | $src_file_im = '"'.$cur_dir.'\\'.strtr($src_file, '/', '\\').'"'; |
122 | 122 | $new_file_im = '"'.$cur_dir.'\\'.strtr($new_file, '/', '\\').'"'; |
123 | 123 | } else { |
124 | - $src_file_im = @escapeshellarg($src_file); |
|
125 | - $new_file_im = @escapeshellarg($new_file); |
|
124 | + $src_file_im = @escapeshellarg($src_file); |
|
125 | + $new_file_im = @escapeshellarg($new_file); |
|
126 | 126 | } |
127 | - $path = empty($xoopsModuleConfig['path_magick'])?"":$xoopsModuleConfig['path_magick']."/"; |
|
128 | - $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . ''; |
|
127 | + $path = empty($xoopsModuleConfig['path_magick']) ? "" : $xoopsModuleConfig['path_magick']."/"; |
|
128 | + $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).''; |
|
129 | 129 | |
130 | 130 | @passthru($magick_command); |
131 | 131 | if (file_exists($new_file)) { |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | } |
135 | 135 | |
136 | 136 | if ($xoopsModuleConfig['image_lib'] == 2 or $xoopsModuleConfig['image_lib'] == 0) { |
137 | - $path = empty($xoopsModuleConfig['path_netpbm'])?"":$xoopsModuleConfig['path_netpbm']."/"; |
|
137 | + $path = empty($xoopsModuleConfig['path_netpbm']) ? "" : $xoopsModuleConfig['path_netpbm']."/"; |
|
138 | 138 | if (eregi("\.png", $source)) { |
139 | - $cmd = $path . "pngtopnm $src_file | ".$path . "pnmscale -xysize $newWidth $newHeight | ".$path . "pnmtopng > $new_file" ; |
|
139 | + $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file"; |
|
140 | 140 | } elseif (eregi("\.(jpg|jpeg)", $source)) { |
141 | - $cmd = $path . "jpegtopnm $src_file | ".$path . "pnmscale -xysize $newWidth $newHeight | ".$path . "ppmtojpeg -quality=90 > $new_file" ; |
|
141 | + $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file"; |
|
142 | 142 | } elseif (eregi("\.gif", $source)) { |
143 | - $cmd = $path . "giftopnm $src_file | ".$path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path . "ppmtogif > $new_file" ; |
|
143 | + $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file"; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | @exec($cmd, $output, $retval); |
@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | if (function_exists('imagejpeg'))$supported_types[] = 2; |
158 | 158 | if (function_exists('imagepng')) $supported_types[] = 3; |
159 | 159 | |
160 | - $imageCreateFunction = (function_exists('imagecreatetruecolor'))? "imagecreatetruecolor" : "imagecreate"; |
|
160 | + $imageCreateFunction = (function_exists('imagecreatetruecolor')) ? "imagecreatetruecolor" : "imagecreate"; |
|
161 | 161 | |
162 | - if (in_array($type, $supported_types) ) { |
|
162 | + if (in_array($type, $supported_types)) { |
|
163 | 163 | switch ($type) { |
164 | 164 | case 1 : |
165 | 165 | if (!function_exists('imagecreatefromgif')) return false; |
166 | - $im = imagecreatefromgif ($src_file); |
|
166 | + $im = imagecreatefromgif($src_file); |
|
167 | 167 | $new_im = imagecreate($newWidth, $newHeight); |
168 | 168 | imagecopyresized($new_im, $im, 0, 0, 0, 0, $newWidth, $newHeight, $imginfo[0], $imginfo[1]); |
169 | - imagegif ($new_im, $new_file); |
|
169 | + imagegif($new_im, $new_file); |
|
170 | 170 | imagedestroy($im); |
171 | 171 | imagedestroy($new_im); |
172 | 172 | break; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | function smartfaq_com_update($faq_id, $total_num) |
11 | 11 | { |
12 | 12 | $db = &XoopsDatabaseFactory::getDatabaseConnection(); |
13 | - $sql = 'UPDATE ' . $db->prefix('smartfaq_faq') . ' SET comments = ' . $total_num . ' WHERE faqid = ' . $faq_id; |
|
13 | + $sql = 'UPDATE '.$db->prefix('smartfaq_faq').' SET comments = '.$total_num.' WHERE faqid = '.$faq_id; |
|
14 | 14 | $db->query($sql); |
15 | 15 | } |
16 | 16 |
@@ -7,9 +7,9 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
11 | 11 | |
12 | -include_once XOOPS_ROOT_PATH . "/modules/smartfaq/include/functions.php"; |
|
12 | +include_once XOOPS_ROOT_PATH."/modules/smartfaq/include/functions.php"; |
|
13 | 13 | include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
14 | 14 | include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php'; |
15 | 15 | include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php'; |
@@ -7,5 +7,5 @@ |
||
7 | 7 | * Licence: GNU |
8 | 8 | */ |
9 | 9 | |
10 | -include dirname(dirname(__DIR__)) . '/mainfile.php'; |
|
11 | -include_once XOOPS_ROOT_PATH . '/include/comment_reply.php'; |
|
10 | +include dirname(dirname(__DIR__)).'/mainfile.php'; |
|
11 | +include_once XOOPS_ROOT_PATH.'/include/comment_reply.php'; |