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 20. Sep 2018, 04:51

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: File deleting problem.
PostPosted: 18. Jul 2011, 13:51 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
Hello,

I'm using TFU 2.14.2 to upload files to TWG webgalley.
I've made some changes when the user uploads a file.
I added a function that check if the files are images, if not it create a 80X80 transparent image and put on it the icon for the specific file and add the file name to this image.
Also, when the user opens a folder in the TFU he doesn't see the images if it's the added images, he sees only the files he uploaded.
This I've done with a function that checks if in folder there is 2 files with the same name, without the extinsion, and if true the filename.png will added to the $exclude_directories.

Ok, now this is working very good for me, but now I have a problem to delete files, when i delete file or files the action is done for the wrong file.
If for example I delete the fourth file in the folder from the TFU, the delete action is done for the fourth file on the server, this 2 file are not the same cause the TFU has some hidden files.
It looks like the delete action is done not by the file name but by the file location in the folder.

I tried to solve it by my self but I just couldn't.
Does someone have any suggestion how to solve it??

Thanks in advance.
Lior Franko


Top
 Profile  
 
PostPosted: 18. Jul 2011, 14:55 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10892
Deletion goes per location because this solves all encoding problems.
So the real problem is that TFU does not see your files.

When do you create them? in a plugin?
When you change a folder the file list should be reloaded and you files are then available as well.

- Michael


Top
 Profile  
 
PostPosted: 24. Jul 2011, 10:50 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
Yes I've created a pulgin that's create the additional images after the upload.

I'm checking now a way to sort the files in a way that all the unnecessary files will listed last and then the "delete by location won't have a problem, does any one have a good idea how to do it?

Thank you,


Top
 Profile  
 
PostPosted: 24. Jul 2011, 12:36 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10892
the files are not the problem. The problem is that they seem not to be visible in the flash but in php and then there is a mismatch. Have you excluded the files you have created somehow?


Top
 Profile  
 
PostPosted: 24. Jul 2011, 13:29 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
$files_list = getDirectoryList($dir);
$withoutExt = preg_replace("/\\.[^.\\s]{3,4}$/", "", $files_list);
$duplicates = array_duplicates($withoutExt);
$withoutExt = array_unique($withoutExt);
foreach($withoutExt as $k=>$v){
array_push($exclude_directories, $v.".png");
}

I added this lines in the tfu_file.php before the read_dir part.


Top
 Profile  
 
PostPosted: 24. Jul 2011, 20:44 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10892
This is the problem - you only changed the exclude_directory for the listing itself but not fir the deletion.
Move this part that is is done for the deletion action and the read dir action.

- Michael


Top
 Profile  
 
PostPosted: 25. Jul 2011, 17:40 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
I'm sorry to bug I didn't understand where to move it.
It's located now between the lines:
clearstatcache();
and:
$size = read_dir($dir, $myFiles, $myDirs, $fix_utf8, $exclude_directories, $sort_files_by_date, $sort_directores_by_date);

Thank you,


Top
 Profile  
 
PostPosted: 25. Jul 2011, 17:47 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10892
no - after

$action = parseInputParameter($_GET['action']);

it has to be done for the delete and the dir action.

does $forbidden_view_file_filter not work for you? There you can use any pattern valid for "fnmatch"


- Michael


Top
 Profile  
 
PostPosted: 25. Jul 2011, 18:10 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
I changed it and it works!
Thank you!!

The $forbidden_view_file_filter is working also but I want to hide the *.png only in some folders not all.
Is there a way to add this parameter per folder? like the config file in the web galley.

Thank you!!!


Top
 Profile  
 
PostPosted: 25. Jul 2011, 22:48 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10892
No - there is not per folder config.

- Michael


Top
 Profile  
 
PostPosted: 26. Jul 2011, 09:11 
Offline

Joined: 10. Jul 2011, 00:57
Posts: 10
Ok,

Thank you for your help.
I'll work with the excluded_files.

Thanks again.


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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