Author Topic: Product Images - Clean up unused images ?  (Read 4045 times)

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #15 on: May 17, 2016, 13:42:08 pm »
Hi shimon,

The tool is GNU/GPL, so you can modify it for your needs.
Remember to send back your changes ;)

Patrick

kalestud

  • Beginner
  • *
  • Posts: 13
    • Vintage Hatter
  • VirtueMart Version: VM 3.2.2 on Joomla 3.7.4
Re: Product Images - Clean up unused images ?
« Reply #16 on: June 11, 2016, 13:25:54 pm »
The plugin from Studio42 really works wonders!
Two additions to clear things up about this plugin:

1 After installing the plugin, as usual, go to your plugins menu and search for 'vmmedia'. Enable the vmmedia_clear plugin to allow itself to show in the Virtuemart Media Files section.

2 Go to Virtuemart > Media Files and first apply a filter to the shown results from the pulldown (e.g. Product, Product Category, Manufacturer or Vendor). Then click the clear button to remove obsolete files or database entries.

That description would help ;-)

Henrik Holm Nielsen

  • Jr. Member
  • **
  • Posts: 68
Re: Product Images - Clean up unused images ?
« Reply #17 on: September 13, 2016, 10:22:24 am »
Hi,

I tried installing Studio 42's plugin, and have enabled it - but the buttons never show?
As mention here, I have also tried changing the filter to Products or Product Categories, but still no buttons?

Any suggestions?

We use VM 3.0.16 and J3.6.2 on PHP 7.0.9 (and now also just tried PHP 5.6.24 as a test - same result).

Cheers
/Zorroson :)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Billigt og professionelt design af din hjemmeside | Brug for en billig, flot og professionel hjemmeside?

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7617
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Product Images - Clean up unused images ?
« Reply #18 on: September 13, 2016, 12:29:53 pm »
Hmm .. just tried and can confirm I can't get the buttons to show either

It used to work not sure what changed

VM3.0.16/J3.6.2/php7
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #19 on: September 13, 2016, 13:08:19 pm »
Hi henrik,
I tested on a fresh install :
VM 3.0.14 and joomla 3.5 : OK
VM 3.0.16 and joomla 3.5 : OK
VM 3.0.16 and joomla 3.6 : OK
VM 3.0.16 and joomla 3.6.2 : OK
The direct link to see the 2 buttons is YOURSITE/administrator/index.php?option=com_virtuemart&view=media
If you need a better tool, i have now added the feature in Vm Be Pro http://shop.st42.fr/en/products/vm-be-pro-batch-product-edit.htm and delete only selected files.
Regards,
Patrick

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #20 on: September 13, 2016, 13:10:55 pm »
Hmm .. just tried and can confirm I can't get the buttons to show either

It used to work not sure what changed

VM3.0.16/J3.6.2/php7
I don't tested php7. But the code is not so complex to have php dependencies

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #21 on: September 13, 2016, 13:14:51 pm »
I found a potential way to not see the buttons.
if(!$user->get('isRoot') ) return; check for administrator, so if you are not super user in Joomla, you don't see the buttons.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7617
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Product Images - Clean up unused images ?
« Reply #22 on: September 13, 2016, 13:31:16 pm »
Hi Patrick,

yes.. with

#if(!$user->get('isRoot') ) return;

they show -- but am definitely a superuser although not shop owner or vendor

logged in as shop owner / super admin they still don't show with the above code in place  :(

apparently broken in 3.6.2

https://groups.google.com/forum/#!topic/joomla-dev-cms/A5GeOPcM86M



GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #23 on: September 13, 2016, 13:57:15 pm »
Sometime, you have stupid Joomla coder. Same problem as mail bug, minor release and remove statut of a value used since Joomla 1.5 that was universal !
I use this in some other case, so now i have to modify other codes too for a so little unneeded change.

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #24 on: September 13, 2016, 14:21:46 pm »

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 7617
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Product Images - Clean up unused images ?
« Reply #25 on: September 13, 2016, 15:15:13 pm »
Quote
Sometime, you have stupid Joomla coder. Same problem as mail bug, minor release and remove statut of a value used since Joomla 1.5 that was universal !

Can only agree... I feel your pain...  :)
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

razor7

  • Jr. Member
  • **
  • Posts: 309
    • MGSCreativa - Professional VM!
Re: Product Images - Clean up unused images ?
« Reply #26 on: September 15, 2016, 13:59:05 pm »
Hi! the plugin thingy did he job!
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

razor7

  • Jr. Member
  • **
  • Posts: 309
    • MGSCreativa - Professional VM!
Re: Product Images - Clean up unused images ?
« Reply #27 on: September 15, 2016, 14:04:58 pm »
Hi! Is it possible to add a new function to remove unused media entries (and files) that are not assigned to any product or cat or anything?
MGS Creativa - VirtueMart Payment Plugin Experts
http://www.mgscreativa.com

Take a look at our downloads section for VirtueMart payment plugins and mouch more!
http://www.mgscreativa.com/en/online-store

Studio 42

  • Contributing Developer
  • Full Member
  • *
  • Posts: 2336
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3.0.x.y
Re: Product Images - Clean up unused images ?
« Reply #28 on: September 15, 2016, 16:19:31 pm »
Hi! Is it possible to add a new function to remove unused media entries (and files) that are not assigned to any product or cat or anything?
You have 2 button, one remove the entries, one remove the files

Else to search and check files before and select what you want to remove
Quote
If you need a better tool, i have now added the feature in Vm Be Pro http://shop.st42.fr/en/products/vm-be-pro-batch-product-edit.htm and delete only selected files...
Regards,
Patrick

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9373
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Product Images - Clean up unused images ?
« Reply #29 on: September 29, 2016, 15:49:45 pm »
I found a potential way to not see the buttons.
if(!$user->get('isRoot') ) return; check for administrator, so if you are not super user in Joomla, you don't see the buttons.

Please use instead if(!vmAccess::manager('media.delete')){

It checks directly if the user is superadmin or has the rights to delete media. Additionally your plugin will also work in WP. Greets
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/