Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 9
It works great to display ramdom images but when I add it to the UBB, I cant figure out how to make it open a new page when you click on it.
Here it is in action.....http://wheelspin.net/cgi-bin/Ultimate.cgi?action=intro
here is the script.....

#!/usr/bin/perl
##############################################################################
# SSI Random Image Displayer Version 1.2 #
# Copyright 1996 Matt Wright [email protected] #
# Created 7/1/95 Last Modified 11/4/95 #
# Scripts Archive at: http://www.worldwidemart.com/scripts/ #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1996 Matthew M. Wright All Rights Reserved. #
# #
# SSI Random Image may be used and modified free of charge by anyone so #
# long as this copyright notice and the comments above remain intact. By #
# using this this code you agree to indemnify Matthew M. Wright from any #
# liability that might arise from it's use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
# Define Variables

$basedir = "http://your.host.xxx/path/to/images/";

@images = ("first_image.gif","second_image.jpg","third_image.gif");

@urls = ("http://url_linked/to/first_image",
"http://url_linked/to/second_image",
"http://url_linked/to/third_image");

@alt = ("First WWW Page","Second WWW Page","Third WWW Page");

##############################################################################
# Options
$uselog = "1"; # 1 = YES; 0 = NO
$logfile = "/path/to/log/file";
$date = `/usr/bin/date`; chop($date);

$link_image = "1"; # 1 = YES; 0 = NO
$align = "left";
$border = "2";

# Done
##############################################################################

srand(time ^ $$);
$num = rand(@images); # Pick a Random Number

# Print Out Header With Random Filename and Base Directory
print "Content-type: text/htmlnn";
if ($link_image eq '1' && $urls[$num] ne "") {
print "";
}

print "if ($border ne "") {
print " border=$border";
}
if ($align ne "") {
print " align=$align";
}
if ($alt[$num] ne "") {
print " alt="$alt[$num]"";
}
print ">";

if ($link_image eq '1' && $urls[$num] ne "") {
print "
";
}

print "n";

# If You want a log, we add to it here.
if ($uselog eq '1') {
open(LOG, ">>$logfile");
print LOG "$images[$num] - $date - $ENV{'REMOTE_HOST'}n";
close(LOG);
}

Sponsored Links
Joined: Jan 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 9
Oh yeah, here is what Im using in the header to display it on my UBB.










Joined: Mar 2000
Posts: 615
Member
Member
Offline
Joined: Mar 2000
Posts: 615
Change:

Code
code:

to:

Code
code:

Joined: Jan 2001
Posts: 9
Junior Member
Junior Member
Offline
Joined: Jan 2001
Posts: 9
Thanks man. It works like a charm.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)