특정 인물의 게시물을 rss로 뽑아오는 방법을 좀...;; 정보
특정 인물의 게시물을 rss로 뽑아오는 방법을 좀...;;
본문
일반적으로 rss는 보드를 긁어올 수는 있는데
'특정 인물의 rss'는 못가져 오더군요 ㅡ_ㅜ;;;
가능할까요?
특정인물의 rss만 가져온다는게!?
가능하다면 좀 알려주세요 ㅠ~~
댓글 전체

가능하겟지요.
rss 페이지를 웹에서 보여줄때
경로/rss.php?mb_id=해당 아이디
이런식으로 넣어주고
rss.php를 에디터로 열어서
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
order by wr_num, wr_reply limit 0, $lines ";
이렇게 된 부분을
$add_where = (!empty($_GET['mb_id'])) ? " and mb_id <> '" . $_GET['mb_id'] . "' " : '';
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
이런식으로 고쳐 주면 되겠네요.
rss 페이지를 웹에서 보여줄때
경로/rss.php?mb_id=해당 아이디
이런식으로 넣어주고
rss.php를 에디터로 열어서
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
order by wr_num, wr_reply limit 0, $lines ";
이렇게 된 부분을
$add_where = (!empty($_GET['mb_id'])) ? " and mb_id <> '" . $_GET['mb_id'] . "' " : '';
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
이런식으로 고쳐 주면 되겠네요.

첫번째 줄인
and mb_id <> '" . $_GET['mb_id'] . "' " : '';
부분에서 오류가 난다고 합니다 ㅡ_ㅜ 훌쩍
일단 답변 감사합니다~!
and mb_id <> '" . $_GET['mb_id'] . "' " : '';
부분에서 오류가 난다고 합니다 ㅡ_ㅜ 훌쩍
일단 답변 감사합니다~!

그래요?
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
그럼 이렇게 해주세요.
조건문도 잘 못 적었엇네요
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
그럼 이렇게 해주세요.
조건문도 잘 못 적었엇네요

다음 태그가 닫히지 않았습니다. rss, channel, p, p, p.
ㅠㅠㅠㅠ 아직 오류가 있네요 ㅡㅜ;;
상기문을 지우고 적는거죠?;;
ㅠㅠㅠㅠ 아직 오류가 있네요 ㅡㅜ;;
상기문을 지우고 적는거죠?;;

음
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
order by wr_num, wr_reply limit 0, $lines ";
요부분을 지우고
그자리에 그대로
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
요렇게 넣으세요
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
order by wr_num, wr_reply limit 0, $lines ";
요부분을 지우고
그자리에 그대로
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
요렇게 넣으세요

<?
include_once("./_common.php");
// 특수문자 변환
function specialchars_replace($str, $len=0)
{
if ($len) {
$str = substr($str, 0, $len);
}
$str = preg_replace("/&/", "&", $str);
$str = preg_replace("/</", "<", $str);
$str = preg_replace("/>/", ">", $str);
return $str;
}
$sql = " select gr_id, bo_subject, bo_page_rows, bo_read_level from $g4[board_table] where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$subj2 = specialchars_replace($row[bo_subject], 255);
$lines = $row[bo_page_rows];
// 비회원 읽기가 가능한 게시판만 RSS 지원
if ($row[bo_read_level] >= 2) {
echo "비회원 읽기가 가능한 게시판만 RSS 지원합니다.";
exit;
}
Header("Content-type: text/xml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$sql = " select gr_subject from $g4[group_table] where gr_id = '$row[gr_id]' ";
$row = sql_fetch($sql);
$subj1 = specialchars_replace($row[gr_subject], 255);
echo "<?xml version=\"1.0\" encoding=\"$g4[charset]\"?>\n";
echo "<!--// RSS2.0 -->\n";
echo "<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/\">\n";
echo "<channel>\n";
echo "<title>".specialchars_replace("$subj1 > $subj2")."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table")."</link>\n";
//echo "<description>테스트 버전 0.2 (2004-04-26)</description>\n";
echo "<language>ko</language>\n";
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$file = "";
//$file .= view_file_link($row[wr_file1]);
//$file .= view_file_link($row[wr_file2]);
//$file = preg_replace("/\.\//", "$cfg[d_url]/", $file);
if (strstr($row[wr_option], 'html'))
$html = 1;
else
$html = 0;
echo "<item>\n";
echo "<title>".specialchars_replace($row[wr_subject])."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]")."</link>\n";
echo "<description><![CDATA[".$file . conv_content($row[wr_content], $html)."]]></description>\n";
echo "<dc:creator>".specialchars_replace($row[wr_name])."</dc:creator>\n";
$date = $row[wr_datetime];
// rss 리더 스킨으로 호출하면 날짜가 제대로 표시되지 않음
//$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";
$date = date('r', strtotime($date));
echo "<dc:date>$date</dc:date>\n";
echo "</item>\n";
}
echo "</channel>\n";
echo "</rss>\n";
?>
ㅡㅜ;; 안되네요;;
include_once("./_common.php");
// 특수문자 변환
function specialchars_replace($str, $len=0)
{
if ($len) {
$str = substr($str, 0, $len);
}
$str = preg_replace("/&/", "&", $str);
$str = preg_replace("/</", "<", $str);
$str = preg_replace("/>/", ">", $str);
return $str;
}
$sql = " select gr_id, bo_subject, bo_page_rows, bo_read_level from $g4[board_table] where bo_table = '$bo_table' ";
$row = sql_fetch($sql);
$subj2 = specialchars_replace($row[bo_subject], 255);
$lines = $row[bo_page_rows];
// 비회원 읽기가 가능한 게시판만 RSS 지원
if ($row[bo_read_level] >= 2) {
echo "비회원 읽기가 가능한 게시판만 RSS 지원합니다.";
exit;
}
Header("Content-type: text/xml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
$sql = " select gr_subject from $g4[group_table] where gr_id = '$row[gr_id]' ";
$row = sql_fetch($sql);
$subj1 = specialchars_replace($row[gr_subject], 255);
echo "<?xml version=\"1.0\" encoding=\"$g4[charset]\"?>\n";
echo "<!--// RSS2.0 -->\n";
echo "<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/\">\n";
echo "<channel>\n";
echo "<title>".specialchars_replace("$subj1 > $subj2")."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table")."</link>\n";
//echo "<description>테스트 버전 0.2 (2004-04-26)</description>\n";
echo "<language>ko</language>\n";
if (!empty($_GET['mb_id'])) {
$add_where = " and mb_id = '" . $_GET['mb_id'] . "' " ;
}
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option
from $g4[write_prefix]$bo_table
where wr_is_comment = 0
and wr_option not like '%secret%'
$add_where
order by wr_num, wr_reply limit 0, $lines ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
$file = "";
//$file .= view_file_link($row[wr_file1]);
//$file .= view_file_link($row[wr_file2]);
//$file = preg_replace("/\.\//", "$cfg[d_url]/", $file);
if (strstr($row[wr_option], 'html'))
$html = 1;
else
$html = 0;
echo "<item>\n";
echo "<title>".specialchars_replace($row[wr_subject])."</title>\n";
echo "<link>".specialchars_replace("$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]")."</link>\n";
echo "<description><![CDATA[".$file . conv_content($row[wr_content], $html)."]]></description>\n";
echo "<dc:creator>".specialchars_replace($row[wr_name])."</dc:creator>\n";
$date = $row[wr_datetime];
// rss 리더 스킨으로 호출하면 날짜가 제대로 표시되지 않음
//$date = substr($date,0,10) . "T" . substr($date,11,8) . "+09:00";
$date = date('r', strtotime($date));
echo "<dc:date>$date</dc:date>\n";
echo "</item>\n";
}
echo "</channel>\n";
echo "</rss>\n";
?>
ㅡㅜ;; 안되네요;;

잘되는데요
링크를 잘 못 걸으셧네요.
제가 위에서 설명을 잘못알려드렷죠?
소스는 그대로 사용하시고
링크는 아래와 같은 형태로 거세요
http://8bong.com/bbs/testrss.php?bo_table=humor_borad&mb_id=dbckdghk
링크를 잘 못 걸으셧네요.
제가 위에서 설명을 잘못알려드렷죠?
소스는 그대로 사용하시고
링크는 아래와 같은 형태로 거세요
http://8bong.com/bbs/testrss.php?bo_table=humor_borad&mb_id=dbckdghk

아 되네요 ㅠ;; 죄송합니다 ㅜ;;;
보드를 지정해줘야 하는군요 ㅠ;;
근데 모든 게시판에서 검색하는 방법은 없을까요 ;ㅅ;?
→나름 응용해서 해봤더니 됩니다 ㅎㅎ;;
감사합니다 창화님!!
보드를 지정해줘야 하는군요 ㅠ;;
근데 모든 게시판에서 검색하는 방법은 없을까요 ;ㅅ;?
→나름 응용해서 해봤더니 됩니다 ㅎㅎ;;
감사합니다 창화님!!