@@ -30,19 +30,19 @@ discard block |
||
30 | 30 | if (!empty($_POST['pdf_data'])) { |
31 | 31 | $pdf_data = unserialize(base64_decode($_POST['pdf_data'])); |
32 | 32 | } elseif (!empty($pdf_data)) { |
33 | -} else { |
|
33 | +}else { |
|
34 | 34 | error_reporting(0); |
35 | - include __DIR__ . '/header.php'; |
|
35 | + include __DIR__.'/header.php'; |
|
36 | 36 | error_reporting(0); |
37 | 37 | |
38 | 38 | if (planet_parse_args($args_num, $args, $args_str)) { |
39 | 39 | $args['article'] = @$args_num[0]; |
40 | 40 | } |
41 | 41 | |
42 | - $article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
42 | + $article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
43 | 43 | |
44 | 44 | $article_handler = xoops_getModuleHandler('article', $GLOBALS['moddirname']); |
45 | - $article_obj =& $article_handler->get($article_id); |
|
45 | + $article_obj = & $article_handler->get($article_id); |
|
46 | 46 | |
47 | 47 | $article_data = array(); |
48 | 48 | |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | $pdf_data['date'] = $article_data['time']; |
70 | 70 | $pdf_data['content'] = ''; |
71 | 71 | if ($article_data['summary']) { |
72 | - $pdf_data['content'] .= planet_constant('MD_SUMMARY') . ': ' . $article_data['summary'] . '<br><br>'; |
|
72 | + $pdf_data['content'] .= planet_constant('MD_SUMMARY').': '.$article_data['summary'].'<br><br>'; |
|
73 | 73 | } |
74 | - $pdf_data['content'] .= $article_data['text'] . '<br>'; |
|
75 | - $pdf_data['url'] = XOOPS_URL . '/modules/' . $GLOBALS['artdirname'] . '/view.article.php' . URL_DELIMITER |
|
74 | + $pdf_data['content'] .= $article_data['text'].'<br>'; |
|
75 | + $pdf_data['url'] = XOOPS_URL.'/modules/'.$GLOBALS['artdirname'].'/view.article.php'.URL_DELIMITER |
|
76 | 76 | . $article_obj->getVar('art_id'); |
77 | 77 | } |
78 | 78 | $pdf_data['filename'] = preg_replace("/[^0-9a-z\-_\.]/i", '', $pdf_data['title']); |
79 | 79 | |
80 | -include XOOPS_ROOT_PATH . '/Frameworks/fpdf/init.php'; |
|
80 | +include XOOPS_ROOT_PATH.'/Frameworks/fpdf/init.php'; |
|
81 | 81 | error_reporting(0); |
82 | 82 | ob_end_clean(); |
83 | 83 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | planet_parse_function(' |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | if (!defined('planet_FUNCTIONS')): |
38 | 38 | define('planet_FUNCTIONS', 1); |
39 | 39 | |
40 | - require XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/vars.php'; |
|
41 | - include_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
42 | - include_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.php'; |
|
40 | + require XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/vars.php'; |
|
41 | + include_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
42 | + include_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.php'; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Function to display messages |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * - "&" in a string |
67 | 67 | */ |
68 | 68 | function planet_parse_args(&$args_numeric, &$args, &$args_string) { |
69 | - $args_abb = array( |
|
69 | + $args_abb = array( |
|
70 | 70 | 'a' => 'article', |
71 | 71 | 'b' => 'blog', |
72 | 72 | 'c' => 'category', |
@@ -81,24 +81,24 @@ discard block |
||
81 | 81 | if (preg_match("/[^\?]*\.php[\/|\?]([^\?]*)/i", $_SERVER['REQUEST_URI'], $matches)) { |
82 | 82 | $vars = preg_split("/[\/|&]/", $matches[1]); |
83 | 83 | $vars = array_map('trim', $vars); |
84 | - if (count($vars) > 0) { |
|
84 | + if (count($vars)>0) { |
|
85 | 85 | foreach ($vars as $var) { |
86 | 86 | if (is_numeric($var)) { |
87 | 87 | $args_numeric[] = $var; |
88 | 88 | } elseif (false === strpos($var, '=')) { |
89 | 89 | if (is_numeric(substr($var, 1))) { |
90 | - $args[$args_abb[strtolower($var{0})]] = (int)substr($var, 1); |
|
91 | - } else { |
|
90 | + $args[$args_abb[strtolower($var{0})]] = (int) substr($var, 1); |
|
91 | + }else { |
|
92 | 92 | $args_string[] = urldecode($var); |
93 | 93 | } |
94 | - } else { |
|
94 | + }else { |
|
95 | 95 | parse_str($var, $args); |
96 | 96 | } |
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - return (count($args) + count($args_numeric) + count($args_string) == 0) ? null : true; |
|
101 | + return (count($args)+count($args_numeric)+count($args_string) == 0) ? null : true; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $pattern = array($pattern); |
121 | 121 | $replacement = array($replacement); |
122 | 122 | } |
123 | - if (is_array($pattern) && count($pattern) > 0) { |
|
123 | + if (is_array($pattern) && count($pattern)>0) { |
|
124 | 124 | $ii = 0; |
125 | 125 | foreach ($pattern as $pat) { |
126 | 126 | if (!in_array($pat, $patterns)) { |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | $pattern = array($pattern); |
156 | 156 | $replacement = array($replacement); |
157 | 157 | } |
158 | - if (is_array($pattern) && count($pattern) > 0) { |
|
158 | + if (is_array($pattern) && count($pattern)>0) { |
|
159 | 159 | $ii = 0; |
160 | 160 | foreach ($pattern as $pat) { |
161 | 161 | if (!in_array($pat, $patterns)) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if (!is_array($userid)) { |
197 | 197 | $userid = array($userid); |
198 | 198 | } |
199 | - $users =& mod_getUnameFromIds($userid, $usereal, $linked); |
|
199 | + $users = & mod_getUnameFromIds($userid, $usereal, $linked); |
|
200 | 200 | |
201 | 201 | return $users; |
202 | 202 | } |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | $myts = MyTextSanitizer::getInstance(); |
213 | 213 | $link_array = preg_split("/(\r\n|\r|\n)( *)/", $text); |
214 | 214 | $links = array(); |
215 | - if (count($link_array) > 0) { |
|
215 | + if (count($link_array)>0) { |
|
216 | 216 | foreach ($link_array as $link) { |
217 | 217 | @list($url, $title) = array_map('trim', preg_split('/ /', $link, 2)); |
218 | 218 | if (empty($url)) { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * @return string |
232 | 232 | */ |
233 | 233 | function planet_getTemplate($pagename) { |
234 | - return $GLOBALS['VAR_PREFIX'] . '_' . $pagename . '.tpl'; |
|
234 | + return $GLOBALS['VAR_PREFIX'].'_'.$pagename.'.tpl'; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | return false; |
258 | 258 | } |
259 | 259 | @list($pat, $rep) = array_map('trim', preg_split("#[\s]+#", $pattern)); |
260 | - $trackback_url = preg_replace('#' . $pat . '#', $rep, $article_obj->getVar('art_link')); |
|
260 | + $trackback_url = preg_replace('#'.$pat.'#', $rep, $article_obj->getVar('art_link')); |
|
261 | 261 | |
262 | 262 | return planet_trackback($trackback_url, $article); |
263 | 263 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | |
273 | 273 | $title = $article->getVar('art_title'); |
274 | 274 | $excerpt = $article->getVar('art_content'); |
275 | - $blog_name = $xoopsConfig['sitename'] . '-' . $xoopsModule->getVar('name'); |
|
275 | + $blog_name = $xoopsConfig['sitename'].'-'.$xoopsModule->getVar('name'); |
|
276 | 276 | $title = xoops_utf8_encode($title); |
277 | 277 | $excerpt = xoops_utf8_encode($excerpt); |
278 | 278 | $blog_name = xoops_utf8_encode($blog_name); |
@@ -280,18 +280,18 @@ discard block |
||
280 | 280 | $title1 = urlencode($title); |
281 | 281 | $excerpt1 = urlencode($excerpt); |
282 | 282 | $name1 = urlencode($blog_name); |
283 | - $url = urlencode(XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' |
|
284 | - . URL_DELIMITER . '' . $article->getVar('art_id')); |
|
283 | + $url = urlencode(XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php' |
|
284 | + . URL_DELIMITER.''.$article->getVar('art_id')); |
|
285 | 285 | $query_string = "title=$title1&url=$url&blog_name=$name1&excerpt=$excerpt1&charset=$charset"; |
286 | 286 | $trackback_url = parse_url($trackback_url); |
287 | 287 | |
288 | - $http_request = 'POST ' . $trackback_url['path'] . ($trackback_url['query'] ? '?' |
|
288 | + $http_request = 'POST '.$trackback_url['path'].($trackback_url['query'] ? '?' |
|
289 | 289 | . $trackback_url['query'] : '') |
290 | 290 | . " HTTP/1.0\r\n"; |
291 | - $http_request .= 'Host: ' . $trackback_url['host'] . "\r\n"; |
|
292 | - $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset=' . $charset . "\r\n"; |
|
293 | - $http_request .= 'Content-Length: ' . strlen($query_string) . "\r\n"; |
|
294 | - $http_request .= 'User-Agent: XOOPS Blogs/' . XOOPS_VERSION; |
|
291 | + $http_request .= 'Host: '.$trackback_url['host']."\r\n"; |
|
292 | + $http_request .= 'Content-Type: application/x-www-form-urlencoded; charset='.$charset."\r\n"; |
|
293 | + $http_request .= 'Content-Length: '.strlen($query_string)."\r\n"; |
|
294 | + $http_request .= 'User-Agent: XOOPS Blogs/'.XOOPS_VERSION; |
|
295 | 295 | $http_request .= "\r\n\r\n"; |
296 | 296 | $http_request .= $query_string; |
297 | 297 | if ('' == $trackback_url['port']) { |
@@ -300,11 +300,11 @@ discard block |
||
300 | 300 | $fs = @fsockopen($trackback_url['host'], $trackback_url['port'], $errno, $errstr, 4); |
301 | 301 | @fwrite($fs, $http_request); |
302 | 302 | if ($xoopsModuleConfig['do_debug']) { |
303 | - $debug_file = XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '_trackback.log'; |
|
303 | + $debug_file = XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'_trackback.log'; |
|
304 | 304 | $fr = "\n*****\nRequest:\n\n$http_request\n\nResponse:\n\n"; |
305 | 305 | $fr .= "CHARSET:$charset\n"; |
306 | 306 | $fr .= "NAME:$blog_name\n"; |
307 | - $fr .= 'TITLE:' . $title . "\n"; |
|
307 | + $fr .= 'TITLE:'.$title."\n"; |
|
308 | 308 | $fr .= "EXCERPT:$excerpt\n\n"; |
309 | 309 | while (!@feof($fs)) { |
310 | 310 | $fr .= @fgets($fs, 4096); |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | if ($fp = fopen($debug_file, 'a')) { |
315 | 315 | fwrite($fp, $fr); |
316 | 316 | fclose($fp); |
317 | - } else { |
|
317 | + }else { |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | @fclose($fs); |
@@ -333,19 +333,19 @@ discard block |
||
333 | 333 | planet_ping($serv, $id); |
334 | 334 | } |
335 | 335 | } |
336 | - include_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class-IXR.php'; |
|
336 | + include_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/class-IXR.php'; |
|
337 | 337 | |
338 | 338 | // using a timeout of 3 seconds should be enough to cover slow servers |
339 | 339 | $client = new IXR_Client($server, false); |
340 | 340 | $client->timeout = 3; |
341 | - $client->useragent .= ' -- XOOPS Article/' . XOOPS_VERSION; |
|
341 | + $client->useragent .= ' -- XOOPS Article/'.XOOPS_VERSION; |
|
342 | 342 | |
343 | 343 | // when set to true, this outputs debug messages by itself |
344 | 344 | $client->debug = false; |
345 | 345 | |
346 | 346 | $blogname = xoops_utf8_encode($GLOBALS['xoopsModule']->getVar('name')); |
347 | - $home = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/'; |
|
348 | - $rss2_url = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/xml.php' . URL_DELIMITER . 'rss2.0/' . $id; |
|
347 | + $home = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/'; |
|
348 | + $rss2_url = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/xml.php'.URL_DELIMITER.'rss2.0/'.$id; |
|
349 | 349 | |
350 | 350 | if (!$client->query('weblogUpdates.extendedPing', $blogname, $home, $rss2_url)) { // then try a normal ping |
351 | 351 | $client->query('weblogUpdates.ping', $blogname, $home); |
@@ -360,16 +360,16 @@ discard block |
||
360 | 360 | function planet_trackback_response($error = 0, $error_message = '') { |
361 | 361 | $charset = 'utf-8'; |
362 | 362 | $error_message = xoops_utf8_encode($error_message); |
363 | - header('Content-Type: text/xml; charset="' . $charset . '"'); |
|
363 | + header('Content-Type: text/xml; charset="'.$charset.'"'); |
|
364 | 364 | if ($error) { |
365 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
365 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
366 | 366 | echo "<response>\n"; |
367 | 367 | echo "<error>1</error>\n"; |
368 | 368 | echo "<message>$error_message</message>\n"; |
369 | 369 | echo '</response>'; |
370 | 370 | die(); |
371 | - } else { |
|
372 | - echo '<?xml version="1.0" encoding="' . $charset . '"?' . ">\n"; |
|
371 | + }else { |
|
372 | + echo '<?xml version="1.0" encoding="'.$charset.'"?'.">\n"; |
|
373 | 373 | echo "<response>\n"; |
374 | 374 | echo "<error>0</error>\n"; |
375 | 375 | echo '</response>'; |
@@ -388,11 +388,11 @@ discard block |
||
388 | 388 | if (is_array($string)) { |
389 | 389 | $value = array(); |
390 | 390 | foreach ($string as $key => $val) { |
391 | - $value[] = $key . '|' . $val; |
|
391 | + $value[] = $key.'|'.$val; |
|
392 | 392 | } |
393 | 393 | $string = implode(',', $value); |
394 | 394 | } |
395 | - setcookie($GLOBALS['VAR_PREFIX'] . $name, $string, (int)$expire, '/'); |
|
395 | + setcookie($GLOBALS['VAR_PREFIX'].$name, $string, (int) $expire, '/'); |
|
396 | 396 | } |
397 | 397 | |
398 | 398 | /** |
@@ -401,14 +401,14 @@ discard block |
||
401 | 401 | * @return array|null |
402 | 402 | */ |
403 | 403 | function planet_getcookie($name, $isArray = false) { |
404 | - $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'] . $name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'] . $name] : null; |
|
404 | + $value = isset($_COOKIE[$GLOBALS['VAR_PREFIX'].$name]) ? $_COOKIE[$GLOBALS['VAR_PREFIX'].$name] : null; |
|
405 | 405 | if ($isArray) { |
406 | 406 | $_value = $value ? explode(',', $value) : array(); |
407 | 407 | $value = array(); |
408 | - if (count($_value) > 0) { |
|
408 | + if (count($_value)>0) { |
|
409 | 409 | foreach ($_value as $string) { |
410 | 410 | $key = substr($string, 0, strpos($string, '|')); |
411 | - $val = substr($string, strpos($string, '|') + 1); |
|
411 | + $val = substr($string, strpos($string, '|')+1); |
|
412 | 412 | $value[$key] = $val; |
413 | 413 | } |
414 | 414 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | * @return string |
463 | 463 | */ |
464 | 464 | function planet_fetch_snoopy($url) { |
465 | - require_once XOOPS_ROOT_PATH . '/class/snoopy.php'; |
|
465 | + require_once XOOPS_ROOT_PATH.'/class/snoopy.php'; |
|
466 | 466 | $snoopy = new Snoopy; |
467 | 467 | $data = ''; |
468 | 468 | if (@$snoopy->fetch($url)) { |
@@ -480,10 +480,10 @@ discard block |
||
480 | 480 | if (!function_exists('curl_init')) { |
481 | 481 | return false; |
482 | 482 | } |
483 | - $ch = curl_init(); // initialize curl handle |
|
483 | + $ch = curl_init(); // initialize curl handle |
|
484 | 484 | curl_setopt($ch, CURLOPT_URL, $url); // set url to post to |
485 | 485 | curl_setopt($ch, CURLOPT_FAILONERROR, 1); |
486 | - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);// allow redirects |
|
486 | + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects |
|
487 | 487 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // return into a variable |
488 | 488 | curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 31s |
489 | 489 | $data = curl_exec($ch); // run the whole process |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | if ($index === false) { |
524 | 524 | return false; |
525 | 525 | } |
526 | - $index = strlen($haystack) - strlen($needle) - $index; |
|
526 | + $index = strlen($haystack)-strlen($needle)-$index; |
|
527 | 527 | |
528 | 528 | return $index; |
529 | 529 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
16 | 16 | |
17 | -if (!@include_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
|
17 | +if (!@include_once XOOPS_ROOT_PATH.'/Frameworks/transfer/transfer.php') { |
|
18 | 18 | return null; |
19 | 19 | } |
20 | 20 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (isset($GLOBALS['xoopsModuleConfig'])) { |
78 | 78 | $moduleConfig = $GLOBALS['xoopsModuleConfig']; |
79 | 79 | } |
80 | - } else { |
|
80 | + }else { |
|
81 | 81 | $moduleHandler = xoops_getHandler('module'); |
82 | 82 | $module = $moduleHandler->getByDirname($GLOBALS['moddirname']); |
83 | 83 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | unset($configs); |
91 | 91 | } |
92 | - if ($customConfig = @include XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/plugin.php') { |
|
92 | + if ($customConfig = @include XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/plugin.php') { |
|
93 | 93 | $moduleConfig = array_merge($moduleConfig, $customConfig); |
94 | 94 | } |
95 | 95 | |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | if (!in_array(URL_DELIMITER, array('?', '/'))) { |
102 | 102 | die('Exit on security'); |
103 | 103 | } |
104 | - } else { |
|
104 | + }else { |
|
105 | 105 | $moduleConfig = planet_load_config(); |
106 | 106 | if (empty($moduleConfig['do_urw'])) { |
107 | 107 | define('URL_DELIMITER', '?'); |
108 | - } else { |
|
108 | + }else { |
|
109 | 109 | define('URL_DELIMITER', '/'); |
110 | 110 | } |
111 | 111 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $GLOBALS['MOD_DB_PREFIX'] = 'planet'; |
37 | 37 | |
38 | 38 | /* You are not supposed to modify following contents */ |
39 | -defined('FRAMEWORKS_ART_FUNCTIONS_INI') || require_once XOOPS_ROOT_PATH . '/Frameworks/art/functions.ini.php'; |
|
39 | +defined('FRAMEWORKS_ART_FUNCTIONS_INI') || require_once XOOPS_ROOT_PATH.'/Frameworks/art/functions.ini.php'; |
|
40 | 40 | $GLOBALS['moddirname'] = mod_getDirname(__FILE__); |
41 | 41 | |
42 | 42 | /* |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * You can chnage to any term but be capital and unique, no conflict with other modules |
51 | 51 | */ |
52 | 52 | $GLOBALS['VAR_PREFIXU'] = strtoupper($GLOBALS['moddirname']); |
53 | -require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/include/functions.ini.php'; |
|
53 | +require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/include/functions.ini.php'; |
|
54 | 54 | |
55 | 55 | // include customized variables |
56 | 56 | if (is_object($GLOBALS['xoopsModule']) && $GLOBALS['moddirname'] == $GLOBALS['xoopsModule']->getVar('dirname', 'n')) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
28 | 28 | |
29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
30 | 30 | $category_handler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | $form = new XoopsThemeForm(_EDIT, 'formblog', xoops_getenv('PHP_SELF'), 'POST', true); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $butt_save = new XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
85 | 85 | $button_tray->addElement($butt_save); |
86 | 86 | $butt_cancel = new XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
87 | -$butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] |
|
88 | - . '/index.php' . URL_DELIMITER . 'b' . (int)$blog_id . "\"'"); |
|
87 | +$butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'] |
|
88 | + . '/index.php'.URL_DELIMITER.'b'.(int) $blog_id."\"'"); |
|
89 | 89 | $button_tray->addElement($butt_cancel); |
90 | 90 | $form->addElement($button_tray); |
91 | 91 | $form->display(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
28 | 28 | |
29 | -include __DIR__ . '/vars.php'; |
|
29 | +include __DIR__.'/vars.php'; |
|
30 | 30 | mod_loadFunctions('', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | planet_parse_function(' |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | ob_start(); |
28 | -include __DIR__ . '/header.php'; |
|
28 | +include __DIR__.'/header.php'; |
|
29 | 29 | |
30 | 30 | if (planet_parse_args($args_num, $args, $args_str)) { |
31 | 31 | $args['article'] = @$args_num[0]; |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | /* Specified Article */ |
36 | -$article_id = (int)(empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
36 | +$article_id = (int) (empty($_GET['article']) ? @$args['article'] : $_GET['article']); |
|
37 | 37 | /* Specified Category */ |
38 | -$category_id = (int)(empty($_GET['category']) ? @$args['category'] : $_GET['category']); |
|
38 | +$category_id = (int) (empty($_GET['category']) ? @$args['category'] : $_GET['category']); |
|
39 | 39 | /* Specified Blog */ |
40 | -$blog_id = (int)(empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
40 | +$blog_id = (int) (empty($_GET['blog']) ? @$args['blog'] : $_GET['blog']); |
|
41 | 41 | /* Specified Bookmar(Favorite) UID */ |
42 | -$uid = (int)(empty($_GET['uid']) ? @$args['uid'] : $_GET['uid']); |
|
42 | +$uid = (int) (empty($_GET['uid']) ? @$args['uid'] : $_GET['uid']); |
|
43 | 43 | |
44 | 44 | $type = empty($_GET['type']) ? (empty($_GET['op']) ? @$args['type'] : $_GET['op']) : $_GET['type']; |
45 | 45 | $type = strtoupper($type); |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | $bookmark_handler = xoops_getModuleHandler('bookmark', $GLOBALS['moddirname']); |
63 | 63 | |
64 | 64 | if (!empty($article_id)) { |
65 | - $article_obj =& $article_handler->get($article_id); |
|
65 | + $article_obj = & $article_handler->get($article_id); |
|
66 | 66 | if (!$article_obj->getVar('art_id')) { |
67 | 67 | planet_trackback_response(1, planet_constant('MD_EXPIRED')); |
68 | 68 | exit(); |
69 | 69 | } |
70 | 70 | $source = 'article'; |
71 | 71 | } elseif (!empty($blog_id)) { |
72 | - $blog_obj =& $blog_handler->get($blog_id); |
|
72 | + $blog_obj = & $blog_handler->get($blog_id); |
|
73 | 73 | if (!$blog_obj->getVar('blog_id')) { |
74 | 74 | planet_trackback_response(1, planet_constant('MD_INVALID')); |
75 | 75 | exit(); |
@@ -77,24 +77,24 @@ discard block |
||
77 | 77 | $source = 'blog'; |
78 | 78 | } elseif (!empty($category_id)) { |
79 | 79 | $source = 'category'; |
80 | - $category_obj =& $category_handler->get($category_id); |
|
80 | + $category_obj = & $category_handler->get($category_id); |
|
81 | 81 | if (!$category_obj->getVar('cat_id')) { |
82 | 82 | planet_trackback_response(1, planet_constant('MD_INVALID')); |
83 | 83 | exit(); |
84 | 84 | } |
85 | 85 | } elseif (!empty($uid)) { |
86 | 86 | $source = 'bookmark'; |
87 | -} else { |
|
87 | +}else { |
|
88 | 88 | $source = ''; |
89 | 89 | } |
90 | 90 | |
91 | 91 | $xml_charset = 'UTF-8'; |
92 | -include_once XOOPS_ROOT_PATH . '/class/template.php'; |
|
92 | +include_once XOOPS_ROOT_PATH.'/class/template.php'; |
|
93 | 93 | $tpl = new XoopsTpl(); |
94 | 94 | $tpl->xoops_setCaching(2); |
95 | 95 | $tpl->xoops_setCacheTime(3600); |
96 | -$xoopsCachedTemplateId = md5($xoopsModule->getVar('mid') . ',' . $article_id . ',' . $category_id . ',' . $blog_id . ',' |
|
97 | - . $uid . ',' . $type); |
|
96 | +$xoopsCachedTemplateId = md5($xoopsModule->getVar('mid').','.$article_id.','.$category_id.','.$blog_id.',' |
|
97 | + . $uid.','.$type); |
|
98 | 98 | if (!$tpl->is_cached('db:system_dummy.tpl', $xoopsCachedTemplateId)) { |
99 | 99 | $criteria = new CriteriaCompo(); |
100 | 100 | $criteria->setLimit($xoopsModuleConfig['articles_perpage']); |
@@ -104,9 +104,9 @@ discard block |
||
104 | 104 | $pagetitle = planet_constant('MD_ARTICLE'); |
105 | 105 | $rssdesc = planet_constant('MD_XMLDESC_ARTICLE'); |
106 | 106 | |
107 | - $articles_obj[$article_id] =& $article_obj; |
|
107 | + $articles_obj[$article_id] = & $article_obj; |
|
108 | 108 | |
109 | - $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' . URL_DELIMITER . '' |
|
109 | + $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php'.URL_DELIMITER.'' |
|
110 | 110 | . $article_obj->getVar('art_id'); |
111 | 111 | break; |
112 | 112 | |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | $rssdesc = sprintf(planet_constant('MD_XMLDESC_CATEGORY'), $category_obj->getVar('cat_title')); |
116 | 116 | |
117 | 117 | $criteria->add(new Criteria('bc.cat_id', $category_id)); |
118 | - $articles_obj =& $article_handler->getByCategory($criteria); |
|
118 | + $articles_obj = & $article_handler->getByCategory($criteria); |
|
119 | 119 | |
120 | - $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'c' |
|
120 | + $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'c' |
|
121 | 121 | . $category_id; |
122 | 122 | break; |
123 | 123 | |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | $rssdesc = sprintf(planet_constant('MD_XMLDESC_BLOG'), $blog_obj->getVar('blog_title')); |
127 | 127 | |
128 | 128 | $criteria->add(new Criteria('blog_id', $blog_id)); |
129 | - $articles_obj =& $article_handler->getAll($criteria); |
|
129 | + $articles_obj = & $article_handler->getAll($criteria); |
|
130 | 130 | |
131 | - $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' |
|
131 | + $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b' |
|
132 | 132 | . $blog_id; |
133 | 133 | break; |
134 | 134 | |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | $rssdesc = sprintf(planet_constant('MD_XMLDESC_BOOKMARK'), $author_name); |
139 | 139 | |
140 | 140 | $criteria->add(new Criteria('bm.bm_uid', $uid)); |
141 | - $articles_obj =& $article_handler->getByBookmark($criteria); |
|
141 | + $articles_obj = & $article_handler->getByBookmark($criteria); |
|
142 | 142 | |
143 | - $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'u' . $uid; |
|
143 | + $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'u'.$uid; |
|
144 | 144 | |
145 | 145 | break; |
146 | 146 | |
@@ -148,24 +148,24 @@ discard block |
||
148 | 148 | $pagetitle = planet_constant('MD_INDEX'); |
149 | 149 | $rssdesc = planet_constant('MD_XMLDESC_INDEX'); |
150 | 150 | |
151 | - $articles_obj =& $article_handler->getAll($criteria); |
|
151 | + $articles_obj = & $article_handler->getAll($criteria); |
|
152 | 152 | |
153 | - $xml_link = XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php'; |
|
153 | + $xml_link = XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'; |
|
154 | 154 | break; |
155 | 155 | } |
156 | 156 | $items = array(); |
157 | 157 | foreach (array_keys($articles_obj) as $id) { |
158 | 158 | $content = $articles_obj[$id]->getVar('art_content'); |
159 | - $content .= '<br>' . planet_constant('MD_SOURCE') . ': ' . $articles_obj[$id]->getVar('art_link') . ' ' |
|
159 | + $content .= '<br>'.planet_constant('MD_SOURCE').': '.$articles_obj[$id]->getVar('art_link').' ' |
|
160 | 160 | . $articles_obj[$id]->getVar('art_author'); |
161 | 161 | $items[] = array( |
162 | 162 | 'title' => $articles_obj[$id]->getVar('art_title'), |
163 | - 'link' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/view.article.php' |
|
164 | - . URL_DELIMITER . '' . $articles_obj[$id]->getVar('art_id'), |
|
163 | + 'link' => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/view.article.php' |
|
164 | + . URL_DELIMITER.''.$articles_obj[$id]->getVar('art_id'), |
|
165 | 165 | 'description' => $content, |
166 | 166 | 'descriptionHtmlSyndicated' => true, |
167 | 167 | 'date' => $articles_obj[$id]->getTime('rss'), |
168 | - 'source' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/', |
|
168 | + 'source' => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/', |
|
169 | 169 | 'author' => $articles_obj[$id]->getVar('art_author') |
170 | 170 | ); |
171 | 171 | } |
@@ -174,25 +174,25 @@ discard block |
||
174 | 174 | $xml_handler = xoops_getModuleHandler('xml', $GLOBALS['moddirname']); |
175 | 175 | $xml = $xml_handler->create($type); |
176 | 176 | $xml->setVar('encoding', $xml_charset); |
177 | - $xml->setVar('title', $xoopsConfig['sitename'] . ' :: ' . $pagetitle, 'UTF-8', $xml_charset, true); |
|
177 | + $xml->setVar('title', $xoopsConfig['sitename'].' :: '.$pagetitle, 'UTF-8', $xml_charset, true); |
|
178 | 178 | $xml->setVar('description', $rssdesc, true); |
179 | 179 | $xml->setVar('descriptionHtmlSyndicated', true); |
180 | 180 | $xml->setVar('link', $xml_link); |
181 | - $xml->setVar('syndicationURL', XOOPS_URL . '/' . xoops_getenv('PHP_SELF')); |
|
181 | + $xml->setVar('syndicationURL', XOOPS_URL.'/'.xoops_getenv('PHP_SELF')); |
|
182 | 182 | $xml->setVar('webmaster', checkEmail($xoopsConfig['adminmail'], true)); |
183 | 183 | $xml->setVar('editor', checkEmail($xoopsConfig['adminmail'], true)); |
184 | 184 | $xml->setVar('category', $xoopsModule->getVar('name'), true); |
185 | 185 | $xml->setVar('generator', $xoopsModule->getInfo('version')); |
186 | 186 | $xml->setVar('language', _LANGCODE); |
187 | 187 | |
188 | - $dimention = @getimagesize(XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/' |
|
188 | + $dimention = @getimagesize(XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/' |
|
189 | 189 | . $xoopsModule->getInfo('image')); |
190 | 190 | $image = array( |
191 | 191 | 'width' => $dimention[0], |
192 | 192 | 'height' => $dimention[1], |
193 | - 'title' => $xoopsConfig['sitename'] . ' :: ' . $pagetitle, |
|
194 | - 'url' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/' . $xoopsModule->getInfo('image'), |
|
195 | - 'link' => XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/', |
|
193 | + 'title' => $xoopsConfig['sitename'].' :: '.$pagetitle, |
|
194 | + 'url' => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/'.$xoopsModule->getInfo('image'), |
|
195 | + 'link' => XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/', |
|
196 | 196 | 'description' => $rssdesc |
197 | 197 | ); |
198 | 198 | $xml->setImage($image); |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | */ |
211 | 211 | $xml->addItems($items); |
212 | 212 | |
213 | - $dummy_content = $xml_handler->display($xml, XOOPS_CACHE_PATH . '/' . $GLOBALS['moddirname'] . '.xml.tmp'); |
|
213 | + $dummy_content = $xml_handler->display($xml, XOOPS_CACHE_PATH.'/'.$GLOBALS['moddirname'].'.xml.tmp'); |
|
214 | 214 | |
215 | 215 | $tpl->assign_by_ref('dummy_content', $dummy_content); |
216 | 216 | } |
217 | 217 | //$content = ob_get_contents(); |
218 | 218 | ob_end_clean(); |
219 | -header('Content-Type:text/xml; charset=' . $xml_charset); |
|
219 | +header('Content-Type:text/xml; charset='.$xml_charset); |
|
220 | 220 | $tpl->display('db:system_dummy.tpl', $xoopsCachedTemplateId); |