100) { $limit = 20; } if (!empty($sort)) { if ($_GET['sort'] == 'all') { $issort = ""; } else { $sort = intval($_GET['sort']); $issort = "AND sortid='$sort'"; } } else { $issort = ""; } // 转换字符 function str_conver($content) { $content = str_replace("&", "&", $content); $content = str_replace("'", "'", $content); $content = str_replace('"', '"', $content); return $content; } switch(intval($_GET['version'])) { case "2": header("Content-Type: text/xml"); echo "\n"; echo "\n"; echo "\t\n"; echo "\t\t".str_conver($options['title'])."\n"; echo "\t\t".$options['url']."\n"; echo "\t\tCopyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.\n"; echo "\t\tSaBlog\n"; break; default: header("Content-Type: text/xml"); echo "\n"; echo "\n"; echo "\t\n"; echo "\t\t".str_conver($options['title'])."\n"; echo "\t\t".$options['url']."\n"; echo "\t\tCopyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.\n"; echo "\t\tzh\n"; break; } switch($_GET['subscribe']) { case "comment": $comments = $DB->query("SELECT c.*, b.visible FROM ".$db_prefix."comment c LEFT JOIN ".$db_prefix."blog b ON (b.blogid=c.blogid) WHERE b.visible='1' AND c.visible='1' ORDER BY commentid DESC LIMIT 0, $limit"); while ($comment = $DB->fetch_array($comments)) { switch($_GET['version']) { case "2"; echo "\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$comment['blogid']."\n"; echo "\t\t\t".str_conver(htmlspecialchars($comment['blogtitle']))."\n"; echo "\t\t\t".str_conver($comment['author'])."\n"; echo "\t\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$comment['blogid']."\n"; echo "\t\t\t".date('Y-n-j',$comment['addtime'])."\n"; echo "\t\t\n"; break; default: echo "\t\t\n"; echo "\t\t\t".str_conver(htmlspecialchars($comment['blogtitle']))."\n"; echo "\t\t\t".str_conver($comment['author'])."\n"; echo "\t\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$comment['blogid']."\n"; echo "\t\t\t".date('Y-n-j',$comment['addtime'])."\n"; echo "\t\t\n"; break; }//end switch }//end while break; default: $blogs = $DB->query("SELECT b.blogid, b.title, b.content, b.sortid, b.sortname, b.addtime, u.nickname, u.email FROM ".$db_prefix."blog b LEFT JOIN ".$db_prefix."user u ON u.userid=b.userid WHERE visible='1' $issort ORDER BY blogid DESC LIMIT 0, $limit"); while ($blog = $DB->fetch_array($blogs)) { switch($_GET['version']) { case "2"; echo "\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$blog['blogid']."\n"; echo "\t\t\t".str_conver(htmlspecialchars($blog['title']))."\n"; echo "\t\t\t".str_conver($blog['nickname'])."\n"; echo "\t\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$blog['blogid']."\n"; echo "\t\t\t".str_conver($blog['sortname'])."\n"; echo "\t\t\t".date('Y-n-j',$blog['addtime'])."\n"; echo "\t\t\n"; break; default: echo "\t\t\n"; echo "\t\t\t".str_conver(htmlspecialchars($blog['title']))."\n"; echo "\t\t\t".str_conver($options['webmaster'])."\n"; echo "\t\t\t\n"; echo "\t\t\t".$options['url']."?action=show&id=".$blog['blogid']."\n"; echo "\t\t\t".date('Y-n-j',$blog['addtime'])."\n"; echo "\t\t\n"; break; }//end switch }//end while break; } echo "\t\n"; echo " \n"; ?>