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

Although I found this tool some time ago I just started learning experimenting and building this first component on Monday and now on Thursday afternoon it's already online. Although I already had a working version done with another tool this is much easier to build and at the end you have the freedom to own your own component. Once you know how to use Cook you will boost your productivity as the learning curve is really moderate compared to many other tools.
Giori (Forum)

Get Started