Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64
User : palandch ( 1163)
PHP Version : 7.1.33
Disable Function : NONE
Directory :  /home/palandch/www/manager/controllers/default/dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/manager/controllers/default/dashboard/widget.modx-news.php
<?php
/**
 * @package modx
 * @subpackage dashboard
 */
/**
 * @package modx
 * @subpackage dashboard
 */
class modDashboardWidgetNewsFeed extends modDashboardWidgetInterface {
    /**
     * @var modRSSParser $rss
     */
    public $rss;

    /**
     * @return string
     */
    public function render() {
        $this->modx->loadClass('xmlrss.modRSSParser','',false,true);
        $this->rss = new modRSSParser($this->modx);

        $o = array();
        $url = $this->modx->getOption('feed_modx_news');
        $newsEnabled = $this->modx->getOption('feed_modx_news_enabled',null,true);
        if (!empty($url) && !empty($newsEnabled)) {
            $rss = $this->rss->parse($url);
            if (is_object($rss)) {
                foreach (array_keys($rss->items) as $key) {
                    $item= &$rss->items[$key];
                    $item['pubdate'] = strftime('%c',$item['date_timestamp']);
                    $o[] = $this->getFileChunk('dashboard/rssitem.tpl',$item);
                }
            }
        }
        return implode("\n",$o);
    }
}
return 'modDashboardWidgetNewsFeed';

Spamworldpro Mini