Microon ASP Random Image Component 1.2 ©2002 Microon.Net

Description

Microon ASP Random Image Component inserts one random chosen image (from the specified folder) into an ASP page.

Features

Syntax

<% MicroonRandomImage path, link, width, height, debugMode, NoMenu, NoGallery %>

The MicroonRandomImage component syntax has these parts:

Part Description
path Relative path to the folder containing the images.
link

String used to specify the link on the image. Values:

  • "" (empty string): no link is added to the image;
  • "===": link to the picked image (Ex: image.jpg) in full size;
  • To link to an external page, for example myPage.asp, simply write "myPage.asp".
width Number specifying the width, in pixel, to be forced for images. If you don't want to force images width, this parameter must be an empty string, that is "".
height Number specifying the height, in pixel, to be forced for images. If you don't want to force images height, this parameter must be an empty string, that is "".
debugMode If equal to 1, some debug messages are displayed, besides the image.
NoMenu If equal to 1, the right-click contextual menu on the image is disabled.
NoGallery If equal to 1, the IE 6 image toolbar is disabled.

 

In the ASP page must be inserted, preferably as the first line, the line:

<%@Language="VBScript.Encode"%>
<!--#include file="path to file RandomImage.asp" -->

(These lines do not affect the rest of the ASP page)
Example: if the file RandomImage.asp is located in the same folder of the calling ASP page, the code must be:
<!--#include file="RandomImage.asp" -->

Examples

Example1: test1.asp

<html>
<%@Language="VBScript.Encode"%>
<!--#include file="RandomImage.asp" -->
<head>
<title>Random Image</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

<% MicroonRandomImage "imageFolder","myImages.asp","","",0,0,0 %>

</body>
</html>

--> This page inserts an image taken from the folder called imageFolder, that is located under the folder of the test1.asp calling file, with a link to the page myImages.asp; the picked image will be automatically adapted to its real dimensions. Debug messages are not displayed, the right-click contextual menu on the image is enabled, IE 6 image toolbar is enabled.
The file RandomImage.asp is located in the same folder of the calling file test1.asp.

Example2: test2.asp

<html>

.......
.......
.......

<body>

<% MicroonRandomImage "../../imageFolder","",400,"",0,1,1 %>
<% MicroonRandomImage "../../imageFolder","","",300,0,0,1 %>

</body>
</html>

--> This page inserts an image taken from the folder called imageFolder, that is located 2 levels up of the folder of the test1.asp calling file, without link; the picked image will be forced to 400 pixels in width (image height is automatically regulated to maintain to original aspect ratio). Debug messages are not displayed, the right-click contextual menu on the image is disabled, IE 6 image toolbar is disabled.
--> This page inserts another image taken from the folder called imageFolder, that is located 2 levels up of the folder of the test1.asp calling file, without link; the picked image will be forced to 300 pixels in height (image width is automatically regulated to maintain to original aspect ratio). Debug messages are not displayed,
the right-click contextual menu on the image is enabled, IE 6 image toolbar is disabled.

Example3: test3.asp

<html>
<%@Language="VBScript.Encode"%>
<!--#include file="../include/RandomImage.asp" -->

.......
.......
.......

</body>
</html>

The file RandomImage.asp is located in the folder called include, that is located one level up of the folder of the calling file test1.asp.


Microon ASP Random Image Component ©2002 Microon.Net. All rights reserved.