Server : nginx/1.22.1 System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : www ( 1000) PHP Version : 7.2.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/www.jkmold.com/phpcms/modules/content/ |
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class rss { private $db; function __construct() { $this->db = pc_base::load_model('content_model'); pc_base::load_app_class('rssbuilder','','','0'); $this->siteid = $_GET['siteid'] ? intval($_GET['siteid']) : '1'; $this->rssid = intval($_GET['rssid']); define('SITEID', $this->siteid); } public function init() { $siteurl = siteurl(SITEID); if(empty($this->rssid)) { $catid = $_GET['catid'] ? intval($_GET['catid']) : '0'; $siteids = getcache('category_content','commons'); $siteid = $siteids[$catid] ? $siteids[$catid] : 1; $CATEGORYS = getcache('category_content_'.$siteid,'commons'); $subcats = subcat($catid,0,1,$siteid); foreach ($CATEGORYS as $r) if($r['parentid'] == 0) $channel[] = $r; include template('content','rss'); } else { $CATEGORYS = getcache('category_content_'.$this->siteid,'commons'); $SITEINFO = getcache('sitelist','commons'); $CAT = $CATEGORYS[$this->rssid]; if(count($CAT) == 0) showmessage(L('missing_part_parameters'),'blank'); $siteid = $CAT['siteid']; $sitedomain = $SITEINFO[$siteid]['domain']; //获取站点域名 $MODEL = getcache('model','commons'); $modelid = $CAT['modelid']; $encoding = CHARSET; $about = SITE_PROTOCOL.SITE_URL; $title = $CAT['catname']; $description = $CAT['description']; $content_html = $CAT['content_ishtml']; $image_link = "<![CDATA[".$CAT['image']."]]> "; $category = ''; $cache = 60; $rssfile = new RSSBuilder($encoding, $about, $title, $description, $image_link, $category, $cache); $publisher = ''; $creator = SITE_PROTOCOL.SITE_URL; $date = date('r'); $rssfile->addDCdata($publisher, $creator, $date); $ids = explode(",",$CAT['arrchildid']); if(count($ids) == 1 && in_array($this->rssid, $ids)) { $sql .= "`catid` = '$this->rssid' AND `status` = '99'"; } else { $sql .= get_sql_catid('category_content_'.$siteid,$this->rssid)." AND `status` = '99'"; } if(empty($MODEL[$modelid]['tablename'])) showmessage(L('missing_part_parameters'),'blank'); $this->db->table_name = $this->db->db_tablepre.$MODEL[$modelid]['tablename']; $info = $this->db->select($sql,'`title`, `description`, `url`, `inputtime`, `thumb`, `keywords`','0,20','id DESC'); foreach ($info as $r) { //添加项目 if(!empty($r['thumb'])) $img = "<img src=".thumb($r['thumb'], 150, 150)." border='0' /><br />";else $img = ''; $about = $link = (strpos($r['url'], 'http://') !== FALSE || strpos($r['url'], 'https://') !== FALSE) ? "<![CDATA[".$r['url']."]]> " : (($content_html == 1) ? "<![CDATA[".substr($sitedomain,0,-1).$r['url']."]]> " : "<![CDATA[".substr(APP_PATH,0,-1).$r['url']."]]> "); $title = "<![CDATA[".$r['title']."]]> "; $description = "<![CDATA[".$img.$r['description']."]]> "; $subject = ''; $date = date('Y-m-d H:i:s' , $r['inputtime']); $author = $PHPCMS['sitename'].' '.SITE_PROTOCOL.SITE_URL; $comments = '';//注释; $rssfile->addItem($about, $title, $link, $description, $subject, $date, $author, $comments, $image); } $version = '2.00'; $rssfile->outputRSS($version); } } } ?>