?%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%option explicit%> <% '****************************************************************** ' Software name:KesionCMS X2.0 ' 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 KSCls Set KSCls = New Link KSCls.Kesion() Set KSCls = Nothing Class Link Private KS,KSUser,ChannelID,ModelTable,Param,XML,Node,StartTime,FormID,TableName,FormName Private CurrPage,MaxPerPage,TotalPut,PageNum,Key,stype,OrderStr,AdminUserList,LoginTF Private Sub Class_Initialize() Set KS=New PublicCls Set KSUser=New UserCls MaxPerPage=10 End Sub Private Sub Class_Terminate() Call CloseConn() Set KS=Nothing Set KSUser=Nothing End Sub Public Sub Kesion() Dim Template,KSR Call FCls.SetClassInfo(1,"20124415294268","0") LoginTF=KSUser.UserLoginChecked Set KSR = New Refresh dim rs,Templ_url FormID=KS.ChkClng(KS.G("id")) if FormID=0 then Call KS.AlertHistory("ID错误!",-1):response.end Set RS=Server.CreateObject("ADODB.Recordset") RS.Open "Select top 1 FormName,PostByStep,TableName,Template,Templ_url,AdminUserList,MaxPerPage_s From KS_Form where id=" & FormID,conn,1,1 If RS.EOF And RS.Bof Then Call KS.AlertHistory("ID错误!",-1):response.end else Templ_url=RS(4):TableName=RS(2):AdminUserList=RS(5) MaxPerPage=KS.ChkCLng(RS("MaxPerPage_s")) If MaxPerPage=0 Then MaxPerPage=10 FormName=RS(0) End If RS.Close select case request("action") case "verify" call verify() case "delete" call formdelete() end select Template = KSR.LoadTemplate(Templ_url) Template =Replace(Template,"{$" & KS.S("Type") &"}"," selected") Template =Replace(Template,"{$ShowFormName}",formname) Template =Replace(Template,"{$ShowFormID}",formid) Template = KSR.KSLabelReplaceAll(Template) Set KSR = Nothing StartTime = Timer() InitialSearch Scan Template End Sub Sub ParseArea(sTokenName, sTemplate) Select Case sTokenName Case "loop" If IsObject(XML) Then For Each Node In Xml.DocumentElement.SelectNodes("row") Scan sTemplate Next Else echo "
" End If End Select End Sub Sub ParseNode(sTokenType, sTokenName) Select Case lcase(sTokenType) case "item" EchoItem sTokenName case "search" select case sTokenName case "showpage" echo KS.ShowPage(totalput, MaxPerPage, "", CurrPage,false,false) case "totalput" echo TotalPut case "leavetime" dim leavetime:leavetime=FormatNumber((timer-starttime),5) if leavetime<1 then leavetime="0"&leavetime echo leavetime case "keyword" echo KS.R(key) case "channelid" echo channelid end select End Select End Sub Sub EchoItem(sTokenName) Select Case sTokenName case "id" echo GetNodeText("id") case "adddate" echo formatdatetime(GetNodeText("AddDate"),2) case "userip" dim userip:userip=GetNodeText("userip") if not ks.isnul(userip) then dim useriparr:useriparr=split(userip&"...." ,".") echo useriparr(0)&"."&useriparr(1)&".***.***" end if case "linkurl" echo KS.GetDomain & "Plus/form/content.asp?FormID="&FormID& "&id=" & GetNodeText("id") case "intro" case "cnote" if not ks.isnul(GetNodeText("note")) then echo "有回?/span>" else echo "未回?/span>" end if case "showmanage" if checkadminpower() then if GetNodeText("status")="0" then echo "未审?/a>" else echo "已审?/a>" end if echo " | 删除 | 回复" end if case else echo GetNodeText(sTokenName) End Select End Sub Function GetNodeText(NodeName) Dim N,Str NodeName=Lcase(NodeName) If IsObject(Node) Then set N=node.SelectSingleNode("@" & NodeName) If Not N is Nothing Then Str=N.text GetNodeText=Str End If End Function '查有没有理表单权限 function checkadminpower() if not ks.isnul(adminuserlist) then if ks.foundinarr(adminuserlist,ks.c("username"),",") and LoginTF=True then checkadminpower=true exit function end if end if checkadminpower=false end function sub verify() if checkadminpower()=false then ks.die "" end if if ks.chkclng(request("v"))=2 then conn.execute("update " & TableName & " set status=2 where id=" & KS.ChkClng(request("rid"))) ks.alerthintscript "恭喜Q审核成?" else conn.execute("update " & TableName & " set status=0 where id=" & KS.ChkClng(request("rid"))) ks.alerthintscript "恭喜Q取消审核成?" end if end sub sub formdelete() if checkadminpower()=false then ks.die "" end if conn.execute("delete from " & TableName & " where id=" & KS.ChkClng(request("rid"))) ks.alerthintscript "恭喜Q删除成?" end sub Sub InitialSearch() Dim FieldStr,SqlStr,TopStr,TopNum ChannelID=KS.ChkClng(Request("M")) CurrPage=KS.ChkClng(Request("Page")) If CurrPage<=0 Then CurrPage=1 ModelTable=TableName if checkadminpower then Param = " where 1=1" else Param = " where status=2" end if dim ks_type:ks_type=KS.ChkClng(KS.S("type")) if ks_type<>0 then select case ks_type case 1 param=param &" and ks_type='在线留言'" case 2 param=param &" and ks_type='校长信箱'" case 3 param=param &" and ks_type='投诉'" end select end if OrderStr=" order by id desc" SqlStr="Select " & TopStr & " * From " & ModelTable & Param & OrderStr 'ks.echo sqlstr Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET") RS.Open SqlStr,conn,1,1 If RS.Eof And RS.Bof Then Else TotalPut = Conn.Execute("select Count(1) from " & ModelTable & " " & Param)(0) If TotalPut>TopNum And TopNum<>0 Then TotalPut=TopNum If CurrPage >1 and (CurrPage - 1) * MaxPerPage < totalPut Then RS.Move (CurrPage - 1) * MaxPerPage Else CurrPage = 1 End If Set XML=KS.ArrayToXml(RS.GetRows(MaxPerPage),RS,"row","root") End If RS.Close Set RS=Nothing End Sub End Class %>