Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[FIXED] Delete thumbnail when an image is removed 18 Apr 2012 17:16 #2049

  • tr4ding
  • tr4ding's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 42
  • Thank you received: 0
Hi everybody!!!

Look at this case......when I click on "DELETE ACTION", only the file is deleted from the directory, but thumbnails still remain.....this causes that if I upload a new file, thumnails are not updated (it remains the old one).

Any clues?

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Re: Delete thumbnail when an image is removed 19 Apr 2012 08:02 #2052

I think the cause is in the classes/files.php.
in the //DELETE THUMBS sections this foreach is added:
foreach(JFolder::files($dir) as $file)

When i check the JFolder::files function at docs.joomla.org/API16:JFolder/files there is a default excludefilter:
public static function files($path, $filter = '.', $recurse = false, $fullpath = false, $exclude = array('.svn', 'CVS','.DS_Store','__MACOSX'), $excludefilter = array('^\..*','.*~'))

I works when i change the foreach statement to:
foreach(JFolder::files($dir,'.',false,false,array('.svn', 'CVS','.DS_Store','__MACOSX'),array()) as $file)

I have now emptied the excludefilter, if think only deleting the second array entry is enough.
Molenwal1 Webdesign
www.molenwal1.nl
The following user(s) said Thank You: admin, tr4ding

Please Log in or Create an account to join the conversation.

Re: Delete thumbnail when an image is removed 19 Apr 2012 17:10 #2062

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed.


I applied exactly your code.

Many thanks
Coding is now a piece of cake
The following user(s) said Thank You: tr4ding

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.076 seconds

For starters it's just so easy to design an app in a way that I'm used to i.e. database first then views followed by customization. The fork system is pure brilliance from a developer standpoint as I can override things and still add and update my projects with minimal effort! Truly amazing to be able to build components in Joomla using incremental refinement without having to do everything by hand. Thanks for the great tool! I am so much more productive now than ever and I can't imagine building components any other way!!!!
Dave (Forum)

Get Started