update_xml()

function update_xml() {
global $db, $dbid, $p_user_nick, $p_title, $p_description, $s_root_path, $r_root_path, $attach_path, $s_attach_path, $r_attach_path, $p_xml_cnt, $p_rss_public;

list($st, $header, $body, $lmdate, $xmlinfo) = xml_parser($s_root_path."index.xml","");
if ($xmlinfo) {
list($stitle, $slink, $sdesc) = str_dbi_check(get_siteinfo($xmlinfo));
}

if (trim($slink)) $s_root_path = str_replace("index.php", "", $slink);

$p_title = htmlspecialchars($p_title);
$p_description = htmlspecialchars(str_tag_truncate($p_description));
$rtime = get_rss_stamp(time());

$rss .= "\r\n";
$rss .= "\r\n";
$rss .= "\r\n";
$rss .= "$p_title\r\n";
$rss .= "$s_root_path"."index.php\r\n";
$rss .= "$p_description\r\n";
$rss .= "ko\r\n";
$rss .= "$rtime\r\n";

$sql = "
select
no, category1, category2, title, body,
user_id, image_file_path1, image_file_path2, regdate
from
t3_".$dbid."
where
is_public = '1'
order by
regdate desc
limit 0, $p_xml_cnt
";
$result = @mysql_query($sql);
while(list(
$no, $category1, $category2, $title, $body,
$user_id, $image_file_path1, $image_file_path2, $regdate
) = @mysql_fetch_array($result)) {

$category = get_category1_label($category1);
if ($category2) $category .= " - ".get_category2_label($category2);

$title = htmlspecialchars($title);
$link = htmlspecialchars($s_root_path."index.php?pl=$no");

if ($p_rss_public) {
$description =
" nl2brc(
autolink(
set_body(
attach_image(0, $body, $s_root_path, $r_root_path, $attach_path.$image_file_path1.$image_file_path2)
)
)
)
, $no)."]]>";
} else {
if (strlen($body) > 240) $add_desc = " >> 글 전체보기";
else $add_desc = "";
$description = "";
}

$regdate = get_rss_stamp($regdate);
$creator = htmlspecialchars($user_id);

$rss .= "\r\n";
$rss .= "$title\r\n";
$rss .= "$link\r\n";
$rss .= "$description\r\n";
$rss .= "".htmlspecialchars($category)."\r\n";
$rss .= "$creator\r\n";
$rss .= "$regdate\r\n";
$rss .= "
\r\n";
}

$rss .= "
\r\n";
$rss .= "
";

$out = fopen($r_root_path."index.xml", "w");
@chmod($r_root_path."index.xml", 0777);
fwrite($out, $rss);
fclose($out);
}
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2006/11/23 17:06 2006/11/23 17:06
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2104

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/2104

« Previous : 1 : ... 4302 : 4303 : 4304 : 4305 : 4306 : 4307 : 4308 : 4309 : 4310 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Statistics Graph

Site Stats

Total hits:
187355
Today:
155
Yesterday:
669