Monday, February 21, 2011

Creating an ad images data file

An ad images data file is created to provide information about the ads to be displayed. By placing the data in one text file, when changes need to be made, you only need to change the data in one location. The ASP page (with the logic in the Include file) sends data in the ad images data file to the Ad Rotator component. The component then selects an ad for display.

The data file is divided into two sections that are separated by an asterisk (*). The first section provides information common to all the ads to be displayed. The second section lists data relevant to each ad.

The following outlines the structure of an ad images data file:
REDIRECTION. URL, the path and name of the ASP file that redirects browsers that select ad images.
WIDTH. The width of ad images in pixels. Default is 440.
HEIGHT. The height of ad images in pixels. Default is 60.
BORDER. The border thickness around ad images. Default is 1.
*. Separates the first section from the second section.
AdURL. Virtual path and filename of the image file containing the advertisement.
AdHomeURL. URL to jump to when this link is selected. To indicate there is no link, use a hyphen.
Text. Text to display if browser does not support graphics.
Impressions. An integer indicating the relative weight, or probability, that this ad will be selected for display. For example, if two ads were displayed, one with an impression of 3 and the other with 7, then the one with 3 would have a 30 percent probability of being selected, while the other would have a 70 percent probability.

Open a new file in your text editor, paste in the following script, and save the file as Adimagedata.txt:

REDIRECT adrotatorredirect.asp
' separates the general data from the image information
images/windows_logo.gif Microsoft Windows
Office 2000

No comments:

Post a Comment