@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | |
32 | 32 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
33 | -include_once dirname(__DIR__) . '/include/vars.php'; |
|
33 | +include_once dirname(__DIR__).'/include/vars.php'; |
|
34 | 34 | mod_loadFunctions('', $GLOBALS['moddirname']); |
35 | 35 | |
36 | 36 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function getRatingAverage($decimals = 1) { |
130 | 130 | $ave = 3; |
131 | 131 | if ($this->getVar('blog_rates')) { |
132 | - $ave = number_format($this->getVar('blog_rating') / $this->getVar('blog_rates'), $decimals); |
|
132 | + $ave = number_format($this->getVar('blog_rating')/$this->getVar('blog_rates'), $decimals); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | return $ave; |
@@ -26,7 +26,7 @@ |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | -include_once dirname(__DIR__) . '/include/vars.php'; |
|
29 | +include_once dirname(__DIR__).'/include/vars.php'; |
|
30 | 30 | mod_loadFunctions('', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | if (!class_exists('Brate')): |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | -include_once dirname(__DIR__) . '/include/vars.php'; |
|
29 | +include_once dirname(__DIR__).'/include/vars.php'; |
|
30 | 30 | mod_loadFunctions('', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | /*** GENERAL USAGE ********************************************************* |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | */ |
65 | 65 | |
66 | 66 | // your local timezone, set to "" to disable or for GMT |
67 | -$server_TZ = abs((int)($GLOBALS['xoopsConfig']['server_TZ'] * 3600.0)); |
|
68 | -$prefix = ($GLOBALS['xoopsConfig']['server_TZ'] < 0) ? '-' : '+'; |
|
69 | -$TIME_ZONE = $prefix . date('H:i', $server_TZ); |
|
67 | +$server_TZ = abs((int) ($GLOBALS['xoopsConfig']['server_TZ']*3600.0)); |
|
68 | +$prefix = ($GLOBALS['xoopsConfig']['server_TZ']<0) ? '-' : '+'; |
|
69 | +$TIME_ZONE = $prefix.date('H:i', $server_TZ); |
|
70 | 70 | define('TIME_ZONE', $TIME_ZONE); |
71 | 71 | // Version string. |
72 | 72 | define('FEEDCREATOR_VERSION', 'ARTICLE @ XOOPS powered by FeedCreator'); |
73 | 73 | |
74 | -require_once __DIR__ . '/feedcreator.class.php'; |
|
74 | +require_once __DIR__.'/feedcreator.class.php'; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Description |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param $version |
95 | 95 | */ |
96 | 96 | public function __construct($version) { |
97 | - $this->filename = XOOPS_CACHE_PATH . '/feed.xml'; |
|
97 | + $this->filename = XOOPS_CACHE_PATH.'/feed.xml'; |
|
98 | 98 | $this->version = $version; |
99 | 99 | } |
100 | 100 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | foreach (array_keys($val) as $key) { |
120 | 120 | $val[$key] = $this->convert_encoding($val[$key]); |
121 | 121 | } |
122 | - } else { |
|
122 | + }else { |
|
123 | 123 | $val = XoopsLocal::convert_encoding($val, $this->encoding, _CHARSET); |
124 | 124 | } |
125 | 125 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | */ |
31 | 31 | |
32 | 32 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
33 | -include_once dirname(__DIR__) . '/include/vars.php'; |
|
33 | +include_once dirname(__DIR__).'/include/vars.php'; |
|
34 | 34 | mod_loadFunctions('', $GLOBALS['moddirname']); |
35 | 35 | |
36 | 36 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | if ($type === 'array') { |
38 | - for ($i = 0, $j = count($this->data); $i < $j; ++$i) { |
|
38 | + for ($i = 0, $j = count($this->data); $i<$j; ++$i) { |
|
39 | 39 | $this->data[$i] = new IXR_Value($this->data[$i]); |
40 | 40 | } |
41 | 41 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | /* We have an array - is it an array or a struct ? */ |
74 | 74 | if ($this->isStruct($this->data)) { |
75 | 75 | return 'struct'; |
76 | - } else { |
|
76 | + }else { |
|
77 | 77 | return 'array'; |
78 | 78 | } |
79 | 79 | } |
@@ -85,31 +85,31 @@ discard block |
||
85 | 85 | /* Return XML for this value */ |
86 | 86 | switch ($this->type) { |
87 | 87 | case 'boolean': |
88 | - return '<boolean>' . ($this->data ? '1' : '0') . '</boolean>'; |
|
88 | + return '<boolean>'.($this->data ? '1' : '0').'</boolean>'; |
|
89 | 89 | break; |
90 | 90 | case 'int': |
91 | - return '<int>' . $this->data . '</int>'; |
|
91 | + return '<int>'.$this->data.'</int>'; |
|
92 | 92 | break; |
93 | 93 | case 'double': |
94 | - return '<double>' . $this->data . '</double>'; |
|
94 | + return '<double>'.$this->data.'</double>'; |
|
95 | 95 | break; |
96 | 96 | case 'string': |
97 | - return '<string>' . htmlspecialchars($this->data) . '</string>'; |
|
97 | + return '<string>'.htmlspecialchars($this->data).'</string>'; |
|
98 | 98 | break; |
99 | 99 | case 'array': |
100 | - $return = '<array><data>' . "\n"; |
|
100 | + $return = '<array><data>'."\n"; |
|
101 | 101 | foreach ($this->data as $item) { |
102 | - $return .= ' <value>' . $item->getXml() . "</value>\n"; |
|
102 | + $return .= ' <value>'.$item->getXml()."</value>\n"; |
|
103 | 103 | } |
104 | 104 | $return .= '</data></array>'; |
105 | 105 | |
106 | 106 | return $return; |
107 | 107 | break; |
108 | 108 | case 'struct': |
109 | - $return = '<struct>' . "\n"; |
|
109 | + $return = '<struct>'."\n"; |
|
110 | 110 | foreach ($this->data as $name => $value) { |
111 | 111 | $return .= " <member><name>$name</name><value>"; |
112 | - $return .= $value->getXml() . "</value></member>\n"; |
|
112 | + $return .= $value->getXml()."</value></member>\n"; |
|
113 | 113 | } |
114 | 114 | $return .= '</struct>'; |
115 | 115 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /* Nasty function to check if an array is a struct or not */ |
133 | 133 | $expected = 0; |
134 | 134 | foreach ($array as $key => $value) { |
135 | - if ((string)$key != (string)$expected) { |
|
135 | + if ((string) $key != (string) $expected) { |
|
136 | 136 | return true; |
137 | 137 | } |
138 | 138 | ++$expected; |
@@ -148,15 +148,15 @@ discard block |
||
148 | 148 | class IXR_Message |
149 | 149 | { |
150 | 150 | public $message; |
151 | - public $messageType; // methodCall / methodResponse / fault |
|
151 | + public $messageType; // methodCall / methodResponse / fault |
|
152 | 152 | public $faultCode; |
153 | 153 | public $faultString; |
154 | 154 | public $methodName; |
155 | 155 | public $params; |
156 | 156 | // Current variable stacks |
157 | - public $_arraystructs = array(); // The stack used to keep track of the current array/struct |
|
157 | + public $_arraystructs = array(); // The stack used to keep track of the current array/struct |
|
158 | 158 | public $_arraystructstypes = array(); // Stack keeping track of if things are structs or array |
159 | - public $_currentStructName = array(); // A stack as well |
|
159 | + public $_currentStructName = array(); // A stack as well |
|
160 | 160 | public $_param; |
161 | 161 | public $_value; |
162 | 162 | public $_currentTag; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function parse() { |
179 | 179 | // first remove the XML declaration |
180 | - $this->message = preg_replace('/<\?xml(.*)?\?' . '>/', '', $this->message); |
|
180 | + $this->message = preg_replace('/<\?xml(.*)?\?'.'>/', '', $this->message); |
|
181 | 181 | if (trim($this->message) == '') { |
182 | 182 | return false; |
183 | 183 | } |
@@ -247,17 +247,17 @@ discard block |
||
247 | 247 | switch ($tag) { |
248 | 248 | case 'int': |
249 | 249 | case 'i4': |
250 | - $value = (int)trim($this->_currentTagContents); |
|
250 | + $value = (int) trim($this->_currentTagContents); |
|
251 | 251 | $this->_currentTagContents = ''; |
252 | 252 | $valueFlag = true; |
253 | 253 | break; |
254 | 254 | case 'double': |
255 | - $value = (double)trim($this->_currentTagContents); |
|
255 | + $value = (double) trim($this->_currentTagContents); |
|
256 | 256 | $this->_currentTagContents = ''; |
257 | 257 | $valueFlag = true; |
258 | 258 | break; |
259 | 259 | case 'string': |
260 | - $value = (string)trim($this->_currentTagContents); |
|
260 | + $value = (string) trim($this->_currentTagContents); |
|
261 | 261 | $this->_currentTagContents = ''; |
262 | 262 | $valueFlag = true; |
263 | 263 | break; |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | case 'value': |
271 | 271 | // "If no type is indicated, the type is string." |
272 | 272 | if (trim($this->_currentTagContents) != '') { |
273 | - $value = (string)$this->_currentTagContents; |
|
273 | + $value = (string) $this->_currentTagContents; |
|
274 | 274 | $this->_currentTagContents = ''; |
275 | 275 | $valueFlag = true; |
276 | 276 | } |
277 | 277 | break; |
278 | 278 | case 'boolean': |
279 | - $value = (boolean)trim($this->_currentTagContents); |
|
279 | + $value = (boolean) trim($this->_currentTagContents); |
|
280 | 280 | $this->_currentTagContents = ''; |
281 | 281 | $valueFlag = true; |
282 | 282 | break; |
@@ -310,17 +310,17 @@ discard block |
||
310 | 310 | $value = trim($value); |
311 | 311 | } |
312 | 312 | */ |
313 | - if (count($this->_arraystructs) > 0) { |
|
313 | + if (count($this->_arraystructs)>0) { |
|
314 | 314 | // Add value to struct or array |
315 | - if ($this->_arraystructstypes[count($this->_arraystructstypes) - 1] === 'struct') { |
|
315 | + if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] === 'struct') { |
|
316 | 316 | // Add to struct |
317 | 317 | $this->_arraystructs[count($this->_arraystructs) |
318 | - - 1][$this->_currentStructName[count($this->_currentStructName) - 1]] = $value; |
|
319 | - } else { |
|
318 | + - 1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; |
|
319 | + }else { |
|
320 | 320 | // Add to array |
321 | - $this->_arraystructs[count($this->_arraystructs) - 1][] = $value; |
|
321 | + $this->_arraystructs[count($this->_arraystructs)-1][] = $value; |
|
322 | 322 | } |
323 | - } else { |
|
323 | + }else { |
|
324 | 324 | // Just add as a paramater |
325 | 325 | $this->params[] = $value; |
326 | 326 | } |
@@ -402,7 +402,7 @@ discard block |
||
402 | 402 | */ |
403 | 403 | public function call($methodname, $args) { |
404 | 404 | if (!$this->hasMethod($methodname)) { |
405 | - return new IXR_Error(-32601, 'server error. requested method ' . $methodname . ' does not exist.'); |
|
405 | + return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.'); |
|
406 | 406 | } |
407 | 407 | $method = $this->callbacks[$methodname]; |
408 | 408 | // Perform the callback and send the response |
@@ -415,19 +415,19 @@ discard block |
||
415 | 415 | // It's a class method - check it exists |
416 | 416 | $method = substr($method, 5); |
417 | 417 | if (!method_exists($this, $method)) { |
418 | - return new IXR_Error(-32601, 'server error. requested class method "' . $method . '" does not exist.'); |
|
418 | + return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); |
|
419 | 419 | } |
420 | 420 | // Call the method |
421 | 421 | $result = $this->$method($args); |
422 | - } else { |
|
422 | + }else { |
|
423 | 423 | // It's a function - does it exist? |
424 | 424 | if (is_array($method)) { |
425 | 425 | if (!method_exists($method[0], $method[1])) { |
426 | 426 | return new IXR_Error(-32601, |
427 | - 'server error. requested object method "' . $method[1] . '" does not exist.'); |
|
427 | + 'server error. requested object method "'.$method[1].'" does not exist.'); |
|
428 | 428 | } |
429 | 429 | } elseif (!function_exists($method)) { |
430 | - return new IXR_Error(-32601, 'server error. requested function "' . $method . '" does not exist.'); |
|
430 | + return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); |
|
431 | 431 | } |
432 | 432 | // Call the function |
433 | 433 | $result = call_user_func($method, $args); |
@@ -452,12 +452,12 @@ discard block |
||
452 | 452 | * @param $xml |
453 | 453 | */ |
454 | 454 | public function output($xml) { |
455 | - $xml = '<?xml version="1.0"?>' . "\n" . $xml; |
|
455 | + $xml = '<?xml version="1.0"?>'."\n".$xml; |
|
456 | 456 | $length = strlen($xml); |
457 | 457 | header('Connection: close'); |
458 | - header('Content-Length: ' . $length); |
|
458 | + header('Content-Length: '.$length); |
|
459 | 459 | header('Content-Type: text/xml'); |
460 | - header('Date: ' . date('r')); |
|
460 | + header('Date: '.date('r')); |
|
461 | 461 | echo $xml; |
462 | 462 | exit; |
463 | 463 | } |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | $params = $call['params']; |
525 | 525 | if ($method === 'system.multicall') { |
526 | 526 | $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); |
527 | - } else { |
|
527 | + }else { |
|
528 | 528 | $result = $this->call($method, $params); |
529 | 529 | } |
530 | 530 | if (is_a($result, 'IXR_Error')) { |
@@ -532,7 +532,7 @@ discard block |
||
532 | 532 | 'faultCode' => $result->code, |
533 | 533 | 'faultString' => $result->message |
534 | 534 | ); |
535 | - } else { |
|
535 | + }else { |
|
536 | 536 | $return[] = array($result); |
537 | 537 | } |
538 | 538 | } |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | if (!$this->path) { |
626 | 626 | $this->path = '/'; |
627 | 627 | } |
628 | - } else { |
|
628 | + }else { |
|
629 | 629 | $this->server = $server; |
630 | 630 | $this->path = $path; |
631 | 631 | $this->port = $port; |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $request .= $xml; |
653 | 653 | // Now send the request |
654 | 654 | if ($this->debug) { |
655 | - echo '<pre>' . htmlspecialchars($request) . "\n</pre>\n\n"; |
|
655 | + echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n"; |
|
656 | 656 | } |
657 | 657 | $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); |
658 | 658 | if (!$fp) { |
@@ -679,11 +679,11 @@ discard block |
||
679 | 679 | $gettingHeaders = false; |
680 | 680 | } |
681 | 681 | if (!$gettingHeaders) { |
682 | - $contents .= trim($line) . "\n"; |
|
682 | + $contents .= trim($line)."\n"; |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | if ($this->debug) { |
686 | - echo '<pre>' . htmlspecialchars($contents) . "\n</pre>\n\n"; |
|
686 | + echo '<pre>'.htmlspecialchars($contents)."\n</pre>\n\n"; |
|
687 | 687 | } |
688 | 688 | // Now parse what we've got back |
689 | 689 | $this->message = new IXR_Message($contents); |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | // $time can be a PHP timestamp or an ISO one |
802 | 802 | if (is_numeric($time)) { |
803 | 803 | $this->parseTimestamp($time); |
804 | - } else { |
|
804 | + }else { |
|
805 | 805 | $this->parseIso($time); |
806 | 806 | } |
807 | 807 | } |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | * @return string |
836 | 836 | */ |
837 | 837 | public function getIso() { |
838 | - return $this->year . $this->month . $this->day . 'T' . $this->hour . ':' . $this->minute . ':' . $this->second |
|
838 | + return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second |
|
839 | 839 | . $this->timezone; |
840 | 840 | } |
841 | 841 | |
@@ -843,7 +843,7 @@ discard block |
||
843 | 843 | * @return string |
844 | 844 | */ |
845 | 845 | public function getXml() { |
846 | - return '<dateTime.iso8601>' . $this->getIso() . '</dateTime.iso8601>'; |
|
846 | + return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>'; |
|
847 | 847 | } |
848 | 848 | |
849 | 849 | /** |
@@ -873,7 +873,7 @@ discard block |
||
873 | 873 | * @return string |
874 | 874 | */ |
875 | 875 | public function getXml() { |
876 | - return '<base64>' . base64_encode($this->data) . '</base64>'; |
|
876 | + return '<base64>'.base64_encode($this->data).'</base64>'; |
|
877 | 877 | } |
878 | 878 | } |
879 | 879 | |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | // Over-rides default call method, adds signature check |
931 | 931 | if (!$this->hasMethod($methodname)) { |
932 | 932 | return new IXR_Error(-32601, |
933 | - 'server error. requested method "' . $this->message->methodName . '" not specified.'); |
|
933 | + 'server error. requested method "'.$this->message->methodName.'" not specified.'); |
|
934 | 934 | } |
935 | 935 | $method = $this->callbacks[$methodname]; |
936 | 936 | $signature = $this->signatures[$methodname]; |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | // Check the argument types |
944 | 944 | $ok = true; |
945 | 945 | $argsbackup = $args; |
946 | - for ($i = 0, $j = count($args); $i < $j; ++$i) { |
|
946 | + for ($i = 0, $j = count($args); $i<$j; ++$i) { |
|
947 | 947 | $arg = array_shift($args); |
948 | 948 | $type = array_shift($signature); |
949 | 949 | switch ($type) { |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | */ |
993 | 993 | public function methodSignature($method) { |
994 | 994 | if (!$this->hasMethod($method)) { |
995 | - return new IXR_Error(-32601, 'server error. requested method "' . $method . '" not specified.'); |
|
995 | + return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); |
|
996 | 996 | } |
997 | 997 | // We should be returning an array of types |
998 | 998 | $types = $this->signatures[$method]; |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | global $msg; |
32 | 32 | |
33 | -require_once XOOPS_ROOT_PATH . '/modules/' . $GLOBALS['moddirname'] . '/class/magpie.inc.php'; |
|
33 | +require_once XOOPS_ROOT_PATH.'/modules/'.$GLOBALS['moddirname'].'/class/magpie.inc.php'; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * XmlParser |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $this->feed_version = empty($this->feed_version) ? '0.3' : $this->feed_version; |
91 | 91 | |
92 | 92 | return $this->feed_version; |
93 | - } else { |
|
93 | + }else { |
|
94 | 94 | return false; |
95 | 95 | } |
96 | 96 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $this->channel['tagline'] = @$this->channel['subtitle']; |
103 | 103 | unset($this->channel['subtitle']); |
104 | 104 | } |
105 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
105 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
106 | 106 | // ATOM time |
107 | 107 | if ($date = @$this->items[$i]['modified']) { |
108 | 108 | continue; |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $this->items[$i]['modified'] = $date; |
123 | 123 | } |
124 | 124 | elseif ($this->is_rss() !== '1.0'): |
125 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
125 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
126 | 126 | if ($date = @$this->items[$i]['pubdate']) { |
127 | 127 | continue; |
128 | 128 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | unset($this->channel['tagline']); |
151 | 151 | } |
152 | 152 | |
153 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
153 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
154 | 154 | if ($date_timestamp = @$this->items[$i]['date_timestamp']) { |
155 | 155 | continue; |
156 | 156 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | $this->items[$i]['date_timestamp'] = $date_timestamp; |
159 | 159 | } elseif ($date_timestamp = @$this->items[$i]['dc']['date']) { |
160 | 160 | $this->items[$i]['date_timestamp'] = $date_timestamp; |
161 | - } else { |
|
161 | + }else { |
|
162 | 162 | $this->items[$i]['date_timestamp'] = time(); |
163 | 163 | } |
164 | 164 | if (!is_numeric($this->items[$i]['date_timestamp'])) { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | foreach (array_keys($val) as $key) { |
203 | 203 | $val[$key] = $this->_encoding($val[$key]); |
204 | 204 | } |
205 | - } else { |
|
205 | + }else { |
|
206 | 206 | $val = XoopsLocal::convert_encoding($val, $this->charset_out, $this->charset_in); |
207 | 207 | } |
208 | 208 |
@@ -26,7 +26,7 @@ |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined'); |
29 | -include_once dirname(__DIR__) . '/include/vars.php'; |
|
29 | +include_once dirname(__DIR__).'/include/vars.php'; |
|
30 | 30 | mod_loadFunctions('', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | if (!class_exists('Xmlrpc_client')) { |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | if (!$this->rawFieldContent) { |
326 | 326 | $result = ''; |
327 | 327 | } elseif ($this->syndicateHtml) { |
328 | - $result = '<![CDATA[' . $this->rawFieldContent . ']]>'; |
|
329 | - } else { |
|
328 | + $result = '<![CDATA['.$this->rawFieldContent.']]>'; |
|
329 | + }else { |
|
330 | 330 | if ($this->truncSize && is_int($this->truncSize)) { |
331 | 331 | $result = FeedCreator::iTrunc(htmlspecialchars($this->rawFieldContent), $this->truncSize); |
332 | - } else { |
|
332 | + }else { |
|
333 | 333 | $result = htmlspecialchars($this->rawFieldContent); |
334 | 334 | } |
335 | 335 | } |
@@ -550,29 +550,29 @@ discard block |
||
550 | 550 | * @return string the truncated string |
551 | 551 | */ |
552 | 552 | public function iTrunc($string, $length) { |
553 | - if (strlen($string) <= $length) { |
|
553 | + if (strlen($string)<=$length) { |
|
554 | 554 | return $string; |
555 | 555 | } |
556 | 556 | |
557 | 557 | $pos = strrpos($string, '.'); |
558 | - if ($pos >= $length - 4) { |
|
559 | - $string = substr($string, 0, $length - 4); |
|
558 | + if ($pos>=$length-4) { |
|
559 | + $string = substr($string, 0, $length-4); |
|
560 | 560 | $pos = strrpos($string, '.'); |
561 | 561 | } |
562 | - if ($pos >= $length * 0.4) { |
|
563 | - return substr($string, 0, $pos + 1) . ' ...'; |
|
562 | + if ($pos>=$length*0.4) { |
|
563 | + return substr($string, 0, $pos+1).' ...'; |
|
564 | 564 | } |
565 | 565 | |
566 | 566 | $pos = strrpos($string, ' '); |
567 | - if ($pos >= $length - 4) { |
|
568 | - $string = substr($string, 0, $length - 4); |
|
567 | + if ($pos>=$length-4) { |
|
568 | + $string = substr($string, 0, $length-4); |
|
569 | 569 | $pos = strrpos($string, ' '); |
570 | 570 | } |
571 | - if ($pos >= $length * 0.4) { |
|
572 | - return substr($string, 0, $pos) . ' ...'; |
|
571 | + if ($pos>=$length*0.4) { |
|
572 | + return substr($string, 0, $pos).' ...'; |
|
573 | 573 | } |
574 | 574 | |
575 | - return substr($string, 0, $length - 4) . ' ...'; |
|
575 | + return substr($string, 0, $length-4).' ...'; |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | * Syndic8.com. |
582 | 582 | */ |
583 | 583 | public function _createGeneratorComment() { |
584 | - return "<!-- generator=\"" . FEEDCREATOR_VERSION . "\" -->\n"; |
|
584 | + return "<!-- generator=\"".FEEDCREATOR_VERSION."\" -->\n"; |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | /** |
@@ -597,7 +597,7 @@ discard block |
||
597 | 597 | $ae = ''; |
598 | 598 | if (is_array($elements)) { |
599 | 599 | foreach ($elements as $key => $value) { |
600 | - $ae .= $indentString . "<$key>$value</$key>\n"; |
|
600 | + $ae .= $indentString."<$key>$value</$key>\n"; |
|
601 | 601 | } |
602 | 602 | } |
603 | 603 | |
@@ -610,10 +610,10 @@ discard block |
||
610 | 610 | public function _createStylesheetReferences() { |
611 | 611 | $xml = ''; |
612 | 612 | if ($this->cssStyleSheet) { |
613 | - $xml .= "<?xml-stylesheet href=\"" . $this->cssStyleSheet . "\" type=\"text/css\"?>\n"; |
|
613 | + $xml .= "<?xml-stylesheet href=\"".$this->cssStyleSheet."\" type=\"text/css\"?>\n"; |
|
614 | 614 | } |
615 | 615 | if ($this->xslStyleSheet) { |
616 | - $xml .= "<?xml-stylesheet href=\"" . $this->xslStyleSheet . "\" type=\"text/xsl\"?>\n"; |
|
616 | + $xml .= "<?xml-stylesheet href=\"".$this->xslStyleSheet."\" type=\"text/xsl\"?>\n"; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | return $xml; |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | public function _generateFilename() { |
647 | 647 | $fileInfo = pathinfo($_SERVER['PHP_SELF']); |
648 | 648 | |
649 | - return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension']) + 1)) . '.xml'; |
|
649 | + return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension'])+1)).'.xml'; |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | /** |
@@ -668,9 +668,9 @@ discard block |
||
668 | 668 | // HTTP redirect, some feed readers' simple HTTP implementations don't follow it |
669 | 669 | //Header("Location: ".$filename); |
670 | 670 | |
671 | - header('Content-Type: ' . $this->contentType . '; charset=' . $this->encoding . '; filename=' |
|
671 | + header('Content-Type: '.$this->contentType.'; charset='.$this->encoding.'; filename=' |
|
672 | 672 | . basename($filename)); |
673 | - header('Content-Disposition: inline; filename=' . basename($filename)); |
|
673 | + header('Content-Disposition: inline; filename='.basename($filename)); |
|
674 | 674 | readfile($filename, 'r'); |
675 | 675 | die(); |
676 | 676 | } |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | if ($filename == '') { |
692 | 692 | $filename = $this->_generateFilename(); |
693 | 693 | } |
694 | - if (file_exists($filename) && (time() - filemtime($filename) < $timeout)) { |
|
694 | + if (file_exists($filename) && (time()-filemtime($filename)<$timeout)) { |
|
695 | 695 | $this->_redirect($filename); |
696 | 696 | } |
697 | 697 | } |
@@ -716,7 +716,7 @@ discard block |
||
716 | 716 | if ($displayContents) { |
717 | 717 | $this->_redirect($filename); |
718 | 718 | } |
719 | - } else { |
|
719 | + }else { |
|
720 | 720 | echo '<br><b>Error creating feed file, please check write permissions.</b><br>'; |
721 | 721 | } |
722 | 722 | } |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | } |
750 | 750 | if (preg_match("~(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s+)?(\\d{1,2})\\s+([a-zA-Z]{3})\\s+(\\d{4})\\s+(\\d{2}):(\\d{2}):(\\d{2})\\s+(.*)~", |
751 | 751 | $dateString, $matches)) { |
752 | - $months = array( |
|
752 | + $months = array( |
|
753 | 753 | 'Jan' => 1, |
754 | 754 | 'Feb' => 2, |
755 | 755 | 'Mar' => 3, |
@@ -765,15 +765,15 @@ discard block |
||
765 | 765 | ); |
766 | 766 | $this->unix = mktime($matches[4], $matches[5], $matches[6], $months[$matches[2]], $matches[1], $matches[3]); |
767 | 767 | if (substr($matches[7], 0, 1) == '+' || substr($matches[7], 0, 1) == '-') { |
768 | - $tzOffset = (substr($matches[7], 0, 3) * 60 + substr($matches[7], -2)) * 60; |
|
769 | - } else { |
|
768 | + $tzOffset = (substr($matches[7], 0, 3)*60+substr($matches[7], -2))*60; |
|
769 | + }else { |
|
770 | 770 | if (strlen($matches[7]) == 1) { |
771 | 771 | $oneHour = 3600; |
772 | 772 | $ord = ord($matches[7]); |
773 | - if ($ord < ord('M')) { |
|
774 | - $tzOffset = (ord('A') - $ord - 1) * $oneHour; |
|
775 | - } elseif ($ord >= ord('M') && $matches[7] !== 'Z') { |
|
776 | - $tzOffset = ($ord - ord('M')) * $oneHour; |
|
773 | + if ($ord<ord('M')) { |
|
774 | + $tzOffset = (ord('A')-$ord-1)*$oneHour; |
|
775 | + } elseif ($ord>=ord('M') && $matches[7] !== 'Z') { |
|
776 | + $tzOffset = ($ord-ord('M'))*$oneHour; |
|
777 | 777 | } elseif ($matches[7] === 'Z') { |
778 | 778 | $tzOffset = 0; |
779 | 779 | } |
@@ -791,8 +791,8 @@ discard block |
||
791 | 791 | if (preg_match("~(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(.*)~", $dateString, $matches)) { |
792 | 792 | $this->unix = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]); |
793 | 793 | if (substr($matches[7], 0, 1) == '+' || substr($matches[7], 0, 1) == '-') { |
794 | - $tzOffset = (substr($matches[7], 0, 3) * 60 + substr($matches[7], -2)) * 60; |
|
795 | - } else { |
|
794 | + $tzOffset = (substr($matches[7], 0, 3)*60+substr($matches[7], -2))*60; |
|
795 | + }else { |
|
796 | 796 | if ($matches[7] === 'Z') { |
797 | 797 | $tzOffset = 0; |
798 | 798 | } |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | //return gmdate("r",$this->unix); |
814 | 814 | $date = gmdate('D, d M Y H:i:s', $this->unix); |
815 | 815 | if (TIME_ZONE != '') { |
816 | - $date .= ' ' . str_replace(':', '', TIME_ZONE); |
|
816 | + $date .= ' '.str_replace(':', '', TIME_ZONE); |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | return $date; |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | */ |
827 | 827 | public function iso8601() { |
828 | 828 | $date = gmdate("Y-m-d\TH:i:sO", $this->unix); |
829 | - $date = substr($date, 0, 22) . ':' . substr($date, -2); |
|
829 | + $date = substr($date, 0, 22).':'.substr($date, -2); |
|
830 | 830 | if (TIME_ZONE != '') { |
831 | 831 | $date = str_replace('+00:00', TIME_ZONE, $date); |
832 | 832 | } |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | * @return string the feed's complete text |
860 | 860 | */ |
861 | 861 | public function createFeed() { |
862 | - $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n"; |
|
862 | + $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; |
|
863 | 863 | $feed .= $this->_createGeneratorComment(); |
864 | 864 | if ($this->cssStyleSheet == '') { |
865 | 865 | $cssStyleSheet = 'http://www.w3.org/2000/08/w3c-synd/style.css'; |
@@ -870,50 +870,50 @@ discard block |
||
870 | 870 | $feed .= " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n"; |
871 | 871 | $feed .= " xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\n"; |
872 | 872 | $feed .= " xmlns:dc=\"http://purl.org/dc/elements/1.1/\">\n"; |
873 | - $feed .= " <channel rdf:about=\"" . $this->syndicationURL . "\">\n"; |
|
874 | - $feed .= ' <title>' . htmlspecialchars($this->title) . "</title>\n"; |
|
875 | - $feed .= ' <description>' . htmlspecialchars($this->description) . "</description>\n"; |
|
876 | - $feed .= ' <link>' . $this->link . "</link>\n"; |
|
873 | + $feed .= " <channel rdf:about=\"".$this->syndicationURL."\">\n"; |
|
874 | + $feed .= ' <title>'.htmlspecialchars($this->title)."</title>\n"; |
|
875 | + $feed .= ' <description>'.htmlspecialchars($this->description)."</description>\n"; |
|
876 | + $feed .= ' <link>'.$this->link."</link>\n"; |
|
877 | 877 | if ($this->image != null) { |
878 | - $feed .= " <image rdf:resource=\"" . $this->image->url . "\" />\n"; |
|
878 | + $feed .= " <image rdf:resource=\"".$this->image->url."\" />\n"; |
|
879 | 879 | } |
880 | 880 | $now = new FeedDate(); |
881 | - $feed .= ' <dc:date>' . htmlspecialchars($now->iso8601()) . "</dc:date>\n"; |
|
881 | + $feed .= ' <dc:date>'.htmlspecialchars($now->iso8601())."</dc:date>\n"; |
|
882 | 882 | $feed .= " <items>\n"; |
883 | 883 | $feed .= " <rdf:Seq>\n"; |
884 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
885 | - $feed .= " <rdf:li rdf:resource=\"" . htmlspecialchars($this->items[$i]->link) . "\"/>\n"; |
|
884 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
885 | + $feed .= " <rdf:li rdf:resource=\"".htmlspecialchars($this->items[$i]->link)."\"/>\n"; |
|
886 | 886 | } |
887 | 887 | $feed .= " </rdf:Seq>\n"; |
888 | 888 | $feed .= " </items>\n"; |
889 | 889 | $feed .= " </channel>\n"; |
890 | 890 | if ($this->image != null) { |
891 | - $feed .= " <image rdf:about=\"" . $this->image->url . "\">\n"; |
|
892 | - $feed .= ' <title>' . $this->image->title . "</title>\n"; |
|
893 | - $feed .= ' <link>' . $this->image->link . "</link>\n"; |
|
894 | - $feed .= ' <url>' . $this->image->url . "</url>\n"; |
|
891 | + $feed .= " <image rdf:about=\"".$this->image->url."\">\n"; |
|
892 | + $feed .= ' <title>'.$this->image->title."</title>\n"; |
|
893 | + $feed .= ' <link>'.$this->image->link."</link>\n"; |
|
894 | + $feed .= ' <url>'.$this->image->url."</url>\n"; |
|
895 | 895 | $feed .= " </image>\n"; |
896 | 896 | } |
897 | 897 | $feed .= $this->_createAdditionalElements($this->additionalElements, ' '); |
898 | 898 | |
899 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
900 | - $feed .= " <item rdf:about=\"" . htmlspecialchars($this->items[$i]->link) . "\">\n"; |
|
899 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
900 | + $feed .= " <item rdf:about=\"".htmlspecialchars($this->items[$i]->link)."\">\n"; |
|
901 | 901 | //$feed.= " <dc:type>Posting</dc:type>\n"; |
902 | 902 | $feed .= " <dc:format>text/html</dc:format>\n"; |
903 | 903 | if ($this->items[$i]->date != null) { |
904 | 904 | $itemDate = new FeedDate($this->items[$i]->date); |
905 | - $feed .= ' <dc:date>' . htmlspecialchars($itemDate->iso8601()) . "</dc:date>\n"; |
|
905 | + $feed .= ' <dc:date>'.htmlspecialchars($itemDate->iso8601())."</dc:date>\n"; |
|
906 | 906 | } |
907 | 907 | if ($this->items[$i]->source != '') { |
908 | - $feed .= ' <dc:source>' . htmlspecialchars($this->items[$i]->source) . "</dc:source>\n"; |
|
908 | + $feed .= ' <dc:source>'.htmlspecialchars($this->items[$i]->source)."</dc:source>\n"; |
|
909 | 909 | } |
910 | 910 | if ($this->items[$i]->author != '') { |
911 | - $feed .= ' <dc:creator>' . htmlspecialchars($this->items[$i]->author) . "</dc:creator>\n"; |
|
911 | + $feed .= ' <dc:creator>'.htmlspecialchars($this->items[$i]->author)."</dc:creator>\n"; |
|
912 | 912 | } |
913 | - $feed .= ' <title>' . htmlspecialchars(strip_tags(strtr($this->items[$i]->title, "\n\r", ' '))) |
|
913 | + $feed .= ' <title>'.htmlspecialchars(strip_tags(strtr($this->items[$i]->title, "\n\r", ' '))) |
|
914 | 914 | . "</title>\n"; |
915 | - $feed .= ' <link>' . htmlspecialchars($this->items[$i]->link) . "</link>\n"; |
|
916 | - $feed .= ' <description>' . htmlspecialchars($this->items[$i]->description) . "</description>\n"; |
|
915 | + $feed .= ' <link>'.htmlspecialchars($this->items[$i]->link)."</link>\n"; |
|
916 | + $feed .= ' <description>'.htmlspecialchars($this->items[$i]->description)."</description>\n"; |
|
917 | 917 | $feed .= $this->_createAdditionalElements($this->items[$i]->additionalElements, ' '); |
918 | 918 | $feed .= " </item>\n"; |
919 | 919 | } |
@@ -961,84 +961,84 @@ discard block |
||
961 | 961 | * @return string the feed's complete text |
962 | 962 | */ |
963 | 963 | public function createFeed() { |
964 | - $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n"; |
|
964 | + $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; |
|
965 | 965 | $feed .= $this->_createGeneratorComment(); |
966 | 966 | $feed .= $this->_createStylesheetReferences(); |
967 | - $feed .= "<rss version=\"" . $this->RSSVersion . "\">\n"; |
|
967 | + $feed .= "<rss version=\"".$this->RSSVersion."\">\n"; |
|
968 | 968 | $feed .= " <channel>\n"; |
969 | - $feed .= ' <title>' . FeedCreator::iTrunc(htmlspecialchars($this->title), 100) . "</title>\n"; |
|
969 | + $feed .= ' <title>'.FeedCreator::iTrunc(htmlspecialchars($this->title), 100)."</title>\n"; |
|
970 | 970 | $this->descriptionTruncSize = 500; |
971 | - $feed .= ' <description>' . $this->getDescription() . "</description>\n"; |
|
972 | - $feed .= ' <link>' . $this->link . "</link>\n"; |
|
971 | + $feed .= ' <description>'.$this->getDescription()."</description>\n"; |
|
972 | + $feed .= ' <link>'.$this->link."</link>\n"; |
|
973 | 973 | $now = new FeedDate(); |
974 | - $feed .= ' <lastBuildDate>' . htmlspecialchars($now->rfc822()) . "</lastBuildDate>\n"; |
|
975 | - $feed .= ' <generator>' . FEEDCREATOR_VERSION . "</generator>\n"; |
|
974 | + $feed .= ' <lastBuildDate>'.htmlspecialchars($now->rfc822())."</lastBuildDate>\n"; |
|
975 | + $feed .= ' <generator>'.FEEDCREATOR_VERSION."</generator>\n"; |
|
976 | 976 | |
977 | 977 | if ($this->image != null) { |
978 | 978 | $feed .= " <image>\n"; |
979 | - $feed .= ' <url>' . $this->image->url . "</url>\n"; |
|
980 | - $feed .= ' <title>' . FeedCreator::iTrunc(htmlspecialchars($this->image->title), 100) |
|
979 | + $feed .= ' <url>'.$this->image->url."</url>\n"; |
|
980 | + $feed .= ' <title>'.FeedCreator::iTrunc(htmlspecialchars($this->image->title), 100) |
|
981 | 981 | . "</title>\n"; |
982 | - $feed .= ' <link>' . $this->image->link . "</link>\n"; |
|
982 | + $feed .= ' <link>'.$this->image->link."</link>\n"; |
|
983 | 983 | if ($this->image->width != '') { |
984 | - $feed .= ' <width>' . $this->image->width . "</width>\n"; |
|
984 | + $feed .= ' <width>'.$this->image->width."</width>\n"; |
|
985 | 985 | } |
986 | 986 | if ($this->image->height != '') { |
987 | - $feed .= ' <height>' . $this->image->height . "</height>\n"; |
|
987 | + $feed .= ' <height>'.$this->image->height."</height>\n"; |
|
988 | 988 | } |
989 | 989 | if ($this->image->description != '') { |
990 | - $feed .= ' <description>' . $this->image->getDescription() . "</description>\n"; |
|
990 | + $feed .= ' <description>'.$this->image->getDescription()."</description>\n"; |
|
991 | 991 | } |
992 | 992 | $feed .= " </image>\n"; |
993 | 993 | } |
994 | 994 | if ($this->language != '') { |
995 | - $feed .= ' <language>' . $this->language . "</language>\n"; |
|
995 | + $feed .= ' <language>'.$this->language."</language>\n"; |
|
996 | 996 | } |
997 | 997 | if ($this->copyright != '') { |
998 | - $feed .= ' <copyright>' . FeedCreator::iTrunc(htmlspecialchars($this->copyright), 100) |
|
998 | + $feed .= ' <copyright>'.FeedCreator::iTrunc(htmlspecialchars($this->copyright), 100) |
|
999 | 999 | . "</copyright>\n"; |
1000 | 1000 | } |
1001 | 1001 | if ($this->editor != '') { |
1002 | - $feed .= ' <managingEditor>' . FeedCreator::iTrunc(htmlspecialchars($this->editor), 100) |
|
1002 | + $feed .= ' <managingEditor>'.FeedCreator::iTrunc(htmlspecialchars($this->editor), 100) |
|
1003 | 1003 | . "</managingEditor>\n"; |
1004 | 1004 | } |
1005 | 1005 | if ($this->webmaster != '') { |
1006 | - $feed .= ' <webMaster>' . FeedCreator::iTrunc(htmlspecialchars($this->webmaster), 100) |
|
1006 | + $feed .= ' <webMaster>'.FeedCreator::iTrunc(htmlspecialchars($this->webmaster), 100) |
|
1007 | 1007 | . "</webMaster>\n"; |
1008 | 1008 | } |
1009 | 1009 | if ($this->pubDate != '') { |
1010 | 1010 | $pubDate = new FeedDate($this->pubDate); |
1011 | - $feed .= ' <pubDate>' . htmlspecialchars($pubDate->rfc822()) . "</pubDate>\n"; |
|
1011 | + $feed .= ' <pubDate>'.htmlspecialchars($pubDate->rfc822())."</pubDate>\n"; |
|
1012 | 1012 | } |
1013 | 1013 | if ($this->category != '') { |
1014 | - $feed .= ' <category>' . htmlspecialchars($this->category) . "</category>\n"; |
|
1014 | + $feed .= ' <category>'.htmlspecialchars($this->category)."</category>\n"; |
|
1015 | 1015 | } |
1016 | 1016 | if ($this->docs != '') { |
1017 | - $feed .= ' <docs>' . FeedCreator::iTrunc(htmlspecialchars($this->docs), 500) . "</docs>\n"; |
|
1017 | + $feed .= ' <docs>'.FeedCreator::iTrunc(htmlspecialchars($this->docs), 500)."</docs>\n"; |
|
1018 | 1018 | } |
1019 | 1019 | if ($this->ttl != '') { |
1020 | - $feed .= ' <ttl>' . htmlspecialchars($this->ttl) . "</ttl>\n"; |
|
1020 | + $feed .= ' <ttl>'.htmlspecialchars($this->ttl)."</ttl>\n"; |
|
1021 | 1021 | } |
1022 | 1022 | if ($this->rating != '') { |
1023 | - $feed .= ' <rating>' . FeedCreator::iTrunc(htmlspecialchars($this->rating), 500) . "</rating>\n"; |
|
1023 | + $feed .= ' <rating>'.FeedCreator::iTrunc(htmlspecialchars($this->rating), 500)."</rating>\n"; |
|
1024 | 1024 | } |
1025 | 1025 | if ($this->skipHours != '') { |
1026 | - $feed .= ' <skipHours>' . htmlspecialchars($this->skipHours) . "</skipHours>\n"; |
|
1026 | + $feed .= ' <skipHours>'.htmlspecialchars($this->skipHours)."</skipHours>\n"; |
|
1027 | 1027 | } |
1028 | 1028 | if ($this->skipDays != '') { |
1029 | - $feed .= ' <skipDays>' . htmlspecialchars($this->skipDays) . "</skipDays>\n"; |
|
1029 | + $feed .= ' <skipDays>'.htmlspecialchars($this->skipDays)."</skipDays>\n"; |
|
1030 | 1030 | } |
1031 | 1031 | $feed .= $this->_createAdditionalElements($this->additionalElements, ' '); |
1032 | 1032 | |
1033 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1033 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1034 | 1034 | $feed .= " <item>\n"; |
1035 | - $feed .= ' <title>' . FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), |
|
1036 | - 100) . "</title>\n"; |
|
1037 | - $feed .= ' <link>' . htmlspecialchars($this->items[$i]->link) . "</link>\n"; |
|
1038 | - $feed .= ' <description>' . $this->items[$i]->getDescription() . "</description>\n"; |
|
1035 | + $feed .= ' <title>'.FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), |
|
1036 | + 100)."</title>\n"; |
|
1037 | + $feed .= ' <link>'.htmlspecialchars($this->items[$i]->link)."</link>\n"; |
|
1038 | + $feed .= ' <description>'.$this->items[$i]->getDescription()."</description>\n"; |
|
1039 | 1039 | |
1040 | 1040 | if ($this->items[$i]->author != '') { |
1041 | - $feed .= ' <author>' . htmlspecialchars($this->items[$i]->author) . "</author>\n"; |
|
1041 | + $feed .= ' <author>'.htmlspecialchars($this->items[$i]->author)."</author>\n"; |
|
1042 | 1042 | } |
1043 | 1043 | /* |
1044 | 1044 | // on hold |
@@ -1047,17 +1047,17 @@ discard block |
||
1047 | 1047 | } |
1048 | 1048 | */ |
1049 | 1049 | if ($this->items[$i]->category != '') { |
1050 | - $feed .= ' <category>' . htmlspecialchars($this->items[$i]->category) . "</category>\n"; |
|
1050 | + $feed .= ' <category>'.htmlspecialchars($this->items[$i]->category)."</category>\n"; |
|
1051 | 1051 | } |
1052 | 1052 | if ($this->items[$i]->comments != '') { |
1053 | - $feed .= ' <comments>' . htmlspecialchars($this->items[$i]->comments) . "</comments>\n"; |
|
1053 | + $feed .= ' <comments>'.htmlspecialchars($this->items[$i]->comments)."</comments>\n"; |
|
1054 | 1054 | } |
1055 | 1055 | if ($this->items[$i]->date != '') { |
1056 | 1056 | $itemDate = new FeedDate($this->items[$i]->date); |
1057 | - $feed .= ' <pubDate>' . htmlspecialchars($itemDate->rfc822()) . "</pubDate>\n"; |
|
1057 | + $feed .= ' <pubDate>'.htmlspecialchars($itemDate->rfc822())."</pubDate>\n"; |
|
1058 | 1058 | } |
1059 | 1059 | if ($this->items[$i]->guid != '') { |
1060 | - $feed .= ' <guid>' . htmlspecialchars($this->items[$i]->guid) . "</guid>\n"; |
|
1060 | + $feed .= ' <guid>'.htmlspecialchars($this->items[$i]->guid)."</guid>\n"; |
|
1061 | 1061 | } |
1062 | 1062 | $feed .= $this->_createAdditionalElements($this->items[$i]->additionalElements, ' '); |
1063 | 1063 | $feed .= " </item>\n"; |
@@ -1107,33 +1107,33 @@ discard block |
||
1107 | 1107 | * @return string |
1108 | 1108 | */ |
1109 | 1109 | public function createFeed() { |
1110 | - $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n"; |
|
1110 | + $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; |
|
1111 | 1111 | $feed .= $this->_createStylesheetReferences(); |
1112 | 1112 | $feed .= "<feed version=\"0.1\" xmlns=\"http://example.com/newformat#\">\n"; |
1113 | - $feed .= ' <title>' . FeedCreator::iTrunc(htmlspecialchars($this->title), 100) . "</title>\n"; |
|
1113 | + $feed .= ' <title>'.FeedCreator::iTrunc(htmlspecialchars($this->title), 100)."</title>\n"; |
|
1114 | 1114 | $this->truncSize = 500; |
1115 | - $feed .= ' <subtitle>' . $this->getDescription() . "</subtitle>\n"; |
|
1116 | - $feed .= ' <link>' . $this->link . "</link>\n"; |
|
1117 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1115 | + $feed .= ' <subtitle>'.$this->getDescription()."</subtitle>\n"; |
|
1116 | + $feed .= ' <link>'.$this->link."</link>\n"; |
|
1117 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1118 | 1118 | $feed .= " <entry>\n"; |
1119 | - $feed .= ' <title>' . FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), 100) |
|
1119 | + $feed .= ' <title>'.FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), 100) |
|
1120 | 1120 | . "</title>\n"; |
1121 | - $feed .= ' <link>' . htmlspecialchars($this->items[$i]->link) . "</link>\n"; |
|
1121 | + $feed .= ' <link>'.htmlspecialchars($this->items[$i]->link)."</link>\n"; |
|
1122 | 1122 | $itemDate = new FeedDate($this->items[$i]->date); |
1123 | - $feed .= ' <created>' . htmlspecialchars($itemDate->iso8601()) . "</created>\n"; |
|
1124 | - $feed .= ' <issued>' . htmlspecialchars($itemDate->iso8601()) . "</issued>\n"; |
|
1125 | - $feed .= ' <modified>' . htmlspecialchars($itemDate->iso8601()) . "</modified>\n"; |
|
1126 | - $feed .= ' <id>' . htmlspecialchars($this->items[$i]->guid) . "</id>\n"; |
|
1123 | + $feed .= ' <created>'.htmlspecialchars($itemDate->iso8601())."</created>\n"; |
|
1124 | + $feed .= ' <issued>'.htmlspecialchars($itemDate->iso8601())."</issued>\n"; |
|
1125 | + $feed .= ' <modified>'.htmlspecialchars($itemDate->iso8601())."</modified>\n"; |
|
1126 | + $feed .= ' <id>'.htmlspecialchars($this->items[$i]->guid)."</id>\n"; |
|
1127 | 1127 | if ($this->items[$i]->author != '') { |
1128 | 1128 | $feed .= " <author>\n"; |
1129 | - $feed .= ' <name>' . htmlspecialchars($this->items[$i]->author) . "</name>\n"; |
|
1129 | + $feed .= ' <name>'.htmlspecialchars($this->items[$i]->author)."</name>\n"; |
|
1130 | 1130 | if ($this->items[$i]->authorEmail != '') { |
1131 | - $feed .= ' <email>' . $this->items[$i]->authorEmail . "</email>\n"; |
|
1131 | + $feed .= ' <email>'.$this->items[$i]->authorEmail."</email>\n"; |
|
1132 | 1132 | } |
1133 | 1133 | $feed .= " </author>\n"; |
1134 | 1134 | } |
1135 | 1135 | $feed .= " <content type=\"text/html\" xml:lang=\"en-us\">\n"; |
1136 | - $feed .= " <div xmlns=\"http://www.w3.org/1999/xhtml\">" . $this->items[$i]->getDescription() |
|
1136 | + $feed .= " <div xmlns=\"http://www.w3.org/1999/xhtml\">".$this->items[$i]->getDescription() |
|
1137 | 1137 | . "</div>\n"; |
1138 | 1138 | $feed .= " </content>\n"; |
1139 | 1139 | $feed .= " </entry>\n"; |
@@ -1174,51 +1174,51 @@ discard block |
||
1174 | 1174 | * @return string |
1175 | 1175 | */ |
1176 | 1176 | public function createFeed() { |
1177 | - $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n"; |
|
1177 | + $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; |
|
1178 | 1178 | $feed .= $this->_createGeneratorComment(); |
1179 | 1179 | $feed .= $this->_createStylesheetReferences(); |
1180 | 1180 | $feed .= "<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\""; |
1181 | 1181 | if ($this->language != '') { |
1182 | - $feed .= " xml:lang=\"" . $this->language . "\""; |
|
1182 | + $feed .= " xml:lang=\"".$this->language."\""; |
|
1183 | 1183 | } |
1184 | 1184 | $feed .= ">\n"; |
1185 | - $feed .= ' <title>' . htmlspecialchars($this->title) . "</title>\n"; |
|
1186 | - $feed .= ' <tagline>' . htmlspecialchars($this->description) . "</tagline>\n"; |
|
1187 | - $feed .= " <link rel=\"alternate\" type=\"text/html\" href=\"" . htmlspecialchars($this->link) . "\"/>\n"; |
|
1188 | - $feed .= ' <id>' . htmlspecialchars($this->link) . "</id>\n"; |
|
1185 | + $feed .= ' <title>'.htmlspecialchars($this->title)."</title>\n"; |
|
1186 | + $feed .= ' <tagline>'.htmlspecialchars($this->description)."</tagline>\n"; |
|
1187 | + $feed .= " <link rel=\"alternate\" type=\"text/html\" href=\"".htmlspecialchars($this->link)."\"/>\n"; |
|
1188 | + $feed .= ' <id>'.htmlspecialchars($this->link)."</id>\n"; |
|
1189 | 1189 | $now = new FeedDate(); |
1190 | - $feed .= ' <modified>' . htmlspecialchars($now->iso8601()) . "</modified>\n"; |
|
1190 | + $feed .= ' <modified>'.htmlspecialchars($now->iso8601())."</modified>\n"; |
|
1191 | 1191 | if ($this->editor != '') { |
1192 | 1192 | $feed .= " <author>\n"; |
1193 | - $feed .= ' <name>' . $this->editor . "</name>\n"; |
|
1193 | + $feed .= ' <name>'.$this->editor."</name>\n"; |
|
1194 | 1194 | if ($this->editorEmail != '') { |
1195 | - $feed .= ' <email>' . $this->editorEmail . "</email>\n"; |
|
1195 | + $feed .= ' <email>'.$this->editorEmail."</email>\n"; |
|
1196 | 1196 | } |
1197 | 1197 | $feed .= " </author>\n"; |
1198 | 1198 | } |
1199 | - $feed .= ' <generator>' . FEEDCREATOR_VERSION . "</generator>\n"; |
|
1199 | + $feed .= ' <generator>'.FEEDCREATOR_VERSION."</generator>\n"; |
|
1200 | 1200 | $feed .= $this->_createAdditionalElements($this->additionalElements, ' '); |
1201 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1201 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1202 | 1202 | $feed .= " <entry>\n"; |
1203 | - $feed .= ' <title>' . htmlspecialchars(strip_tags($this->items[$i]->title)) . "</title>\n"; |
|
1203 | + $feed .= ' <title>'.htmlspecialchars(strip_tags($this->items[$i]->title))."</title>\n"; |
|
1204 | 1204 | $feed .= " <link rel=\"alternate\" type=\"text/html\" href=\"" |
1205 | - . htmlspecialchars($this->items[$i]->link) . "\"/>\n"; |
|
1205 | + . htmlspecialchars($this->items[$i]->link)."\"/>\n"; |
|
1206 | 1206 | if ($this->items[$i]->date == '') { |
1207 | 1207 | $this->items[$i]->date = time(); |
1208 | 1208 | } |
1209 | 1209 | $itemDate = new FeedDate($this->items[$i]->date); |
1210 | - $feed .= ' <created>' . htmlspecialchars($itemDate->iso8601()) . "</created>\n"; |
|
1211 | - $feed .= ' <issued>' . htmlspecialchars($itemDate->iso8601()) . "</issued>\n"; |
|
1212 | - $feed .= ' <modified>' . htmlspecialchars($itemDate->iso8601()) . "</modified>\n"; |
|
1213 | - $feed .= ' <id>' . htmlspecialchars($this->items[$i]->link) . "</id>\n"; |
|
1210 | + $feed .= ' <created>'.htmlspecialchars($itemDate->iso8601())."</created>\n"; |
|
1211 | + $feed .= ' <issued>'.htmlspecialchars($itemDate->iso8601())."</issued>\n"; |
|
1212 | + $feed .= ' <modified>'.htmlspecialchars($itemDate->iso8601())."</modified>\n"; |
|
1213 | + $feed .= ' <id>'.htmlspecialchars($this->items[$i]->link)."</id>\n"; |
|
1214 | 1214 | $feed .= $this->_createAdditionalElements($this->items[$i]->additionalElements, ' '); |
1215 | 1215 | if ($this->items[$i]->author != '') { |
1216 | 1216 | $feed .= " <author>\n"; |
1217 | - $feed .= ' <name>' . htmlspecialchars($this->items[$i]->author) . "</name>\n"; |
|
1217 | + $feed .= ' <name>'.htmlspecialchars($this->items[$i]->author)."</name>\n"; |
|
1218 | 1218 | $feed .= " </author>\n"; |
1219 | 1219 | } |
1220 | 1220 | if ($this->items[$i]->description != '') { |
1221 | - $feed .= ' <summary>' . htmlspecialchars($this->items[$i]->description) . "</summary>\n"; |
|
1221 | + $feed .= ' <summary>'.htmlspecialchars($this->items[$i]->description)."</summary>\n"; |
|
1222 | 1222 | } |
1223 | 1223 | $feed .= " </entry>\n"; |
1224 | 1224 | } |
@@ -1260,23 +1260,23 @@ discard block |
||
1260 | 1260 | //$line = rtrim($line); // remove trailing white space -> no =20\r\n necessary |
1261 | 1261 | $linlen = strlen($line); |
1262 | 1262 | $newline = ''; |
1263 | - for ($i = 0; $i < $linlen; ++$i) { |
|
1263 | + for ($i = 0; $i<$linlen; ++$i) { |
|
1264 | 1264 | $c = substr($line, $i, 1); |
1265 | 1265 | $dec = ord($c); |
1266 | - if (($dec == 32) && ($i == ($linlen - 1))) { // convert space at eol only |
|
1266 | + if (($dec == 32) && ($i == ($linlen-1))) { // convert space at eol only |
|
1267 | 1267 | $c = '=20'; |
1268 | - } elseif (($dec == 61) || ($dec < 32) || ($dec > 126)) { // always encode "\t", which is *not* required |
|
1269 | - $h2 = floor($dec / 16); |
|
1270 | - $h1 = floor($dec % 16); |
|
1271 | - $c = $escape . $hex["$h2"] . $hex["$h1"]; |
|
1268 | + } elseif (($dec == 61) || ($dec<32) || ($dec>126)) { // always encode "\t", which is *not* required |
|
1269 | + $h2 = floor($dec/16); |
|
1270 | + $h1 = floor($dec%16); |
|
1271 | + $c = $escape.$hex["$h2"].$hex["$h1"]; |
|
1272 | 1272 | } |
1273 | - if ((strlen($newline) + strlen($c)) >= $line_max) { // CRLF is not counted |
|
1274 | - $output .= $newline . $escape . $eol; // soft line break; " =\r\n" is okay |
|
1273 | + if ((strlen($newline)+strlen($c))>=$line_max) { // CRLF is not counted |
|
1274 | + $output .= $newline.$escape.$eol; // soft line break; " =\r\n" is okay |
|
1275 | 1275 | $newline = ''; |
1276 | 1276 | } |
1277 | 1277 | $newline .= $c; |
1278 | 1278 | } // end of for |
1279 | - $output .= $newline . $eol; |
|
1279 | + $output .= $newline.$eol; |
|
1280 | 1280 | } |
1281 | 1281 | |
1282 | 1282 | return trim($output); |
@@ -1287,22 +1287,22 @@ discard block |
||
1287 | 1287 | * @return string the feed's complete text |
1288 | 1288 | */ |
1289 | 1289 | public function createFeed() { |
1290 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1290 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1291 | 1291 | if ($this->items[$i]->author != '') { |
1292 | 1292 | $from = $this->items[$i]->author; |
1293 | - } else { |
|
1293 | + }else { |
|
1294 | 1294 | $from = $this->title; |
1295 | 1295 | } |
1296 | 1296 | $itemDate = new FeedDate($this->items[$i]->date); |
1297 | - $feed .= 'From ' . strtr(MBOXCreator::qp_enc($from), ' ', '_') . ' ' . date('D M d H:i:s Y', |
|
1298 | - $itemDate->unix()) . "\n"; |
|
1297 | + $feed .= 'From '.strtr(MBOXCreator::qp_enc($from), ' ', '_').' '.date('D M d H:i:s Y', |
|
1298 | + $itemDate->unix())."\n"; |
|
1299 | 1299 | $feed .= "Content-Type: text/plain;\n"; |
1300 | - $feed .= " charset=\"" . $this->encoding . "\"\n"; |
|
1300 | + $feed .= " charset=\"".$this->encoding."\"\n"; |
|
1301 | 1301 | $feed .= "Content-Transfer-Encoding: quoted-printable\n"; |
1302 | 1302 | $feed .= "Content-Type: text/plain\n"; |
1303 | - $feed .= "From: \"" . MBOXCreator::qp_enc($from) . "\"\n"; |
|
1304 | - $feed .= 'Date: ' . $itemDate->rfc822() . "\n"; |
|
1305 | - $feed .= 'Subject: ' . MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title, 100)) . "\n"; |
|
1303 | + $feed .= "From: \"".MBOXCreator::qp_enc($from)."\"\n"; |
|
1304 | + $feed .= 'Date: '.$itemDate->rfc822()."\n"; |
|
1305 | + $feed .= 'Subject: '.MBOXCreator::qp_enc(FeedCreator::iTrunc($this->items[$i]->title, 100))."\n"; |
|
1306 | 1306 | $feed .= "\n"; |
1307 | 1307 | $body = chunk_split(MBOXCreator::qp_enc($this->items[$i]->description)); |
1308 | 1308 | $feed .= preg_replace("~\nFrom ([^\n]*)(\n?)~", "\n>From $1$2\n", $body); |
@@ -1322,7 +1322,7 @@ discard block |
||
1322 | 1322 | public function _generateFilename() { |
1323 | 1323 | $fileInfo = pathinfo($_SERVER['PHP_SELF']); |
1324 | 1324 | |
1325 | - return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension']) + 1)) . '.mbox'; |
|
1325 | + return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension'])+1)).'.mbox'; |
|
1326 | 1326 | } |
1327 | 1327 | } |
1328 | 1328 | |
@@ -1346,35 +1346,35 @@ discard block |
||
1346 | 1346 | * @return string |
1347 | 1347 | */ |
1348 | 1348 | public function createFeed() { |
1349 | - $feed = "<?xml version=\"1.0\" encoding=\"" . $this->encoding . "\"?>\n"; |
|
1349 | + $feed = "<?xml version=\"1.0\" encoding=\"".$this->encoding."\"?>\n"; |
|
1350 | 1350 | $feed .= $this->_createGeneratorComment(); |
1351 | 1351 | $feed .= $this->_createStylesheetReferences(); |
1352 | 1352 | $feed .= "<opml xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"; |
1353 | 1353 | $feed .= " <head>\n"; |
1354 | - $feed .= ' <title>' . htmlspecialchars($this->title) . "</title>\n"; |
|
1354 | + $feed .= ' <title>'.htmlspecialchars($this->title)."</title>\n"; |
|
1355 | 1355 | if ($this->pubDate != '') { |
1356 | 1356 | $date = new FeedDate($this->pubDate); |
1357 | - $feed .= ' <dateCreated>' . $date->rfc822() . "</dateCreated>\n"; |
|
1357 | + $feed .= ' <dateCreated>'.$date->rfc822()."</dateCreated>\n"; |
|
1358 | 1358 | } |
1359 | 1359 | if ($this->lastBuildDate != '') { |
1360 | 1360 | $date = new FeedDate($this->lastBuildDate); |
1361 | - $feed .= ' <dateModified>' . $date->rfc822() . "</dateModified>\n"; |
|
1361 | + $feed .= ' <dateModified>'.$date->rfc822()."</dateModified>\n"; |
|
1362 | 1362 | } |
1363 | 1363 | if ($this->editor != '') { |
1364 | - $feed .= ' <ownerName>' . $this->editor . "</ownerName>\n"; |
|
1364 | + $feed .= ' <ownerName>'.$this->editor."</ownerName>\n"; |
|
1365 | 1365 | } |
1366 | 1366 | if ($this->editorEmail != '') { |
1367 | - $feed .= ' <ownerEmail>' . $this->editorEmail . "</ownerEmail>\n"; |
|
1367 | + $feed .= ' <ownerEmail>'.$this->editorEmail."</ownerEmail>\n"; |
|
1368 | 1368 | } |
1369 | 1369 | $feed .= " </head>\n"; |
1370 | 1370 | $feed .= " <body>\n"; |
1371 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1371 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1372 | 1372 | $feed .= " <outline type=\"rss\" "; |
1373 | 1373 | $title = htmlspecialchars(strip_tags(strtr($this->items[$i]->title, "\n\r", ' '))); |
1374 | - $feed .= " title=\"" . $title . "\""; |
|
1375 | - $feed .= " text=\"" . $title . "\""; |
|
1374 | + $feed .= " title=\"".$title."\""; |
|
1375 | + $feed .= " text=\"".$title."\""; |
|
1376 | 1376 | //$feed.= " description=\"".htmlspecialchars($this->items[$i]->description)."\""; |
1377 | - $feed .= " url=\"" . htmlspecialchars($this->items[$i]->link) . "\""; |
|
1377 | + $feed .= " url=\"".htmlspecialchars($this->items[$i]->link)."\""; |
|
1378 | 1378 | $feed .= "/>\n"; |
1379 | 1379 | } |
1380 | 1380 | $feed .= " </body>\n"; |
@@ -1449,7 +1449,7 @@ discard block |
||
1449 | 1449 | |
1450 | 1450 | //if no stylePrefix is set, generate it yourself depending on the script name |
1451 | 1451 | if ($this->stylePrefix == '') { |
1452 | - $this->stylePrefix = str_replace('.', '_', $this->_generateFilename()) . '_'; |
|
1452 | + $this->stylePrefix = str_replace('.', '_', $this->_generateFilename()).'_'; |
|
1453 | 1453 | } |
1454 | 1454 | |
1455 | 1455 | //set an openInNewWindow_token_to be inserted or not |
@@ -1460,26 +1460,26 @@ discard block |
||
1460 | 1460 | // use this array to put the lines in and implode later with "document.write" javascript |
1461 | 1461 | $feedArray = array(); |
1462 | 1462 | if ($this->image != null) { |
1463 | - $imageStr = "<a href='" . $this->image->link . "'" . $targetInsert . '>' . "<img src='" . $this->image->url |
|
1464 | - . "' border='0' alt='" . FeedCreator::iTrunc(htmlspecialchars($this->image->title), 100) |
|
1465 | - . "' align='" . $this->imageAlign . "' "; |
|
1463 | + $imageStr = "<a href='".$this->image->link."'".$targetInsert.'>'."<img src='".$this->image->url |
|
1464 | + . "' border='0' alt='".FeedCreator::iTrunc(htmlspecialchars($this->image->title), 100) |
|
1465 | + . "' align='".$this->imageAlign."' "; |
|
1466 | 1466 | if ($this->image->width) { |
1467 | - $imageStr .= " width='" . $this->image->width . "' "; |
|
1467 | + $imageStr .= " width='".$this->image->width."' "; |
|
1468 | 1468 | } |
1469 | 1469 | if ($this->image->height) { |
1470 | - $imageStr .= " height='" . $this->image->height . "' "; |
|
1470 | + $imageStr .= " height='".$this->image->height."' "; |
|
1471 | 1471 | } |
1472 | 1472 | $imageStr .= '/></a>'; |
1473 | 1473 | $feedArray[] = $imageStr; |
1474 | 1474 | } |
1475 | 1475 | |
1476 | 1476 | if ($this->title) { |
1477 | - $feedArray[] = "<div class='" . $this->stylePrefix . "title'><a href='" . $this->link . "' " . $targetInsert |
|
1478 | - . " class='" . $this->stylePrefix . "title'>" |
|
1479 | - . FeedCreator::iTrunc(htmlspecialchars($this->title), 100) . '</a></div>'; |
|
1477 | + $feedArray[] = "<div class='".$this->stylePrefix."title'><a href='".$this->link."' ".$targetInsert |
|
1478 | + . " class='".$this->stylePrefix."title'>" |
|
1479 | + . FeedCreator::iTrunc(htmlspecialchars($this->title), 100).'</a></div>'; |
|
1480 | 1480 | } |
1481 | 1481 | if ($this->getDescription()) { |
1482 | - $feedArray[] = "<div class='" . $this->stylePrefix . "description'>" . str_replace(']]>', '', |
|
1482 | + $feedArray[] = "<div class='".$this->stylePrefix."description'>".str_replace(']]>', '', |
|
1483 | 1483 | str_replace('<![CDATA[', |
1484 | 1484 | '', |
1485 | 1485 | $this->getDescription())) |
@@ -1487,29 +1487,29 @@ discard block |
||
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | if ($this->header) { |
1490 | - $feedArray[] = "<div class='" . $this->stylePrefix . "header'>" . $this->header . '</div>'; |
|
1490 | + $feedArray[] = "<div class='".$this->stylePrefix."header'>".$this->header.'</div>'; |
|
1491 | 1491 | } |
1492 | 1492 | |
1493 | - for ($i = 0, $iMax = count($this->items); $i < $iMax; ++$i) { |
|
1494 | - if ($this->separator && $i > 0) { |
|
1495 | - $feedArray[] = "<div class='" . $this->stylePrefix . "separator'>" . $this->separator . '</div>'; |
|
1493 | + for ($i = 0, $iMax = count($this->items); $i<$iMax; ++$i) { |
|
1494 | + if ($this->separator && $i>0) { |
|
1495 | + $feedArray[] = "<div class='".$this->stylePrefix."separator'>".$this->separator.'</div>'; |
|
1496 | 1496 | } |
1497 | 1497 | |
1498 | 1498 | if ($this->items[$i]->title) { |
1499 | 1499 | if ($this->items[$i]->link) { |
1500 | - $feedArray[] = "<div class='" . $this->stylePrefix . "item_title'><a href='" |
|
1501 | - . $this->items[$i]->link . "' class='" . $this->stylePrefix . "item_title'" |
|
1502 | - . $targetInsert . '>' |
|
1500 | + $feedArray[] = "<div class='".$this->stylePrefix."item_title'><a href='" |
|
1501 | + . $this->items[$i]->link."' class='".$this->stylePrefix."item_title'" |
|
1502 | + . $targetInsert.'>' |
|
1503 | 1503 | . FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), 100) |
1504 | 1504 | . '</a></div>'; |
1505 | - } else { |
|
1506 | - $feedArray[] = "<div class='" . $this->stylePrefix . "item_title'>" |
|
1505 | + }else { |
|
1506 | + $feedArray[] = "<div class='".$this->stylePrefix."item_title'>" |
|
1507 | 1507 | . FeedCreator::iTrunc(htmlspecialchars(strip_tags($this->items[$i]->title)), 100) |
1508 | 1508 | . '</div>'; |
1509 | 1509 | } |
1510 | 1510 | } |
1511 | 1511 | if ($this->items[$i]->getDescription()) { |
1512 | - $feedArray[] = "<div class='" . $this->stylePrefix . "item_description'>" . str_replace(']]>', '', |
|
1512 | + $feedArray[] = "<div class='".$this->stylePrefix."item_description'>".str_replace(']]>', '', |
|
1513 | 1513 | str_replace('<![CDATA[', |
1514 | 1514 | '', |
1515 | 1515 | $this->items[$i]->getDescription())) |
@@ -1517,10 +1517,10 @@ discard block |
||
1517 | 1517 | } |
1518 | 1518 | } |
1519 | 1519 | if ($this->footer) { |
1520 | - $feedArray[] = "<div class='" . $this->stylePrefix . "footer'>" . $this->footer . '</div>'; |
|
1520 | + $feedArray[] = "<div class='".$this->stylePrefix."footer'>".$this->footer.'</div>'; |
|
1521 | 1521 | } |
1522 | 1522 | |
1523 | - $feed = '' . implode($feedArray, "\r\n"); |
|
1523 | + $feed = ''.implode($feedArray, "\r\n"); |
|
1524 | 1524 | |
1525 | 1525 | return $feed; |
1526 | 1526 | } |
@@ -1535,7 +1535,7 @@ discard block |
||
1535 | 1535 | public function _generateFilename() { |
1536 | 1536 | $fileInfo = pathinfo($_SERVER['PHP_SELF']); |
1537 | 1537 | |
1538 | - return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension']) + 1)) . '.html'; |
|
1538 | + return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension'])+1)).'.html'; |
|
1539 | 1539 | } |
1540 | 1540 | } |
1541 | 1541 | |
@@ -1559,7 +1559,7 @@ discard block |
||
1559 | 1559 | |
1560 | 1560 | $jsFeed = ''; |
1561 | 1561 | foreach ($feedArray as $value) { |
1562 | - $jsFeed .= "document.write('" . trim(addslashes($value)) . "');\n"; |
|
1562 | + $jsFeed .= "document.write('".trim(addslashes($value))."');\n"; |
|
1563 | 1563 | } |
1564 | 1564 | |
1565 | 1565 | return $jsFeed; |
@@ -1575,7 +1575,7 @@ discard block |
||
1575 | 1575 | public function _generateFilename() { |
1576 | 1576 | $fileInfo = pathinfo($_SERVER['PHP_SELF']); |
1577 | 1577 | |
1578 | - return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension']) + 1)) . '.js'; |
|
1578 | + return substr($fileInfo['basename'], 0, -(strlen($fileInfo['extension'])+1)).'.js'; |
|
1579 | 1579 | } |
1580 | 1580 | } |
1581 | 1581 |
@@ -24,18 +24,18 @@ |
||
24 | 24 | // URL: http://xoops.org // |
25 | 25 | // Project: Article Project // |
26 | 26 | // ------------------------------------------------------------------------ // |
27 | -include __DIR__ . '/header.php'; |
|
28 | -$article_id = empty($_GET['article']) ? 0 : (int)$_GET['article']; |
|
27 | +include __DIR__.'/header.php'; |
|
28 | +$article_id = empty($_GET['article']) ? 0 : (int) $_GET['article']; |
|
29 | 29 | if (empty($article_id)) { |
30 | 30 | return; |
31 | 31 | } |
32 | -if (planet_getcookie('art_' . $article_id) > 0) { |
|
32 | +if (planet_getcookie('art_'.$article_id)>0) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | $article_handler = xoops_getModuleHandler('article', $xoopsModule->getVar('dirname')); |
36 | -$article_obj =& $article_handler->get($article_id); |
|
37 | -$article_obj->setVar('art_views', $article_obj->getVar('art_views') + 1, true); |
|
36 | +$article_obj = & $article_handler->get($article_id); |
|
37 | +$article_obj->setVar('art_views', $article_obj->getVar('art_views')+1, true); |
|
38 | 38 | $article_handler->insert($article_obj, true); |
39 | -planet_setcookie('art_' . $article_id, time()); |
|
39 | +planet_setcookie('art_'.$article_id, time()); |
|
40 | 40 | |
41 | 41 | return; |