The Ad Rotator component automates the rotation of advertisement images on a Web page. Each time a user opens or reloads the Web page, this component displays a new advertisement based on the information specified in the Ad Rotator Schedule file.
The Ad Rotator Schedule file contains information that the Ad Rotator component uses to manage and display the various advertisement images. This file stores the size of the advertisement space, the image files to be loaded and the display time (in percentage) for each advertisement. This file can store a maximum of 1000 advertisements.
The Ad Rotator Schedule file has two sections: The first section contains a set of optional parameters that are common to all advertisement images in the rotation schedule. Each parameter contains a keyword and a value. If no values are specified for the global parameter, the Ad Rotator uses default values. The first line of the file must contain a single asterisk (*), when these parameters are not specified. If any of the parameters are set more than once, the last set value is used.
The second section specifies file and location information for individual advertisements and the display time (in percentage) for each advertisement. The two sections are separated by a line containing a single asterisk (*). For more details See Syntax .
Following is the syntax of the Ad Rotator Schedule file:
[REDIRECT RedirectURL] [WIDTH Width] [HEIGHT Height] [BORDER Border] * AdURL AdHomePageURL Text Probability
For example, if a Ad Rotator Schedule file contains three ads with weights set to 4, 7, and 9, the first advertisement has a probability of 20 percent, the second has 35 percent, and the third has 45 percent.
The Ad Rotator object uses the last defined values for the following four parameters:
The following is a sample Ad Rotator Schedule file to display a variety of advertisements, with redirection.
ADROT.TXT
REDIRECT /nsp/adredir.htm WIDTH 500 HEIGHT 100 BORDER 0 * images/banner1.gif http://www.novell.com/netware5 NetWare 5 - The No.1 NOS 20 images/banner2.gif http://www.novell.com/bordermanager/ BorderManager - Improves internet browsing efficiency 20 images/banner3.gif http://www.novell.com/nds/ NDS - Truly cross-platform 60
The AdRotator object automates the rotation of advertisement images on a Web page.
Defines the border size of the advertisement image to be displayed.
Object.Border( BorderSize As Integer)
Integer.
Read/write.
By default the value is 1.This value will be a overridden by the value set in the Ad Rotator Schedule file.
For more details about border property see Example.
NOTE:All the scripts should be embedded in a HTML page and saved
with .asp extension in a folder under /DOCS. For more details
about NSP see Creating
NSP Scripts
and Executing
NSP scripts
Sets the advertisement image to be a hyperlink.
Object.Clickable( Value As Boolean)
Boolean.
Read/write.
For more details on Clickable property see Example.
Specifies the name of the frame into which the hyperlinked page is to be loaded.
Object.TargetFrame( Name As String)
String. Specifies the name of the frame in which the ad image is to be displayed.
Read/write.
The parameter can also be one of the HTML frame attributes, such as _TOP, _New, _CHILD, _SELF, _PARENT, or _BLANK. The default value is NO FRAME.
For more details on TargetFrame property see Example .
Gets the specifications from the Ad Rotator Schedule file and returns the HTML output for the next scheduled advertisement.
object.GetAdvertisement( AdRotatorScheduleFilePath As String)
String. This is the set of HTML tags required by the browser to display the next advertisement.
The advertisements are chosen randomly. The probability is defined by the weight value specified as Probability in the Ad Rotator Schedule file. See Syntax for details.
This example gets an advertisement from "Adrot.txt" file and displays it in the web page based on the specified bordersize, frame details and clickable property.
<% ’Displays an advertisement without a border. Set Ad = CreateObject("MSWC.AdRotator") ’Sets the bordersize of the ad image Ad.Border = 0 ’Enables the hyperlink characteristic of the ad image Ad.Clickable = TRUE ’Sets the name of the frame in which the ad image is displayed. Ad.TargetFrame = "NewFrame" %> <%= Ad.GetAdvertisement("adrot.txt") %>
NOTE:The argument in the CreateObject call may also be "UCX:AdRotator".
NOTE:If the ad rotator schedule file and the asp are not located in the same folder, the full path should be given for the adrot.txt file. For example if the ADROT.TXT is located in a folder SCH under /DOCS and the asp file is located in the folder ADVERTISE under the folder DOCS, the path for the ADROT.TXT should be given as SYS:/NOVONYX/SUITESPOT/DOCS/SCH/ADROT.TXT.