Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Remove Unused Images [Support Thread]


spooks

Recommended Posts

I installed the version osc 2.3.x

 

In the first Column on the left I see this in the headline:

TEXT_LINE_280_12371

 

 

The database is being read as:

 

after that everything seems fine in the left column of the report.

I think it has something to do with the line, that is not displaying correctly on my site, but I'm not sure:

$msg .= TEXT_LINE_280_1. $count_db_list. '</br>' .TEXT_LINE_280_2. '<i>' . $sql . '</i></br>' . ($descip_check ? TEXT_LINE_280_3 : '');

 

Anyone also experiencing this problem and maybe has a solution for it?

Link to comment
Share on other sites

I installed the version osc 2.3.x

 

In the first Column on the left I see this in the headline:

TEXT_LINE_280_12371

 

 

The database is being read as:

 

after that everything seems fine in the left column of the report.

I think it has something to do with the line, that is not displaying correctly on my site, but I'm not sure:

$msg .= TEXT_LINE_280_1. $count_db_list. '</br>' .TEXT_LINE_280_2. '<i>' . $sql . '</i></br>' . ($descip_check ? TEXT_LINE_280_3 : '');

 

Anyone also experiencing this problem and maybe has a solution for it?

 

Have you installed the language files?

Link to comment
Share on other sites

  • 2 weeks later...

they should make a like contrib that removes unused files also... ie when shop is ready to go live it checks database etc for what files are needed to keep every feature etc running

 

i have made a very plain pizza delivery site and would very much like to remove anything not used, funny enough i could handle the images fine (maybe cheating since i have converted every image to png)

Link to comment
Share on other sites

  • 6 months later...

Just installing and ran in to the following:

Not Found

 

The requested URL /admin/FILENAME_REMOVE_IMAGES was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Apache Server at www.ladybuggardendecor.com Port 443

I checked the admin file and the php is there, I checked the filenames.php and it is set correctly there. I have set toos box to 705 so it should have permessions. Can you help me Please.

Link to comment
Share on other sites

It started working. Not sure what happened. Now I have another issue.

When i click on the, "list end - clck here", of list it goes back to the main admin screen. Same when I schroll down and click "check all", it goes back to my admin screen. Not shure what is going on.

Link to comment
Share on other sites

  • 3 months later...

Hi all,

Have been running V 1.8 of Remove Unused Images - all worked well.

Upgraded to oscommerce V2.3.3.3

Now finding that this contribution is searching files in admin/includes/boxes/ instead of the images folder?????

I have gone over the code (with the limited knowledge I have of php) and can't seem to isolate the problem.

As this has only happened since the upgrade in OSC I believe the problem may be related to the fact that OSC now calls the modules in admin dynamically.

See upgrade instructions on github - https://github.com/osCommerce/oscommerce2/commit/8fd022a085e988e44b85f0b0fdeaf3849a707789

I removed the above mod to OSC so that the modules are not called dynamically and this fixed the problem.

So Basically problem is OSC Update and remove unused images now conflict.

If anyone can look at the MOD on github for the OSC and work out an edit for the contribution so it works AND the OSC can be updated to call admin modules dynamically (as per update) it would be appreciated.

 

Sincerely

Tony

:unsure:

Link to comment
Share on other sites

  • 1 month later...

Now finding that this contribution is searching files in admin/includes/boxes/ instead of the images folder?????

See upgrade instructions on github - https://github.com/osCommerce/oscommerce2/commit/8fd022a085e988e44b85f0b0fdeaf3849a707789

I removed the above mod to OSC so that the modules are not called dynamically and this fixed the problem.

So Basically problem is OSC Update and remove unused images now conflict.

If anyone can look at the MOD on github for the OSC and work out an edit for the contribution so it works AND the OSC can be updated to call admin modules dynamically (as per update) it would be appreciated.

 

Sincerely

Tony

:unsure:

 

Same issue here, but I could not make it work. I used a copy of column_left from 2.3.3.1 and still have the issue with the menus being called instead of images.

 

Tim

Link to comment
Share on other sites

  • 2 months later...

Hi guys,

 

i've had the same problem, and came with a fix!

 

Open admin/remove_unused_images.php in a text editor

Replace all occurences of $files with $serverfiles

Save, and you're done! :)

 

The problem was that column_left.php uses the same variable, and $files gets erased with column_left's content. Renaming $files does the trick!

 

Great plugin, by the way, thanks!!

Link to comment
Share on other sites

  • 4 weeks later...

Installed version 1.8.2 of this contrib. (The most recent one from albanderuaz.) Getting an error. Triple-checked everything and can't find the problem. I have installed many contribs and use ftp all the time, so I doubt it's an ftp issue. Anyway, here is the message I get when I click on Remove Images in the Admin panel (in 2.2):

 

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

 

Here is the entry from the server error log:

 

PHP Fatal error: require(): Failed opening required 'includes/languages/english/remove_unused_images.php' (include_path='.:/usr/local/lib/php-5.3.13/lib/php') in /blah/blah/blah/admin/remove_unused_images.php on line 12

 

Line 12 of the code is the require statement:

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_REMOVE_IMAGES);

 

Why is it looking for the remove_unused_images.php file in the includes/languages/english directory? The install instructions specifically say:

 

1. Add this files into your admin directory:

 

admin/remove_unused_images.php

 

Do I need to copy it to the includes/languages/english directory for some unexplained reason?

 

I do have htaccess and htpasswd files for the admin directory. But I've got other contribs insalled that are doing just as much as this one (and more) and they work fine.

 

I have file permissions set to 755 for this contrib, by the way. Same as the other files on the server...

 

Any help you can give would be appreciated.

Edited by kru

Add-Ons personally installed:

Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --
Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --
htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --
Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-Ons installed by others:

View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields

Link to comment
Share on other sites

Install version 1.5 folks. It works, unlike the latest version (1.8.2)...

Add-Ons personally installed:

Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --
Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --
htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --
Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-Ons installed by others:

View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields

Link to comment
Share on other sites

Actually, 1.8.2 would probably work if the install instructions were accurate. There is a remove_unused_image.php file that is evidently supposed to be installed in the includes/languages/english directory. I found it while exploring the zipped folders in the contrib again. However, it is not documented in the instructions. There is a somewhat cryptic reference to language files but it is not spelled out as an actual step, like the other adds/changes are.

 

So...if you install 1.8.2, make sure to copy the included includes/languages/english/remove_unused_images.php to the same directory on your server. (The same file exists in other language files in the contrib too but you wouldn't need to install those if your site is English only.)

 

Personally, I was concerned enough about the documentation, it got me wondering about the code. So I just went with 1.5.

Edited by kru

Add-Ons personally installed:

Step by Step Manual Order -- Request Reviews -- Reviews in Product Listing -- Reviews in Product Display -- Review Approval System -- Leverage Browser Cache --
Header Tag Controller -- Multilayer SEO Pop Out Menu -- Follow Us Box -- View All Products -- USPS Shipping Labels -- UPS Shipping Labels -- Monthly Sales/Tax Report --
htacess Optimisation -- Remove Unused Images -- Master Password -- Admin Change Customer Password -- Database Backup Manager -- Zero Stock Report --
Searchbox Search In Descriptions -- Easy Populate 2.76i -- Barcode Rendering -- Admin Sort By Model -- Products Purchased Report

Add-Ons personally developed:

Search for email address, etc in Orders -- Discontinue Product

Add-Ons installed by others:

View Counter -- Site Monitor -- Image Thumbnailer -- Database Optimizer -- Recaptcha -- Discount Coupons -- Add More Fields

Link to comment
Share on other sites

  • 6 months later...

Not sure if this is unique to our website or not but could do with some help...

 

The way our website is structured is this:

 

1. Image is stored in 'images/product_images/[product_code]/ so an example of an image patch would be 'images/product_images/2000/image.jpg'

2. The database stores the product code (i.e. '2000') and the image filename (i.e. 'image.jpg')

3. The front end of the website is written to look up the product code, find the correct image in the database and find the correct product code in the 'images/product_images' folder.

 

This is causing problems when scanning for unused images because the database is showing 'image.jpg' but the scanner is looking for a reference to the full path.

 

Is it possible to modify the code to remove the directories and/or sub-directories from the images stored in $serverfiles so the code will just look for a reference in the database to 'image.jpg' no matter what the sub-directories are?

Link to comment
Share on other sites

  • 1 year later...

I am not sure I found what I was looking for. Can anyone clarify this addon for me?

 

I'd like it to scan the database for image names associated to products then scan my images folder to match those names. Any image in the images folder which does not match a product image will be removed. Is this what this addon does? Does it show a list of images which have no matches to the product images? 

 

Thanks in advance for your help. 

Link to comment
Share on other sites

  • 3 months later...

I'm running under 2.3.4 w/ bootstrap.  I have taken the 1.8.2 and applied the bug fix.  After the upload I click on the "remove images" and got the following error.

 

Warning: file_get_contents(/home/ladybug3597/public_html/stylesheet.css): failed to open stream: No such file or directory in /home/ladybugXXXXX/public_html/adminXXXX/remove_unused_images.php on line 216

 

I check the line added in the stylesheet and it matches what the step 7 has in the instructions.

 

I clicked on 1 image to see what would happen, then click on move images and it logged me off the admin page.  I checked the unused folder and it is empty. 

 

Any ideas what is happening?

Link to comment
Share on other sites

Fixed the first issue with the stylesheet.


But still can not fix the last error when trying to move items to the unused folder.


Warning: rename(/home/ladybugxxxx/public_html/images/catalog.php,/home/ladybug3597/public_html/images/UNUSED/catalog.php): No such file or directory in /home/ladybugxxxx/public_html/adminxxxx/remove_unused_images.php on line 559

Link to comment
Share on other sites

  • 2 weeks later...

Thought all was working.  Ran into one more problem.  When I click on "Check All Boxes"  you can see the boxes get checked then before you can do anything the screen goes back to the front admin page.  Go back to remove and nothing was done, the images are still there.

 

If I click on each one, and then click moved all works.

Link to comment
Share on other sites

  • 2 months later...

I am having issue with this addon. I have installed this on os 2.3 version with patch. I see that it does not show the correct result in admin section. It shows me 12 images are unused whether fact is that there are hundred of images that are unused in server. It only check the images that are in database and are not in server. It do not scan the images that are in server and are not associated with any product. Can anyone let me know how to see the images that I have in server and do not have any relation to my website products/categories/manufacturer.

 

Thanks in advance for the help..

Link to comment
Share on other sites

  • 10 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...