% Response.Buffer = True Response.ContentType = "application/x-javascript" BannerZone = Request("BannerZone") '*********************************************************************** ' System : ASPBanner ' Author : Christopher Williams of CJWSoft www.CJWSoft.com ' ' COPYRIGHT NOTICE ' ' See attached Software License Agreement ' ' (c) Copyright 2000 - 2001 by CJWSoft. All rights reserved '*********************************************************************** %> <% ' Checks the time the banner data was last updated and basically updates it if an hour or more has passed If Cint(Application("BannersLastUpdated")) <> Cint(Hour(time)) Then %> <% End If %> <% ' Set all variables to empty as this code may be included multiple times in the same page BannerCycleData = "" Banner_Array = "" CurrentBanner = "" CycleBannerTotal = "" NewCycleList = "" NewCycleListArray = "" Banner_Array2 = "" Stop_Processing = "" BR = "" BN = "" IIS = "" IW = "" IH = "" IB = "" IAT = "" IA = "" BT = "" JSCRIPT_Code = "" If Application("BannerLocation" & BannerZone & "_Cycle") <> "" Then BannerCycleData = Split(Application("BannerLocation" & BannerZone & "_Cycle"),"|") Banner_Array = Split(Application("BannerLocation" & BannerZone),"|") Keep_Processing = True Else Keep_Processing = False End If %> <% If Keep_Processing = True Then CurrentBanner = BannerCycleData(0) CycleBannerTotal = BannerCycleData(1) NewCycleList = BannerCycleData(2) NewCycleListArray = Split(NewCycleList,",") Banner_Array2 = Split(Banner_Array(NewCycleListArray(CurrentBanner)),vbTab) Set ConnPasswords = Server.CreateObject("ADODB.Connection") ConnPasswords.Open BannerConnectionString Set cmdTemp = Server.CreateObject("ADODB.Command") Set CmdUpdateStats = Server.CreateObject("ADODB.Recordset") If BannerDatabaseType = "SQL" Then cmdTemp.CommandText = "SELECT Banner_Stats.* FROM Banner_Stats WHERE (Banner_ID = " & Trim(Banner_Array2(0)) & ") AND Banner_Day = '" & DATE & "'" ElseIf BannerDatabaseType = "MSACCESS" Then cmdTemp.CommandText = "SELECT Banner_Stats.* FROM Banner_Stats WHERE (Banner_ID = " & Trim(Banner_Array2(0)) & ") AND Banner_Day = #" & DATE & "#" End If cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = ConnPasswords CmdUpdateStats.Open cmdTemp, , 1, 3 If Not CmdUpdateStats.EOF Then CmdUpdateStats.Fields("Banner_Impressions") = (CmdUpdateStats("Banner_Impressions") + 1) CmdUpdateStats.Update CmdUpdateStats.Close Set CmdUpdateStats = Nothing Else Set cmdTemp = Server.CreateObject("ADODB.Command") Set CmdUpdateStats = Server.CreateObject("ADODB.Recordset") cmdTemp.CommandText = "SELECT Banner_Stats.* FROM Banner_Stats" Set cmdTemp.ActiveConnection = ConnPasswords CmdUpdateStats.Open cmdTemp, , 1, 3 CmdUpdateStats.AddNew CmdUpdateStats.Fields("Banner_ID") = Trim(Banner_Array2(0)) CmdUpdateStats.Fields("Banner_Day") = DATE CmdUpdateStats.Fields("Banner_Impressions") = 1 CmdUpdateStats.Fields("Banner_Clicks") = 0 CmdUpdateStats.Update CmdUpdateStats.Close Set CmdUpdateStats = Nothing End If ConnPasswords.Close Set ConnPasswords = Nothing JSCRIPT_Code = "
| " & vbCrLf
%>
<%
' Banner Type Image Process Like So
If (Banner_Array2(9)) = "Image" Then
If ISNumeric(Banner_Array2(0)) = True Then
BR = BannerRedirectURL
BN = Trim(Banner_Array2(0))
IIS = Trim(Banner_Array2(1))
IW = Trim(Banner_Array2(2))
IH = Trim(Banner_Array2(3))
IB = Trim(Banner_Array2(4))
IAT = Trim(Banner_Array2(5))
IA = Trim(Banner_Array2(6))
BT = Trim(Banner_Array2(7))
JSCRIPT_Code = JSCRIPT_Code + "" & vbCrLf
JSCRIPT_Code = JSCRIPT_Code + " " JSCRIPT_Code = JSCRIPT_Code + "" & vbCrLf JSCRIPT_Code = JSCRIPT_Code + " " & IAT & "" End If End If %> <% ' Banner Type Code Process Like So If (Banner_Array2(9)) = "Code" Then JSCRIPT_Code = (Banner_Array2(8)) End If JSCRIPT_Code = JSCRIPT_Code + " |