@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | if (isset($GLOBALS['xoopsModule']) && is_object($GLOBALS['xoopsModule']) && $GLOBALS['xoopsModule']->getVar('dirname', 'n') == $dirname) { |
31 | 31 | if (isset($GLOBALS['xoopsModuleConfig'])) { |
32 | - $moduleConfig =& $GLOBALS['xoopsModuleConfig']; |
|
32 | + $moduleConfig = & $GLOBALS['xoopsModuleConfig']; |
|
33 | 33 | } else { |
34 | 34 | return null; |
35 | 35 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | XoopsCache::write("{$dirname}_config", $moduleConfig); |
41 | 41 | } |
42 | 42 | } |
43 | - if ($customConfig = @include XOOPS_ROOT_PATH . "/modules/{$dirname}/include/plugin.php") { |
|
43 | + if ($customConfig = @include XOOPS_ROOT_PATH."/modules/{$dirname}/include/plugin.php") { |
|
44 | 44 | $moduleConfig = array_merge($moduleConfig, $customConfig); |
45 | 45 | } |
46 | 46 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | if (!defined('FRAMEWORKS_ART_FUNCTIONS_ADMIN')): |
14 | 14 | define('FRAMEWORKS_ART_FUNCTIONS_ADMIN', true); |
15 | 15 | |
16 | - defined('FRAMEWORKS_ART_FUNCTIONS_INI') || include_once __DIR__ . '/functions.ini.php'; |
|
16 | + defined('FRAMEWORKS_ART_FUNCTIONS_INI') || include_once __DIR__.'/functions.ini.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * @param $currentoption |
@@ -28,18 +28,18 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | $breadcrumb = empty($breadcrumb) ? $adminmenu[$currentoption]['title'] : $breadcrumb; |
31 | - $module_link = XOOPS_URL . '/modules/' . $GLOBALS['xoopsModule']->getVar('dirname') . '/'; |
|
32 | - $image_link = XOOPS_URL . '/Frameworks/compat/include'; |
|
31 | + $module_link = XOOPS_URL.'/modules/'.$GLOBALS['xoopsModule']->getVar('dirname').'/'; |
|
32 | + $image_link = XOOPS_URL.'/Frameworks/compat/include'; |
|
33 | 33 | |
34 | 34 | $adminmenu_text = ' |
35 | 35 | <style type="text/css"> |
36 | 36 | <!-- |
37 | 37 | #buttontop { float: left; width: 100%; background: #e7e7e7; font-size: 93%; line-height: normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0;} |
38 | - #buttonbar { float: left; width: 100%; background: #e7e7e7 url("' . $image_link . '/modadminbg.gif") repeat-x left bottom; font-size: 93%; line-height: normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;} |
|
38 | + #buttonbar { float: left; width: 100%; background: #e7e7e7 url("' . $image_link.'/modadminbg.gif") repeat-x left bottom; font-size: 93%; line-height: normal; border-left: 1px solid black; border-right: 1px solid black; margin-bottom: 12px;} |
|
39 | 39 | #buttonbar ul { margin: 0; margin-top: 15px; padding: 10px 10px 0; list-style: none; } |
40 | 40 | #buttonbar li { display: inline; margin: 0; padding: 0; } |
41 | - #buttonbar a { float: left; background: url("' . $image_link . '/left_both.gif") no-repeat left top; margin: 0; padding: 0 0 0 9px; border-bottom: 1px solid #000; text-decoration: none; } |
|
42 | - #buttonbar a span { float: left; display: block; background: url("' . $image_link . '/right_both.gif") no-repeat right top; padding: 5px 15px 4px 6px; font-weight: bold; color: #765; } |
|
41 | + #buttonbar a { float: left; background: url("' . $image_link.'/left_both.gif") no-repeat left top; margin: 0; padding: 0 0 0 9px; border-bottom: 1px solid #000; text-decoration: none; } |
|
42 | + #buttonbar a span { float: left; display: block; background: url("' . $image_link.'/right_both.gif") no-repeat right top; padding: 5px 15px 4px 6px; font-weight: bold; color: #765; } |
|
43 | 43 | /* Commented Backslash Hack hides rule from IE5-Mac \*/ |
44 | 44 | #buttonbar a span {float: none;} |
45 | 45 | /* End IE5-Mac hack */ |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | <table style="width: 100%; padding: 0; " cellspacing="0"> |
55 | 55 | <tr> |
56 | 56 | <td style="width: 70%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;"> |
57 | - <a href="../index.php">' . $GLOBALS['xoopsModule']->getVar('name') . '</a> |
|
57 | + <a href="../index.php">' . $GLOBALS['xoopsModule']->getVar('name').'</a> |
|
58 | 58 | </td> |
59 | 59 | <td style="width: 30%; font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;"> |
60 | - <strong>' . $GLOBALS['xoopsModule']->getVar('name') . '</strong> ' . $breadcrumb . ' |
|
60 | + <strong>' . $GLOBALS['xoopsModule']->getVar('name').'</strong> '.$breadcrumb.' |
|
61 | 61 | </td> |
62 | 62 | </tr> |
63 | 63 | </table> |
@@ -66,10 +66,10 @@ discard block |
||
66 | 66 | <ul> |
67 | 67 | '; |
68 | 68 | foreach (array_keys($adminmenu) as $key) { |
69 | - $adminmenu_text .= (($currentoption == $key) ? '<li class="current">' : '<li>') . '<a href="' . $module_link . $adminmenu[$key]['link'] . '"><span>' . $adminmenu[$key]['title'] . '</span></a></li>'; |
|
69 | + $adminmenu_text .= (($currentoption == $key) ? '<li class="current">' : '<li>').'<a href="'.$module_link.$adminmenu[$key]['link'].'"><span>'.$adminmenu[$key]['title'].'</span></a></li>'; |
|
70 | 70 | } |
71 | 71 | if ($GLOBALS['xoopsModule']->getVar('hasconfig') || $GLOBALS['xoopsModule']->getVar('hascomments') || $GLOBALS['xoopsModule']->getVar('hasnotification')) { |
72 | - $adminmenu_text .= '<li><a href="' . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $GLOBALS['xoopsModule']->getVar('mid') . '"><span>' . _PREFERENCES . '</span></a></li>'; |
|
72 | + $adminmenu_text .= '<li><a href="'.XOOPS_URL.'/modules/system/admin.php?fct=preferences&op=showmod&mod='.$GLOBALS['xoopsModule']->getVar('mid').'"><span>'._PREFERENCES.'</span></a></li>'; |
|
73 | 73 | } |
74 | 74 | $adminmenu_text .= ' |
75 | 75 | </ul> |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | if (!empty($groups) && is_array($groups)) { |
30 | 30 | sort($groups); |
31 | - $contentCacheId = substr(md5(implode(',', $groups) . XOOPS_DB_PASS . XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2); |
|
31 | + $contentCacheId = substr(md5(implode(',', $groups).XOOPS_DB_PASS.XOOPS_DB_NAME), 0, strlen(XOOPS_DB_USER) * 2); |
|
32 | 32 | } else { |
33 | 33 | $contentCacheId = XOOPS_GROUP_ANONYMOUS; |
34 | 34 | } |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | { |
59 | 59 | global $xoopsModule; |
60 | 60 | |
61 | - $name = $name ? : (string)time(); |
|
62 | - $dirname = $dirname ? : (is_object($xoopsModule) ? $xoopsModule->getVar('dirname', 'n') : 'system'); |
|
61 | + $name = $name ?: (string)time(); |
|
62 | + $dirname = $dirname ?: (is_object($xoopsModule) ? $xoopsModule->getVar('dirname', 'n') : 'system'); |
|
63 | 63 | |
64 | 64 | xoops_load('XoopsCache'); |
65 | 65 | $key = "{$dirname}_{$name}"; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | if (empty($name)) { |
111 | 111 | return $data; |
112 | 112 | } |
113 | - $dirname = $dirname ? : (is_object($xoopsModule) ? $xoopsModule->getVar('dirname', 'n') : 'system'); |
|
113 | + $dirname = $dirname ?: (is_object($xoopsModule) ? $xoopsModule->getVar('dirname', 'n') : 'system'); |
|
114 | 114 | xoops_load('XoopsCache'); |
115 | 115 | $key = "{$dirname}_{$name}"; |
116 | 116 | |
@@ -160,14 +160,14 @@ discard block |
||
160 | 160 | $pattern = $dirname ? "{$dirname}_{$name}.*\.php" : "[^_]+_{$name}.*\.php"; |
161 | 161 | if ($handle = opendir($root_path)) { |
162 | 162 | while (false !== ($file = readdir($handle))) { |
163 | - if (is_file($root_path . '/' . $file) && preg_match("/{$pattern}$/", $file)) { |
|
164 | - @unlink($root_path . '/' . $file); |
|
163 | + if (is_file($root_path.'/'.$file) && preg_match("/{$pattern}$/", $file)) { |
|
164 | + @unlink($root_path.'/'.$file); |
|
165 | 165 | } |
166 | 166 | } |
167 | 167 | closedir($handle); |
168 | 168 | } |
169 | 169 | } else { |
170 | - $files = (array)glob($root_path . "/*{$dirname}_{$name}*.php"); |
|
170 | + $files = (array)glob($root_path."/*{$dirname}_{$name}*.php"); |
|
171 | 171 | foreach ($files as $file) { |
172 | 172 | @unlink($file); |
173 | 173 | } |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | } |
203 | 203 | if ($handle = opendir(XOOPS_CACHE_PATH)) { |
204 | 204 | while (false !== ($file = readdir($handle))) { |
205 | - if (is_file(XOOPS_CACHE_PATH . '/' . $file) && preg_match($pattern, $file)) { |
|
206 | - @unlink(XOOPS_CACHE_PATH . '/' . $file); |
|
205 | + if (is_file(XOOPS_CACHE_PATH.'/'.$file) && preg_match($pattern, $file)) { |
|
206 | + @unlink(XOOPS_CACHE_PATH.'/'.$file); |
|
207 | 207 | } |
208 | 208 | } |
209 | 209 | closedir($handle); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($action === 'search') { |
93 | 93 | include $GLOBALS['xoops']->path('header.php'); |
94 | 94 | include $GLOBALS['xoops']->path('include/searchform.php'); |
95 | - $xoopsTpl->assign('form', $search_form->render()); |
|
95 | + $xoopsTpl->assign('form', $search_form->render()); |
|
96 | 96 | include $GLOBALS['xoops']->path('footer.php'); |
97 | 97 | exit(); |
98 | 98 | } |
@@ -139,28 +139,28 @@ discard block |
||
139 | 139 | } |
140 | 140 | $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
141 | 141 | include $GLOBALS['xoops']->path('header.php'); |
142 | - $xoopsTpl->assign('results', true); |
|
142 | + $xoopsTpl->assign('results', true); |
|
143 | 143 | $nomatch = true; |
144 | - $keywords = ''; |
|
145 | - $error_length = ''; |
|
146 | - $error_keywords = ''; |
|
144 | + $keywords = ''; |
|
145 | + $error_length = ''; |
|
146 | + $error_keywords = ''; |
|
147 | 147 | if ($andor !== 'exact') { |
148 | 148 | foreach ($queries as $q) { |
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
150 | 150 | } |
151 | 151 | if (!empty($ignored_queries)) { |
152 | - $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
152 | + $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | 153 | foreach ($ignored_queries as $q) { |
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } else { |
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
158 | + $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
159 | 159 | } |
160 | - $xoopsTpl->assign('keywords', $keywords); |
|
161 | - $xoopsTpl->assign('error_length', $error_length); |
|
162 | - $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | - $results_arr = array(); |
|
160 | + $xoopsTpl->assign('keywords', $keywords); |
|
161 | + $xoopsTpl->assign('error_length', $error_length); |
|
162 | + $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | + $results_arr = array(); |
|
164 | 164 | foreach ($mids as $mid) { |
165 | 165 | $mid = (int)$mid; |
166 | 166 | if (in_array($mid, $available_modules)) { |
@@ -169,57 +169,57 @@ discard block |
||
169 | 169 | $count = count($results); |
170 | 170 | if (is_array($results) && $count > 0) { |
171 | 171 | $nomatch = false; |
172 | - $module_name = $module->getVar('name'); |
|
172 | + $module_name = $module->getVar('name'); |
|
173 | 173 | for ($i = 0; $i < $count; ++$i) { |
174 | 174 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
175 | + $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | 176 | } else { |
177 | - $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
177 | + $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | 178 | } |
179 | - $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
179 | + $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | 180 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
181 | 181 | $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
182 | 182 | } |
183 | - $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | - $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
183 | + $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | + $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
185 | 185 | |
186 | 186 | $results[$i]['uid'] = @(int)$results[$i]['uid']; |
187 | 187 | if (!empty($results[$i]['uid'])) { |
188 | 188 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
189 | - $results_arr[$i]['uname'] = $uname; |
|
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
189 | + $results_arr[$i]['uname'] = $uname; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
191 | + } |
|
192 | + if (!empty($results[$i]['time'])){ |
|
193 | + $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
191 | 194 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
193 | - $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | - } |
|
195 | 195 | } |
196 | 196 | if ($count >= 5) { |
197 | 197 | $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
198 | 198 | $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
199 | - $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
199 | + $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
200 | 200 | } |
201 | - $search_arr['module_name'] = $module_name; |
|
202 | - $search_arr['module_data'] = $results_arr; |
|
203 | - $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | - unset($results_arr, $search_arr); |
|
201 | + $search_arr['module_name'] = $module_name; |
|
202 | + $search_arr['module_data'] = $results_arr; |
|
203 | + $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | + unset($results_arr, $search_arr); |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | unset($results, $module, $module_name); |
208 | 208 | } |
209 | 209 | |
210 | 210 | if ($nomatch) { |
211 | - $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
211 | + $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
212 | 212 | } |
213 | 213 | include $GLOBALS['xoops']->path('include/searchform.php'); |
214 | - $xoopsTpl->assign('form', $search_form->render()); |
|
214 | + $xoopsTpl->assign('form', $search_form->render()); |
|
215 | 215 | break; |
216 | 216 | |
217 | 217 | case 'showall': |
218 | 218 | case 'showallbyuser': |
219 | 219 | include $GLOBALS['xoops']->path('header.php'); |
220 | - $xoopsTpl->assign('showallbyuser', true); |
|
220 | + $xoopsTpl->assign('showallbyuser', true); |
|
221 | 221 | /* @var $module_handler XoopsModuleHandler */ |
222 | - $module_handler = xoops_getHandler('module'); |
|
222 | + $module_handler = xoops_getHandler('module'); |
|
223 | 223 | $module = $module_handler->get($mid); |
224 | 224 | $results = $module->search($queries, $andor, 20, $start, $uid); |
225 | 225 | $count = count($results); |
@@ -231,43 +231,43 @@ discard block |
||
231 | 231 | $has_next = true; |
232 | 232 | } |
233 | 233 | if ($action === 'showall') { |
234 | - $xoopsTpl->assign('showall', true); |
|
235 | - $keywords = ''; |
|
234 | + $xoopsTpl->assign('showall', true); |
|
235 | + $keywords = ''; |
|
236 | 236 | if ($andor !== 'exact') { |
237 | 237 | foreach ($queries as $q) { |
238 | - $keywords .= htmlspecialchars(stripslashes($q)); |
|
238 | + $keywords .= htmlspecialchars(stripslashes($q)); |
|
239 | 239 | } |
240 | 240 | } else { |
241 | - $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
241 | + $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
242 | 242 | } |
243 | - $xoopsTpl->assign('keywords', $keywords); |
|
243 | + $xoopsTpl->assign('keywords', $keywords); |
|
244 | 244 | } |
245 | - $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | - $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | - $results_arr = array(); |
|
245 | + $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | + $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | + $results_arr = array(); |
|
248 | 248 | for ($i = 0; $i < $count; ++$i) { |
249 | 249 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
250 | + $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | 251 | } else { |
252 | - $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
252 | + $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
253 | 253 | } |
254 | - $results_arr['image_title'] = $module->getVar('name'); |
|
254 | + $results_arr['image_title'] = $module->getVar('name'); |
|
255 | 255 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
256 | 256 | $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
257 | 257 | } |
258 | - $results_arr['link'] = $results[$i]['link']; |
|
259 | - $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
258 | + $results_arr['link'] = $results[$i]['link']; |
|
259 | + $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | 260 | $results['uid'] = @(int)$results[$i]['uid']; |
261 | 261 | if (!empty($results[$i]['uid'])) { |
262 | 262 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
263 | - $results_arr['uname'] = $uname; |
|
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
263 | + $results_arr['uname'] = $uname; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
265 | + } |
|
266 | + if (!empty($results[$i]['time'])){ |
|
267 | + $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
265 | 268 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
267 | - $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | - } |
|
269 | - $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | - unset($results_arr); |
|
269 | + $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | + unset($results_arr); |
|
271 | 271 | } |
272 | 272 | $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
273 | 273 | $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
@@ -277,15 +277,15 @@ discard block |
||
277 | 277 | if ($start > 0) { |
278 | 278 | $prev = $start - 20; |
279 | 279 | $search_url_prev = $search_url . "&start={$prev}"; |
280 | - $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
280 | + $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
281 | 281 | } |
282 | 282 | if (false !== $has_next) { |
283 | 283 | $next = $start + 20; |
284 | 284 | $search_url_next = $search_url . "&start={$next}"; |
285 | - $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
285 | + $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
286 | 286 | } |
287 | 287 | } else { |
288 | - $xoopsTpl->assign('nomatch', true); |
|
288 | + $xoopsTpl->assign('nomatch', true); |
|
289 | 289 | } |
290 | 290 | include $GLOBALS['xoops']->path('include/searchform.php'); |
291 | 291 | $search_form->display(); |
@@ -125,170 +125,170 @@ |
||
125 | 125 | } |
126 | 126 | } |
127 | 127 | switch ($action) { |
128 | - case 'results': |
|
129 | - /* @var $module_handler XoopsModuleHandler */ |
|
130 | - $module_handler = xoops_getHandler('module'); |
|
131 | - $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
|
132 | - $criteria->add(new Criteria('isactive', 1)); |
|
133 | - $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
134 | - $modules = $module_handler->getObjects($criteria, true); |
|
135 | - $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
|
136 | - if (empty($mids) || !is_array($mids)) { |
|
137 | - unset($mids); |
|
138 | - $mids = array_keys($modules); |
|
139 | - } |
|
140 | - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
141 | - include $GLOBALS['xoops']->path('header.php'); |
|
142 | - $xoopsTpl->assign('results', true); |
|
143 | - $nomatch = true; |
|
144 | - $keywords = ''; |
|
145 | - $error_length = ''; |
|
146 | - $error_keywords = ''; |
|
147 | - if ($andor !== 'exact') { |
|
148 | - foreach ($queries as $q) { |
|
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
128 | + case 'results': |
|
129 | + /* @var $module_handler XoopsModuleHandler */ |
|
130 | + $module_handler = xoops_getHandler('module'); |
|
131 | + $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
|
132 | + $criteria->add(new Criteria('isactive', 1)); |
|
133 | + $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
134 | + $modules = $module_handler->getObjects($criteria, true); |
|
135 | + $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
|
136 | + if (empty($mids) || !is_array($mids)) { |
|
137 | + unset($mids); |
|
138 | + $mids = array_keys($modules); |
|
150 | 139 | } |
151 | - if (!empty($ignored_queries)) { |
|
152 | - $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | - foreach ($ignored_queries as $q) { |
|
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
140 | + $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
141 | + include $GLOBALS['xoops']->path('header.php'); |
|
142 | + $xoopsTpl->assign('results', true); |
|
143 | + $nomatch = true; |
|
144 | + $keywords = ''; |
|
145 | + $error_length = ''; |
|
146 | + $error_keywords = ''; |
|
147 | + if ($andor !== 'exact') { |
|
148 | + foreach ($queries as $q) { |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
150 | + } |
|
151 | + if (!empty($ignored_queries)) { |
|
152 | + $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
|
153 | + foreach ($ignored_queries as $q) { |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
155 | + } |
|
155 | 156 | } |
157 | + } else { |
|
158 | + $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
156 | 159 | } |
157 | - } else { |
|
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
159 | - } |
|
160 | - $xoopsTpl->assign('keywords', $keywords); |
|
161 | - $xoopsTpl->assign('error_length', $error_length); |
|
162 | - $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | - $results_arr = array(); |
|
164 | - foreach ($mids as $mid) { |
|
165 | - $mid = (int)$mid; |
|
166 | - if (in_array($mid, $available_modules)) { |
|
167 | - $module = $modules[$mid]; |
|
168 | - $results = $module->search($queries, $andor, 5, 0); |
|
169 | - $count = count($results); |
|
170 | - if (is_array($results) && $count > 0) { |
|
171 | - $nomatch = false; |
|
172 | - $module_name = $module->getVar('name'); |
|
173 | - for ($i = 0; $i < $count; ++$i) { |
|
174 | - if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | - } else { |
|
177 | - $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | - } |
|
179 | - $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | - if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
181 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
182 | - } |
|
183 | - $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | - $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
160 | + $xoopsTpl->assign('keywords', $keywords); |
|
161 | + $xoopsTpl->assign('error_length', $error_length); |
|
162 | + $xoopsTpl->assign('error_keywords', $error_keywords); |
|
163 | + $results_arr = array(); |
|
164 | + foreach ($mids as $mid) { |
|
165 | + $mid = (int)$mid; |
|
166 | + if (in_array($mid, $available_modules)) { |
|
167 | + $module = $modules[$mid]; |
|
168 | + $results = $module->search($queries, $andor, 5, 0); |
|
169 | + $count = count($results); |
|
170 | + if (is_array($results) && $count > 0) { |
|
171 | + $nomatch = false; |
|
172 | + $module_name = $module->getVar('name'); |
|
173 | + for ($i = 0; $i < $count; ++$i) { |
|
174 | + if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
175 | + $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
176 | + } else { |
|
177 | + $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
|
178 | + } |
|
179 | + $results_arr[$i]['image_title'] = $module->getVar('name'); |
|
180 | + if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
181 | + $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
182 | + } |
|
183 | + $results_arr[$i]['link'] = $results[$i]['link']; |
|
184 | + $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
185 | 185 | |
186 | - $results[$i]['uid'] = @(int)$results[$i]['uid']; |
|
187 | - if (!empty($results[$i]['uid'])) { |
|
188 | - $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
189 | - $results_arr[$i]['uname'] = $uname; |
|
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
186 | + $results[$i]['uid'] = @(int)$results[$i]['uid']; |
|
187 | + if (!empty($results[$i]['uid'])) { |
|
188 | + $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
189 | + $results_arr[$i]['uname'] = $uname; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
191 | + } |
|
192 | + if (!empty($results[$i]['time'])){ |
|
193 | + $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | + } |
|
191 | 195 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
193 | - $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
|
194 | - } |
|
195 | - } |
|
196 | - if ($count >= 5) { |
|
197 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
198 | - $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
|
199 | - $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
196 | + if ($count >= 5) { |
|
197 | + $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
198 | + $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
|
199 | + $search_arr['module_show_all'] = htmlspecialchars($search_url); |
|
200 | + } |
|
201 | + $search_arr['module_name'] = $module_name; |
|
202 | + $search_arr['module_data'] = $results_arr; |
|
203 | + $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | + unset($results_arr, $search_arr); |
|
200 | 205 | } |
201 | - $search_arr['module_name'] = $module_name; |
|
202 | - $search_arr['module_data'] = $results_arr; |
|
203 | - $xoopsTpl->append_by_ref('search', $search_arr); |
|
204 | - unset($results_arr, $search_arr); |
|
205 | - } |
|
206 | - } |
|
207 | - unset($results, $module, $module_name); |
|
208 | - } |
|
206 | + } |
|
207 | + unset($results, $module, $module_name); |
|
208 | + } |
|
209 | 209 | |
210 | - if ($nomatch) { |
|
211 | - $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
212 | - } |
|
213 | - include $GLOBALS['xoops']->path('include/searchform.php'); |
|
214 | - $xoopsTpl->assign('form', $search_form->render()); |
|
215 | - break; |
|
216 | - |
|
217 | - case 'showall': |
|
218 | - case 'showallbyuser': |
|
219 | - include $GLOBALS['xoops']->path('header.php'); |
|
220 | - $xoopsTpl->assign('showallbyuser', true); |
|
221 | - /* @var $module_handler XoopsModuleHandler */ |
|
222 | - $module_handler = xoops_getHandler('module'); |
|
223 | - $module = $module_handler->get($mid); |
|
224 | - $results = $module->search($queries, $andor, 20, $start, $uid); |
|
225 | - $count = count($results); |
|
226 | - if (is_array($results) && $count > 0) { |
|
227 | - $next_results = $module->search($queries, $andor, 1, $start + 20, $uid); |
|
228 | - $next_count = count($next_results); |
|
229 | - $has_next = false; |
|
230 | - if (is_array($next_results) && $next_count == 1) { |
|
231 | - $has_next = true; |
|
210 | + if ($nomatch) { |
|
211 | + $xoopsTpl->assign('nomatch', _SR_NOMATCH); |
|
232 | 212 | } |
233 | - if ($action === 'showall') { |
|
234 | - $xoopsTpl->assign('showall', true); |
|
235 | - $keywords = ''; |
|
236 | - if ($andor !== 'exact') { |
|
237 | - foreach ($queries as $q) { |
|
238 | - $keywords .= htmlspecialchars(stripslashes($q)); |
|
213 | + include $GLOBALS['xoops']->path('include/searchform.php'); |
|
214 | + $xoopsTpl->assign('form', $search_form->render()); |
|
215 | + break; |
|
216 | + |
|
217 | + case 'showall': |
|
218 | + case 'showallbyuser': |
|
219 | + include $GLOBALS['xoops']->path('header.php'); |
|
220 | + $xoopsTpl->assign('showallbyuser', true); |
|
221 | + /* @var $module_handler XoopsModuleHandler */ |
|
222 | + $module_handler = xoops_getHandler('module'); |
|
223 | + $module = $module_handler->get($mid); |
|
224 | + $results = $module->search($queries, $andor, 20, $start, $uid); |
|
225 | + $count = count($results); |
|
226 | + if (is_array($results) && $count > 0) { |
|
227 | + $next_results = $module->search($queries, $andor, 1, $start + 20, $uid); |
|
228 | + $next_count = count($next_results); |
|
229 | + $has_next = false; |
|
230 | + if (is_array($next_results) && $next_count == 1) { |
|
231 | + $has_next = true; |
|
232 | + } |
|
233 | + if ($action === 'showall') { |
|
234 | + $xoopsTpl->assign('showall', true); |
|
235 | + $keywords = ''; |
|
236 | + if ($andor !== 'exact') { |
|
237 | + foreach ($queries as $q) { |
|
238 | + $keywords .= htmlspecialchars(stripslashes($q)); |
|
239 | + } |
|
240 | + } else { |
|
241 | + $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
239 | 242 | } |
240 | - } else { |
|
241 | - $keywords .= htmlspecialchars(stripslashes($queries[0])); |
|
243 | + $xoopsTpl->assign('keywords', $keywords); |
|
242 | 244 | } |
243 | - $xoopsTpl->assign('keywords', $keywords); |
|
244 | - } |
|
245 | - $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | - $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | - $results_arr = array(); |
|
248 | - for ($i = 0; $i < $count; ++$i) { |
|
249 | - if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | - } else { |
|
252 | - $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
245 | + $xoopsTpl->assign('showing', sprintf(_SR_SHOWING, $start + 1, $start + $count)); |
|
246 | + $xoopsTpl->assign('module_name', $module->getVar('name')); |
|
247 | + $results_arr = array(); |
|
248 | + for ($i = 0; $i < $count; ++$i) { |
|
249 | + if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
|
250 | + $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
251 | + } else { |
|
252 | + $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
|
253 | + } |
|
254 | + $results_arr['image_title'] = $module->getVar('name'); |
|
255 | + if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
256 | + $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
257 | + } |
|
258 | + $results_arr['link'] = $results[$i]['link']; |
|
259 | + $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | + $results['uid'] = @(int)$results[$i]['uid']; |
|
261 | + if (!empty($results[$i]['uid'])) { |
|
262 | + $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
263 | + $results_arr['uname'] = $uname; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
265 | + } |
|
266 | + if (!empty($results[$i]['time'])){ |
|
267 | + $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | + } |
|
269 | + $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | + unset($results_arr); |
|
253 | 271 | } |
254 | - $results_arr['image_title'] = $module->getVar('name'); |
|
255 | - if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
|
256 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
272 | + $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
273 | + $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
|
274 | + if ($action === 'showallbyuser') { |
|
275 | + $search_url .= "&uid={$uid}"; |
|
257 | 276 | } |
258 | - $results_arr['link'] = $results[$i]['link']; |
|
259 | - $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
|
260 | - $results['uid'] = @(int)$results[$i]['uid']; |
|
261 | - if (!empty($results[$i]['uid'])) { |
|
262 | - $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
|
263 | - $results_arr['uname'] = $uname; |
|
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
277 | + if ($start > 0) { |
|
278 | + $prev = $start - 20; |
|
279 | + $search_url_prev = $search_url . "&start={$prev}"; |
|
280 | + $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
265 | 281 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
267 | - $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
|
268 | - } |
|
269 | - $xoopsTpl->append_by_ref('results_arr', $results_arr); |
|
270 | - unset($results_arr); |
|
271 | - } |
|
272 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
273 | - $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
|
274 | - if ($action === 'showallbyuser') { |
|
275 | - $search_url .= "&uid={$uid}"; |
|
276 | - } |
|
277 | - if ($start > 0) { |
|
278 | - $prev = $start - 20; |
|
279 | - $search_url_prev = $search_url . "&start={$prev}"; |
|
280 | - $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
|
281 | - } |
|
282 | - if (false !== $has_next) { |
|
283 | - $next = $start + 20; |
|
284 | - $search_url_next = $search_url . "&start={$next}"; |
|
285 | - $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
282 | + if (false !== $has_next) { |
|
283 | + $next = $start + 20; |
|
284 | + $search_url_next = $search_url . "&start={$next}"; |
|
285 | + $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
|
286 | + } |
|
287 | + } else { |
|
288 | + $xoopsTpl->assign('nomatch', true); |
|
286 | 289 | } |
287 | - } else { |
|
288 | - $xoopsTpl->assign('nomatch', true); |
|
289 | - } |
|
290 | - include $GLOBALS['xoops']->path('include/searchform.php'); |
|
291 | - $search_form->display(); |
|
292 | - break; |
|
290 | + include $GLOBALS['xoops']->path('include/searchform.php'); |
|
291 | + $search_form->display(); |
|
292 | + break; |
|
293 | 293 | } |
294 | 294 | include $GLOBALS['xoops']->path('footer.php'); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @author Taiwen Jiang <[email protected]> |
24 | 24 | * @todo Modularize; Both search algorithms and interface will be redesigned |
25 | 25 | */ |
26 | -include __DIR__ . '/mainfile.php'; |
|
26 | +include __DIR__.'/mainfile.php'; |
|
27 | 27 | |
28 | 28 | xoops_loadLanguage('search'); |
29 | 29 | /* @var $config_handler XoopsConfigHandler */ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $xoopsConfigSearch = $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH); |
32 | 32 | |
33 | 33 | if ($xoopsConfigSearch['enable_search'] != 1) { |
34 | - header('Location: ' . XOOPS_URL . '/index.php'); |
|
34 | + header('Location: '.XOOPS_URL.'/index.php'); |
|
35 | 35 | exit(); |
36 | 36 | } |
37 | 37 | $action = 'search'; |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | $module_handler = xoops_getHandler('module'); |
131 | 131 | $criteria = new CriteriaCompo(new Criteria('hassearch', 1)); |
132 | 132 | $criteria->add(new Criteria('isactive', 1)); |
133 | - $criteria->add(new Criteria('mid', '(' . implode(',', $available_modules) . ')', 'IN')); |
|
133 | + $criteria->add(new Criteria('mid', '('.implode(',', $available_modules).')', 'IN')); |
|
134 | 134 | $modules = $module_handler->getObjects($criteria, true); |
135 | 135 | $mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array(); |
136 | 136 | if (empty($mids) || !is_array($mids)) { |
137 | 137 | unset($mids); |
138 | 138 | $mids = array_keys($modules); |
139 | 139 | } |
140 | - $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS . ': ' . implode(' ', $queries); |
|
140 | + $xoopsOption['xoops_pagetitle'] = _SR_SEARCHRESULTS.': '.implode(' ', $queries); |
|
141 | 141 | include $GLOBALS['xoops']->path('header.php'); |
142 | 142 | $xoopsTpl->assign('results', true); |
143 | 143 | $nomatch = true; |
@@ -146,16 +146,16 @@ discard block |
||
146 | 146 | $error_keywords = ''; |
147 | 147 | if ($andor !== 'exact') { |
148 | 148 | foreach ($queries as $q) { |
149 | - $keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
149 | + $keywords .= htmlspecialchars(stripslashes($q)).' '; |
|
150 | 150 | } |
151 | 151 | if (!empty($ignored_queries)) { |
152 | 152 | $error_length = sprintf(_SR_IGNOREDWORDS, $xoopsConfigSearch['keyword_min']); |
153 | 153 | foreach ($ignored_queries as $q) { |
154 | - $error_keywords .= htmlspecialchars(stripslashes($q)) . ' '; |
|
154 | + $error_keywords .= htmlspecialchars(stripslashes($q)).' '; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | } else { |
158 | - $keywords .= '"' . htmlspecialchars(stripslashes($queries[0])) . '"'; |
|
158 | + $keywords .= '"'.htmlspecialchars(stripslashes($queries[0])).'"'; |
|
159 | 159 | } |
160 | 160 | $xoopsTpl->assign('keywords', $keywords); |
161 | 161 | $xoopsTpl->assign('error_length', $error_length); |
@@ -172,13 +172,13 @@ discard block |
||
172 | 172 | $module_name = $module->getVar('name'); |
173 | 173 | for ($i = 0; $i < $count; ++$i) { |
174 | 174 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
175 | - $results_arr[$i]['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
175 | + $results_arr[$i]['image_link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image']; |
|
176 | 176 | } else { |
177 | 177 | $results_arr[$i]['image_link'] = 'images/icons/posticon2.gif'; |
178 | 178 | } |
179 | 179 | $results_arr[$i]['image_title'] = $module->getVar('name'); |
180 | 180 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
181 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
181 | + $results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link']; |
|
182 | 182 | } |
183 | 183 | $results_arr[$i]['link'] = $results[$i]['link']; |
184 | 184 | $results_arr[$i]['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
@@ -187,14 +187,14 @@ discard block |
||
187 | 187 | if (!empty($results[$i]['uid'])) { |
188 | 188 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
189 | 189 | $results_arr[$i]['uname'] = $uname; |
190 | - $results_arr[$i]['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
190 | + $results_arr[$i]['uname_link'] = XOOPS_URL.'/userinfo.php?uid='.$results[$i]['uid']; |
|
191 | 191 | } |
192 | - if (!empty($results[$i]['time'])){ |
|
192 | + if (!empty($results[$i]['time'])) { |
|
193 | 193 | $results_arr[$i]['time'] = formatTimestamp((int)$results[$i]['time']); |
194 | 194 | } |
195 | 195 | } |
196 | 196 | if ($count >= 5) { |
197 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
197 | + $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); |
|
198 | 198 | $search_url .= "&mid={$mid}&action=showall&andor={$andor}"; |
199 | 199 | $search_arr['module_show_all'] = htmlspecialchars($search_url); |
200 | 200 | } |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | $results_arr = array(); |
248 | 248 | for ($i = 0; $i < $count; ++$i) { |
249 | 249 | if (isset($results[$i]['image']) && $results[$i]['image'] != '') { |
250 | - $results_arr['image_link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['image']; |
|
250 | + $results_arr['image_link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['image']; |
|
251 | 251 | } else { |
252 | 252 | $results_arr['image_link'] = 'images/icons/posticon2.gif'; |
253 | 253 | } |
254 | 254 | $results_arr['image_title'] = $module->getVar('name'); |
255 | 255 | if (!preg_match("/^http[s]*:\/\//i", $results[$i]['link'])) { |
256 | - $results[$i]['link'] = 'modules/' . $module->getVar('dirname') . '/' . $results[$i]['link']; |
|
256 | + $results[$i]['link'] = 'modules/'.$module->getVar('dirname').'/'.$results[$i]['link']; |
|
257 | 257 | } |
258 | 258 | $results_arr['link'] = $results[$i]['link']; |
259 | 259 | $results_arr['link_title'] = $myts->htmlspecialchars($results[$i]['title']); |
@@ -261,27 +261,27 @@ discard block |
||
261 | 261 | if (!empty($results[$i]['uid'])) { |
262 | 262 | $uname = XoopsUser::getUnameFromId($results[$i]['uid']); |
263 | 263 | $results_arr['uname'] = $uname; |
264 | - $results_arr['uname_link'] = XOOPS_URL . '/userinfo.php?uid=' . $results[$i]['uid']; |
|
264 | + $results_arr['uname_link'] = XOOPS_URL.'/userinfo.php?uid='.$results[$i]['uid']; |
|
265 | 265 | } |
266 | - if (!empty($results[$i]['time'])){ |
|
266 | + if (!empty($results[$i]['time'])) { |
|
267 | 267 | $results_arr['time'] = formatTimestamp((int)$results[$i]['time']); |
268 | 268 | } |
269 | 269 | $xoopsTpl->append_by_ref('results_arr', $results_arr); |
270 | 270 | unset($results_arr); |
271 | 271 | } |
272 | - $search_url = XOOPS_URL . '/search.php?query=' . urlencode(stripslashes(implode(' ', $queries))); |
|
272 | + $search_url = XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' ', $queries))); |
|
273 | 273 | $search_url .= "&mid={$mid}&action={$action}&andor={$andor}"; |
274 | 274 | if ($action === 'showallbyuser') { |
275 | 275 | $search_url .= "&uid={$uid}"; |
276 | 276 | } |
277 | 277 | if ($start > 0) { |
278 | 278 | $prev = $start - 20; |
279 | - $search_url_prev = $search_url . "&start={$prev}"; |
|
279 | + $search_url_prev = $search_url."&start={$prev}"; |
|
280 | 280 | $xoopsTpl->assign('previous', htmlspecialchars($search_url_prev)); |
281 | 281 | } |
282 | 282 | if (false !== $has_next) { |
283 | 283 | $next = $start + 20; |
284 | - $search_url_next = $search_url . "&start={$next}"; |
|
284 | + $search_url_next = $search_url."&start={$next}"; |
|
285 | 285 | $xoopsTpl->assign('next', htmlspecialchars($search_url_next)); |
286 | 286 | } |
287 | 287 | } else { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | $xoopsOption['pagetype'] = 'admin'; |
16 | 16 | |
17 | -include __DIR__ . '/mainfile.php'; |
|
17 | +include __DIR__.'/mainfile.php'; |
|
18 | 18 | include_once $GLOBALS['xoops']->path('include/cp_functions.php'); |
19 | 19 | /** |
20 | 20 | * Admin Authentication |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | * Error warning messages |
34 | 34 | */ |
35 | 35 | if (!isset($xoopsConfig['admin_warnings_enable']) || $xoopsConfig['admin_warnings_enable']) { |
36 | - if (is_dir(XOOPS_ROOT_PATH . '/install/')) { |
|
37 | - xoops_error(sprintf(_AD_WARNINGINSTALL, XOOPS_ROOT_PATH . '/install/')); |
|
36 | + if (is_dir(XOOPS_ROOT_PATH.'/install/')) { |
|
37 | + xoops_error(sprintf(_AD_WARNINGINSTALL, XOOPS_ROOT_PATH.'/install/')); |
|
38 | 38 | echo '<br>'; |
39 | 39 | } |
40 | 40 | |
41 | - if (is_writable(XOOPS_ROOT_PATH . '/mainfile.php')) { |
|
42 | - xoops_error(sprintf(_AD_WARNINGWRITEABLE, XOOPS_ROOT_PATH . '/mainfile.php')); |
|
41 | + if (is_writable(XOOPS_ROOT_PATH.'/mainfile.php')) { |
|
42 | + xoops_error(sprintf(_AD_WARNINGWRITEABLE, XOOPS_ROOT_PATH.'/mainfile.php')); |
|
43 | 43 | echo '<br>'; |
44 | 44 | } |
45 | 45 | // ###### Output warn messages for correct functionality ###### |
@@ -57,12 +57,12 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | //www fits inside www_private, lets add a trailing slash to make sure it doesn't |
60 | - if (strpos(XOOPS_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) { |
|
60 | + if (strpos(XOOPS_PATH.'/', XOOPS_ROOT_PATH.'/') !== false || strpos(XOOPS_PATH.'/', $_SERVER['DOCUMENT_ROOT'].'/') !== false) { |
|
61 | 61 | xoops_error(sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_PATH)); |
62 | 62 | echo '<br>'; |
63 | 63 | } |
64 | 64 | |
65 | - if (strpos(XOOPS_VAR_PATH . '/', XOOPS_ROOT_PATH . '/') !== false || strpos(XOOPS_VAR_PATH . '/', $_SERVER['DOCUMENT_ROOT'] . '/') !== false) { |
|
65 | + if (strpos(XOOPS_VAR_PATH.'/', XOOPS_ROOT_PATH.'/') !== false || strpos(XOOPS_VAR_PATH.'/', $_SERVER['DOCUMENT_ROOT'].'/') !== false) { |
|
66 | 66 | xoops_error(sprintf(_AD_WARNINGXOOPSLIBINSIDE, XOOPS_VAR_PATH)); |
67 | 67 | echo '<br>'; |
68 | 68 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | $rssurl = array(); |
75 | 75 | //$rssurl[] = 'http://sourceforge.net/export/rss2_projnews.php?group_id=41586&rss_fulltext=1'; |
76 | 76 | $rssurl[] = 'http://www.xoops.org/backend.php'; |
77 | - if ($URLs = include $GLOBALS['xoops']->path('language/' . xoops_getConfigOption('language') . '/backend.php')) { |
|
77 | + if ($URLs = include $GLOBALS['xoops']->path('language/'.xoops_getConfigOption('language').'/backend.php')) { |
|
78 | 78 | $rssurl = array_unique(array_merge($rssurl, $URLs)); |
79 | 79 | } |
80 | - $rssfile = 'adminnews-' . xoops_getConfigOption('language'); |
|
80 | + $rssfile = 'adminnews-'.xoops_getConfigOption('language'); |
|
81 | 81 | xoops_load('XoopsCache'); |
82 | 82 | $items = array(); |
83 | 83 | if (!$items = XoopsCache::read($rssfile)) { |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | $rssdata = $snoopy->results; |
93 | 93 | $rss2parser = new XoopsXmlRss2Parser($rssdata); |
94 | 94 | if (false !== $rss2parser->parse()) { |
95 | - $_items =& $rss2parser->getItems(); |
|
95 | + $_items = & $rss2parser->getItems(); |
|
96 | 96 | $count = count($_items); |
97 | 97 | for ($i = 0; $i < $count; ++$i) { |
98 | 98 | $_items[$i]['title'] = XoopsLocal::convert_encoding($_items[$i]['title'], _CHARSET, 'UTF-8'); |
99 | 99 | $_items[$i]['description'] = XoopsLocal::convert_encoding($_items[$i]['description'], _CHARSET, 'UTF-8'); |
100 | - $items[(string)strtotime($_items[$i]['pubdate']) . '-' . (string)($cnt++)] = $_items[$i]; |
|
100 | + $items[(string)strtotime($_items[$i]['pubdate']).'-'.(string)($cnt++)] = $_items[$i]; |
|
101 | 101 | } |
102 | 102 | } else { |
103 | 103 | echo $rss2parser->getErrors(); |
@@ -110,16 +110,16 @@ discard block |
||
110 | 110 | if ($items != '') { |
111 | 111 | $ret = '<table class="outer width100">'; |
112 | 112 | foreach (array_keys($items) as $i) { |
113 | - $ret .= '<tr class="head"><td><a href="' . htmlspecialchars($items[$i]['link']) . '" rel="external">'; |
|
114 | - $ret .= htmlspecialchars($items[$i]['title']) . '</a> (' . htmlspecialchars($items[$i]['pubdate']) . ')</td></tr>'; |
|
113 | + $ret .= '<tr class="head"><td><a href="'.htmlspecialchars($items[$i]['link']).'" rel="external">'; |
|
114 | + $ret .= htmlspecialchars($items[$i]['title']).'</a> ('.htmlspecialchars($items[$i]['pubdate']).')</td></tr>'; |
|
115 | 115 | if ($items[$i]['description'] != '') { |
116 | - $ret .= '<tr><td class="odd">' . $items[$i]['description']; |
|
116 | + $ret .= '<tr><td class="odd">'.$items[$i]['description']; |
|
117 | 117 | if (!empty($items[$i]['guid'])) { |
118 | - $ret .= ' <a href="' . htmlspecialchars($items[$i]['guid']) . '" rel="external" title="">' . _MORE . '</a>'; |
|
118 | + $ret .= ' <a href="'.htmlspecialchars($items[$i]['guid']).'" rel="external" title="">'._MORE.'</a>'; |
|
119 | 119 | } |
120 | 120 | $ret .= '</td></tr>'; |
121 | 121 | } elseif ($items[$i]['guid'] != '') { |
122 | - $ret .= '<tr><td class="even aligntop"></td><td colspan="2" class="odd"><a href="' . htmlspecialchars($items[$i]['guid']) . '" rel="external">' . _MORE . '</a></td></tr>'; |
|
122 | + $ret .= '<tr><td class="even aligntop"></td><td colspan="2" class="odd"><a href="'.htmlspecialchars($items[$i]['guid']).'" rel="external">'._MORE.'</a></td></tr>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | $ret .= '</table>'; |
@@ -15,26 +15,26 @@ |
||
15 | 15 | * @since 2.0.0 |
16 | 16 | */ |
17 | 17 | |
18 | -include __DIR__ . '/mainfile.php'; |
|
18 | +include __DIR__.'/mainfile.php'; |
|
19 | 19 | |
20 | 20 | header('Content-Type: text/html'); |
21 | -echo '<html><head><title>' . htmlspecialchars($xoopsConfig['sitename']) . "</title> |
|
21 | +echo '<html><head><title>'.htmlspecialchars($xoopsConfig['sitename'])."</title> |
|
22 | 22 | <meta name='HandheldFriendly' content='True' /> |
23 | 23 | <meta name='PalmComputingPlatform' content='True' /> |
24 | 24 | </head> |
25 | 25 | <body>"; |
26 | 26 | |
27 | -$sql = 'SELECT storyid, title FROM ' . $xoopsDB->prefix('stories') . ' WHERE published>0 AND published<' . time() . ' ORDER BY published DESC'; |
|
27 | +$sql = 'SELECT storyid, title FROM '.$xoopsDB->prefix('stories').' WHERE published>0 AND published<'.time().' ORDER BY published DESC'; |
|
28 | 28 | $result = $xoopsDB->query($sql, 10, 0); |
29 | 29 | //TODO Remove this hardcoded string |
30 | 30 | if (!$result) { |
31 | 31 | echo 'An error occured'; |
32 | 32 | } else { |
33 | - echo "<img src='images/logo.gif' alt='" . htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) . "' border='0' /><br>"; |
|
34 | - echo '<h2>' . htmlspecialchars($xoopsConfig['slogan']) . '</h2>'; |
|
33 | + echo "<img src='images/logo.gif' alt='".htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)."' border='0' /><br>"; |
|
34 | + echo '<h2>'.htmlspecialchars($xoopsConfig['slogan']).'</h2>'; |
|
35 | 35 | echo '<div>'; |
36 | 36 | while (false !== (list($storyid, $title) = $xoopsDB->fetchRow($result))) { |
37 | - echo "<a href='" . XOOPS_URL . "/modules/news/print.php?storyid=$storyid'>" . htmlspecialchars($title) . '</a><br>'; |
|
37 | + echo "<a href='".XOOPS_URL."/modules/news/print.php?storyid=$storyid'>".htmlspecialchars($title).'</a><br>'; |
|
38 | 38 | } |
39 | 39 | echo '</div>'; |
40 | 40 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | |
21 | 21 | $xoopsOption['pagetype'] = 'banners'; |
22 | -include __DIR__ . '/mainfile.php'; |
|
22 | +include __DIR__.'/mainfile.php'; |
|
23 | 23 | |
24 | 24 | /********************************************/ |
25 | 25 | /* Function to let your client login to see */ |
@@ -76,16 +76,16 @@ discard block |
||
76 | 76 | } |
77 | 77 | '); |
78 | 78 | echo "<div id='login_window'> |
79 | - <h2 class='content_title'>" . _BANNERS_LOGIN_TITLE . "</h2> |
|
79 | + <h2 class='content_title'>" . _BANNERS_LOGIN_TITLE."</h2> |
|
80 | 80 | <form method='post' action='banners.php' class='login_form'> |
81 | 81 | <div class='credentials'> |
82 | - <label for='login_form-login'>" . _BANNERS_LOGIN_LOGIN . "</label> |
|
82 | + <label for='login_form-login'>" . _BANNERS_LOGIN_LOGIN."</label> |
|
83 | 83 | <input type='text' name='login' id='login_form-login' value='' /><br> |
84 | - <label for='login_form-password'>" . _BANNERS_LOGIN_PASS . "</label> |
|
84 | + <label for='login_form-password'>" . _BANNERS_LOGIN_PASS."</label> |
|
85 | 85 | <input type='password' name='pass' id='login_form-password' value='' /><br> |
86 | 86 | </div> |
87 | - <div class='actions'><input type='hidden' name='op' value='Ok' /><button type='submit'>" . _BANNERS_LOGIN_OK . "</button></div> |
|
88 | - <div class='login_info'>" . _BANNERS_LOGIN_INFO . '</div>' . $GLOBALS['xoopsSecurity']->getTokenHTML('BANNER_LOGIN') . ' |
|
87 | + <div class='actions'><input type='hidden' name='op' value='Ok' /><button type='submit'>" . _BANNERS_LOGIN_OK."</button></div> |
|
88 | + <div class='login_info'>" . _BANNERS_LOGIN_INFO.'</div>'.$GLOBALS['xoopsSecurity']->getTokenHTML('BANNER_LOGIN').' |
|
89 | 89 | </form></div>'; |
90 | 90 | include $GLOBALS['xoops']->path('footer.php'); |
91 | 91 | } |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | '); |
113 | 113 | |
114 | 114 | echo "<div id='bannerstats'> |
115 | - <h4 class='content_title'>" . sprintf(_BANNERS_TITLE, $name) . "</h4><hr /> |
|
115 | + <h4 class='content_title'>" . sprintf(_BANNERS_TITLE, $name)."</h4><hr /> |
|
116 | 116 | <table summary=''> |
117 | - <caption>" . sprintf(_BANNERS_TITLE, $name) . '</caption> |
|
117 | + <caption>" . sprintf(_BANNERS_TITLE, $name).'</caption> |
|
118 | 118 | <thead><tr> |
119 | 119 | <td>ID</td> |
120 | - <td>' . _BANNERS_IMP_MADE . '</td> |
|
121 | - <td>' . _BANNERS_IMP_TOTAL . '</td> |
|
122 | - <td>' . _BANNERS_IMP_LEFT . '</td> |
|
123 | - <td>' . _BANNERS_CLICKS . '</td> |
|
124 | - <td>' . _BANNERS_PER_CLICKS . '</td> |
|
125 | - <td>' . _BANNERS_FUNCTIONS . "</td></tr></thead> |
|
120 | + <td>' . _BANNERS_IMP_MADE.'</td> |
|
121 | + <td>' . _BANNERS_IMP_TOTAL.'</td> |
|
122 | + <td>' . _BANNERS_IMP_LEFT.'</td> |
|
123 | + <td>' . _BANNERS_CLICKS.'</td> |
|
124 | + <td>' . _BANNERS_PER_CLICKS.'</td> |
|
125 | + <td>' . _BANNERS_FUNCTIONS."</td></tr></thead> |
|
126 | 126 | <tfoot><tr><td colspan='7'></td></tr></tfoot>"; |
127 | 127 | |
128 | - $result = $xoopsDB->query('SELECT bid, imptotal, impmade, clicks, date FROM ' . $xoopsDB->prefix('banner') . " WHERE cid={$cid}"); |
|
128 | + $result = $xoopsDB->query('SELECT bid, imptotal, impmade, clicks, date FROM '.$xoopsDB->prefix('banner')." WHERE cid={$cid}"); |
|
129 | 129 | $i = 0; |
130 | 130 | while (false !== (list($bid, $imptotal, $impmade, $clicks, $date) = $xoopsDB->fetchRow($result))) { |
131 | 131 | if ($impmade == 0) { |
@@ -146,14 +146,14 @@ discard block |
||
146 | 146 | <td>{$left}</td> |
147 | 147 | <td>{$clicks}</td> |
148 | 148 | <td>{$percent}%</td> |
149 | - <td><a href='banners.php?op=EmailStats&cid={$cid}&bid={$bid}' title='" . _BANNERS_STATS . "'>" . _BANNERS_STATS . '</a></td></tr></tbody>'; |
|
149 | + <td><a href='banners.php?op=EmailStats&cid={$cid}&bid={$bid}' title='"._BANNERS_STATS."'>"._BANNERS_STATS.'</a></td></tr></tbody>'; |
|
150 | 150 | ++$i; |
151 | 151 | } |
152 | 152 | echo "</table> |
153 | 153 | <br><br> |
154 | - <h4 class='content_title'>" . _BANNERS_FOW_IN . htmlspecialchars($xoopsConfig['sitename']) . '</h4><hr />'; |
|
154 | + <h4 class='content_title'>" . _BANNERS_FOW_IN.htmlspecialchars($xoopsConfig['sitename']).'</h4><hr />'; |
|
155 | 155 | |
156 | - $result = $xoopsDB->query('SELECT bid, imageurl, clickurl, htmlbanner, htmlcode FROM ' . $xoopsDB->prefix('banner') . " WHERE cid={$cid}"); |
|
156 | + $result = $xoopsDB->query('SELECT bid, imageurl, clickurl, htmlbanner, htmlcode FROM '.$xoopsDB->prefix('banner')." WHERE cid={$cid}"); |
|
157 | 157 | while (false !== (list($bid, $imageurl, $clickurl, $htmlbanner, $htmlcode) = $xoopsDB->fetchRow($result))) { |
158 | 158 | $numrows = $xoopsDB->getRowsNum($result); |
159 | 159 | if ($numrows > 1) { |
@@ -171,31 +171,31 @@ discard block |
||
171 | 171 | echo "<img src='{$imageurl}' alt='' />"; |
172 | 172 | } |
173 | 173 | } |
174 | - echo '<br><strong>' . _BANNERS_ID . $bid . '</strong><br>' . sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid=' . $cid . '&bid=' . $bid) . '<br>'; |
|
174 | + echo '<br><strong>'._BANNERS_ID.$bid.'</strong><br>'.sprintf(_BANNERS_SEND_STATS, 'banners.php?op=EmailStats&cid='.$cid.'&bid='.$bid).'<br>'; |
|
175 | 175 | if (!$htmlbanner) { |
176 | 176 | $clickurl = htmlspecialchars($clickurl, ENT_QUOTES); |
177 | - echo sprintf(_BANNERS_POINTS, $clickurl) . "<br> |
|
178 | - <form action='banners.php' method='post'>" . _BANNERS_URL . " |
|
177 | + echo sprintf(_BANNERS_POINTS, $clickurl)."<br> |
|
178 | + <form action='banners.php' method='post'>" . _BANNERS_URL." |
|
179 | 179 | <input type='text' name='url' size='50' maxlength='200' value='{$clickurl}' /> |
180 | 180 | <input type='hidden' name='bid' value='{$bid}' /> |
181 | 181 | <input type='hidden' name='cid' value='{$cid}' /> |
182 | - <input type='submit' name='op' value='" . _BANNERS_CHANGE . "' />" . $GLOBALS['xoopsSecurity']->getTokenHTML('BANNER_EDIT') . '</form>'; |
|
182 | + <input type='submit' name='op' value='"._BANNERS_CHANGE."' />".$GLOBALS['xoopsSecurity']->getTokenHTML('BANNER_EDIT').'</form>'; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
186 | 186 | /* Finnished Banners */ |
187 | 187 | echo '<br>'; |
188 | - if ($result = $xoopsDB->query('SELECT bid, impressions, clicks, datestart, dateend FROM ' . $xoopsDB->prefix('bannerfinish') . " WHERE cid={$cid}")) { |
|
189 | - echo "<h4 class='content_title'>" . sprintf(_BANNERS_FINISHED, $name) . "</h4><hr /> |
|
188 | + if ($result = $xoopsDB->query('SELECT bid, impressions, clicks, datestart, dateend FROM '.$xoopsDB->prefix('bannerfinish')." WHERE cid={$cid}")) { |
|
189 | + echo "<h4 class='content_title'>".sprintf(_BANNERS_FINISHED, $name)."</h4><hr /> |
|
190 | 190 | <table summary=''> |
191 | - <caption>" . sprintf(_BANNERS_FINISHED, $name) . '</caption> |
|
191 | + <caption>" . sprintf(_BANNERS_FINISHED, $name).'</caption> |
|
192 | 192 | <thead><tr> |
193 | 193 | <td>ID</td> |
194 | - <td>' . _BANNERS_IMP_MADE . '</td> |
|
195 | - <td>' . _BANNERS_CLICKS . '</td> |
|
196 | - <td>' . _BANNERS_PER_CLICKS . '</td> |
|
197 | - <td>' . _BANNERS_STARTED . '</td> |
|
198 | - <td>' . _BANNERS_ENDED . "</td></tr></thead> |
|
194 | + <td>' . _BANNERS_IMP_MADE.'</td> |
|
195 | + <td>' . _BANNERS_CLICKS.'</td> |
|
196 | + <td>' . _BANNERS_PER_CLICKS.'</td> |
|
197 | + <td>' . _BANNERS_STARTED.'</td> |
|
198 | + <td>' . _BANNERS_ENDED."</td></tr></thead> |
|
199 | 199 | <tfoot><tr><td colspan='6'></td></tr></tfoot>"; |
200 | 200 | |
201 | 201 | $i = 0; |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | <td>{$impressions}</td> |
212 | 212 | <td>{$clicks}</td> |
213 | 213 | <td>{$percent}%</td> |
214 | - <td>" . formatTimestamp($datestart) . '</td> |
|
215 | - <td>' . formatTimestamp($dateend) . '</td></tr></tbody>'; |
|
214 | + <td>".formatTimestamp($datestart).'</td> |
|
215 | + <td>' . formatTimestamp($dateend).'</td></tr></tbody>'; |
|
216 | 216 | } |
217 | 217 | echo '</table></div>'; |
218 | 218 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | if ($email == '') { |
243 | 243 | redirect_header('banners.php', 3, sprintf(_BANNERS_MAIL_ERROR, $name)); |
244 | 244 | } else { |
245 | - if ($result = $xoopsDB->query('SELECT bid, imptotal, impmade, clicks, imageurl, clickurl, date FROM ' . $xoopsDB->prefix('banner') . " WHERE bid={$bid} AND cid={$cid}")) { |
|
245 | + if ($result = $xoopsDB->query('SELECT bid, imptotal, impmade, clicks, imageurl, clickurl, date FROM '.$xoopsDB->prefix('banner')." WHERE bid={$bid} AND cid={$cid}")) { |
|
246 | 246 | list($bid, $imptotal, $impmade, $clicks, $imageurl, $clickurl, $date) = $xoopsDB->fetchRow($result); |
247 | 247 | if ($impmade == 0) { |
248 | 248 | $percent = 0; |
@@ -312,12 +312,12 @@ discard block |
||
312 | 312 | global $xoopsDB; |
313 | 313 | $bid = (int)$bid; |
314 | 314 | if ($bid > 0) { |
315 | - $bresult = $xoopsDB->query('SELECT clickurl FROM ' . $xoopsDB->prefix('banner') . " WHERE bid={$bid}"); |
|
315 | + $bresult = $xoopsDB->query('SELECT clickurl FROM '.$xoopsDB->prefix('banner')." WHERE bid={$bid}"); |
|
316 | 316 | list($clickurl) = $xoopsDB->fetchRow($bresult); |
317 | 317 | if ($clickurl) { |
318 | 318 | if ($GLOBALS['xoopsSecurity']->checkReferer()) { |
319 | - $xoopsDB->queryF('UPDATE ' . $xoopsDB->prefix('banner') . " SET clicks=clicks+1 WHERE bid=$bid"); |
|
320 | - header('Location: ' . $clickurl); |
|
319 | + $xoopsDB->queryF('UPDATE '.$xoopsDB->prefix('banner')." SET clicks=clicks+1 WHERE bid=$bid"); |
|
320 | + header('Location: '.$clickurl); |
|
321 | 321 | } else { |
322 | 322 | //No valid referer found so some javascript error or direct access found |
323 | 323 | echo _BANNERS_NO_REFERER; |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | |
29 | 29 | if ($xoopsOption['theme_use_smarty'] == 0) { |
30 | 30 | // the old way |
31 | - $footer = htmlspecialchars($xoopsConfigMetaFooter['footer']) . '<br><div class="txtcenter small">Powered by XOOPS © <a href="http://xoops.org" rel="external" title="The XOOPS Project">The XOOPS Project</a></div>'; |
|
31 | + $footer = htmlspecialchars($xoopsConfigMetaFooter['footer']).'<br><div class="txtcenter small">Powered by XOOPS © <a href="http://xoops.org" rel="external" title="The XOOPS Project">The XOOPS Project</a></div>'; |
|
32 | 32 | if (isset($GLOBALS['xoopsOption']['template_main'])) { |
33 | 33 | $xoopsTpl->caching = 0; |
34 | - $xoopsTpl->display('db:' . $GLOBALS['xoopsOption']['template_main']); |
|
34 | + $xoopsTpl->display('db:'.$GLOBALS['xoopsOption']['template_main']); |
|
35 | 35 | } |
36 | 36 | if (!isset($xoopsOption['show_rblock'])) { |
37 | 37 | $xoopsOption['show_rblock'] = 0; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | // RMV-NOTIFY |
43 | 43 | include_once $GLOBALS['xoops']->path('include/notification_select.php'); |
44 | 44 | if (!headers_sent()) { |
45 | - header('Content-Type:text/html; charset=' . _CHARSET); |
|
45 | + header('Content-Type:text/html; charset='._CHARSET); |
|
46 | 46 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
47 | 47 | //header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
48 | 48 | header('Cache-Control: private, no-cache'); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (isset($GLOBALS['xoopsOption']['template_main']) && $GLOBALS['xoopsOption']['template_main'] != $xoTheme->contentTemplate) { |
58 | 58 | trigger_error("xoopsOption['template_main'] should be defined before including header.php", E_USER_WARNING); |
59 | 59 | if (false === strpos($GLOBALS['xoopsOption']['template_main'], ':')) { |
60 | - $xoTheme->contentTemplate = 'db:' . $GLOBALS['xoopsOption']['template_main']; |
|
60 | + $xoTheme->contentTemplate = 'db:'.$GLOBALS['xoopsOption']['template_main']; |
|
61 | 61 | } else { |
62 | 62 | $xoTheme->contentTemplate = $GLOBALS['xoopsOption']['template_main']; |
63 | 63 | } |
@@ -43,167 +43,167 @@ |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | switch ($op) { |
46 | - case 'cancel': |
|
47 | - // FIXME: does this always go back to correct location?? |
|
48 | - redirect_header('index.php'); |
|
49 | - break; |
|
46 | + case 'cancel': |
|
47 | + // FIXME: does this always go back to correct location?? |
|
48 | + redirect_header('index.php'); |
|
49 | + break; |
|
50 | 50 | |
51 | - case 'list': |
|
52 | - // Do we allow other users to see our notifications? Nope, but maybe |
|
53 | - // see who else is monitoring a particular item (or at least how many)? |
|
54 | - // Well, maybe admin can see all... |
|
55 | - // TODO: need to span over multiple pages...??? |
|
56 | - // Get an array of all notifications for the selected user |
|
57 | - $criteria = new Criteria('not_uid', $uid); |
|
58 | - $criteria->setSort('not_modid,not_category,not_itemid'); |
|
59 | - /* @var $notification_handler XoopsNotificationHandler */ |
|
60 | - $notification_handler = xoops_getHandler('notification'); |
|
61 | - $notifications = $notification_handler->getObjects($criteria); |
|
51 | + case 'list': |
|
52 | + // Do we allow other users to see our notifications? Nope, but maybe |
|
53 | + // see who else is monitoring a particular item (or at least how many)? |
|
54 | + // Well, maybe admin can see all... |
|
55 | + // TODO: need to span over multiple pages...??? |
|
56 | + // Get an array of all notifications for the selected user |
|
57 | + $criteria = new Criteria('not_uid', $uid); |
|
58 | + $criteria->setSort('not_modid,not_category,not_itemid'); |
|
59 | + /* @var $notification_handler XoopsNotificationHandler */ |
|
60 | + $notification_handler = xoops_getHandler('notification'); |
|
61 | + $notifications = $notification_handler->getObjects($criteria); |
|
62 | 62 | |
63 | - // Generate the info for the template |
|
64 | - /* @var $module_handler XoopsModuleHandler */ |
|
65 | - $module_handler = xoops_getHandler('module'); |
|
66 | - include_once $GLOBALS['xoops']->path('include/notification_functions.php'); |
|
67 | - $modules = array(); |
|
68 | - $prev_modid = -1; |
|
69 | - $prev_category = -1; |
|
70 | - $prev_item = -1; |
|
71 | - foreach ($notifications as $n) { |
|
72 | - $modid = $n->getVar('not_modid'); |
|
73 | - if ($modid != $prev_modid) { |
|
74 | - $prev_modid = $modid; |
|
75 | - $prev_category = -1; |
|
76 | - $prev_item = -1; |
|
77 | - $module = $module_handler->get($modid); |
|
78 | - $modules[$modid] = array( |
|
79 | - 'id' => $modid, |
|
80 | - 'name' => $module->getVar('name'), |
|
81 | - 'categories' => array()); |
|
82 | - // TODO: note, we could auto-generate the url from the id |
|
83 | - // and category info... (except when category has multiple |
|
84 | - // subscription scripts defined...) |
|
85 | - // OR, add one more option to xoops_version 'view_from' |
|
86 | - // which tells us where to redirect... BUT, e.g. forums, it |
|
87 | - // still wouldn't give us all the required info... e.g. the |
|
88 | - // topic ID doesn't give us the ID of the forum which is |
|
89 | - // a required argument... |
|
90 | - // Get the lookup function, if exists |
|
91 | - $not_config = $module->getInfo('notification'); |
|
92 | - $lookup_func = ''; |
|
93 | - if (!empty($not_config['lookup_file'])) { |
|
94 | - $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); |
|
95 | - if (file_exists($lookup_file)) { |
|
96 | - include_once $lookup_file; |
|
97 | - if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) { |
|
98 | - $lookup_func = $not_config['lookup_func']; |
|
63 | + // Generate the info for the template |
|
64 | + /* @var $module_handler XoopsModuleHandler */ |
|
65 | + $module_handler = xoops_getHandler('module'); |
|
66 | + include_once $GLOBALS['xoops']->path('include/notification_functions.php'); |
|
67 | + $modules = array(); |
|
68 | + $prev_modid = -1; |
|
69 | + $prev_category = -1; |
|
70 | + $prev_item = -1; |
|
71 | + foreach ($notifications as $n) { |
|
72 | + $modid = $n->getVar('not_modid'); |
|
73 | + if ($modid != $prev_modid) { |
|
74 | + $prev_modid = $modid; |
|
75 | + $prev_category = -1; |
|
76 | + $prev_item = -1; |
|
77 | + $module = $module_handler->get($modid); |
|
78 | + $modules[$modid] = array( |
|
79 | + 'id' => $modid, |
|
80 | + 'name' => $module->getVar('name'), |
|
81 | + 'categories' => array()); |
|
82 | + // TODO: note, we could auto-generate the url from the id |
|
83 | + // and category info... (except when category has multiple |
|
84 | + // subscription scripts defined...) |
|
85 | + // OR, add one more option to xoops_version 'view_from' |
|
86 | + // which tells us where to redirect... BUT, e.g. forums, it |
|
87 | + // still wouldn't give us all the required info... e.g. the |
|
88 | + // topic ID doesn't give us the ID of the forum which is |
|
89 | + // a required argument... |
|
90 | + // Get the lookup function, if exists |
|
91 | + $not_config = $module->getInfo('notification'); |
|
92 | + $lookup_func = ''; |
|
93 | + if (!empty($not_config['lookup_file'])) { |
|
94 | + $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); |
|
95 | + if (file_exists($lookup_file)) { |
|
96 | + include_once $lookup_file; |
|
97 | + if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) { |
|
98 | + $lookup_func = $not_config['lookup_func']; |
|
99 | + } |
|
99 | 100 | } |
100 | 101 | } |
101 | 102 | } |
102 | - } |
|
103 | - $category = $n->getVar('not_category'); |
|
104 | - if ($category != $prev_category) { |
|
105 | - $prev_category = $category; |
|
106 | - $prev_item = -1; |
|
107 | - $category_info = ¬ificationCategoryInfo($category, $modid); |
|
108 | - $modules[$modid]['categories'][$category] = array( |
|
109 | - 'name' => $category, |
|
110 | - 'title' => $category_info['title'], |
|
111 | - 'items' => array()); |
|
112 | - } |
|
113 | - $item = $n->getVar('not_itemid'); |
|
114 | - if ($item != $prev_item) { |
|
115 | - $prev_item = $item; |
|
116 | - if (!empty($lookup_func)) { |
|
117 | - $item_info = $lookup_func($category, $item); |
|
118 | - } else { |
|
119 | - $item_info = array( |
|
120 | - 'name' => '[' . _NOT_NAMENOTAVAILABLE . ']', |
|
121 | - 'url' => ''); |
|
103 | + $category = $n->getVar('not_category'); |
|
104 | + if ($category != $prev_category) { |
|
105 | + $prev_category = $category; |
|
106 | + $prev_item = -1; |
|
107 | + $category_info = ¬ificationCategoryInfo($category, $modid); |
|
108 | + $modules[$modid]['categories'][$category] = array( |
|
109 | + 'name' => $category, |
|
110 | + 'title' => $category_info['title'], |
|
111 | + 'items' => array()); |
|
112 | + } |
|
113 | + $item = $n->getVar('not_itemid'); |
|
114 | + if ($item != $prev_item) { |
|
115 | + $prev_item = $item; |
|
116 | + if (!empty($lookup_func)) { |
|
117 | + $item_info = $lookup_func($category, $item); |
|
118 | + } else { |
|
119 | + $item_info = array( |
|
120 | + 'name' => '[' . _NOT_NAMENOTAVAILABLE . ']', |
|
121 | + 'url' => ''); |
|
122 | + } |
|
123 | + $modules[$modid]['categories'][$category]['items'][$item] = array( |
|
124 | + 'id' => $item, |
|
125 | + 'name' => $item_info['name'], |
|
126 | + 'url' => $item_info['url'], |
|
127 | + 'notifications' => array()); |
|
122 | 128 | } |
123 | - $modules[$modid]['categories'][$category]['items'][$item] = array( |
|
124 | - 'id' => $item, |
|
125 | - 'name' => $item_info['name'], |
|
126 | - 'url' => $item_info['url'], |
|
127 | - 'notifications' => array()); |
|
129 | + $event_info =& notificationEventInfo($category, $n->getVar('not_event'), $n->getVar('not_modid')); |
|
130 | + $modules[$modid]['categories'][$category]['items'][$item]['notifications'][] = array( |
|
131 | + 'id' => $n->getVar('not_id'), |
|
132 | + 'module_id' => $n->getVar('not_modid'), |
|
133 | + 'category' => $n->getVar('not_category'), |
|
134 | + 'category_title' => $category_info['title'], |
|
135 | + 'item_id' => $n->getVar('not_itemid'), |
|
136 | + 'event' => $n->getVar('not_event'), |
|
137 | + 'event_title' => $event_info['title'], |
|
138 | + 'user_id' => $n->getVar('not_uid')); |
|
128 | 139 | } |
129 | - $event_info =& notificationEventInfo($category, $n->getVar('not_event'), $n->getVar('not_modid')); |
|
130 | - $modules[$modid]['categories'][$category]['items'][$item]['notifications'][] = array( |
|
131 | - 'id' => $n->getVar('not_id'), |
|
132 | - 'module_id' => $n->getVar('not_modid'), |
|
133 | - 'category' => $n->getVar('not_category'), |
|
134 | - 'category_title' => $category_info['title'], |
|
135 | - 'item_id' => $n->getVar('not_itemid'), |
|
136 | - 'event' => $n->getVar('not_event'), |
|
137 | - 'event_title' => $event_info['title'], |
|
138 | - 'user_id' => $n->getVar('not_uid')); |
|
139 | - } |
|
140 | - $GLOBALS['xoopsOption']['template_main'] = 'system_notification_list.tpl'; |
|
141 | - include $GLOBALS['xoops']->path('header.php'); |
|
142 | - $xoopsTpl->assign('modules', $modules); |
|
143 | - $user_info = array('uid' => $xoopsUser->getVar('uid')); |
|
144 | - $xoopsTpl->assign('user', $user_info); |
|
145 | - $xoopsTpl->assign('lang_cancel', _CANCEL); |
|
146 | - $xoopsTpl->assign('lang_clear', _NOT_CLEAR); |
|
147 | - $xoopsTpl->assign('lang_delete', _DELETE); |
|
148 | - $xoopsTpl->assign('lang_checkall', _NOT_CHECKALL); |
|
149 | - $xoopsTpl->assign('lang_module', _NOT_MODULE); |
|
150 | - $xoopsTpl->assign('lang_event', _NOT_EVENT); |
|
151 | - $xoopsTpl->assign('lang_events', _NOT_EVENTS); |
|
152 | - $xoopsTpl->assign('lang_category', _NOT_CATEGORY); |
|
153 | - $xoopsTpl->assign('lang_itemid', _NOT_ITEMID); |
|
154 | - $xoopsTpl->assign('lang_itemname', _NOT_ITEMNAME); |
|
155 | - $xoopsTpl->assign('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS); |
|
156 | - $xoopsTpl->assign('notification_token', $GLOBALS['xoopsSecurity']->createToken()); |
|
157 | - include $GLOBALS['xoops']->path('footer.php'); |
|
140 | + $GLOBALS['xoopsOption']['template_main'] = 'system_notification_list.tpl'; |
|
141 | + include $GLOBALS['xoops']->path('header.php'); |
|
142 | + $xoopsTpl->assign('modules', $modules); |
|
143 | + $user_info = array('uid' => $xoopsUser->getVar('uid')); |
|
144 | + $xoopsTpl->assign('user', $user_info); |
|
145 | + $xoopsTpl->assign('lang_cancel', _CANCEL); |
|
146 | + $xoopsTpl->assign('lang_clear', _NOT_CLEAR); |
|
147 | + $xoopsTpl->assign('lang_delete', _DELETE); |
|
148 | + $xoopsTpl->assign('lang_checkall', _NOT_CHECKALL); |
|
149 | + $xoopsTpl->assign('lang_module', _NOT_MODULE); |
|
150 | + $xoopsTpl->assign('lang_event', _NOT_EVENT); |
|
151 | + $xoopsTpl->assign('lang_events', _NOT_EVENTS); |
|
152 | + $xoopsTpl->assign('lang_category', _NOT_CATEGORY); |
|
153 | + $xoopsTpl->assign('lang_itemid', _NOT_ITEMID); |
|
154 | + $xoopsTpl->assign('lang_itemname', _NOT_ITEMNAME); |
|
155 | + $xoopsTpl->assign('lang_activenotifications', _NOT_ACTIVENOTIFICATIONS); |
|
156 | + $xoopsTpl->assign('notification_token', $GLOBALS['xoopsSecurity']->createToken()); |
|
157 | + include $GLOBALS['xoops']->path('footer.php'); |
|
158 | 158 | |
159 | - // TODO: another display mode... instead of one notification per line, |
|
160 | - // show one line per item_id, with checkboxes for the available options... |
|
161 | - // and an update button to change them... And still have the delete box |
|
162 | - // to delete all notification for that item |
|
163 | - // How about one line per ID, showing category, name, id, and list of |
|
164 | - // events... |
|
165 | - // TODO: it would also be useful to provide links to other available |
|
166 | - // options so we can say switch from new_message to 'bookmark' if we |
|
167 | - // are receiving too many emails. OR, if we click on 'change options' |
|
168 | - // we get a form for that page... |
|
169 | - // TODO: option to specify one-time??? or other modes?? |
|
170 | - break; |
|
159 | + // TODO: another display mode... instead of one notification per line, |
|
160 | + // show one line per item_id, with checkboxes for the available options... |
|
161 | + // and an update button to change them... And still have the delete box |
|
162 | + // to delete all notification for that item |
|
163 | + // How about one line per ID, showing category, name, id, and list of |
|
164 | + // events... |
|
165 | + // TODO: it would also be useful to provide links to other available |
|
166 | + // options so we can say switch from new_message to 'bookmark' if we |
|
167 | + // are receiving too many emails. OR, if we click on 'change options' |
|
168 | + // we get a form for that page... |
|
169 | + // TODO: option to specify one-time??? or other modes?? |
|
170 | + break; |
|
171 | 171 | |
172 | - case 'delete_ok': |
|
173 | - if (empty($_POST['del_not'])) { |
|
174 | - redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); |
|
175 | - } |
|
176 | - include $GLOBALS['xoops']->path('header.php'); |
|
177 | - $hidden_vars = array( |
|
178 | - 'uid' => $uid, |
|
179 | - 'delete_ok' => 1, |
|
180 | - 'del_not' => $_POST['del_not']); |
|
181 | - echo '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; |
|
182 | - xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL); |
|
183 | - include $GLOBALS['xoops']->path('footer.php'); |
|
184 | - // FIXME: There is a problem here... in xoops_confirm it treats arrays as |
|
185 | - // optional radio arguments on the confirmation page... change this or |
|
186 | - // write new function... |
|
187 | - break; |
|
172 | + case 'delete_ok': |
|
173 | + if (empty($_POST['del_not'])) { |
|
174 | + redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); |
|
175 | + } |
|
176 | + include $GLOBALS['xoops']->path('header.php'); |
|
177 | + $hidden_vars = array( |
|
178 | + 'uid' => $uid, |
|
179 | + 'delete_ok' => 1, |
|
180 | + 'del_not' => $_POST['del_not']); |
|
181 | + echo '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; |
|
182 | + xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL); |
|
183 | + include $GLOBALS['xoops']->path('footer.php'); |
|
184 | + // FIXME: There is a problem here... in xoops_confirm it treats arrays as |
|
185 | + // optional radio arguments on the confirmation page... change this or |
|
186 | + // write new function... |
|
187 | + break; |
|
188 | 188 | |
189 | - case 'delete': |
|
190 | - if (!$GLOBALS['xoopsSecurity']->check()) { |
|
191 | - redirect_header('notifications.php', 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
192 | - } |
|
193 | - if (empty($_POST['del_not'])) { |
|
194 | - redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); |
|
195 | - } |
|
196 | - $notification_handler = xoops_getHandler('notification'); |
|
197 | - foreach ($_POST['del_not'] as $n_array) { |
|
198 | - foreach ($n_array as $n) { |
|
199 | - $notification = $notification_handler->get($n); |
|
200 | - if ($notification->getVar('not_uid') == $uid) { |
|
201 | - $notification_handler->delete($notification); |
|
189 | + case 'delete': |
|
190 | + if (!$GLOBALS['xoopsSecurity']->check()) { |
|
191 | + redirect_header('notifications.php', 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors())); |
|
192 | + } |
|
193 | + if (empty($_POST['del_not'])) { |
|
194 | + redirect_header('notifications.php', 2, _NOT_NOTHINGTODELETE); |
|
195 | + } |
|
196 | + $notification_handler = xoops_getHandler('notification'); |
|
197 | + foreach ($_POST['del_not'] as $n_array) { |
|
198 | + foreach ($n_array as $n) { |
|
199 | + $notification = $notification_handler->get($n); |
|
200 | + if ($notification->getVar('not_uid') == $uid) { |
|
201 | + $notification_handler->delete($notification); |
|
202 | + } |
|
202 | 203 | } |
203 | 204 | } |
204 | - } |
|
205 | - redirect_header('notifications.php', 2, _NOT_DELETESUCCESS); |
|
206 | - break; |
|
207 | - default: |
|
208 | - break; |
|
205 | + redirect_header('notifications.php', 2, _NOT_DELETESUCCESS); |
|
206 | + break; |
|
207 | + default: |
|
208 | + break; |
|
209 | 209 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | $xoopsOption['pagetype'] = 'notification'; |
19 | -include __DIR__ . '/mainfile.php'; |
|
19 | +include __DIR__.'/mainfile.php'; |
|
20 | 20 | |
21 | 21 | if (!is_object($xoopsUser)) { |
22 | 22 | redirect_header('index.php', 3, _NOT_NOACCESS); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $not_config = $module->getInfo('notification'); |
92 | 92 | $lookup_func = ''; |
93 | 93 | if (!empty($not_config['lookup_file'])) { |
94 | - $lookup_file = $GLOBALS['xoops']->path('modules/' . $module->getVar('dirname') . '/' . $not_config['lookup_file']); |
|
94 | + $lookup_file = $GLOBALS['xoops']->path('modules/'.$module->getVar('dirname').'/'.$not_config['lookup_file']); |
|
95 | 95 | if (file_exists($lookup_file)) { |
96 | 96 | include_once $lookup_file; |
97 | 97 | if (!empty($not_config['lookup_func']) && function_exists($not_config['lookup_func'])) { |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $item_info = $lookup_func($category, $item); |
118 | 118 | } else { |
119 | 119 | $item_info = array( |
120 | - 'name' => '[' . _NOT_NAMENOTAVAILABLE . ']', |
|
120 | + 'name' => '['._NOT_NAMENOTAVAILABLE.']', |
|
121 | 121 | 'url' => ''); |
122 | 122 | } |
123 | 123 | $modules[$modid]['categories'][$category]['items'][$item] = array( |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | 'url' => $item_info['url'], |
127 | 127 | 'notifications' => array()); |
128 | 128 | } |
129 | - $event_info =& notificationEventInfo($category, $n->getVar('not_event'), $n->getVar('not_modid')); |
|
129 | + $event_info = & notificationEventInfo($category, $n->getVar('not_event'), $n->getVar('not_modid')); |
|
130 | 130 | $modules[$modid]['categories'][$category]['items'][$item]['notifications'][] = array( |
131 | 131 | 'id' => $n->getVar('not_id'), |
132 | 132 | 'module_id' => $n->getVar('not_modid'), |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | 'uid' => $uid, |
179 | 179 | 'delete_ok' => 1, |
180 | 180 | 'del_not' => $_POST['del_not']); |
181 | - echo '<h4>' . _NOT_DELETINGNOTIFICATIONS . '</h4>'; |
|
181 | + echo '<h4>'._NOT_DELETINGNOTIFICATIONS.'</h4>'; |
|
182 | 182 | xoops_confirm($hidden_vars, xoops_getenv('PHP_SELF'), _NOT_RUSUREDEL); |
183 | 183 | include $GLOBALS['xoops']->path('footer.php'); |
184 | 184 | // FIXME: There is a problem here... in xoops_confirm it treats arrays as |