<% @ Language=VBScript CodePage=65001%> <% Session.CodePage = 65001 response.charset="utf-8"%> <% 'dim sql, rs, rs1, aid Count_type=reqkeng(request("C_type")) '計數頁面類別,GN表黃金文字公告,wc表必敗速報及每周精選 select case Count_type case "GN" call GN_Count case "wc" call wc_count case "channel" call channel_Count case "channel_pic" call channel_pic case "chnews_lab21" call channel_Count_lab21 case "chpic_lab21" call channel_Pic_lab21 case else ShowMsgClose("頁面類別有誤!") end select Sub wc_count aid = reqnum(trim(request("ID"))) if aid = "" then ShowMsgClose("找不到該筆資料!!") sql="select WC_Aid,WC_Link from Week_Choose where WC_Aid=" & aid Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql,conn,3 if rs1.bof and rs1.eof then rs1.close set rs1=nothing ShowMsgClose("找不到這筆資料!!") else err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_weekchoose" comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,aid) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("wc_type",130,1,1,"C") comm.Execute if err <> 0 then response.Write("發生錯誤!"&err&err.description) else response.Redirect reqdata2(rs1("WC_Link")) rs1.close set rs1=nothing rs.close set rs=nothing response.end end if end if end Sub ' sub GN_Count AutoID=reqnum(request("ID")) err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_GoldNews" 'comm.Parameters.Append comm.CreateParameter("return",3,4) comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,AutoID) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("GN_type",130,1,1,"C") set rs_gn = comm.Execute() return=rs_gn("ret") response.Write(rs_gn(1))&":sdf:" if err <> 0 then response.Write("發生錯誤!"&err&err.description) response.end else message=rs_gn(1) rs_gn.close set rs_gn=nothing select case return case 1 response.Redirect message response.end case -110 ShowMsgClose(message) case -100 ShowMsgClose(message) case else response.Write("發生例外狀況!"&return) response.end end select end if end sub sub channel_Count aid = reqnum(trim(request("ID"))) if aid = "" then error1("找不到該筆資料!!") sql="select Autoid,N_Url from Top_ch_News where Autoid=" & aid Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql,conn,3 if rs1.bof and rs1.eof then rs1.close set rs1=nothing error1("找不到這筆資料!!") else err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_cannal_news" comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,aid) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("CN_type",130,1,1,"C") comm.Parameters.Append comm.CreateParameter("@output",3,2,4) comm.Execute if err <> 0 then response.Write("發生錯誤!"&err&err.description) else response.Redirect reqdata2(rs1("N_Url")) rs1.close set rs1=nothing rs.close set rs=nothing response.end end if end if end sub sub channel_Count_lab21 '頻道2版型1的消息計數 aid = reqnum(trim(request("ID"))) if aid = "" then error1("找不到該筆資料!!") sql="select AutoID,PN_Url from Top_ch_NP where AutoID=" & aid Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql,conn,3 if rs1.bof and rs1.eof then rs1.close set rs1=nothing error1("找不到這筆資料!!") else err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_cannal_news" comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,aid) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("CN_type",130,1,1,"Y") comm.Parameters.Append comm.CreateParameter("@output",3,2,4) comm.Execute if err <> 0 then response.Write("發生錯誤!"&err&err.description) else response.Redirect reqdata2(rs1("PN_Url")) rs1.close set rs1=nothing rs.close set rs=nothing response.end end if end if end sub sub channel_Pic_lab21 aid = reqnum(trim(request("ID"))) if aid = "" then error1("找不到該筆資料!!") sql="select AutoID,PN_Url from Top_ch_NP where Autoid=" & aid Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql,conn,3 if rs1.bof and rs1.eof then rs1.close set rs1=nothing error1("找不到這筆資料!!") else err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_cannal_pic" comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,aid) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("CN_type",130,1,1,"Y") comm.Execute if err <> 0 then response.Write("發生錯誤!"&err&err.description) else response.Redirect reqdata2(rs1("PN_Url")) rs1.close set rs1=nothing rs.close set rs=nothing response.end end if end if end sub sub channel_pic aid = reqnum(trim(request("ID"))) if aid = "" then error1("找不到該筆資料!!") sql="select Autoid,P_Url from Top_ch_Pic where Autoid=" & aid Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.Open sql,conn,3 if rs1.bof and rs1.eof then rs1.close set rs1=nothing error1("找不到這筆資料!!") else err=0'訊息先清空 set comm = Server.CreateObject("ADODB.Command") comm.activeConnection = conn comm.CommandType = 4 comm.CommandText = "CountDel_cannal_pic" comm.Parameters.Append comm.CreateParameter("AutoID",19,1,4,aid) comm.Parameters.Append comm.CreateParameter("AdminName",202,1,20,"") comm.Parameters.Append comm.CreateParameter("CN_type",130,1,1,"C") comm.Execute if err <> 0 then response.Write("發生錯誤!"&err&err.description) else response.Redirect reqdata2(rs1("P_Url")) rs1.close set rs1=nothing rs.close set rs=nothing response.end end if end if end sub %>