Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 24. Nov 2024, 09:25

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: 2. Mar 2009, 14:27 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
I'd like TinyWebGallery not to show my folder.jpg files as album pics. Is it possible? I've seen I can exclude directories based on name using an additional variable... is there anyway to do the same, but with files?

Thank you very much.


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 15:38 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
you have to modify

is_supported_image in inc/filefunctions.inc.php to do this. I already have some exceptions for png. Simply do this for jpg as well.

I add this to my todo list because then I can define the exclude_images I use as well and don't have them in the code.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 17:08 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
Thanks.

I've modified the function this way:

Code:
function is_supported_image($image)
{
   $image = strtolower ($image);
   return preg_match("/.*\.(jp)(e){0,1}(g)$/", $image) ||
   preg_match("/.*\.(gif)$/", $image) ||
    (preg_match("/.*\.(png)$/", $image) && $image != 'folder.png' && $image != 'private.png' && $image != 'watermark.png'
     && $image != 'watermark_big.png' && $image != 'back.png' && $image != 'Folder.jpg') ;
}


But Folder.jpg images are still shown... Is TinyWebGallery doing any kind of cache I have to erase to see changes? I only see Image cache...


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 17:18 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
twg does a lot of caching (see http://www.tinywebgallery.com/en/faq.php#h43) But in you case the code is simply wrong ;).

you have added it to the png exclude files. you have to add this to the jpg part of the check.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 17:25 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
Oops! :) It's too long since I didn't do anything under php, and definetely, today it's not MY day... :P

Right code:

Code:
function is_supported_image($image)
{
   $image = strtolower ($image);
   return (preg_match("/.*\.(jp)(e){0,1}(g)$/", $image)  && $image != 'Folder.jpg') ||
   preg_match("/.*\.(gif)$/", $image) ||
    (preg_match("/.*\.(png)$/", $image) && $image != 'folder.png' && $image != 'private.png' && $image != 'watermark.png'
     && $image != 'watermark_big.png' && $image != 'back.png') ;
}

Working like a charm...

Thank you. It worths paying... :) I'll do it ASAP.


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 17:44 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
Oops... I was wrong... still not working... :( Will keep on investigating.


Top
 Profile  
 
 Post subject:
PostPosted: 2. Mar 2009, 17:48 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
click on the bandwidth icon to reset the internal caches.

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 19. Mar 2009, 09:46 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
Ok... After some time I've come back to this issue, and found what was happening. I added "Folder.jpg" as not supported using above code, but didn't see that before the matching line, there was a "lowercase" conversion, so "Folder.jpg" didn't match.... :) Just changed to "folder.jpg" and my folder preview images have just gone from normal browsing.

Thank you for your help anyway!!!

bye!


Top
 Profile  
 
 Post subject:
PostPosted: 9. Feb 2010, 18:00 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
I've just upgraded from 1.7.7 to 1.7.8.1, but didn't you've added some piece of config to do this without having to touch php code... did you?

Thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: 9. Feb 2010, 18:05 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I did.

Use

$exclude_images[]='folder.jpg';
in your my_config.php

- Michael


Top
 Profile  
 
 Post subject:
PostPosted: 10. Feb 2010, 14:28 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
That's great... :)

I'll try.

Thanks a lot.


Top
 Profile  
 
 Post subject:
PostPosted: 11. Feb 2010, 13:22 
Offline

Joined: 2. Mar 2009, 13:36
Posts: 16
Hi!

It's working. Just point out that you've got to be careful with upper/lowercase. Filenames are converted to lowercase before checking this variable, so if you want to ignore "Folder.jpg", you have to configure "folder.jpg"... otherwise it won't match.

bye!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy