Welcome, Guest
Username: Password: Remember me

TOPIC: [FIXED] Delete thumbnail when an image is removed

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

  • tr4ding
  • tr4ding's Avatar
  • Offline
  • Senior Member
  • Posts: 42
  • Karma: 1
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?

Last Edit: 19 Apr 2012 20:06 by admin.
The administrator has disabled public write access.

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

  • molenwal1
  • molenwal1's Avatar
  • Offline
  • Senior Member
  • Posts: 63
  • Thank you received: 17
  • Karma: 3
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 administrator has disabled public write access.
The following user(s) said Thank You: admin, tr4ding

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

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 985
  • Karma: 140
Fixed.


I applied exactly your code.

Many thanks
Coding is now a piece of cake
The administrator has disabled public write access.
The following user(s) said Thank You: tr4ding
Time to create page: 0.101 seconds

Get Started