<%@ LANGUAGE="VBSCRIPT" %> <% '*********************************************************************** ' System : ASPBanner Unlimited ' Author : Christopher Williams of CJWSoft www.CJWSoft.com ' ' COPYRIGHT NOTICE ' ' See attached Software License Agreement ' ' (c) Copyright 2000 - 2003 by CJWSoft. All rights reserved '*********************************************************************** %> <% CHECKFOR = "Admin" %> <% Banner_ID = Request("Banner_ID") Zone_ID = Request("Zone_ID") Show_Banners = Request("Show_Banners") If Request("EditButton") = "Edit Zone" And Zone_ID <> "" Then Response.Redirect("edit_zone.asp?Zone_ID=" & Zone_ID) Response.End End If If Request("DeleteButton") = "Delete Zone" And Zone_ID <> "" Then Response.Redirect("delete_zone.asp?Zone_ID=" & Zone_ID) Response.End End If If Request("ShowSubmit") = "Display Banners" And Zone_ID = "" Then %> <% End If PostPage = "zones.asp" WhichPage = Request("WhichPage") If WhichPage = "" then WhichPage = 1 end if MyPageSize = Request("MyPageSize") If MyPageSize = "" Then MyPageSize = 15 End If %> <% =App_Name %> >
Return to Main Screen.

Zones are the locations on your site where your banners are displayed.
Zone Report Overview

Add New Zone



Banners Per Page
> 5 > 50
> 15 > 100
> 30
Show Banner Images >
<% If Zone_ID <> "" Then %> <% ' This setting from check_user_inc.asp purposely overridden ' To make record cycling features work ok on this page THISPAGE = Request.ServerVariables("script_name") BASE_URL = "http://" & Request.ServerVariables("HTTP_HOST") & Replace(Request.ServerVariables("URL"),"aspbanner/zones.asp","") InjectBanner_Directory = BASE_URL & "aspbanner/injectbanner.asp" RowCount = 0 Function FileFound(FileName) Dim FileObj FileFound = True Set fs = CreateObject("Scripting.FileSystemObject") On Error Resume Next Set FileObj = fs.OpenTextFile(FileName, 1, False, 0) If Err.Number <> 0 Then Err.Clear FileFound = False Exit Function End If FileObj.Close Set fs = Nothing End Function Set ConnBannerSystem = Server.CreateObject("ADODB.Connection") ConnBannerSystem.Open BannerConnectionString Set CmdBannerTemp = Server.CreateObject("ADODB.Command") Set CmdGetZones = Server.CreateObject("ADODB.Recordset") CmdBannerTemp.CommandText = "SELECT Banner_Zones.* FROM Banner_Zones Where Zone_ID =" & Zone_ID CmdBannerTemp.CommandType = 1 Set CmdBannerTemp.ActiveConnection = ConnBannerSystem CmdGetZones.Open CmdBannerTemp, , 1, 3 %>
Banners For (<% =CmdGetZones("Zone_Name") %>)
<% Set ConnClassified = Server.CreateObject("ADODB.Connection") ConnClassified.Open BannerConnectionString Set CmdBannerTemp = Server.CreateObject("ADODB.Command") Set CmdListBanners = Server.CreateObject("ADODB.Recordset") CmdBannerTemp.CommandText = "SELECT Banners.* FROM Banners WHERE (Zone_ID = " & Zone_ID & ")" CmdBannerTemp.CommandType = 1 Set CmdBannerTemp.ActiveConnection = ConnClassified CmdListBanners.Open CmdBannerTemp, , 1, 1 If Not CmdListBanners.EOF Then CmdListBanners.movefirst CmdListBanners.pagesize = MyPageSize MaxPages = CInt(CmdListBanners.pagecount) MaxRecords = CInt(CmdListBanners.pagesize) CmdListBanners.absolutepage = WhichPage HowManyRecords = 0 HowManyFields = CmdListBanners.fields.count -1 TotalRecords = CmdListBanners.recordcount Span = (MyPageSize * WhichPage) ShowTableEnd = True %>

(<% = TotalRecords %> Banner<% If TotalRecords > 1 Then %>s<% End If%> Found)   <% If CInt(MaxPages) <> 1 Then %> (Showing <% = ((Span - MyPageSize) + 1) %> - <% If CInt(MaxPages) = CInt(WhichPage) Then %><% =TotalRecords %><% Else %><% =Span %><% End If %>)   (Page <% =WhichPage %> of <% =MaxPages%>)

<% End If %>

<% If Show_Banners <> "True" Then %> <% End If %> <% Else %>

No Banners have been set up for this Zone yet.

<% End If %> <% DO UNTIL CmdListBanners.EOF Or HowManyRecords >= MaxRecords If RowCount = 2 Then RowCount = 0 End If If RowCount = 0 Then Cellbgcolor = "#F3F3EB" Else Cellbgcolor = "#FFFFFF" End If RowCount = RowCount + 1 If CmdListBanners("Banner_Status") = "Active" Then Status_Cellbgcolor = "#00FF00" ElseIf CmdListBanners("Banner_Status") = "Hold" Then Status_Cellbgcolor = "#FFFF00" ElseIf CmdListBanners("Banner_Status") = "Waiting" Then Status_Cellbgcolor = "#98B0EF" ElseIf CmdListBanners("Banner_Status") = "ImpHit" Then Status_Cellbgcolor = "#FF9900" ElseIf CmdListBanners("Banner_Status") = "Expired" Then Status_Cellbgcolor = "#FF0000" End If Set CmdBannerTemp = Server.CreateObject("ADODB.Command") Set CmdRetrieveImpressions = Server.CreateObject("ADODB.Recordset") CmdBannerTemp.CommandText = "SELECT SUM(Banner_Impressions) AS TotalImpressions, SUM(Banner_Clicks) AS TotalClicks FROM Banner_Stats WHERE (Banner_ID = " & CmdListBanners("Banner_ID") & ")" CmdBannerTemp.CommandType = 1 Set CmdBannerTemp.ActiveConnection = ConnBannerSystem CmdRetrieveImpressions.Open CmdBannerTemp, , 0, 1 %> <% If Show_Banners = "True" Then Cellbgcolor = "#F3F3EB" %> <% End If %> <% If Show_Banners = "True" Then %> <% End If%> <% CmdListBanners.MoveNext HowManyRecords = HowManyRecords+1 Loop %> <% If ShowTableEnd Then %>
  Name  Status  Type  Weight  Begins  Ends    Limit  Imp  Clicks  ClickThru   
  Name  Status  Type  Weight  Begins  Ends    Limit  Imp  Clicks  ClickThru   
&TotalImpressions=<% =CmdRetrieveImpressions("TotalImpressions") %>&TotalClicks=<% =CmdRetrieveImpressions("TotalClicks") %>', 600, 600)">View Banner Statistics <% =CmdListBanners("Banner_Name") %> <%= CmdListBanners("Banner_Status") %> <% =CmdListBanners("Banner_Type") %> <%= CmdListBanners("Banner_Weight") %> <%= CmdListBanners("Banner_Begin_Date") %> <%= CmdListBanners("Banner_End_Date") %> &Zone_ID=<% =Zone_ID %>">Reset Banner Stats <%= CmdListBanners("Banner_Impressions_Purchased") %> <%= CmdRetrieveImpressions("TotalImpressions") %> <%= CmdRetrieveImpressions("TotalClicks") %> <% If CmdRetrieveImpressions("TotalImpressions") > 0 AND CmdRetrieveImpressions("TotalClicks") > 0 then Response.Write(FormatPercent((CmdRetrieveImpressions("TotalClicks")/CmdRetrieveImpressions("TotalImpressions")),1)) %> &Zone_ID=<% =Zone_ID %>&User_ID=<% =CmdListBanners("User_ID") %>">Edit Banner &Zone_ID=<% =Zone_ID %>">Delete Banner

<% If CmdListBanners("Banner_Type") = "Image" Then %> " target="_blank"> " src="<% =CmdListBanners("Banner_Image_URL") %>" alt="<% =CmdListBanners("Banner_ALT_Text") %>" <% If CmdListBanners("Banner_Width") <> "" Then %>width="<% =CmdListBanners("Banner_Width") %>" <% End If %> <% If CmdListBanners("Banner_height") <> "" Then %>height="<% =CmdListBanners("Banner_height") %>"<% End If %>> <% If CmdListBanners("Banner_Text_Message") <> "" Then %>
" target="_blank"><% =CmdListBanners("Banner_Text_Message") %>

<% Else %>

<% End If %> <% Else %> <% =CmdListBanners("Banner_HTML_Code") %> <% End If %>

<% End If%>
<% If CInt(MaxPages) <> 1 Then %>

<% For MyCounter = 1 to MaxPages TempSpan = (MyPageSize * MyCounter) %> (<% = ((TempSpan - MyPageSize) + 1) %> - <% If CInt(MaxPages) = CInt(MyCounter) Then %><% =TotalRecords %><% Else %><% =TempSpan %><% End If %>)  <% If MyCounter Mod 10 = 0 then %>
<% End If %> <% Next %>

<% End If %> <% TempSpan2 = (MyPageSize * WhichPage + 1) %>

Normal Method
To call this banner zone from a ."asp" page" not using Option Explicit.
Be sure to edit the include path if necessary. You can also use a virtual include.

Option Explicit Method
To call this banner zone from a ."asp" page" using Option Explicit.
Be sure to edit the include path if necessary. You can also use a virtual include.
If calling multiple banner zones on the same page the variable dimming section can only to used once before any banner includes are called.

Javascript Method
To call this banner zone from a non ".asp" page.
This technique may not work with all JavaScript code banners such as Linkexchange and Doubleclick.

ASPTear Component Method
To call this banner zone from a ."asp" page" using the ASPTear component.

XML Parser Method
To call this banner zone from a ."asp" page" using the Microsoft XML Parser.

AspHTTP Component Method
To call this banner zone from a ."asp" page" using the AspHTTP Component.
Notes on Banner Displaying Methods

<% Else %>








<% End If %>