|
My understanding of the license is that if I modify the code, I am supposed to post it back here for others, so here goes.
I wanted a randomly selected banner ad mechanism. This mod allows use of a banner images located immediately to the right of the forum image on each page. The images are in a single folder, and an image is randomly selected from the coded list of images and associated links.
First create a new folder under the webwize forum folder called "bannerimages". Place whatever image files are to be used therein. This code example is based upon the forum being in a folder called "forum".
Replace /forum/includes/header.asp with the following:
<head> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <script language="javascript" src="includes/default_javascript_v9.js" type="text/javascript"></script> </head> </head>
<body> <table class="basicTable" cellspacing="0" cellpadding="3" align="center"> <tr> <td><% 'If there is a forum image then dsiplay it If NOT strTitleImage = "" Then Response.Write("<a href=""" & strWebsiteURL & """><img src=""" & strTitleImage & """ border=""0"" alt=""" & strWebsiteName & " " & strTxtHomepage & """ title=""" & strWebsiteName & " " & strTxtHomepage & """ /></a>")
%></td>
<!--select random banner image to display to the right of the forum image and associated link--> <td><%
Dim strarrayimage(3), strarraylink(3) Dim randomval
'enter names of random banner images strarrayimage(0) = "/forum/bannerimages/2_star_rating.png" strarrayimage(1) = "/forum/bannerimages/3_star_rating.png" strarrayimage(2) = "/forum/bannerimages/4_star_rating.png" strarrayimage(3) = "/forum/bannerimages/5_star_rating.png"
'enter links associated with above listed files strarraylink(0) = " http://www.link2 - " strarraylink(1) = " http://www.link3 - " strarraylink(2) = " http://www.link4 - " strarraylink(3) = " http://www.link5 - "
randomval = Int(Rnd(1)*UBound(strarrayimage))
Response.Write("<a href=""" & strarraylink(randomval) & """><img src=""" & strarrayimage(randomval) & """ ></a>")
%> </td> </tr> </table>
In this example, I used the 2, 3, 4 and 5 star images just as example files to give it something to display. Use your own image files there as values of strarrayimage. Change the DIM statement for strarraylink and strarrayimage to align with however many images you have. Enter the link you want the user sent to if he clicks on the displayed banner image in strarraylink.
This code will randomly pick one of the listed banner images, display it, and hyperlink it to the associated correct link. It seems to work well. You will need to work on the image files to make them the correct size etc so that they will display correctly....or you probably could modify the response.write to force the display to the desired size etc. Also may want to modify it to force the browser to open the page in a new window.
HTH........
|