Jump to content

Recommended Posts

Posted

hello.

 

i just started using TCH, and it seems great.

 

i have a few questions regarding a perl script i am trying to use. i have successfully installed it elsewhere (years ago) so i must be forgetting something. basically, i wish to have one page show an image from a set of images, and another page to show an image from a different set of images.

 

the scripti am trying to use is bannerwheel...the code is below.

 

 

i am trying to implement it here:

 

http://69.56.169.186/~mascoto/mascot_puzzle.shtml

 

the first image is from the handy randomhtml cgi included in the hosting...the problem with that, is i need multiple random html generation...i.e. different html for different pages. i'd be happy to use that if i can make more than one occurance of it...i downloaded it but it was not editble...must have been compiled?

 

the next lines i have use to execute the perl are as follows:

><!--#exec cmd="cgi-bin/logo_chango.pl"--> border="0">
	 <BR><BR>
	 <!--#exec cgi="/cgi-bin/logo_chango.pl"--> border="0">
	 <BR><BR>
	 <!--#exec cgi="cgi-bin/logo_chango.pl"--> border="0">
	 <BR><BR>
	 <!--#exec cmd="/cgi-bin/logo_chango.pl"--> border="0">

 

something is happening, as they do disappear.

i am obviously grasping at straws...but none seem to work.

i have set the permission to 777 and then 755 after searching this forum. (5 = no write correct?)

 

i feel maybe my path to my site is wrong...i used:

>$base_path = "/home/mascoto/public_html/images/mini";
# This is the base path to the directory with the images and the file(s)
# detailing the images to show.

 

so question 1.) can i make multiple occurances fo ranomdhtml.cgi from the included scripts?

 

2.) is my path to home correct?

 

3.) any suggestions on what else to try with this perl script?

 

thanks.

 

 

also, banner wheel needs a txt file in the location specified. i ahve done that and it is:

><img src="images/mini/clem02.gif"::1::1
<img src="images/mini/col02.gif"::1::1
<img src="images/mini/conn_u02.gif"::1::1
<img src="images/mini/georgia02.gif"::1::1
<img src="images/mini/kansas02.gif"::1::1
<img src="images/mini/ksu02.gif"::1::1
<img src="images/mini/miami02.gif"::1::1
<img src="images/mini/michst02.gif"::1::1
<img src="images/mini/neb02.gif"::1::1
<img src="images/mini/purdue02.gif"::1::1
<img src="images/mini/texas02.gif"::1::1
<img src="images/mini/txtech02.gif"::1::1

 

 

bannerwheeel script:

 

>##!/usr/bin/perl
########################## 
# BannerWheel 1.0 
# 
# By Command-O Software 
# http://www.command-o.com 
#
# Copyright 1996. 
# All Rights Reserved
#
#If you find this script useful, we would appreciate a 
#donation to keep this service active for the community.
#Command-O Software, P.O. Box 12200, Jackson WY 83002
##########################

$base_path = "/home/mascoto/public_html/images/mini";
# This is the base path to the directory with the images and the file(s)
# detailing the images to show.

$base_url = "http://69.56.169.186/~mascoto/";
# This is the url to the directory where the images are stored.
# You only need to fill this out if you use the script without
# server side includes.

$ssi_file = "logo_chango.txt";
# This is the name of the file (in the $base_path directory) that has
# the details for what the script should do when used with server
# side includes.

$non_ssi_file = "non_ssi_file.txt";
# This is the name of the file (in the $base_path directory) that has
# the details for what the script should do when used without server
# side includes.
#
# That's all there is to it. Check the README file that goes with this
# script for more information on setting up and using this script.
#
# You must get express written permission from Command-O Software
# if you want to change anything below this point.
#####################
if ($ENV{'QUERY_STRING'} eq "non-ssi") {
  open(FILE,"$base_path/$non_ssi_file");
}
else {
  open(FILE,"$base_path/$ssi_file");
}
@filedata = <FILE>;
close(FILE);
foreach$fileline(@filedata) {
  $fileline =~ s/\n//g;
  undef($image,$frequency,$display);
  ($image,$frequency,$display) = split(/::/,$fileline);
  push(@allimages,"$image");
  if ($frequency eq "") {
     $frequency = "1";
  } 
  push(@frequencies,"$frequency");
  if ($display eq "") {
     $display = "0";
  }
  push(@displays,"$display");
  $number = $frequency;
  while($number > 0) {
     push(@images,"$image");
     $number = $number - 1;
  }
}
srand(time|$$);
$random = int(rand(@images));
$theimage = $images[$random];
if ($ENV{'QUERY_STRING'} eq "non-ssi") {
  print "Location: $base_url/$theimage\n\n";
  open(FILE,">$base_path/$non_ssi_file");

}
else {
  print "Content-type: text/html\n\n";
  print "$theimage";
  open(FILE,">$base_path/$ssi_file");
}
foreach$displaynum(@allimages){
  if ($displaynum eq "$theimage") {
      $bingo = $count;
  }
  $count = $count + 1;
}
$displays[$bingo] = $displays[$bingo] + 1;
$listnum = 0;
$imagenum = @allimages;
while($listnum < $imagenum) {
  print FILE "$allimages[$listnum]::$frequencies[$listnum]::$displays[$listnum]\n";
  $listnum = $listnum + 1;
}
close(FILE);
exit;

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...