關于增強會員修改文章功能權限(2)_動易Cms教程
%>
<!--#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('系統(tǒng)編輯文章時限為" & LTime & "分鐘,而從您該發(fā)表文章到現在已經有" & 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代碼稍微明白的朋友都知道原因呵):
出現下面錯誤提示:
以下是引用片段: 相關動易Cms教程:
|