채택완료

RSS 생성이 안됩니다..

2020-03-11 (수) 06:39:17 2,132
Copy
<?php
include_once "_common.php";

header("Content-type: text/xml;charset=utf-8");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

$limit = 100; // feed »ý¼º ¼ö

$buff = '';

$buff .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>".PHP_EOL;
$buff .= '<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:activity="http://activitystrea.ms/spec/1.0/" >'.PHP_EOL;
$buff .= '<channel>'.PHP_EOL;
$buff .= '<title><![CDATA['.$config['cf_title'].']]></title>'.PHP_EOL;
$buff .= '<link>http://mcbekr.kr</link>'.PHP_EOL;
$buff .= '<description><![CDATA['.$config['cf_1'].']]></description>'.PHP_EOL;
$buff .= '<language>ko</language>'.PHP_EOL;
  
$Search = " where (1) ";
$Search .= " and wr_is_comment = 0 ";
$SelectBoard = " select bo_table,bo_subject from ".$g5['board_table']." where bo_use_search = 1 ";
$QueryBoard = sql_query($SelectBoard);
while($RowBoard = sql_fetch_array($QueryBoard)){ $ResultSelect[] = "( select *, '".$RowBoard['bo_table']."' as bo_table from ".$g5['write_prefix'].$RowBoard['bo_table'].$Search." )"; }
$ResultQuery = implode(" union all ", $ResultSelect);
$ResultQuery .= " order by wr_datetime desc limit 0 , $limit ";
$Query = sql_query($ResultQuery);
while($Row = sql_fetch_array($Query)){
    
$content = strip_tags($Row['wr_content']);
$content = str_replace("&nbsp;"," ",$content);

$board = sql_fetch("select bo_subject from g5_board where bo_table = '".$Row['bo_table']."'");

$buff .= "<item>".PHP_EOL;
$buff .= "<category><![CDATA[".$board['bo_subject']."]]></category>".PHP_EOL;
$buff .= "<title><![CDATA[".$Row['bo_subject']." - ".$Row['wr_subject']."]]></title>".PHP_EOL;
$buff .= "<link>".G5_BBS_URL."/board.php?bo_table=".$Row['bo_table']."&amp;wr_id=".$Row['wr_id']."</link>".PHP_EOL;
$buff .= "<description><![CDATA[".mb_strimwidth($content,0,400,'..','utf-8')."]]></description>".PHP_EOL;
$buff .= "<author>".$Row['wr_name']."</author>".PHP_EOL;
$buff .= "<pubDate>".date("D, d M Y H:i:s T", strtotime($Row['wr_datetime']))."</pubDate>".PHP_EOL;
$buff .= "</item>".PHP_EOL;
}
  
$buff .= "</channel>".PHP_EOL;
$buff .= "</rss>";


echo $buff;


?>

이렇게 되어있는데

mcbekr.kr/rss.php들어가면 불러오질 못하네요 ㅠㅠ

도와주실 수 있을까요??

|

답변 1개

채택된 답변
+20 포인트

그누보드의 bbs/rss.php 참고해보시는게 좋을 듯합니다.

답변을 작성하려면 로그인이 필요합니다.