Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

a question for a triple black belt ninja at OSC


jahwise

Recommended Posts

Posted

i have set up my cart in such a way that the images from one of my distrbutors Hal Leonard (45, 000 products) are called from their servers...

 

what we did was wrote a script which searched for the HL gif image say 12345678.gif (which is not uploaded to my server) and when it didnt find that image (cause none are uploaded on my server) it puts this in front of it http://www.halleonard.com/item_gif/ so it becomes http://www.halleonard.com/item_gif/12345678.gif (all the images have 8 numbers...)

 

 

this is working great, pulling down the image from the HL server...but if you go to the music education category on my site at http://www.loopwise.com/osc/catalog/defaul...t.php?cPath=156 you will see there are many broken image links...this is becuase many of the products just dont have images, plain and simple. (but the excel EP image colum is all filled with image names regardless...even though some dont have image names are bogus)

 

My problem is that i need to have another script written ON TOP of this HL image calling script which does the following: when no image is found on the HL server...it then automatically defaults to a noimage.gif picture... This is possible right?

 

My other web designer says he doenst think it is possible, he says its one way or the other...but he is not totally sure.

 

if you can help me with this i would be very happy! The only other option i have is to go through each product one by one and find all the image less products and update individually but that is totally not efficient...and would take forever...

 

 

thanks so much...

 

taylor

AIM Y! MSN loopwisechat

http://www.loopwise.com

Posted

I don't have any belts but here what I use (I found it at www.php.net)

 

$image_info = @getimagesize("http://$filelocation/$filename");

$type=$image_info[2];

 if ($type == 0) {

               echo "file doesnt exists";

               } else {

               echo "the file exists";

               }

 

based on this snippet you can have noimage.gif shown if there's no image on a remote server

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...