📄 digg.asp
字号:
<%
mdb="../../"
%>
<!--#include file = ../../admin_conn.asp -->
<!--#include file = ../../admin/titleb.asp -->
<!--#include file = ../Art_user.asp -->
<%
On Error Resume Next
Err.Clear
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
response.Charset = "gb2312"
Dim Digg_RS
Dim TmpStr
Dim stype,DiggID,ModeID
Dim ip,GetTime,Deltime,UserHS,ArtUser
Set UserHS = New Art_User
Set Digg_RS=Server.CreateObject("ADODB.RecordSet")
ip = getip()
GetTime = Date()
stype = RSQL(request("post"))
DiggID = ChkNumeric(RSQL(request("id")))
Call diggs()
Sub diggs()
Dim ActCMS_Digg
ArtCMS_Digg=config("ArtCMS_Digg") 'digg开关,1为关闭,0为开启
IsUse=config("IsUse") '是否允许游客DIGG:1为不允许,0为允许
ModeID=1
If stype="" or DiggID="" Then
response.Write("0")
response.End()
End If
Select Case stype
Case "diggshow"
Set Digg_RS=ArtEXE("Select Digg from news where ID="&DiggID&"")
If not Digg_RS.eof then TmpStr = Digg_RS(0) Else TmpStr="0"
response.Write("document.write('"&TmpStr&"')")
Case "downshow"
Set Digg_RS=ArtEXE("Select down from news where ID="&DiggID&"")
If not Digg_RS.eof then TmpStr = Digg_RS(0) Else TmpStr="0"
response.Write("document.write('"&TmpStr&"')")
Case "digg"
If ArtCMS_Digg=1 Then
response.Write("Close")
Exit Sub
End If
IF Cbool(UserHS.UserLoginChecked)=False And IsUse=1 then
Response.Write "Login"
Exit Sub
Response.End
Else
IF Cbool(UserHS.UserLoginChecked)=False Then
ArtUser= ""
Else
ArtUser= UserHS.UserName
End If
End If
Deltime = DateDiff("D",2,GetTime)
ArtEXE("DELETE * from Art_Digg where DiggTime<"&Deltime)
set Digg_RS=ArtEXE("Select * from Art_Digg where ip = '"&ip&"' and NewsID = "&DiggID&"")
If Not Digg_RS.eof then
response.Write("Art")&"|"&DiggID
Else
ArtEXE("Insert into Art_Digg(users,ModeID,Digg,IP,NewsID,DiggTime) values('"&ArtUser&"',"&ModeID&",1,'"&ip&"',"&DiggID&",'"&GetTime&"')")
ArtEXE("Update news set Digg=Digg+1 where ID="&DiggID&"")
Dim DiggHtmlname:DiggHtmlname=config("path")&"Include/digg/Digg_list.asp"
Dim DiggName: DiggName=config("path")&"html/Digg_list.html"
call SaveHtmlFile(DiggName,DiggHtmlname)
set Digg_RS=ArtEXE("Select Digg from news where ID="&DiggID&"")
if not Digg_RS.eof then TmpStr = cstr(Digg_RS(0)) Else TmpStr="0"
response.Write(TmpStr)&"|"&DiggID
End If
Case "down"
If ArtCMS_Digg=1 Then
response.Write("Close")
Exit Sub
End If
IF Cbool(UserHS.UserLoginChecked)=False And IsUse=1 then
Response.Write "Login"
Exit Sub
Response.End
Else
IF Cbool(UserHS.UserLoginChecked)=False Then
ArtUser= ""
Else
ArtUser= UserHS.UserName
End If
End If
Deltime = DateDiff("D",2,GetTime)
ArtEXE("DELETE * from Art_Digg where DiggTime<"&Deltime)
Set Digg_RS=ArtEXE("Select * from Art_Digg where ip = '"&ip&"' and NewsID = "&DiggID&"")
if Not Digg_RS.eof then
response.Write("Art")&"|"&DiggID
Else
ArtEXE("Insert into Art_Digg(users,ModeID,Digg,IP,NewsID,DiggTime) values('"&ArtUser&"',"&ModeID&",2,'"&ip&"',"&DiggID&",'"&GetTime&"')")
ArtEXE("Update news set down=down+1 where ID="&DiggID&"")
set Digg_RS=ArtEXE("Select down from news where ID="&DiggID&"")
if not Digg_RS.eof then TmpStr = cstr(Digg_RS(0)) Else TmpStr="0"
Response.Write(TmpStr)&"|"&DiggID
End If
Case Else
response.Write("err")
End Select
End Sub
Set UserHS = Nothing:Call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -