Sideway BICK BlogSideway BICK BLOG from Sideway

A Sideway to Sideway Home

Link:http://output.to/sideway/default.asp?qno=130200003

ASP Server Component, Pre-made Function, Ad Rotator Component

ASP Server Components

Some of the ASP server components are the common features found in dynamic web pages. These base ASP server components are provided to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages. However, some IIS pre-made components are not installed for all version of IIS. Ad Rotator, Browser Capabilities, Content Linker, Content Rotator, Counters, Logging Utility, My Info, Page Counter, Status, and tools are not installed with IIS 6.0. However, if you upgrade your Web server from a previous version of IIS, the pre-made components are not removed. Some IIS pre-made components, ASP content rotator and nextlink,  are deprecated in IIS7. And most IIS pre-made components are either not installed with IIS7 or their usage is not supported.

Ad Rotator Component

The Ad Rotator component can be used to create an AdRotator object that acts as a HTML tag holder on an ASP page for controlling the rotation of banner images to be displayed on a web page automatically. The function of the AdRotator object is to automate the displaying of a new banner image on the web page each time when an user opens or reloads the web page. A text file called Rotator Schedule File is used to store the information for controlling the way of the banner image to be displaced on the web page. There is another optional text file called Redirection File by setting the URL paramenter in the Rotator Schedule File for recording how many users click on each banner image through redirect users to the Redirection File. And each jump to an redirected URL will be recorded in the web server activity log.

File Name

The file name of the Ad Rotator component is Adrot.dll.

Syntax

Set AdRotatorName = Server.CreateObject( "MSWC.AdRotator" )

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name assigned to the instance of the AdRotator object created by the call using the Server.CreateObject.

Remark

The Ad Rotator Component does not work with Internet Information Server 7 (IIS7).

AdRotator.Border Property

AdRotator.Border property is used to specify the size of the surrounding border when displaying the banner image for individual instance of the AdRotator object.

Syntax

AdRotatorName.Border = size

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set.

size

The parameter "size" is used to specifies the thickness of the border used to surround the displayed banner image. The default value is set in the header of Rotator Schedule file.

AdRotator.Clickable Property

AdRotator.Clickable property is used to specify whether the displayed banner image is a hyperlink or not.

Syntax

AdRotatorName.Clickable = value

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set.

value

The parameter "value" is used to specify whether the displayed banner image is a hyperlink or not. The default value is TRUE. And the possible values are:

TRUE: to display the banner image as a hyperlink

FALSE: to display the banner image as an image only

AdRotator.TargetFrame Property

AdRotator.TargetFrame property is used to specify the target frame in which the link should be loaded. The AdRotator.TargetFrame property act as the same function of the TARGET parameter used in an HTML anchor statement.

Syntax

AdRotatorName.TargetFrame = frame

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be set.

frame

The parameter "frame" is used to specify the name of the frame in which to display the banner image. The default value is "NO FRAME". And the possible values are the keywords of HTML frame, such as  _TOP, _NEW, _CHILD, _PARENT, or _BLANK.

AdRotator.GetAdvertisement Method

AdRotator.GetAdvertisement Method is used to set up the HTML tag of the banner image on an ASP page by retrieving the information of the next scheduled banner image and the specification details of the scheduled banner ad from the text file, Rotator Schedule file and formats the banner image as HTML tag according the specifications received from the AdRotator properties and Rotator Schedule file. The script "AdRotator.GetAdvertisement" runs each time when a user opens or reload the page, and the AdRotator.GetAdvertisement method will retrieve a new next scheduled banner image each time.

Syntax

AdRotatorName.GetAdvertisement( rotationSchedulePath )

Parameters

AdRotatorName

The parameter "AdRotatorName" is the name of the instance of the AdRotator object to be specify.

rotationSchedulePath

The parameter "rotationSchedulePath" is used to specify the virtual location of the Rotator Schedule file relative to the virtual directory.

Rotator Schedule File

The Rotator Schedule File is used to store the specification details of the scheduled banner ad and the information of the scheduled banner images for the AdRotator Object. The specification details of the scheduled banner ad relate to the redirect link if applicable, the dimension of the banner image, and the default border size in pixel. While the information of the scheduled banner images relate to the file location of the image, the relevance home page, the alternate text for the image, and time of display for each banner image. Therefore the rotator schedule file can be divided into two sections seperated by a line with an asterisk * only. The first section contains the optional global parameters for the banner ad and the second section contains the individual information and setting for each banner image.

The Rotator Schedule File should be stored under the web server directory so that the Rotator Schedule file can be accessed through a virtual path. Each parameter or setting is stroed in one single line. Since the four parameters in first section is only an optional parameter, the whole line of entry can be ignore. If there is no global parameters setting in the first section, the AdRotator Object will use the default values for the new instance of the Ad Rototor object setup, and the line with just a single asterisk x becomes the first line of the Rotator Schedule file. But in the section, the parameters for each banner image is fixed at four line of entry, if there is home page of banner ad, a line with a single hyphen - should be entered.  These four line of entry for each banner image will be repeated for every banner image in the banner ad.

The change in a Rotator Schedule File may need to restart the IIS services in ordered to make the changes become effective.

Syntax

[REDIRECT URL]
[WIDTH numWidth]
[HEIGHT numHeight]
[BORDER numBorder]
*
(adURL
adHomePageURL
Text
impressions)+

Parameters

*

The parameter "*" is the separator of two sections only.

[...]

The parameter "[" & "]" is the indicator of the bracketed parameters by a pair of square brackets "[...]" is an optional item.

(...)+

The parameter "+" is the indicator of the four bracketed parameters by a pair of brackets "(...)" can be repeated one or more times.

URL

The parameter "URL" is used to specify the path of redirection handling script on the web server to implement the control plan of redirection. The redirection handling script can be either dynamic-link library (.dll) or application file (.asp). The specified path can be either full URL path (http://...) or virtual path relative to the virtual directory (/...).

numWidth

The parameter "numWidth" is used to specify the width of the banner image displayed on the web page. The unit of the numWidth is in pixels and the default value is 440 pixels.

numHeight

The parameter "numHeight" is used to specify the height of the banner image displayed on the web page. The unit of the numHeight is in pixels and the default value is 60 pixels.

numBorder

The parameter "numBorder" is used to specify the thickness of the hyperlink border around the banner image. The unit of the numBorder is in pixels and the default value is 1 pixel. And the value of numBorder is set to 0 when there is no border around the banner image.

adURL

The parameter "adURL" is used to specify the location of the banner image file.

adHomePageURL

The parameter "adHomePageURL" is used to specify the link of associated home page of the banner image. A hyphen - is needed to put on this line when the banner image does not have a associated home page. 

Text

The parameter "Text" is used to specify the alternate text to be displayed when the graphics capability of the browser is either not supported, or turned off.

impressions

The parameter "impressions" is used to specify the individual relative weight of the banner ad.  Although a number between 0 and 10000 can be used for indicating the individual relative weight of the banner image, there is a limitation that the sum of the impressions for all item cannot exceed 10000, otherwise an error will be generated at the first time when the Rotator Schedule file is called by the GetAdvertisement method. The number 10000 is only the maximum total number of impressions for all items in a banner ad. The weighting mechanism for the impressions will only consider the total number of impressions for all items in the Rotator Schedule file. For example, if a Rotator Schedule file contains three ads with impressions set to 1, 3, and 4, the first advertisement is displayed 12.5 percent of the time, the second 37.5 percent of the time, and the third 50 percent of the time.

Redirection File

The Redirection file is an optional file to implement the control plan of redirection. The Redirection file can be either dynamic-link library (.dll) or application file (.asp) and is stored on the web server so that the Redirection file can be accessed by specifying either full URL path (http://...) or virtual path relative to the virtual directory (/...). The redirection handling script on the web server is activated by the AdRotator Object after the banner image is being clicked by the user. One common application of the redirection handling script in the Redirection file is to record the number of user click on each banner image.

When the Redirection File is called by the AdRotator Object click, the AdRotator object also passes a QueryString to the Redirection File for parsing. There are two variables in the QueryString. One is called image that holds the file name of banner image. The other is called URL that holds the link of the associated home page of the banner image. The redirection handling script can make use of  the query string sent by the AdRotator object to parse and to redirect the user to the URL associated with the banner image that the user clicked on. In the Redirection file, the redirection handling script can also be included script to count the number of users that have clicked on a particular banner image and store the counter  to a file on the web server.

Examples

  • Example of an AdRotator Web page, named AdRotator.asp to display banner ad on AdRot_Schedule.txt with no border, no hyperlink, and displays on frame "target='_blank'"

    ASP Page, AdRotator.asp:

    <%
    Set ad = Server.CreateObject("MSWC.AdRotator")
    ad.Border = 0
    ad.Clickable = FALSE
    ad.TargetFrame ="target='_TOP'"
    Response.Write ad.GetAdvertisement("/ads/AdRot_Schedule.txt")
    %>

  • Example of Rotator Schedule File, named AdRot_Schedule.txt to store the specification details of the scheduled banner ad and the information of the scheduled banner images for the AdRotator Object. 

    Text in the Rotator Schedule File, AdRot_Schedule.txt:

    REDIRECT AdRot_Redirect.asp
    WIDTH 280
    HEIGHT 50
    BORDER 1
    *
    http://www.output.to/images/sideway.jpg
    http://www.output.to
    HomePage of Output.to
    1
    http://sideway.com.hk/images/pearl.gif
    -
    HomePage of Pearl PicBlog
    3
    http://www.sideway.hk/images/sideway.jpg
    http://www.sideway.hk
    HomePage of Sideway
    4 4

  • Example of Redirection File, named AdRot_Redirt.asp to store user information in Application variables and redirect the user to the home page of the associated banner image..

    ASP script command in the Redirection File, AdRot_Redirect.asp:

    <%
    Application.Lock
    Application("AdClicked") = Request.QueryString("image")
    Application("User") = Request.ServerVariables("REMOTE_ADDR")
    Application.UnLock
    Response.Redirect(Request.QueryString("url"))
    %>

Link:http://output.to/sideway/default.asp?qno=130200002

ASP Server Component

ASP Server Components

Unlike build-in ASP Objects, an ASP component is an executable self contained code with specific functions designed for providing one or more objects by performing those specific functions within the component. In general, an object instance is collections of information with specific methods to carry out some predefined procedures for manipulating the properties of an instance of an object by modifying its attributes created by the execution of the corresponding asp component. An instance of the object can be created by assigning a new variable name to the ASP object provided by the ASP component using the ASP Server.CreateObject method. Since the ASP Server.CreateObject method needs the registered name of the ASP component, the ASP component should be registered before the ASP component can be used to provide ASP objects.

The ASP built-in server components are provided to enhance the usability of ASP technology by adding some built-in components to increase the fundamental capability of ASP technology for creating dynamic and interactive web pages. Besides, there are also some base components to enrich the pre-made functions of ASP technology for making dynamic and interactive web pages.

Some IIS pre-made components are not installed for all version of IIS. Ad Rotator, Browser Capabilities, Content Linker, Content Rotator, Counters, Logging Utility, My Info, Page Counter, Status, and tools are not installed with IIS 6.0. However, if you upgrade your Web server from a previous version of IIS, the pre-made components are not removed. Some IIS pre-made components, ASP content rotator and nextlink,  are deprecated in IIS7. And most IIS pre-made components are either not installed with IIS7 or their usage is not supported.

Component Name Component Description
Ad Rotator To create an AdRotator object according to the specified schedule. This object replaces the web banner displayed on the page automatically .
Browser Capabilities To create a BrowserType object. This object determines the version, type and capabilities of each browser that accesses the Web site.
Content Linking To create a NextLink object according to the specified table of contents. This object provides a link to a web page as the continuous page of a book.
Content Rotator To create an Content Rotator object according to the specified web contents. This object replaces the string HTML content on the web page automatically .
Counters To create a Counters object with any numeber of individual counters. This object performs individual create, remove, store, increment, and retrieve counter operation.
Database Access To create an ActiveX Data Object (ADO) object. This object provides access to the information stored in a database or other  forms of tabular data.
File Access To create FileSystemObject or TextStream object. These objects provide access to the file system of the computer and to the input and output of files.
IIS Log component To create IISLog object. This object reads the HTTP activity in the IIS log file generated by IIS.
MyInfo To create a MyInfo object. This object records the personal information of the site administrator name, address, and display settings.
Page Counter To create a PageCounter object. This object counts and displays the number of times a Web page has been opened.
Permission Checker To create a PermissionChecker object. This object makes use of the password provided by the authentication protocol (IIS) to determine whether the Web user has been granted permissions to read files in the Microsoft ® Internet Information Services.
Status To create a Status object. This object has properties that contain information about the server status. Currently, the server status is only available on a personal Web server for Macintosh.
Tools To create a Tools object. This object provides utilities for adding advanced features to Web pages easily.
Previous Month  FEB  2013  Next Month
SMTWTFS
12
3456789
10111213141516
17181920212223
2425262728

Previous Month  SEP  2016  Next Month
SMTWTFS
123
45678910
11121314151617
18192021222324
252627282930

Sideway BICK Blog

06/02


Copyright © 2000-2020 Sideway . All rights reserved Disclaimerslast modified on 26 January 2013