특정 인물의 게시물을 rss로 뽑아오는 방법을 좀...;; > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

특정 인물의 게시물을 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 ";

이런식으로 고쳐 주면 되겠네요.
그래요?

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("/&/", "&amp;", $str);
    $str = preg_replace("/</", "&lt;", $str);
    $str = preg_replace("/>/", "&gt;", $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
아 되네요 ㅠ;; 죄송합니다 ㅜ;;;
보드를 지정해줘야 하는군요 ㅠ;;

근데 모든 게시판에서 검색하는 방법은 없을까요 ;ㅅ;?

→나름 응용해서 해봤더니 됩니다 ㅎㅎ;;

감사합니다 창화님!!
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT