Passed
Push — master ( b0fca4...7540c5 )
by Michael
06:08 queued 02:59
created
Severity
1
<?php
2
3
declare(strict_types=1);
4
/*
5
 * You may not change or alter any portion of this comment or credits
6
 * of supporting developers from this source code or any supporting source code
7
 * which is considered copyrighted (c) material of the original comment or credit authors.
8
 *
9
 * This program is distributed in the hope that it will be useful,
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 */
13
14
/**
15
 * @copyright    XOOPS Project (https://xoops.org)
16
 * @license      GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
17
 * @package      RSSFit - Extendable XML news feed generator
18
 * @author       NS Tai (aka tuff) <http://www.brandycoke.com>
19
 * @author       XOOPS Development Team
20
 */
21
22
$GLOBALS['xoopsOption']['template_main'] = 'rssfit_index.tpl';
23
global $xoopsConfig, $xoopsTpl;
24
25
require_once __DIR__ . '/header.php';
26
require_once XOOPS_ROOT_PATH . '/header.php';
27
28
/** @var \XoopsModules\Rssfit\MiscHandler $miscHandler */
29
$intr = $miscHandler->getObjects2(new \Criteria('misc_category', 'intro'));
30
if ($intr) {
0 ignored issues
show
$intr is of type array|null, thus it always evaluated to false.
Loading history...
31
    $intro   = $intr[0];
32
    $setting = $intro->getVar('misc_setting');
33
    $intro->setDoHtml((bool)$setting['dohtml']);
34
    $intro->setDoBr((bool)$setting['dobr']);
35
    $title   = str_replace('{SITENAME}', $xoopsConfig['sitename'], $intro->getVar('misc_title'));
36
    $content = str_replace(['{SITENAME}', '{SITEURL}'], [$xoopsConfig['sitename'], XOOPS_URL . '/'], $intro->getVar('misc_content'));
37
    /** @var \XoopsModules\Rssfit\PluginHandler $pluginHandler */
38
    if (false !== mb_strpos($content, '{SUB}') && $plugins = $pluginHandler->getObjects2(new \Criteria('subfeed', '1'))) {
39
        $sublist = '';
40
        foreach ($plugins as $p) {
41
            $sub     = ($setting['sub']);
42
            $sub     = str_replace('{URL}', $feedHandler->subFeedUrl($p->getVar('rssf_filename')), $sub);
43
            $sub     = str_replace(['{TITLE}', '{DESC}'], [$p->getVar('sub_title'), $p->getVar('sub_desc')], $sub);
44
            $sublist .= $sub;
45
        }
46
        $content = str_replace('{SUB}', $sublist, $content);
47
    } else {
48
        $content = str_replace('{SUB}', '', $content);
49
    }
50
    $xoopsTpl->assign('intro', ['title' => $title, 'content' => $content]);
51
}
52
require_once XOOPS_ROOT_PATH . '/footer.php';
53