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.077 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started