$brdnum = bbs_getboard($brdname, $brdarr); if ($brdnum == 0) { continue; } $brdname = urlencode($brdarr["NAME"]); $gid = find_content($board, "groupid"); $item["title"] = htmlspecialchars("[" . $brdarr["DESC"] . "] " . find_content($board, "title")); $item["link"] = SiteURL . "bbstcon.php?board=" . $brdname . "&gid=" . $gid; $item["author"] = find_content($board, "author"); $item["pubDate"] = gmt_date_format(find_content($board, "time")); $item["guid"] = $item["link"]; $articles = array(); $num = bbs_get_records_from_id($brdname, $gid, $dir_modes["NORMAL"], $articles); if ($num <= 0) { continue; } $article = $articles[1]; if (!$article) { continue; } $contentfile = bbs_get_board_filename($brdname, $article["FILENAME"]); $content = bbs2_readfile_text($contentfile, DESC_CHAR_PER_RSS_ITEM, 0); if (is_string($content)) { $item["description"] = "<![CDATA[" . $content . "]]>"; } else { continue; } $items[] = $item; } $channel["lastBuildDate"] = gmt_date_format($modifytime); output_rss($channel, $items);
$artcnt = ARTICLE_PER_RSS; if ($total <= $artcnt) { $start = 1; $artcnt = $total; } else { $start = $total - $artcnt + 1; } $articles = bbs_getarticles($board, $start, $artcnt, $ftype) or die; $cc = count($articles); for ($i = $cc - 1; $i >= 0; $i--) { $origin = $articles[$i]; $item = array(); $item["title"] = htmlspecialchars($origin['TITLE'], ENT_QUOTES) . " "; $conurl = "bbscon.php?bid=" . $brdnum . "&id=" . $origin['ID']; //you want the link to always work, so you don't want to add num //if ($ftype == $dir_modes["DIGEST"]) $conurl .= "&ftype=".$ftype."&num=".($start+$i); $item["link"] = SiteURL . $conurl; $item["author"] = $origin['OWNER']; $item["pubDate"] = gmt_date_format($origin['POSTTIME']); $item["guid"] = $item["link"]; //TODO //$item["comments"] = ?? //TODO $filename = bbs_get_board_filename($board, $origin["FILENAME"]); $contents = bbs2_readfile_text($filename, DESC_CHAR_PER_RSS_ITEM, 0); if (is_string($contents)) { $item["description"] = "<![CDATA[" . $contents . "]]>"; } $items[] = $item; } } output_rss($channel, $items);
function atomic_mailread() { global $currentuser; atomic_mail_header(); $mail_fullpath = bbs_setmailfile($currentuser["userid"], ".DIR"); $mail_num = bbs_getmailnum2($mail_fullpath); if ($mail_num <= 0 || $mail_num > 30000) { atomic_error("读取邮件数据失败!"); } if (isset($_GET["num"])) { $num = @intval($_GET["num"]); } else { atomic_error("错误的参数"); } if ($num <= 0 || $num > $mail_num) { atomic_error("错误的参数"); } $articles = array(); if (bbs_get_records_from_num($mail_fullpath, $num - 1, $articles)) { $filename = bbs_setmailfile($currentuser["userid"], $articles[0]["FILENAME"]); } else { atomic_error("错误的参数"); } $html = "<p>"; $html .= '<a href="?act=mailpost">写信</a> <a href="?act=mailpost&num=' . $num . '">回信</a> '; if ($num > 1) { $html .= '<a href="?act=mailread&num=' . ($num - 1) . '">上一篇</a> '; } $html .= '<a href="?act=mail&start=' . $num . '">收件箱</a> '; if ($num < $mail_num) { $html .= '<a href="?act=mailread&num=' . ($num + 1) . '">下一篇</a> '; } $html .= "</p>"; echo $html; echo bbs2_readfile_text($filename, 0, 2); bbs_setmailreaded($mail_fullpath, $num - 1); atomic_footer(); }