Link to home
Create AccountLog in
Avatar of starview
starview

asked on

perl scroller

I have a perl scroller script that I modifed from my website. It works but not the way it should and I don't know if I have enough information to give you for you to help.
This script will display an product images and discription, but will not change the the image until the images is click. I would like to find out how to make it go to a new images as it strolls though. Also,
It uses the "marquee" to scroll, I would  rather not use the "marquee" because it is only good in explorer browser.
if ($form_data{'order_form_button'} || $form_data{'order_form_button.x'} ||
    $form_data{'submit_order_form_button'} || $form_data{'submit_order_form_button'} ||
    $form_data{'viewOrder'} || $form_data{'viewOrder.x'} ||
    $form_data{$process_variable{$gateway}})
{
   $random_products = "";
} else {
	$imageURL = "$URL_of_images_directory";

   open(DATAFILE, "$sc_log_file_directory_path/products.txt") || &errorcode(__FILE__, __LINE__, "$sc_log_file_directory_path/products.txt", "$!", "print", "FILE OPEN ERROR", "0");
   @line=<DATAFILE>;
   close (DATAFILE);

   srand;

   $array1 = $line[int rand(@line)];
   $array2 = $array1;

   $d_counter = 0;

   while ($array2 eq $array1 || $d_counter eq 20)
   {
      $array2 = $line[int rand(@line)];
      $d_counter++;
   }

   @special1 = split (/\|/, $array1);
   @special2 = split (/\|/, $array2);

   $image1 = $special1[4];
   $image2 = $special2[4];

   $special1[2] = &display_price(&format_price($special1[2]));
   $special2[2] = &display_price(&format_price($special2[2]));

   $random_products .= qq~
         <marquee><p align="center">
         <font face="Arial" size=1><a href="$sc_store_url?pid=$special1[0]&amp;cart_id=$cart_id"><img src=$imageURL/product/$special1[4] border=0></a>
         </marquee>      
   ~;
}

1;

Open in new window

Avatar of starview
starview

ASKER

Here is my website if you would like to see it in action:
http://www.oneplaceonly.com

It is the Random Products on the page.
ASKER CERTIFIED SOLUTION
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
The shopping cart that this works with is a cgi-perl cart. and I really don't know anything about ajax or even to get it to work with my cart. and seek out the information from it.
It look like the demo you put up is that you have to add the images in the script and I want it to get the images and product descripyion automatically, that is why I put the script up here, so it could be modified to scroll and change images and product information.
The marquee could be replaced. All the information is in the script, if I can just figure it out how to replace the marquee and have it scroll and change images as it scrolls. It will change images and product information now if I click on the image. I just want it to do it automatically.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
The site is working fine just the way it is.I am not going to re-write my website, all I am asking for is help in modifing the script that I put up here. If that can not be done fine, then i will go on and find a different way. Thank you for your help
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
how would i place the foreach loop  in the script?
The question yhat I asked was never really answered