@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | function smartfaq_search($queryarray, $andor, $limit, $offset, $userid) |
17 | 17 | { |
18 | - include_once XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php'; |
|
18 | + include_once XOOPS_ROOT_PATH.'/modules/smartfaq/include/functions.php'; |
|
19 | 19 | |
20 | 20 | $ret = array(); |
21 | 21 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | for ($i = 0, $iMax = count($faqsObj); $i < $iMax; ++$i) { |
27 | 27 | $ret[$i]['image'] = 'assets/images/smartfaq.gif'; |
28 | - $ret[$i]['link'] = 'faq.php?faqid=' . $faqsObj[$i]->faqid(); |
|
28 | + $ret[$i]['link'] = 'faq.php?faqid='.$faqsObj[$i]->faqid(); |
|
29 | 29 | $ret[$i]['title'] = $faqsObj[$i]->question(50); |
30 | 30 | $ret[$i]['time'] = $faqsObj[$i]->getVar('datesub'); |
31 | 31 | $ret[$i]['uid'] = $faqsObj[$i]->uid(); |
@@ -6,8 +6,8 @@ discard block |
||
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 |
||
21 | 21 | $searchcat = new XoopsFormSelect(_MD_WB_CATEGORY, 'categoryID', $categoryID); |
22 | 22 | $searchcat->addOption('0', _MD_WB_ALLOFTHEM); |
23 | 23 | |
24 | - $resultcat = $xoopsDB->query('SELECT categoryID, name FROM ' . $xoopsDB->prefix('wbcategories') . ' ORDER BY categoryID'); |
|
24 | + $resultcat = $xoopsDB->query('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"); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
13 | 13 | |
14 | -defined('NEWBB_FUNCTIONS_INI') || include __DIR__ . '/functions.ini.php'; |
|
14 | +defined('NEWBB_FUNCTIONS_INI') || include __DIR__.'/functions.ini.php'; |
|
15 | 15 | define('NEWBB_FUNCTIONS_RENDER_LOADED', true); |
16 | 16 | |
17 | 17 | if (!defined('NEWBB_FUNCTIONS_RENDER')): |
@@ -56,16 +56,16 @@ discard block |
||
56 | 56 | // decode xcode |
57 | 57 | if ($image != 0) { |
58 | 58 | // image allowed |
59 | - $text =& $myts->xoopsCodeDecode($text); |
|
59 | + $text = & $myts->xoopsCodeDecode($text); |
|
60 | 60 | } else { |
61 | 61 | // image not allowed |
62 | - $text =& $myts->xoopsCodeDecode($text, 0); |
|
62 | + $text = & $myts->xoopsCodeDecode($text, 0); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | if ($br != 0) { |
66 | - $text =& $myts->nl2Br($text); |
|
66 | + $text = & $myts->nl2Br($text); |
|
67 | 67 | } |
68 | - $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
68 | + $text = $myts->codeConv($text, $xcode, $image); // Ryuji_edit(2003-11-18) |
|
69 | 69 | |
70 | 70 | return $text; |
71 | 71 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}' />"; |
97 | 97 | if (empty($asImage)) { |
98 | - $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>'; |
|
98 | + $button = "<a href='{$link}' title='{$alt}' {$extra}>".sf_displayImage($button, $alt, true).'</a>'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | return $button; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | if (!class_exists('NewbbIconHandler')) { |
150 | - require_once dirname(__DIR__) . '/class/icon.php'; |
|
150 | + require_once dirname(__DIR__).'/class/icon.php'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | $iconHandler = NewbbIconHandler::instance(); |
@@ -34,22 +34,22 @@ |
||
34 | 34 | |
35 | 35 | if ($category === 'category') { |
36 | 36 | // Assume we have a valid category id |
37 | - $sql = 'SELECT name FROM ' . $xoopsDB->prefix('smartfaq_categories') . ' WHERE categoryid = ' . $item_id; |
|
37 | + $sql = 'SELECT name FROM '.$xoopsDB->prefix('smartfaq_categories').' WHERE categoryid = '.$item_id; |
|
38 | 38 | $result = $xoopsDB->query($sql); // TODO: error check |
39 | 39 | $result_array = $xoopsDB->fetchArray($result); |
40 | 40 | $item['name'] = $result_array['name']; |
41 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/category.php?categoryid=' . $item_id; |
|
41 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/category.php?categoryid='.$item_id; |
|
42 | 42 | |
43 | 43 | return $item; |
44 | 44 | } |
45 | 45 | |
46 | 46 | if ($category === 'faq') { |
47 | 47 | // Assume we have a valid story id |
48 | - $sql = 'SELECT question FROM ' . $xoopsDB->prefix('smartfaq_faq') . ' WHERE faqid = ' . $item_id; |
|
48 | + $sql = 'SELECT question FROM '.$xoopsDB->prefix('smartfaq_faq').' WHERE faqid = '.$item_id; |
|
49 | 49 | $result = $xoopsDB->query($sql); // TODO: error check |
50 | 50 | $result_array = $xoopsDB->fetchArray($result); |
51 | 51 | $item['name'] = $result_array['question']; |
52 | - $item['url'] = XOOPS_URL . '/modules/' . $module->getVar('dirname') . '/faq.php?faqid=' . $item_id; |
|
52 | + $item['url'] = XOOPS_URL.'/modules/'.$module->getVar('dirname').'/faq.php?faqid='.$item_id; |
|
53 | 53 | |
54 | 54 | return $item; |
55 | 55 | } |
@@ -40,23 +40,23 @@ discard block |
||
40 | 40 | { |
41 | 41 | global $xoopsModuleConfig; |
42 | 42 | |
43 | - $img_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments']; |
|
44 | - $img_url = XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments']; |
|
45 | - $thumb_path = $img_path . '/thumbs'; |
|
46 | - $thumb_url = $img_url . '/thumbs'; |
|
43 | + $img_path = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments']; |
|
44 | + $img_url = XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments']; |
|
45 | + $thumb_path = $img_path.'/thumbs'; |
|
46 | + $thumb_url = $img_url.'/thumbs'; |
|
47 | 47 | |
48 | - $thumb = $thumb_path . '/' . $source; |
|
49 | - $image = $img_path . '/' . $source; |
|
50 | - $thumb_url = $thumb_url . '/' . $source; |
|
51 | - $image_url = $img_url . '/' . $source; |
|
48 | + $thumb = $thumb_path.'/'.$source; |
|
49 | + $image = $img_path.'/'.$source; |
|
50 | + $thumb_url = $thumb_url.'/'.$source; |
|
51 | + $image_url = $img_url.'/'.$source; |
|
52 | 52 | |
53 | 53 | $imginfo = @getimagesize($image); |
54 | - $img_info = (count($imginfo) > 0) ? $imginfo[0] . 'X' . $imginfo[1] . ' px' : ''; |
|
54 | + $img_info = (count($imginfo) > 0) ? $imginfo[0].'X'.$imginfo[1].' px' : ''; |
|
55 | 55 | |
56 | 56 | if ($xoopsModuleConfig['max_image_width'] > 0 && $xoopsModuleConfig['max_image_height'] > 0) { |
57 | 57 | if ($imginfo[0] > $xoopsModuleConfig['max_image_width'] || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
58 | 58 | //if (!file_exists($thumb_path.'/'.$source) && $imginfo[0] > $xoopsModuleConfig['max_img_width']) { |
59 | - if (!file_exists($thumb_path . '/' . $source)) { |
|
59 | + if (!file_exists($thumb_path.'/'.$source)) { |
|
60 | 60 | sf_createThumbnail($source, $xoopsModuleConfig['max_image_width']); |
61 | 61 | } |
62 | 62 | } |
@@ -64,26 +64,26 @@ discard block |
||
64 | 64 | if ($imginfo[0] > $xoopsModuleConfig['max_image_width'] || $imginfo[1] > $xoopsModuleConfig['max_image_height']) { |
65 | 65 | $pseudo_width = $xoopsModuleConfig['max_image_width']; |
66 | 66 | $pseudo_height = $xoopsModuleConfig['max_image_width'] * ($imginfo[1] / $imginfo[0]); |
67 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
67 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
68 | 68 | } |
69 | 69 | // irmtfan to fix Undefined variable: pseudo_height |
70 | 70 | if (!empty($pseudo_height) && $xoopsModuleConfig['max_image_height'] > 0 && $pseudo_height > $xoopsModuleConfig['max_image_height']) { |
71 | 71 | $pseudo_height = $xoopsModuleConfig['max_image_height']; |
72 | 72 | $pseudo_width = $xoopsModuleConfig['max_image_height'] * ($imginfo[0] / $imginfo[1]); |
73 | - $pseudo_size = "width='" . $pseudo_width . "px' height='" . $pseudo_height . "px'"; |
|
73 | + $pseudo_size = "width='".$pseudo_width."px' height='".$pseudo_height."px'"; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | 77 | if (file_exists($thumb)) { |
78 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
79 | - $attachmentImage .= '<img src="' . $thumb_url . '" alt="' . $source . ' ' . $img_info . '" />'; |
|
78 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
79 | + $attachmentImage .= '<img src="'.$thumb_url.'" alt="'.$source.' '.$img_info.'" />'; |
|
80 | 80 | $attachmentImage .= '</a>'; |
81 | 81 | } elseif (!empty($pseudo_size)) { |
82 | - $attachmentImage = '<a href="' . $image_url . '" title="' . $source . ' ' . $img_info . '" target="_blank">'; |
|
83 | - $attachmentImage .= '<img src="' . $image_url . '" ' . $pseudo_size . ' alt="' . $source . ' ' . $img_info . '" />'; |
|
82 | + $attachmentImage = '<a href="'.$image_url.'" title="'.$source.' '.$img_info.'" target="_blank">'; |
|
83 | + $attachmentImage .= '<img src="'.$image_url.'" '.$pseudo_size.' alt="'.$source.' '.$img_info.'" />'; |
|
84 | 84 | $attachmentImage .= '</a>'; |
85 | 85 | } elseif (file_exists($image)) { |
86 | - $attachmentImage = '<img src="' . $image_url . '" alt="' . $source . ' ' . $img_info . '" />'; |
|
86 | + $attachmentImage = '<img src="'.$image_url.'" alt="'.$source.' '.$img_info.'" />'; |
|
87 | 87 | } else { |
88 | 88 | $attachmentImage = ''; |
89 | 89 | } |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | { |
101 | 101 | global $xoopsModuleConfig; |
102 | 102 | |
103 | - $img_path = XOOPS_ROOT_PATH . '/' . $xoopsModuleConfig['dir_attachments']; |
|
104 | - $thumb_path = $img_path . '/thumbs'; |
|
105 | - $src_file = $img_path . '/' . $source; |
|
106 | - $new_file = $thumb_path . '/' . $source; |
|
103 | + $img_path = XOOPS_ROOT_PATH.'/'.$xoopsModuleConfig['dir_attachments']; |
|
104 | + $thumb_path = $img_path.'/thumbs'; |
|
105 | + $src_file = $img_path.'/'.$source; |
|
106 | + $new_file = $thumb_path.'/'.$source; |
|
107 | 107 | //$imageLibs = sf_getImageLibs(); |
108 | 108 | |
109 | 109 | if (!filesize($src_file) || !is_readable($src_file)) { |
@@ -123,20 +123,20 @@ discard block |
||
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
126 | - $newWidth = (int)min($imginfo[0], $thumb_width); |
|
127 | - $newHeight = (int)($imginfo[1] * $newWidth / $imginfo[0]); |
|
126 | + $newWidth = (int) min($imginfo[0], $thumb_width); |
|
127 | + $newHeight = (int) ($imginfo[1] * $newWidth / $imginfo[0]); |
|
128 | 128 | |
129 | 129 | if ($xoopsModuleConfig['image_lib'] == 1 or $xoopsModuleConfig['image_lib'] == 0) { |
130 | 130 | if (preg_match("#[A-Z]:|\\\\#Ai", __FILE__)) { |
131 | 131 | $cur_dir = __DIR__; |
132 | - $src_file_im = '"' . $cur_dir . '\\' . strtr($src_file, '/', '\\') . '"'; |
|
133 | - $new_file_im = '"' . $cur_dir . '\\' . strtr($new_file, '/', '\\') . '"'; |
|
132 | + $src_file_im = '"'.$cur_dir.'\\'.strtr($src_file, '/', '\\').'"'; |
|
133 | + $new_file_im = '"'.$cur_dir.'\\'.strtr($new_file, '/', '\\').'"'; |
|
134 | 134 | } else { |
135 | 135 | $src_file_im = @escapeshellarg($src_file); |
136 | 136 | $new_file_im = @escapeshellarg($new_file); |
137 | 137 | } |
138 | - $path = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'] . '/'; |
|
139 | - $magick_command = $path . 'convert -quality 85 -antialias -sample ' . $newWidth . 'x' . $newHeight . ' ' . $src_file_im . ' +profile "*" ' . str_replace('\\', '/', $new_file_im) . ''; |
|
138 | + $path = empty($xoopsModuleConfig['path_magick']) ? '' : $xoopsModuleConfig['path_magick'].'/'; |
|
139 | + $magick_command = $path.'convert -quality 85 -antialias -sample '.$newWidth.'x'.$newHeight.' '.$src_file_im.' +profile "*" '.str_replace('\\', '/', $new_file_im).''; |
|
140 | 140 | |
141 | 141 | @passthru($magick_command); |
142 | 142 | if (file_exists($new_file)) { |
@@ -145,13 +145,13 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | if ($xoopsModuleConfig['image_lib'] == 2 or $xoopsModuleConfig['image_lib'] == 0) { |
148 | - $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'] . '/'; |
|
148 | + $path = empty($xoopsModuleConfig['path_netpbm']) ? '' : $xoopsModuleConfig['path_netpbm'].'/'; |
|
149 | 149 | if (preg_match("/\.png/i", $source)) { |
150 | - $cmd = $path . "pngtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "pnmtopng > $new_file"; |
|
150 | + $cmd = $path."pngtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."pnmtopng > $new_file"; |
|
151 | 151 | } elseif (preg_match("/\.(jpg|jpeg)/i", $source)) { |
152 | - $cmd = $path . "jpegtopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | " . $path . "ppmtojpeg -quality=90 > $new_file"; |
|
152 | + $cmd = $path."jpegtopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ".$path."ppmtojpeg -quality=90 > $new_file"; |
|
153 | 153 | } elseif (preg_match("/\.gif/i", $source)) { |
154 | - $cmd = $path . "giftopnm $src_file | " . $path . "pnmscale -xysize $newWidth $newHeight | ppmquant 256 | " . $path . "ppmtogif > $new_file"; |
|
154 | + $cmd = $path."giftopnm $src_file | ".$path."pnmscale -xysize $newWidth $newHeight | ppmquant 256 | ".$path."ppmtogif > $new_file"; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | @exec($cmd, $output, $retval); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | if (!is_object($xoopsUser) || !is_object($xoopsModule) || !$xoopsUser->isAdmin($xoopsModule->mid())) { |
41 | 41 | exit('Access Denied'); |
42 | 42 | } |
43 | -include_once XOOPS_ROOT_PATH . '/class/xoopsblock.php'; |
|
44 | -include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
43 | +include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php'; |
|
44 | +include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blocksadmin.php'; |
|
45 | 45 | |
46 | 46 | $op = 'list'; |
47 | 47 | if (isset($HTTP_POST_VARS)) { |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | if (isset($HTTP_GET_VARS['op'])) { |
54 | 54 | 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') { |
55 | 55 | $op = $HTTP_GET_VARS['op']; |
56 | - $bid = isset($HTTP_GET_VARS['bid']) ? (int)$HTTP_GET_VARS['bid'] : 0; |
|
56 | + $bid = isset($HTTP_GET_VARS['bid']) ? (int) $HTTP_GET_VARS['bid'] : 0; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | if (isset($previewblock)) { |
61 | 61 | xoops_cp_header(); |
62 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
62 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
63 | 63 | $xoopsTpl = new XoopsTpl(); |
64 | 64 | $xoopsTpl->xoops_setCaching(0); |
65 | 65 | if (isset($bid)) { |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | $myts = MyTextSanitizer::getInstance(); |
80 | 80 | $myblock->setVar('title', $myts->stripSlashesGPC($btitle)); |
81 | 81 | $myblock->setVar('content', $myts->stripSlashesGPC($bcontent)); |
82 | - $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>'; |
|
82 | + $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>'; |
|
83 | 83 | |
84 | - $dummyfile = '_dummyfile_' . time() . '.html'; |
|
85 | - $fp = fopen(XOOPS_CACHE_PATH . '/' . $dummyfile, 'w'); |
|
84 | + $dummyfile = '_dummyfile_'.time().'.html'; |
|
85 | + $fp = fopen(XOOPS_CACHE_PATH.'/'.$dummyfile, 'w'); |
|
86 | 86 | fwrite($fp, $dummyhtml); |
87 | 87 | fclose($fp); |
88 | 88 | $block['edit_form'] = false; |
@@ -93,24 +93,24 @@ discard block |
||
93 | 93 | $block['visible'] = $bvisible; |
94 | 94 | $block['title'] = $myblock->getVar('title', 'E'); |
95 | 95 | $block['content'] = $myblock->getVar('content', 'E'); |
96 | - $block['modules'] =& $bmodule; |
|
96 | + $block['modules'] = & $bmodule; |
|
97 | 97 | $block['ctype'] = isset($bctype) ? $bctype : $myblock->getVar('c_type'); |
98 | 98 | $block['is_custom'] = true; |
99 | - $block['cachetime'] = (int)$bcachetime; |
|
100 | - echo '<a href="admin.php?fct=blocksadmin">' . _AM_BADMIN . '</a> <span style="font-weight:bold;">»»</span> ' . $block['form_title'] . '<br /><br />'; |
|
101 | - include XOOPS_ROOT_PATH . '/modules/system/admin/blocksadmin/blockform.php'; |
|
99 | + $block['cachetime'] = (int) $bcachetime; |
|
100 | + echo '<a href="admin.php?fct=blocksadmin">'._AM_BADMIN.'</a> <span style="font-weight:bold;">»»</span> '.$block['form_title'].'<br /><br />'; |
|
101 | + include XOOPS_ROOT_PATH.'/modules/system/admin/blocksadmin/blockform.php'; |
|
102 | 102 | $form->display(); |
103 | 103 | xoops_cp_footer(); |
104 | 104 | echo '<script type="text/javascript"> |
105 | 105 | <!--// |
106 | - preview_window = openWithSelfMain("' . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file=' . $dummyfile . '", "popup", 250, 200); |
|
106 | + preview_window = openWithSelfMain("' . XOOPS_URL.'/modules/system/admin.php?fct=blocksadmin&op=previewpopup&file='.$dummyfile.'", "popup", 250, 200); |
|
107 | 107 | //--> |
108 | 108 | </script>'; |
109 | 109 | exit(); |
110 | 110 | } |
111 | 111 | |
112 | 112 | if ($op === 'previewpopup') { |
113 | - $file = str_replace('..', '', XOOPS_CACHE_PATH . '/' . trim($HTTP_GET_VARS['file'])); |
|
113 | + $file = str_replace('..', '', XOOPS_CACHE_PATH.'/'.trim($HTTP_GET_VARS['file'])); |
|
114 | 114 | if (file_exists($file)) { |
115 | 115 | include $file; |
116 | 116 | @unlink($file); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | if ($op === 'update') { |
151 | - $bcachetime = isset($bcachetime) ? (int)$bcachetime : 0; |
|
151 | + $bcachetime = isset($bcachetime) ? (int) $bcachetime : 0; |
|
152 | 152 | $options = isset($options) ? $options : array(); |
153 | 153 | $bcontent = isset($bcontent) ? $bcontent : ''; |
154 | 154 | $bctype = isset($bctype) ? $bctype : ''; |
@@ -239,27 +239,27 @@ discard block |
||
239 | 239 | $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid); |
240 | 240 | $db->query($sql); |
241 | 241 | foreach ($bmodule as $bmid) { |
242 | - $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid); |
|
242 | + $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int) $bmid); |
|
243 | 243 | $db->query($sql); |
244 | 244 | } |
245 | - include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
245 | + include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
246 | 246 | $xoopsTpl = new XoopsTpl(); |
247 | 247 | $xoopsTpl->xoops_setCaching(2); |
248 | 248 | if ($myblock->getVar('template') != '') { |
249 | - if ($xoopsTpl->is_cached('db:' . $myblock->getVar('template'))) { |
|
250 | - if (!$xoopsTpl->clear_cache('db:' . $myblock->getVar('template'))) { |
|
251 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
249 | + if ($xoopsTpl->is_cached('db:'.$myblock->getVar('template'))) { |
|
250 | + if (!$xoopsTpl->clear_cache('db:'.$myblock->getVar('template'))) { |
|
251 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } else { |
255 | - if ($xoopsTpl->is_cached('db:system_dummy.html', 'block' . $bid)) { |
|
256 | - if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'block' . $bid)) { |
|
257 | - $msg = 'Unable to clear cache for block ID' . $bid; |
|
255 | + if ($xoopsTpl->is_cached('db:system_dummy.html', 'block'.$bid)) { |
|
256 | + if (!$xoopsTpl->clear_cache('db:system_dummy.html', 'block'.$bid)) { |
|
257 | + $msg = 'Unable to clear cache for block ID'.$bid; |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | } |
261 | 261 | } else { |
262 | - $msg = 'Failed update of block. ID:' . $bid; |
|
262 | + $msg = 'Failed update of block. ID:'.$bid; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | return $msg; // GIJ + |
@@ -7,9 +7,9 @@ discard block |
||
7 | 7 | */ |
8 | 8 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
9 | 9 | |
10 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/category.php'; |
|
11 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/faq.php'; |
|
12 | -include_once XOOPS_ROOT_PATH . '/modules/smartfaq/class/answer.php'; |
|
10 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/category.php'; |
|
11 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/faq.php'; |
|
12 | +include_once XOOPS_ROOT_PATH.'/modules/smartfaq/class/answer.php'; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @return mixed|null |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | break; |
64 | 64 | |
65 | 65 | case 'inside' : |
66 | - return XOOPS_URL . '/modules/smartfaq/doc/'; |
|
66 | + return XOOPS_URL.'/modules/smartfaq/doc/'; |
|
67 | 67 | break; |
68 | 68 | |
69 | 69 | case 'custom' : |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | $ret = ''; |
82 | 82 | foreach ($errors as $key => $value) { |
83 | - $ret .= '<br /> - ' . $value; |
|
83 | + $ret .= '<br /> - '.$value; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | return $ret; |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | $spaces .= '--'; |
104 | 104 | } |
105 | 105 | |
106 | - $ret .= "<option value='" . $categoryObj->categoryid() . "'"; |
|
106 | + $ret .= "<option value='".$categoryObj->categoryid()."'"; |
|
107 | 107 | if ($selectedid == $categoryObj->categoryid()) { |
108 | 108 | $ret .= " selected='selected'"; |
109 | 109 | } |
110 | - $ret .= '>' . $spaces . $categoryObj->name() . "</option>\n"; |
|
110 | + $ret .= '>'.$spaces.$categoryObj->name()."</option>\n"; |
|
111 | 111 | |
112 | 112 | $subCategoriesObj = $categoryHandler->getCategories(0, 0, $categoryObj->categoryid()); |
113 | 113 | if (count($subCategoriesObj) > 0) { |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | */ |
129 | 129 | function sf_createCategorySelect($selectedid = 0, $parentcategory = 0, $allCatOption = true) |
130 | 130 | { |
131 | - $ret = '' . _MB_SF_SELECTCAT . " <select name='options[]'>"; |
|
131 | + $ret = ''._MB_SF_SELECTCAT." <select name='options[]'>"; |
|
132 | 132 | if ($allCatOption) { |
133 | 133 | $ret .= "<option value='0'"; |
134 | - $ret .= '>' . _MB_SF_ALLCAT . "</option>\n"; |
|
134 | + $ret .= '>'._MB_SF_ALLCAT."</option>\n"; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | // Creating the category handler object |
@@ -199,9 +199,9 @@ discard block |
||
199 | 199 | { |
200 | 200 | $smartModule = sf_getModuleInfo(); |
201 | 201 | |
202 | - $modfootertxt = 'Module ' . $smartModule->getInfo('name') . ' - Version ' . $smartModule->getInfo('version') . ''; |
|
202 | + $modfootertxt = 'Module '.$smartModule->getInfo('name').' - Version '.$smartModule->getInfo('version').''; |
|
203 | 203 | |
204 | - $modfooter = "<a href='" . $smartModule->getInfo('support_site_url') . "' target='_blank'><img src='" . XOOPS_URL . "/modules/smartfaq/assets/images/sfcssbutton.gif' title='" . $modfootertxt . "' alt='" . $modfootertxt . "'/></a>"; |
|
204 | + $modfooter = "<a href='".$smartModule->getInfo('support_site_url')."' target='_blank'><img src='".XOOPS_URL."/modules/smartfaq/assets/images/sfcssbutton.gif' title='".$modfootertxt."' alt='".$modfootertxt."'/></a>"; |
|
205 | 205 | |
206 | 206 | return $modfooter; |
207 | 207 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | $gpermHandler = xoops_getHandler('groupperm'); |
299 | 299 | |
300 | - $sql = 'SELECT faqid FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE categoryid = '$categoryid' "; |
|
300 | + $sql = 'SELECT faqid FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE categoryid = '$categoryid' "; |
|
301 | 301 | $result = $xoopsDB->query($sql); |
302 | 302 | |
303 | 303 | if (count($result) > 0) { |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | $ret = array(); |
413 | 413 | global $xoopsDB; |
414 | 414 | |
415 | - $result = $xoopsDB->query('SELECT * FROM ' . $xoopsDB->prefix('smartfaq_faq') . " WHERE faqid = '$faqid'"); |
|
415 | + $result = $xoopsDB->query('SELECT * FROM '.$xoopsDB->prefix('smartfaq_faq')." WHERE faqid = '$faqid'"); |
|
416 | 416 | $ret = $xoopsDB->fetcharray($result); |
417 | 417 | |
418 | 418 | return $ret; |
@@ -431,26 +431,26 @@ discard block |
||
431 | 431 | { |
432 | 432 | global $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsConfig; |
433 | 433 | $adminLinks = ''; |
434 | - $modulePath = XOOPS_URL . '/modules/' . $xoopsModule->dirname() . '/'; |
|
434 | + $modulePath = XOOPS_URL.'/modules/'.$xoopsModule->dirname().'/'; |
|
435 | 435 | $page = $open ? 'question.php' : 'faq.php'; |
436 | 436 | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->getVar('mid'))) { |
437 | 437 | // Edit button |
438 | - $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=mod&faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/edit.gif'" . " title='" . _MD_SF_EDIT . "' alt='" . _MD_SF_EDIT . "'/></a>"; |
|
438 | + $adminLinks .= "<a href='".$modulePath."admin/$page?op=mod&faqid=".$faqid."'><img src='".$modulePath."assets/images/links/edit.gif'"." title='"._MD_SF_EDIT."' alt='"._MD_SF_EDIT."'/></a>"; |
|
439 | 439 | $adminLinks .= ' '; |
440 | 440 | // Delete button |
441 | - $adminLinks .= "<a href='" . $modulePath . "admin/$page?op=del&faqid=" . $faqid . "'><img src='" . $modulePath . "assets/images/links/delete.gif'" . " title='" . _MD_SF_DELETE . "' alt='" . _MD_SF_DELETE . "'/></a>"; |
|
441 | + $adminLinks .= "<a href='".$modulePath."admin/$page?op=del&faqid=".$faqid."'><img src='".$modulePath."assets/images/links/delete.gif'"." title='"._MD_SF_DELETE."' alt='"._MD_SF_DELETE."'/></a>"; |
|
442 | 442 | $adminLinks .= ' '; |
443 | 443 | } |
444 | 444 | // Print button |
445 | - $adminLinks .= "<a href='" . $modulePath . 'print.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/print.gif' title='" . _MD_SF_PRINT . "' alt='" . _MD_SF_PRINT . "'/></a>"; |
|
445 | + $adminLinks .= "<a href='".$modulePath.'print.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/print.gif' title='"._MD_SF_PRINT."' alt='"._MD_SF_PRINT."'/></a>"; |
|
446 | 446 | $adminLinks .= ' '; |
447 | 447 | // Email button |
448 | - $maillink = 'mailto:?subject=' . sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']) . '&body=' . sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']) . ': ' . $modulePath . 'faq.php?faqid=' . $faqid; |
|
449 | - $adminLinks .= "<a href=\"" . $maillink . "\"><img src='" . $modulePath . "assets/images/links/friend.gif' title='" . _MD_SF_MAIL . "' alt='" . _MD_SF_MAIL . "'/></a>"; |
|
448 | + $maillink = 'mailto:?subject='.sprintf(_MD_SF_INTARTICLE, $xoopsConfig['sitename']).'&body='.sprintf(_MD_SF_INTARTFOUND, $xoopsConfig['sitename']).': '.$modulePath.'faq.php?faqid='.$faqid; |
|
449 | + $adminLinks .= "<a href=\"".$maillink."\"><img src='".$modulePath."assets/images/links/friend.gif' title='"._MD_SF_MAIL."' alt='"._MD_SF_MAIL."'/></a>"; |
|
450 | 450 | $adminLinks .= ' '; |
451 | 451 | // Submit New Answer button |
452 | 452 | if ($xoopsModuleConfig['allownewanswer'] && (is_object($xoopsUser) || $xoopsModuleConfig['anonpost'])) { |
453 | - $adminLinks .= "<a href='" . $modulePath . 'answer.php?faqid=' . $faqid . "'><img src='" . $modulePath . "assets/images/links/newanswer.gif' title='" . _MD_SF_SUBMITANSWER . "' alt='" . _MD_SF_SUBMITANSWER . "'/></a>"; |
|
453 | + $adminLinks .= "<a href='".$modulePath.'answer.php?faqid='.$faqid."'><img src='".$modulePath."assets/images/links/newanswer.gif' title='"._MD_SF_SUBMITANSWER."' alt='"._MD_SF_SUBMITANSWER."'/></a>"; |
|
454 | 454 | $adminLinks .= ' '; |
455 | 455 | } |
456 | 456 | |
@@ -471,7 +471,7 @@ discard block |
||
471 | 471 | return $userid; |
472 | 472 | } |
473 | 473 | |
474 | - $userid = (int)$userid; |
|
474 | + $userid = (int) $userid; |
|
475 | 475 | if ($userid > 0) { |
476 | 476 | if ($users == array()) { |
477 | 477 | //fetching users |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | if (!isset($users[$userid])) { |
482 | 482 | return $GLOBALS['xoopsConfig']['anonymous']; |
483 | 483 | } |
484 | - $user =& $users[$userid]; |
|
484 | + $user = & $users[$userid]; |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | if (is_object($user)) { |
@@ -495,9 +495,9 @@ discard block |
||
495 | 495 | $fullname = $user->getVar('name'); |
496 | 496 | } |
497 | 497 | if (!empty($fullname)) { |
498 | - $linkeduser = "$fullname [<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . $ts->htmlSpecialChars($username) . '</a>]'; |
|
498 | + $linkeduser = "$fullname [<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".$ts->htmlSpecialChars($username).'</a>]'; |
|
499 | 499 | } else { |
500 | - $linkeduser = "<a href='" . XOOPS_URL . '/userinfo.php?uid=' . $userid . "'>" . ucwords($ts->htmlSpecialChars($username)) . '</a>'; |
|
500 | + $linkeduser = "<a href='".XOOPS_URL.'/userinfo.php?uid='.$userid."'>".ucwords($ts->htmlSpecialChars($username)).'</a>'; |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | return $linkeduser; |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | //--> |
579 | 579 | </script> |
580 | 580 | <?php |
581 | - echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('" . $tablename . "'); toggleIcon('" . $iconname . "');\">"; |
|
581 | + echo "<h3 style=\"color: #2F5376; margin: 6px 0 0 0; \"><a href='#' onClick=\"toggle('".$tablename."'); toggleIcon('".$iconname."');\">"; |
|
582 | 582 | } |
583 | 583 | |
584 | 584 | /** |
@@ -591,16 +591,16 @@ discard block |
||
591 | 591 | static $handlers; |
592 | 592 | $name = strtolower(trim($name)); |
593 | 593 | if (!isset($handlers[$name])) { |
594 | - if (file_exists($hnd_file = XOOPS_ROOT_PATH . '/modules/smartfaq/class/' . $name . '.php')) { |
|
594 | + if (file_exists($hnd_file = XOOPS_ROOT_PATH.'/modules/smartfaq/class/'.$name.'.php')) { |
|
595 | 595 | require_once $hnd_file; |
596 | 596 | } |
597 | - $class = 'sf' . ucfirst($name) . 'Handler'; |
|
597 | + $class = 'sf'.ucfirst($name).'Handler'; |
|
598 | 598 | if (class_exists($class)) { |
599 | 599 | $handlers[$name] = new $class($GLOBALS['xoopsDB']); |
600 | 600 | } |
601 | 601 | } |
602 | 602 | if (!$optional && !isset($handlers[$name])) { |
603 | - trigger_error('Class <b>' . $class . '</b> does not exist<br />Handler Name: ' . $name, E_USER_ERROR); |
|
603 | + trigger_error('Class <b>'.$class.'</b> does not exist<br />Handler Name: '.$name, E_USER_ERROR); |
|
604 | 604 | } |
605 | 605 | $false = false; |
606 | 606 |
@@ -9,9 +9,9 @@ |
||
9 | 9 | |
10 | 10 | global $_POST; |
11 | 11 | |
12 | -include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
13 | -include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
14 | -include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
12 | +include_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
13 | +include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
14 | +include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
15 | 15 | |
16 | 16 | $form = new XoopsThemeForm(_MD_SF_REQUEST, 'form', xoops_getenv('PHP_SELF')); |
17 | 17 | // CATEGORY |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | |
10 | 10 | global $_POST, $xoopsDB; |
11 | 11 | |
12 | -include_once XOOPS_ROOT_PATH . '/class/xoopstree.php'; |
|
13 | -include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
14 | -include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
12 | +include_once XOOPS_ROOT_PATH.'/class/xoopstree.php'; |
|
13 | +include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
14 | +include_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
15 | 15 | |
16 | 16 | include_once 'functions.php'; |
17 | 17 | |
@@ -70,18 +70,18 @@ discard block |
||
70 | 70 | // $upload_tray->addElement(new XoopsFormFile('', 'userfile', ($forum_obj->getVar('attach_maxkb') * 1024))); |
71 | 71 | $upload_tray->addElement(new XoopsFormFile('', 'userfile', $xoopsModuleConfig['max_image_size'] * 1024)); |
72 | 72 | $upload_tray->addElement(new XoopsFormButton('', 'contents_upload', _MD_SF_UPLOAD, 'submit')); |
73 | -$upload_tray->addElement(new XoopsFormLabel('<br /><br />' . _MD_SF_MAX_FILESIZE . ':', $xoopsModuleConfig['max_image_size'] . 'Kb; ')); |
|
73 | +$upload_tray->addElement(new XoopsFormLabel('<br /><br />'._MD_SF_MAX_FILESIZE.':', $xoopsModuleConfig['max_image_size'].'Kb; ')); |
|
74 | 74 | $extensions = trim(str_replace('|', ' ', $xoopsModuleConfig['attach_ext'])); |
75 | 75 | $extensions = (empty($extensions) || $extensions === '*') ? _ALL : $extensions; |
76 | -$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS . ':', $extensions)); |
|
77 | -$upload_tray->addElement(new XoopsFormLabel('<br />' . sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width']))); |
|
76 | +$upload_tray->addElement(new XoopsFormLabel(_MD_SF_ALLOWED_EXTENSIONS.':', $extensions)); |
|
77 | +$upload_tray->addElement(new XoopsFormLabel('<br />'.sprintf(_MD_SF_MAXPIC, $xoopsModuleConfig['max_img_height'], $xoopsModuleConfig['max_img_width']))); |
|
78 | 78 | $form->addElement($upload_tray); |
79 | 79 | //} |
80 | 80 | |
81 | 81 | if (!empty($attachments) && is_array($attachments) && count($attachments)) { |
82 | 82 | $delete_attach_checkbox = new XoopsFormCheckBox(_MD_SF_ATTACHED_FILES, 'delete_attach[]'); |
83 | 83 | foreach ($attachments as $key => $attachment) { |
84 | - $attach = ' ' . _DELETE . ' <a href=' . XOOPS_URL . '/' . $xoopsModuleConfig['dir_attachments'] . '/' . $attachment['name_saved'] . ' rel="external">' . $attachment['name_display'] . '</a><br />'; |
|
84 | + $attach = ' '._DELETE.' <a href='.XOOPS_URL.'/'.$xoopsModuleConfig['dir_attachments'].'/'.$attachment['name_saved'].' rel="external">'.$attachment['name_display'].'</a><br />'; |
|
85 | 85 | $delete_attach_checkbox->addOption($key, $attach); |
86 | 86 | } |
87 | 87 | $form->addElement($delete_attach_checkbox); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $delete_attach_checkbox = new XoopsFormCheckBox(_MD_REMOVE, 'delete_tmp[]'); |
93 | 93 | $url_prefix = str_replace(XOOPS_ROOT_PATH, XOOPS_URL, XOOPS_CACHE_PATH); |
94 | 94 | foreach ($attachments_tmp as $key => $attachment) { |
95 | - $attach = ' <a href="' . $url_prefix . '/' . $attachment[0] . '" rel="external">' . $attachment[1] . '</a><br />'; |
|
95 | + $attach = ' <a href="'.$url_prefix.'/'.$attachment[0].'" rel="external">'.$attachment[1].'</a><br />'; |
|
96 | 96 | $delete_attach_checkbox->addOption($key, $attach); |
97 | 97 | } |
98 | 98 | $form->addElement($delete_attach_checkbox); |