|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
You may not change or alter any portion of this comment or credits |
|
4
|
|
|
of supporting developers from this source code or any supporting source code |
|
5
|
|
|
which is considered copyrighted (c) material of the original comment or credit authors. |
|
6
|
|
|
|
|
7
|
|
|
This program is distributed in the hope that it will be useful, |
|
8
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
9
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* XOOPS feed creator |
|
14
|
|
|
* |
|
15
|
|
|
* @copyright XOOPS Project (https://xoops.org) |
|
16
|
|
|
* @license GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) |
|
17
|
|
|
* @package core |
|
18
|
|
|
* @since 2.6.0 |
|
19
|
|
|
* @author Laurent JEN (aka DuGris) |
|
20
|
|
|
*/ |
|
21
|
|
|
if (file_exists('mainfile.php')) { |
|
22
|
|
|
include __DIR__ . '/mainfile.php'; |
|
23
|
|
|
} else { |
|
24
|
|
|
require dirname(dirname(__DIR__)) . '/' . '/mainfile.php'; |
|
25
|
|
|
} |
|
26
|
|
|
|
|
27
|
|
|
$xoops = \Xoops::getInstance(); |
|
28
|
|
|
$xoops->disableErrorReporting(); |
|
29
|
|
|
|
|
30
|
|
|
if (function_exists('mb_http_output')) { |
|
31
|
|
|
mb_http_output('pass'); |
|
32
|
|
|
} |
|
33
|
|
|
header('Content-Type:text/xml; charset=utf-8'); |
|
34
|
|
|
|
|
35
|
|
|
$dirname = $xoops->isModule() ? $xoops->module->getVar('dirname') : 'system'; |
|
|
|
|
|
|
36
|
|
|
$tpl = new \XoopsTpl(); |
|
37
|
|
|
$tpl->caching = 2; |
|
38
|
|
|
$tpl->cache_lifetime = 3600; |
|
39
|
|
|
if (!$tpl->is_cached('module:' . $dirname . '/system_rss.tpl')) { |
|
40
|
|
|
$tpl->assign('channel_title', (htmlspecialchars($xoops->getConfig('sitename'), ENT_QUOTES))); |
|
41
|
|
|
$tpl->assign('channel_link', \XoopsBaseConfig::get('url') . '/'); |
|
42
|
|
|
$tpl->assign('channel_desc', (htmlspecialchars($xoops->getConfig('slogan'), ENT_QUOTES))); |
|
43
|
|
|
$tpl->assign('channel_lastbuild', \XoopsLocale::formatTimestamp(time(), 'rss')); |
|
44
|
|
|
$tpl->assign('channel_webmaster', $xoops->checkEmail($xoops->getConfig('adminmail'), true)); |
|
45
|
|
|
$tpl->assign('channel_editor', $xoops->checkEmail($xoops->getConfig('adminmail'), true)); |
|
46
|
|
|
$tpl->assign('channel_category', 'News'); |
|
47
|
|
|
$tpl->assign('channel_generator', 'XOOPS'); |
|
48
|
|
|
$tpl->assign('channel_language', _LANGCODE); |
|
49
|
|
|
|
|
50
|
|
|
$xoTheme = $xoops->theme(); |
|
51
|
|
|
$imgPath = $xoTheme->resourcePath('/img/logo.png'); |
|
52
|
|
|
$tpl->assign('image_url', $xoops->url($imgPath)); |
|
53
|
|
|
$dimension = getimagesize($xoops->path($imgPath)); |
|
54
|
|
|
$tpl->assign('image_width', $dimension[0]); |
|
55
|
|
|
$tpl->assign('image_height', $dimension[1]); |
|
56
|
|
|
|
|
57
|
|
|
$items = []; |
|
58
|
|
|
|
|
59
|
|
|
if ($xoops->isModule()) { |
|
60
|
|
|
/* @var SystemPluginInterface $plugin */ |
|
61
|
|
|
$plugin = \Xoops\Module\Plugin::getPlugin($dirname, 'system'); |
|
|
|
|
|
|
62
|
|
|
$res = $plugin->backend(10); |
|
63
|
|
|
if (is_array($res) && count($res) > 0) { |
|
64
|
|
|
foreach ($res as $item) { |
|
65
|
|
|
$date[] = ['date' => $item['date']]; |
|
66
|
|
|
$items[] = [ |
|
67
|
|
|
'date' => \XoopsLocale::formatTimestamp($item['date'], 'rss'), |
|
68
|
|
|
'title' => (htmlspecialchars($item['title'])), |
|
69
|
|
|
'content' => (htmlspecialchars($item['content'])), |
|
70
|
|
|
'link' => $item['link'], |
|
71
|
|
|
'guid' => $item['link'], |
|
72
|
|
|
]; |
|
73
|
|
|
} |
|
74
|
|
|
} |
|
75
|
|
|
} else { |
|
76
|
|
|
$plugins = \Xoops\Module\Plugin::getPlugins('system'); |
|
77
|
|
|
/* @var SystemPluginInterface $plugin */ |
|
78
|
|
|
foreach ($plugins as $plugin) { |
|
79
|
|
|
$res = $plugin->backend(10); |
|
80
|
|
|
if (is_array($res) && count($res) > 0) { |
|
81
|
|
|
foreach ($res as $item) { |
|
82
|
|
|
$date[] = ['date' => $item['date']]; |
|
83
|
|
|
$items[] = [ |
|
84
|
|
|
'date' => \XoopsLocale::formatTimestamp($item['date'], 'rss'), |
|
85
|
|
|
'title' => (htmlspecialchars($item['title'])), |
|
86
|
|
|
'content' => (htmlspecialchars($item['content'])), |
|
87
|
|
|
'link' => $item['link'], |
|
88
|
|
|
'guid' => $item['link'], |
|
89
|
|
|
]; |
|
90
|
|
|
} |
|
91
|
|
|
} |
|
92
|
|
|
} |
|
93
|
|
|
} |
|
94
|
|
|
array_multisort($date, SORT_DESC, $items); |
|
95
|
|
|
$tpl->assign('items', $items); |
|
96
|
|
|
} |
|
97
|
|
|
$tpl->display('module:' . $dirname . '/system_rss.tpl'); |
|
98
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.