discuz修改论坛的rss为全文输出的方法-Discuz教程下载

discuz修改论坛的rss为全文输出的方法

开通本站Svip会员,全站资源免费下
打开 \source\module\forum\forum_rss.php 文件
找到
  1. if($attachfile) {
  2. if($attachremote) {
  3.       $filename = $_G['setting']['ftp']['attachurl'].'forum/'.$attachfile;
  4. } else {
  5.       $filename = (!strstr($_G['setting']['attachurl'], '://') ? $_G['siteurl'] : '').$_G['setting']['attachurl'].'forum/'.$attachfile;
  6. }
  7. }
复制代码

在其下方加入
  1. $fdata = DB::fetch_first("SELECT * FROM ".DB::table('forum_post')." WHERE tid = '$thread[tid]' and first = 1");
复制代码

将其下方的这段话:
  1. echo      "    <item>\n".
  2.                          "      <title>".$thread['subject']."</title>\n".
  3.                          "      <link>$_G[siteurl]".($trewriteflag ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : "forum.php?mod=viewthread&tid=$thread[tid]")."</link>\n".
  4.                          "      <description><![CDATA[".dhtmlspecialchars($thread['description'])."]]></description>\n".
  5.                          "      <category>".dhtmlspecialchars($thread['forum'])."</category>\n".
  6.                          "      <author>".dhtmlspecialchars($thread['author'])."</author>\n".
  7.                          ($attachfile ? '<enclosure url="'.$filename.'" length="'.$attachsize.'" type="image/jpeg" />' : '').
  8.                          "      <pubDate>".gmdate('r', $thread['dateline'])."</pubDate>\n".
  9.                          "    </item>\n";
复制代码

修改为:
  1. echo      "    <item>\n".
  2.                          "      <title>".$thread['subject']."</title>\n".
  3.                          "      <link>$_G[siteurl]".($trewriteflag ? rewriteoutput('forum_viewthread', 1, '', $thread['tid']) : "forum.php?mod=viewthread&tid=$thread[tid]")."</link>\n".
  4.                          "      <description><![CDATA[".dhtmlspecialchars($fdata['message'])."]]></description>\n".
  5.                          "      <category>".dhtmlspecialchars($thread['forum'])."</category>\n".
  6.                          "      <author>".dhtmlspecialchars($thread['author'])."</author>\n".
  7.                          ($attachfile ? '<enclosure url="'.$filename.'" length="'.$attachsize.'" type="image/jpeg" />' : '').
  8.                          "      <pubDate>".gmdate('r', $thread['dateline'])."</pubDate>\n".
  9.                          "    </item>\n";
复制代码

然后刷新即可看到效果

全部评论 0

您需要登录后才可以回帖 立即登录
登录
0
0
0
返回顶部