Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I organize and access over 23,000 images?


videobus

Recommended Posts

My client is a video store and has a database of over 23,000 different titles. Currently OSC places them in the \images\ folder, which would be totally unmanagable. My scheme would be to create a products folder:

 

\images\product\

 

and then each movie category would be in its own folder:

 

\images\products\comedy

\images\product\drama

\images\product\mystery

(etc.)

 

This would place about 2,000 movies in each category, which is better, but still very difficult to manage.

 

1st question: any better scheme to organize?

2nd question: where and how do I change OSC to accomodate this?

 

BTW, I imported the 23,000 titles and categories with easypopulate (of course it timed out every 5,000 movies, so I uploaded it in 5 segments).

 

The import contains the image name which I made to be the same as the title name with jpg appended to it. Eg: IT'S A BUGS LIFE.JPG

This makes it easy to auto-create the image for mySQL during easypopulate.

 

Now what I would like to do is to automatically add the image folder including the correct category to the title when displaying it.

 

Eg:\catalog\images\products\children\IT'S A BUGS LIFE.JPG

Link to comment
Share on other sites

When you set up your image files in an sql (or easy populate) specify the image as children/photo.jpg. This will load the path into the images column in your database.

 

For individual items added from Admin, if you image is, for example

 

c:\My Photos\catalog\images\children\photo.jpg

 

Change in the product image upload to:

 

c:\My Photos\catalog\images\children/photo.jpg

 

HTH...

 

ps. you may run into problems if you actually uploaded image names as you listed in your post. Spaces, ' and most any other non alpha-numeric other than _ should not be used.

GEOTEX from Houston, TX

 

(George)

Link to comment
Share on other sites

Thanks for the help.

 

I still have a remaining problem: the db has the image names already added when I uploaded all items with easypopulate (can be easily removed with a fresh upload). This is in anticipation of the client adding the actual images as time permits.

 

In otherwords, the item already has SUPERMAN.JPG in mySQL. The problem is that now I get the red-x where the image should be. I'm trying to find a place to put a test to not display the image if the image file does not exist, rather than rely on the db to tell me if there is an image associated with the item.

 

With this scheme, the client only needs to copy (ftp) the correct image into the correct category folder on the site en-masse, and not have to bother using Admin to add an image to each of the 23,000 items, one at a time.

 

If anyone knows of a better solution, I would be forever in your debt, so please advise.

Link to comment
Share on other sites

I have already tried that and in my scheme it won't work. In this client's scheme, images are required, but only for the items that have an actual image file. This switch is for all or no images if they are in the db. According to the comment, it's designed to catch broken images to be fixed during development.

 

OSC depend on the db to know if there's an image or not. Since I already have all the image names in the db, it will attempt to display it, and when it fails (because there's no physical image file), it displays the red-x.

 

The code I'm looking at is in \includes\modules\product_listing.php around line 150 -> case 'PRODUCT_LIST_IMAGE':

 

The function tep_image(....) could be modified (if I can find it) to not display anything if there's no file for the image. Currently it attempt to display the file name that's in the db, whether it physically exists or not.

 

Again, if there's a better way to do this, I'm open for it. I'm just trying to avoid having the client add images one at a time in the Admin section. I timed the average add, and it took about 2min. per image. multiply that by 23,000 images, which would be about 766 hours, which is 19 weeks (766hrs/40hrs) of someone doing this 8hrs./5 days.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...