Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Delete Old images


lt_oneman

Recommended Posts

Hello

I can't seem to find what i'm needing. I have items we do not sale anymore and just removing the item don't remove the image file off the server. I need a way to remove all images not being used now. Is there a easy was to remove the images from past/older items we don't sale anymore without having to hunt them down and remove myself one by one?

 

Please tell me there is a easyer way to delete or remove un-used images???

 

thanks

Link to comment
Share on other sites

I am working on a script to do just that, but it is for a modified version.

(It will not work on OSC without being modified)

 

What is your product images folder set up? images? anything else?

Do you have anything in the images folder that isn't a product? like a logo or design image?

 

The script I am almost done with will rename (with a prefix of remove_) all jpg images in the folders I set to be checked that are not in the database. This will allow me to, check the site to see if images are not showing properly (after renaming them) and then allow me to quickly copy the images to my hard drive and then delete them.

 

Are you able to do any php coding?

Link to comment
Share on other sites

I am working on a script to do just that, but it is for a modified version.

(It will not work on OSC without being modified)

 

What is your product images folder set up? images? anything else?

Do you have anything in the images folder that isn't a product? like a logo or design image?

 

The script I am almost done with will rename (with a prefix of remove_) all jpg images in the folders I set to be checked that are not in the database. This will allow me to, check the site to see if images are not showing properly (after renaming them) and then allow me to quickly copy the images to my hard drive and then delete them.

 

Are you able to do any php coding?

 

Well all my images are in the (images) folder. all my other images like banner and things i have made are not in the (images) folder it only holds the product images and the default images that was there when i open the site like all the table_backgound and so on. other then them it's only product images.

 

PHP coding?? I wish I could do php coding but i can't.

Link to comment
Share on other sites

The script will not work for you if you have non product images (unless you don't use them) in the images folder.

It is a good design idea to keep images in their own folder so you might want to move the usable images to something like design.

 

What is the database setup you are using.

 

I have a setup using

 

p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6

 

which images are you using? most likely

 

p.products_image

 

anything else? do you have any image mods?

 

When done, if there is time, will update the script for you to print a list of all unused images. This will save you from hunting for them. no promises....

Link to comment
Share on other sites

The script will not work for you if you have non product images (unless you don't use them) in the images folder.

It is a good design idea to keep images in their own folder so you might want to move the usable images to something like design.

 

What is the database setup you are using.

 

I have a setup using

 

p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6

 

which images are you using? most likely

 

p.products_image

 

anything else? do you have any image mods?

 

When done, if there is time, will update the script for you to print a list of all unused images. This will save you from hunting for them. no promises....

 

The script will not work for you if you have non product images (unless you don't use them) in the images folder.

Well in this images folder the images there was in there when i started the site was there by default i guess. it's only about 20 or so and i have them on my hd as backups so if they were to get remove or renamed it's nothing to re upload them again. Not really sure how i would go about getting them to work if i moved them to a new folder. I can move them to new say site_images folder but wouldn't have a clue on changing the path to point to the new site_images folder i would have to creat.

 

What is the database setup you are using.

 

I have a setup using

 

p.products_image, p.products_image_med, p.products_image_lrg, p.products_image_sm_1, p.products_image_xl_1, p.products_image_sm_2, p.products_image_xl_2, p.products_image_sm_3, p.products_image_xl_3, p.products_image_sm_4, p.products_image_xl_4, p.products_image_sm_5, p.products_image_xl_5, p.products_image_sm_6, p.products_image_xl_6

 

which images are you using? most likely

 

p.products_image

I think this would be the p.products_images but not really sure about this. how can i find this info out that your asking about? where would i look?

 

anything else? do you have any image mods?

No images mods added by me. I have a really hard time to get any mods working. I have installed a google ads box and a paypal box and it took help to get them working.

Link to comment
Share on other sites

Lt Oneman,

I finished the script, PM me your email address and I'll send it to you.

 

I adjusted the script to work for OSC default, only 2 setting to edit.

 

Your feedback will be appreciated before I post the script.

Link to comment
Share on other sites

Lt Oneman,

Instead of sending me a pm - I posted the script - you can get it here:

 

http://forums.creloaded.com/Forums/viewtopic/t=13505.html

 

About the script:

 

Will work for default OSC or modified versions

Script worked well testing 9000 image files

 

What this script does:

* Read the database and report back a list of installed images

* Mark (in RED) any DB listed image which does not exist on the server

* Read the server images and report back a list

* Compare the lists for missing data

* Offer you the ability to check or uncheck listed images controlling what gets renamed

* Rename the USER checked listed images from myimage.jpg to UNUSED_myimage.jpg

* Allow you to ftp and delete ALL renamed UNUSED_myimage.jpg images

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...