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

Amazing Tool !
And only tool I know that allows complete Scaffolding in terms of component creation. It really saves loads of time (actually much more than that). Simple architecture enables quick and painless changes at any time. Code is clean and consintent. It's just... what's the word... neat! :) Great work! You should definetely try this one!

pi_wo (JED)
         

Get Started