⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inc_feed.asp

📁 ZD-BS是一个基于asp+access的个人blog系统 程序特点: 1.数据结构合理
💻 ASP
字号:
<script language="JScript" runat="server">

//============================================================
//     Copyright 2006-2007 VAL/ZYI. All Rights Reserved.
//============================================================

function articleRSS(arrPara){
	var strRSS="";
	var intCatID=arrPara["catID"];
	var strQuery="select top 10 cat_name,post_ID,post_title,post_authorName,post_content,post_excerpt,post_postTime from zd_post,zd_category where post_catID=cat_ID and post_type='article' and post_state='publish' and cat_state='publish' ";
	if(intCatID!=0) strQuery+="and post_catID="+intCatID+" ";
	strQuery+="order by post_postTime desc";
	var arrArticle=dbConn.query(strQuery);
	if(arrArticle!=null){
		var arr=new Array();
		for(var i=0;i<arrArticle.length;i++){
			arr[i]={
				"title":arrArticle[i]["post_title"],
				"URL":theHTML.encodeURL(zd_set["blogURL"]+"article.asp?/a"+arrArticle[i]["post_ID"]+".html"),
				"commURL":theHTML.encodeURL(zd_set["blogURL"]+"article.asp?/a"+arrArticle[i]["post_ID"]+".html#comment"),
				"time":func.dateStr(arrArticle[i]["post_postTime"],"we, dd me yyyy HH:MM:SS Z"),
				"author":arrArticle[i]["post_authorName"],
				"title":arrArticle[i]["post_title"],
				"cate":arrArticle[i]["cat_name"],
				"content":(arrArticle[i]["post_excerpt"]?arrArticle[i]["post_excerpt"]:theHTML.encodeHTML(theHTML.trimHTML(arrArticle[i]["post_content"]))),
				"commRSS":theHTML.encodeURL(zd_set["blogURL"]+"feed.asp?act=rss2-comm&logID="+arrArticle[i]["post_ID"])
			};
		}
		strRSS=theAPI.IRSS2Article(arr);
	}
	var arrHeader={
		"mode":"article",
		"title":zd_set["blogName"],
		"URL":theHTML.encodeURL(zd_set["blogURL"]),
		"describe":zd_set["blogDescribe"],
		"time":(arrArticle!=null?func.dateStr(arrArticle[0]["post_postTime"],"we, dd me yyyy HH:MM:SS Z"):func.dateStr(new Date(),"we, dd me yyyy HH:MM:SS Z")),
		"language":language
	};
	theXML.output(theAPI.sendIRSS2Response(arrHeader,strRSS));
}

function commentRSS(arrPara){
	var strRSS="";
	var intLogID=arrPara["logID"];
	var strQuery="select top 10 post_ID,post_title,comm_ID,comm_content,comm_authorName,comm_postTime from zd_category,zd_post,zd_comment where comm_postID=post_ID and post_catID=cat_ID and comm_type='comment' and comm_state='publish' and post_state='publish' and cat_state='publish' ";
	if(intLogID!=0) strQuery+="and post_ID="+intLogID+" ";
	strQuery+="order by comm_postTime desc";
	var arrComment=dbConn.query(strQuery);
	if(arrComment!=null){
		var arr=new Array();
		for(var i=0;i<arrComment.length;i++){
			arr[i]={
				"title":"Comment on: "+arrComment[i]["post_title"],
				"URL":theHTML.encodeURL(zd_set["blogURL"]+"article.asp?/a"+arrComment[i]["post_ID"]+".html#comment"+arrComment[i]["comm_ID"]),
				"author":arrComment[i]["comm_authorName"],
				"time":func.dateStr(arrComment[i]["comm_postTime"],"we, dd me yyyy HH:MM:SS Z"),
				"content":theHTML.encodeHTML(theHTML.trimHTML(arrComment[i]["comm_content"]))
			};
		}
		strRSS=theAPI.IRSS2Comment(arr);
	}
	var arrHeader={
		"mode":"comment",
		"title":zd_set["blogName"]+" (Comments)",
		"URL":theHTML.encodeURL(zd_set["blogURL"]),
		"describe":zd_set["blogDescribe"],
		"time":(arrComment!=null?func.dateStr(arrComment[0]["comm_postTime"],"we, dd me yyyy HH:MM:SS Z"):func.dateStr(new Date(),"we, dd me yyyy HH:MM:SS Z")),
		"language":language
	};
	theXML.output(theAPI.sendIRSS2Response(arrHeader,strRSS));
}

function doit(){
	var arrPara=new Array();
	var arrQS=func.getInput(0);
	var strMode=arrQS["act"];
	var intCatID=func.checkInt(arrQS["catID"]);
	var intLogID=func.checkInt(arrQS["logID"]);
	if(strMode!="rss2-log"&&strMode!="rss2-comm") strMode="rss2-log";
	if(strMode=="rss2-log"){
		arrPara["catID"]=intCatID;
		articleRSS(arrPara);
	}else if(strMode=="rss2-comm"){
		arrPara["logID"]=intLogID;
		commentRSS(arrPara);
	}else{
		//other feed...
	}
}

</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -