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; } // 출력할거를 초기화 $list= array(); // $bo_table이 없으면, RSS 가능한 전체 게시판을 RSS if ($bo_table == "") { // tmp 테이블을 만듭니다. RSS 가능한 게시판 목록을 만들기 위해서 // 팀장처럼 create temporaty table의 권한을 안주는 경우, 지원할 수 없습니다. 시스템 부하가 너무 커요. if ($g4['old_stype_search']) { goto_url("./rss_list.php"); } else { $sql = "select A.bo_table, A.bo_subject, A.bo_use_rss_view, B.gr_id, B.gr_subject from $g4[board_table] A left join $g4[group_table] B on A.gr_id=B.gr_id where bo_read_level = 1 and bo_use_search = 1 and gr_use_search = 1 and gr_use_access <> 1 and bo_use_rss_view = 1 order by B.gr_order_search, B.gr_id "; $sql_tmp = " create TEMPORARY table list_tmp as $sql "; $sql_ord = " select B.* from list_tmp A left join $g4[board_new_table] B on A.bo_table = B.bo_table where wr_is_comment = 0 order by bn_id desc limit 0, 20"; @mysql_query($sql_tmp) or die("
$sql_tmp
" . mysql_errno() . " : " . mysql_error() . "
error file : $_SERVER[PHP_SELF]"); $result = @mysql_query($sql_ord) or die("
$sql_ord
" . mysql_errno() . " : " . mysql_error() . "
error file : $_SERVER[PHP_SELF]");
$subj1 = "전체 RSS";
$subj2 = "전체 RSS";
$rsslink = "$g4[url]/bbs/rss_list.php";
$j = 0;
for ($i=0; $row=sql_fetch_array($result); $i++) {
$board = get_board($row[bo_table]);
if (!$board)
continue;
$tmp_write_table = $g4[write_prefix] . $row[bo_table];
$write = sql_fetch(" select * from $tmp_write_table where wr_id = '$row[wr_id]' ");
$list[$j] = get_list($write, $board, $latest_skin_path, $subject_len);
$list[$j][url] = "$g4[url]/$g4[bbs]/board.php?bo_table=$row[bo_table]&wr_id=$row[wr_id]";
$list[$i][bo_table] = $row[bo_table];
$j++;
}
}
} else {
// 비회원 읽기가 가능한 게시판만 RSS 지원
if ($board[bo_read_level] >= 2) {
echo "비회원 읽기가 가능한 게시판만 RSS 지원합니다.";
exit;
}
// RSS 사용 체크
if (!$board[bo_use_rss_view]) {
echo "RSS 보기가 금지되어 있습니다.";
exit;
}
// 게시판 제목
$subj2 = specialchars_replace($board[bo_subject], 255);
$lines = $board[bo_page_rows];
// 그룹 제목
$sql = " select gr_subject from $g4[group_table] where gr_id = '$board[gr_id]' ";
$row = sql_fetch($sql);
$subj1 = specialchars_replace($row[gr_subject], 255);
// 게시판 정보를 Feed
$sql = " select wr_id, wr_subject, wr_content, wr_name, wr_datetime, wr_option, wr_link1, wr_link2, mb_id
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 ";
$result = sql_query($sql);
$rsslink = "$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table";
for ($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i][url] = "$g4[url]/$g4[bbs]/board.php?bo_table=$bo_table&wr_id=$row[wr_id]";
$list[$i][bo_table] = $bo_table;
}
}
// RSS 정보를 XML 형식으로 출력
Header("Content-type: text/xml");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "\n";
echo " Link $j : $ltext " . $tmp_file[$j][view] . "
";
for ($k=0; $k |