Perl Script Question...ramdom Image [bannerwheel]

admin

Administrator
Staff member
hello.<br /><br />i just started using TCH, and it seems great.<br /><br />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.<br /><br />the scripti am trying to use is bannerwheel...the code is below.<br /><br /><br />i am trying to implement it here:<br /><br /><a href="http://69.56.169.186/~mascoto/mascot_puzzle.shtml" target="_blank">http://69.56.169.186/~mascoto/mascot_puzzle.shtml</a><br /><br />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? <br /><br />the next lines i have use to execute the perl are as follows:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><!--#exec cmd="cgi-bin/logo_chango.pl"--> border="0"><br />      <BR><BR><br />      <!--#exec cgi="/cgi-bin/logo_chango.pl"--> border="0"><br />      <BR><BR><br />      <!--#exec cgi="cgi-bin/logo_chango.pl"--> border="0"><br />      <BR><BR><br />      <!--#exec cmd="/cgi-bin/logo_chango.pl"--> border="0"><!--c2--></div><!--ec2--><br /><br />something is happening, as they do disappear.<br />i am obviously grasping at straws...but none seem to work.<br />i have set the permission to 777 and then 755 after searching this forum. (5 = no write correct?) <br /><br />i feel maybe my path to my site is wrong...i used:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$base_path = "/home/mascoto/public_html/images/mini";<br /># This is the base path to the directory with the images and the file(s)<br /># detailing the images to show.<!--c2--></div><!--ec2--><br /><br />so question 1.) can i make multiple occurances fo ranomdhtml.cgi from the included scripts?<br /><br />2.) is my path to home correct?<br /><br />3.) any suggestions on what else to try with this perl script?<br /><br />thanks.<br /><br /><br />also, banner wheel needs a txt file in the location specified. i ahve done that and it is:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/clem02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/col02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/conn_u02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/georgia02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/kansas02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/ksu02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/miami02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/michst02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/neb02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/purdue02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/texas02.gif"::1::1<br /><img src=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"images/mini/txtech02.gif"::1::1<!--c2--></div><!--ec2--><br /><br /><br />bannerwheeel script:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->##!/usr/bin/perl<br />########################## <br /># BannerWheel 1.0 <br /># <br /># By Command-O Software <br /># http://www.command-o.com <br />#<br /># Copyright 1996. <br /># All Rights Reserved<br />#<br />#If you find this script useful, we would appreciate a <br />#donation to keep this service active for the community.<br />#Command-O Software, P.O. Box 12200, Jackson WY 83002<br />##########################<br /><br />$base_path = "/home/mascoto/public_html/images/mini";<br /># This is the base path to the directory with the images and the file(s)<br /># detailing the images to show.<br /><br />$base_url = "http://69.56.169.186/~mascoto/";<br /># This is the url to the directory where the images are stored.<br /># You only need to fill this out if you use the script without<br /># server side includes.<br /><br />$ssi_file = "logo_chango.txt";<br /># This is the name of the file (in the $base_path directory) that has<br /># the details for what the script should do when used with server<br /># side includes.<br /><br />$non_ssi_file = "non_ssi_file.txt";<br /># This is the name of the file (in the $base_path directory) that has<br /># the details for what the script should do when used without server<br /># side includes.<br />#<br /># That's all there is to it. Check the README file that goes with this<br /># script for more information on setting up and using this script.<br />#<br /># You must get express written permission from Command-O Software<br /># if you want to change anything below this point.<br />#####################<br />if ($ENV{'QUERY_STRING'} eq "non-ssi") {<br />   open(FILE,"$base_path/$non_ssi_file");<br />}<br />else {<br />   open(FILE,"$base_path/$ssi_file");<br />}<br />@filedata = <FILE>;<br />close(FILE);<br />foreach$fileline(@filedata) {<br />   $fileline =~ s/\n//g;<br />   undef($image,$frequency,$display);<br />   ($image,$frequency,$display) = split(/::/,$fileline);<br />   push(@allimages,"$image");<br />   if ($frequency eq "") {<br />      $frequency = "1";<br />   } <br />   push(@frequencies,"$frequency");<br />   if ($display eq "") {<br />      $display = "0";<br />   }<br />   push(@displays,"$display");<br />   $number = $frequency;<br />   while($number > 0) {<br />      push(@images,"$image");<br />      $number = $number - 1;<br />   }<br />}<br />srand(time|$$);<br />$random = int(rand(@images));<br />$theimage = $images[$random];<br />if ($ENV{'QUERY_STRING'} eq "non-ssi") {<br />   print "Location: $base_url/$theimage\n\n";<br />   open(FILE,">$base_path/$non_ssi_file");<br /><br />}<br />else {<br />   print "Content-type: text/html\n\n";<br />   print "$theimage";<br />   open(FILE,">$base_path/$ssi_file");<br />}<br />foreach$displaynum(@allimages){<br />   if ($displaynum eq "$theimage") {<br />       $bingo = $count;<br />   }<br />   $count = $count + 1;<br />}<br />$displays[$bingo] = $displays[$bingo] + 1;<br />$listnum = 0;<br />$imagenum = @allimages;<br />while($listnum < $imagenum) {<br />   print FILE "$allimages[$listnum]::$frequencies[$listnum]::$displays[$listnum]\n";<br />   $listnum = $listnum + 1;<br />}<br />close(FILE);<br />exit;<!--c2--></div><!--ec2--><!--content-->
just found the file manager to verify that the permissions are indedd 755.<br /><br />same questions remain.<br /><br />thanks.<!--content-->
 
Back
Top