打开rss.php文件,找到下面的函数:- function getrss($catid) {
- global $_SGLOBAL, $_SCONFIG ;
- $rssarr = array();
- $attacharr = array();
- if(empty($_SCONFIG['rssnum'])) $_SCONFIG['rssnum'] = 10;
- $sql = "SELECT si.itemid, si.uid, si.username, si.subject, sn.*, si.dateline, c.name FROM ".tname('spaceitems')." si INNER JOIN ".tname('categories')." c ON si.catid = c.catid LEFT JOIN ".tname('spacenews')." sn ON si.itemid = sn.itemid WHERE si.type='news' ";
- if(!empty($catid)) {
- $sql .= " AND si.catid='$catid' ";
- }
- $sql .= " ORDER BY si.dateline DESC LIMIT 100";
- $query = $_SGLOBAL['db']->query($sql);
- while($items = $_SGLOBAL['db']->fetch_array($query)) {
- $othermsgarr = array();
- $items['message'] = cutstr($items['message'], 255, 1);
- if(!empty($othermsgarr)) $items['message'] = implode('<br>', $othermsgarr).'<br>'.$items['message'];
- if(!empty($items['hash'])) $attacharr[] = trim($items['hash']);
- $rssarr[$items['itemid']] = $items;
- }
- return $rssarr;
- }
复制代码 将其改为:- function getrss($catid) {
- global $_SGLOBAL, $_SCONFIG ;
- $rssarr = array();
- $attacharr = array();
- include_once(S_ROOT."./data/system/category.cache.php");
-
- if(empty($_SCONFIG['rssnum'])) $_SCONFIG['rssnum'] = 10;
- $sql = "SELECT si.itemid, si.uid, si.username, si.subject, sn.*, si.dateline, c.name FROM ".tname('spaceitems')." si INNER JOIN ".tname('categories')." c ON si.catid = c.catid LEFT JOIN ".tname('spacenews')." sn ON si.itemid = sn.itemid WHERE si.type='".$_SGLOBAL['category'][$catid]['type']."' ";
- if(!empty($catid)) {
- $sql .= " AND si.catid='$catid' ";
- }
- $sql .= " ORDER BY si.dateline DESC LIMIT 100";
- $query = $_SGLOBAL['db']->query($sql);
- while($items = $_SGLOBAL['db']->fetch_array($query)) {
- $othermsgarr = array();
- $items['message'] = cutstr($items['message'], 255, 1);
- if(!empty($othermsgarr)) $items['message'] = implode('<br>', $othermsgarr).'<br>'.$items['message'];
- if(!empty($items['hash'])) $attacharr[] = trim($items['hash']);
- $rssarr[$items['itemid']] = $items;
- }
- return $rssarr;
- }
复制代码 修改后即可。
如果不想修改可直接用文件覆盖,此文件适用于所有编码。
|