%
'****************************************************
' Software name:Kesion CMS 9.5
' Email: service@kesion.com . 营销QQ:4000080263 Tel:400-008-0263
' Web: http://www.kesion.com http://www.kesion.cn
' Copyright (C) Kesion Network All Rights Reserved.
'****************************************************
Dim KS:Set KS=New PublicCls
Dim Channelid,ID,RS,ArticleContent,PayTF
ChannelID=KS.ChkClng(KS.S("M"))
ID=KS.ChkClng(KS.S("ID"))
if ID=0 Or ChannelID=0 then
Response.Write""
Response.End
end if
Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select a.*,ClassPurview From "& KS.C_S(ChannelID,2) & " a inner join ks_class b on a.tid=b.id Where a.ID=" & ID,Conn,1,1
IF RS.EOF AND RS.BOF THEN
RS.CLOSE:SET RS=NOthing
Call CloseConn()
Set KS=Nothing
Response.Write""
Response.End
END IF
Dim InfoPurview:InfoPurview=Cint(RS("InfoPurview"))
Dim ReadPoint:ReadPoint=Cint(RS("ReadPoint"))
Dim ChargeType:ChargeType=Cint(RS("ChargeType"))
Dim PitchTime:PitchTime=Cint(RS("PitchTime"))
Dim ReadTimes:ReadTimes=Cint(RS("ReadTimes"))
Dim ClassID:ClassID=RS("Tid")
Dim KSUser:Set KSUser=New UserCls
Dim UserLoginTF:UserLoginTF=Cbool(KSUser.UserLoginChecked)
If ReadPoint>0 Then
IF UserLoginTF=false Then
Call GetNoLoginInfo
Else
Call PayPointProcess()
End If
ElseIf InfoPurview=2 Then
IF UserLoginTF=false Then
Call GetNoLoginInfo
Else
IF InStr(RS("ArrGroupID"),KSUser.GroupID)=0 Then
ArticleContent="
对不起,你没有查看本文的权限!
"
Else
Call PayPointProcess()
End If
End If
ElseIF InfoPurview=0 And (RS("ClassPurview")=1 Or RS("ClassPurview")=2) Then
If UserLoginTF=false Then
Call GetNoLoginInfo
Else
Call PayPointProcess()
End If
Else
Call PayPointProcess()
End If
'收费扣点处理过程
Sub PayPointProcess()
Dim UserChargeType:UserChargeType=KSUser.ChargeType
If Cint(ReadPoint)>0 Then
If UserChargeType=1 Then
Select Case ChargeType
Case 0:Call CheckPayTF("1=1")
Case 1:Call CheckPayTF("datediff('h',AddDate," & SqlNowString & ")<" & PitchTime)
Case 2:Call CheckPayTF("Times<" & ReadTimes)
Case 3:Call CheckPayTF("datediff('h',AddDate," & SqlNowString & ")<" & PitchTime & " or Times<" & ReadTimes)
Case 4:Call CheckPayTF("datediff('h',AddDate," & SqlNowString & ")<" & PitchTime & " and Times<" & ReadTimes)
Case 5:Call PayConfirm()
End Select
Elseif UserChargeType=2 Then
If KSUser.GetEdays <=0 Then
ArticleContent="
"
Else
Call GetContent()
End If
Else
Call GetContent()
end if
Else
Call GetContent()
End IF
End Sub
'检查是否过期,如果过期要重复扣点券
'返回值 过期返回 true,未过期返回false
Sub CheckPayTF(Param)
Dim SqlStr:SqlStr="Select top 1 Times From KS_LogPoint Where ChannelID=" & ChannelID & " And InfoID=" & ID & " And InOrOutFlag=2 and UserName='" & KSUser.UserName & "' And (" & Param & ") Order By ID"
Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open SqlStr,conn,1,3
IF RS.Eof And RS.Bof Then
Call PayConfirm()
Else
RS.Movelast
RS(0)=RS(0)+1
RS.Update
Call GetContent()
End IF
RS.Close:Set RS=nothing
End Sub
Sub PayConfirm()
If UserLoginTF=false Then Call GetNoLoginInfo():Exit Sub
If Cint(KSUser.GetUserInfo("Point"))" & ReadPoint & " " & KS.Setting(46) & KS.Setting(45) &",你还有 " & KSUser.GetUserInfo("Point") & " " & KS.Setting(46) & KS.Setting(45) & ",请及时与我们联系!"
Else
If PayTF="yes" Then
IF Cbool(KS.PointInOrOut(ChannelID,RS("ID"),KSUser.UserName,2,ReadPoint,"系统","阅读收费" & KS.C_S(ChannelID,3) & ": " & RS("Title"),0))=True Then Call GetContent()
Else
ArticleContent="