关于增强会员修改文章功能权限(2)_动易Cms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

%>
<!--#include file="../conn.asp"-->
<!--#include file="../inc/function.asp"-->
<%
If CheckUserLogined() = False Then
Call CloseConn
Response.Redirect "User_Login.asp"
End If
Dim ArticleID, ChannelID, sql, rs, Status, NextTitle, UpdateTime, LTime, ETime,Inputer
ArticleID = Trim(request("ArticleID"))
ChannelID = Trim(request("ChannelID"))
LTime = 100 '定义编辑文章时限,单位为分钟
ArticleID = CLng(ArticleID)
sql = "select Status,UpdateTime,Inputer from PE_Article where ArticleID=" & ArticleID & " and ChannelID=" & ChannelID & ""
Set rs = server.CreateObject("ADODB.recordset")
rs.open sql, conn, 1, 3
If rs.bof And rs.EOF Then
NextTitle="<script language=javascript>alert('参数错误,点击确定反回!');history.go(-1);</script>"
Else
If rs(2)<>UserName Then
NextTitle="<script language=javascript>alert('你不能编辑他人的文章!');history.go(-1);</script>"
Else
Status = rs(0)

If Status = -1 or Status = 0 Then
NextTitle="<script language=javascript>;location.href = 'User_Article.asp?ChannelID="&ChannelID&"&Action=Modify&ArticleID="&ArticleID&"';</script>"
Else
UpdateTime = rs(1)
ETime = DateDiff("n",UpdateTime,Now())
If ETime > LTime Then
NextTitle="<script language=javascript>alert('系统编辑文章时限为" & LTime & "分钟,而从您该发表文章到现在已经有" & ETime & "分钟了!');history.go(-1);</script>"
Else
If Status = 3 Then
rs(0) = 0
rs.Update
End If
NextTitle="<script language=javascript>;location.href = 'User_Article.asp?ChannelID="&ChannelID&"&Action=Modify&ArticleID="&ArticleID&"';</script>"
End If
End If

End If
End If
rs.Close
Set rs = Nothing
Call CloseConn
response.Write NextTitle
%>



三、演示,本站会员中心

******************************更正提示*********************************

有网友反应如下问题(对asp代码稍微明白的朋友都知道原因呵):

出现下面错误提示:

以下是引用片段:
Microsoft VBScript 编译器错误 错误 ’800a0411’
名称重定义
/User/top.asp,行 272

查看更多 动易Cms教程  动易Cms模板

来源:模板无忧//所属分类:动易Cms教程/更新时间:2007-10-11
相关动易Cms教程