user_url.asp
来自「是个不错的文件代码,希望大家好好用,」· ASP 代码 · 共 709 行 · 第 1/2 页
ASP
709 行
<!--#include file="user_top.asp"-->
<body style="overflow:hidden;" class="user_iframe">
<%
If oblog.l_Group(18,0)=0 Then
oblog.AddErrStr ("您目前所属的等级不允许使用订阅功能")
oblog.showUserErr
Response.End
End if
Dim Action
Dim rs,rsSubject,UrlId,Id,Ids,targetSubjectid,Sql,OutRssDisplay
Dim sTitle,sUrl,sClassId,sSubjectId,sTags,sMemo,isPrivate,encodeing,mainuserid
Action = LCase(Trim(Request("action")))
Set rs=Server.CreateObject("Adodb.Recordset")
Id=Request("Id")
G_P_FileName="user_url.asp?page="
If Id<>"" And InStr(Id,",")<=0 Then Id=Int(Id)
if En_OutRss=0 then OutRssDisplay="style='display:none'"
'缓存一个分类信息
Set rsSubject=oblog.Execute("Select * From oblog_subject Where userid=" & oblog.l_uid & " And subjecttype=3")
Select Case Action
Case "save"
Call Save
Case "add","edit"
Call EditForm
Case "del"
'删除
If Id<>"" Then
Ids=FilterIds(Id)
conn.Execute("Delete From oblog_myurl Where Id In(" & Ids & ") And userid=" & oblog.l_uid)
End If
Response.Write "<script>parent.getfeedlist();</script>"
response.Flush()
oblog.showok "删除成功!","user_url.asp"
Case "bdel"
'批量删除
Ids=FilterIds(UrlId)
If Ids<>"" Then
conn.Execute("Delete From oblog_myurl Where Id in(" & Ids & ") And userid=" & oblog.l_uid)
'需增加计数器的处理
End If
Response.Write "<script>parent.getfeedlist();</script>"
response.Flush()
oblog.showok "删除成功!","user_url.asp"
Case "bmove"
Ids=FilterIds(UrlId)
targetSubjectid=Int(Request("subject"))
If Ids<>"" Then '批量组转移
conn.Execute("Update oblog_myurl Set subjectid=" &targetSubjectid &" Where Id in(" & Ids & ") And userid=" & oblog.l_uid)
End If
Response.Write "<script>parent.getfeedlist();</script>"
response.Flush()
oblog.showok "移动成功!","user_url.asp"
case "read"
call readrss()
Case Else
Call List
End Select
Set rs=Nothing
%>
</body>
</html>
<%
sub readrss()
dim feedurl
if trim(request("mainuserid"))="" then
mainuserid=0
else
mainuserid=clng(trim(request("mainuserid")))
end if
if mainuserid>0 and true_domain=0 then
feedurl=trim(request("feedurl"))
else
if trim(request("encodeing"))="gb2312" then
feedurl="readrss.asp?feedurl="&trim(request("feedurl"))
else
feedurl="readrss_utf8.asp?feedurl="&trim(request("feedurl"))
end if
end if
if mainuserid>0 then oblog.execute("update oblog_myurl set isupdate=0 where mainuserid="&mainuserid&" and userid="&oblog.l_uid)
oblog.execute("update oblog_user set sub_num=0")
%>
<ul id="user_page_top" >
<li style="font-size:16px;font-family:Verdana, Arial, Helvetica, sans-serif;margin-left:5px"><%=request("title")%></li>
</ul>
<style type="text/css">
<!--
.rssTitleList{
/*标签为UL,顶部标题列表*/
list-style:none;
}
.rssTitleList li{
/*标签为li,顶部标题列表*/
list-style:none;
padding:2px;
font-size:14px;
border-bottom:#ccc 1px dashed;
background-color:#F6F9FA;
}
.rssTitleList li a{
/*标签为a,顶部标题列表*/
text-decoration:none;
}
.rsslist {
/*标签为UL,全部rss全部包含在此*/
list-style:none;
background-color:#F6F9FA;
}
.rssTitle{
/*标签为P,标题*/
background-color:#DAE5EF;
font-size:15px;
margin:0;
margin:2px 0;
padding:5px;
border-bottom:#ccc 2px dashed;
}
.rssTitle a{
color:#000000;
text-decoration:none;
}
.rssMemo{
/*标签为UL,但无实际意义,此处是为IEDOM兼容采用了UL标签,代替为DIV 此处为内容*/
padding:5px;
margin:0;
list-style:none;
}
.floatTime{
margin:0 20px;
color:#993300;
font-size:12px;
}
-->
</style>
<body scroll="no" style="overflow-x:hidden;background:#fff;">
<!-- <div style="font-size:18px; margin-left:20px"></div> -->
<div id="rssbody" style="overflow:auto;height:88%; width:97%; padding:10px;"></div>
<script language="javascript" type="text/javascript">
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
var rssReader = Class.create();
rssReader.prototype = {
initialize: function(url) {
this.url = url;
this.http_request = false;
this.titlelist = document.createElement("ul");
this.titlelist.setAttribute('className','rssTitleList');
this.showload();
this.getRss();
},
showload:function(){
var loading = document.createElement('span');
loading.setAttribute('id','loading');
//var text = document.createTextNode("<img src='images/loading.gif'>");
//loading.appendChild(text);
loading.innerHTML="<img src='images/loading.gif'> 正在加载..."
document.getElementById("rssbody").appendChild(loading);
},
getRss:function() {
if(window.XMLHttpRequest) {
this.http_request = new XMLHttpRequest();
if (this.http_request.overrideMimeType) {
this.http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) {
try {
this.http_request = new ActiveXObject(" Msxml2.XMLHTTP");
} catch (e) {
try {
this.http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!this.http_request) {
window.alert ("不能创建XMLHttpRequest对象实例.");
return false;
}
var othis = this;
this.http_request.onreadystatechange = function(){othis.callback();};
this.http_request.open("get", this.url, true);
this.http_request.send(null);
},
callback:function() {
if (this.http_request.readyState == 4) {
if (this.http_request.status == 200) {
this.loadready(this.http_request.responseXML);
} else {
alert("您所请求的页面有异常。");
}
}
},
loadready:function(xml){
var xol = document.createElement("ul");
xol.setAttribute('className','rsslist');
var allitems = xml.getElementsByTagName("item");
for(var i = 0;i < allitems.length;i++){
var xli = document.createElement("li");
var div = document.createElement("div");
var a = document.createElement("a");
var p = document.createElement("p");
p.setAttribute('className','rssTitle');
var title = document.createTextNode(allitems[i].getElementsByTagName("title")[0].firstChild.data);
a.appendChild(title);
a.setAttribute('href',allitems[i].getElementsByTagName("link")[0].firstChild.data);
a.setAttribute('target','_blank');
p.setAttribute('id','tag'+i);
p.appendChild(a);
xli.appendChild(p);
var title = document.createTextNode(allitems[i].getElementsByTagName("title")[0].firstChild.data);
var li = document.createElement("li");
var a = document.createElement("a");
a.appendChild(title);
a.setAttribute('href','#tag'+i);
li.appendChild(a);
this.titlelist.appendChild(li);
var pubtime = allitems[i].getElementsByTagName("pubDate")[0].firstChild.data;
var timespan = document.createElement("span");
timespan.setAttribute('className','floatTime');
var old = new Date(Date.parse(pubtime));
var now = new Date();
var tmptime;
var year;
var month;
var date;
var hours;
if ( old == "NaN" ){
tmptime = pubtime.match(/(\d{4})-([0-1]?\d)-(\d?\d)\s(\d?\d):(\d?\d):(\d?\d)/i);
if(tmptime){
year = tmptime[1];
month = tmptime[2]-1;
date = tmptime[3];
hours = tmptime[4];
timespan.appendChild(document.createTextNode(datedif()));
}else{
timespan.appendChild(document.createTextNode(pubtime));
}
}else{
year = old.getYear();
month = old.getMonth();
date = old.getDate();
hours = old.getHours();
try{
timespan.appendChild(document.createTextNode(datedif()));
}catch(e){}
}
li.appendChild(timespan);
function datedif(){
if (now.getYear()-year==0) {
if(now.getMonth()-month==0){
if(now.getDate()-date==0){
if(now.getHours()-hours==0){
return ("刚刚");
}else{
return (now.getHours()-hours+"小时前");
}
}else{
return (now.getDate()-date+"天前");
}
}else{
return (now.getMonth()-month+"月前");
}
}else{
return (now.getYear()-year+"年前");
}
}
try{
description = allitems[i].getElementsByTagName("description")[0].firstChild.data;
}
catch(e)
{
description = "no";
}
var desul = document.createElement("ul");
var deli = document.createElement("li");
try{deli.innerHTML=description;}catch(e){deli.innerText=description;};
desul.appendChild(deli);
desul.setAttribute('className','rssMemo');
xli.appendChild(desul);
xol.appendChild(xli)
}
document.getElementById("rssbody").appendChild(this.titlelist);
document.getElementById("rssbody").appendChild(xol);
var loading = document.getElementById('loading');
document.getElementById("rssbody").removeChild(loading);
}
}
function strToDate(str)
{
var val=Date.parse(str);
var newDate=new Date(val);
return newDate;
}
window.onload = function(){var Rss = new rssReader('<%=feedurl%>');}
</script>
<%end sub
Sub EditForm()
Dim rst
mainuserid=trim(request("mainuserid"))
sTitle=trim(request("sTitle"))
sUrl=trim(request("sUrl"))
If Id<>"" Then
Set rst=oblog.Execute("Select * From oblog_myurl Where userid=" & oblog.l_uid & " And Id=" & Id)
If rst.Eof Then
ErrMsg="错误的信息编号"
Else
sUrl=rst("Url")
sTitle=rst("Title")
sSubjectId=rst("subjectid")
sTags=rst("tags")
sMemo=rst("memo")
isPrivate=rst("isprivate")
encodeing=rst("encodeing")
End If
set rst=nothing
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?