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 23. Oct 2017, 12:00

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 17. Jun 2011, 14:37 
Offline

Joined: 23. Dec 2010, 21:01
Posts: 16
Hi Michael,

Is there a way to reset or reload the Uploader so that it moves back up to the main directory after a folder is deleted inside a deeper folder?

Brief explanation of what I'm doing ...

My images are loaded into folders by the Country in which they were photographed.
The Country folder is automatically created according to the country name selected in a drop down menu when the user uploads the image.
I also have my thumbnails automatically placed inside that country folder.

I have created an "_after_process_file" plugin (which you already helped me with) that deletes the thumbnails inside the country folder if a user deletes an image.
Then the plugin checks to see if that thumbnails folder and country folder are empty, if yes, then it deletes both the thumbnails folder and the country folder. This way I wont have a lot of empty country folders if the user is deleting images.
When the country folder is automatically deleted, I get the status message "The remote folder does not exist or was removed." which I understand, because the user is still inside that directory.

What I need to do, is after that folder is automatically deleted, is to have the Uploader reset or move back up to the starting directory, so the user is not confused. I want them to be automatically taken back to the starting point.

Does this make sense? I explored some of the functions in the tfu_helper and tfu_file. I found "resetSessionTree()" and "change_folder" functions, but was not successful in doing anything with them.

Any suggestions would be greatly appreciated! :)

Tracy

Joomla 1.6.3
JFU 2.14
Server: localhost / development site


Top
 Profile  
 
PostPosted: 17. Jun 2011, 15:10 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10499
This does not help.

if you delete a directory with the flash I go one step higher. Do you want to do this or to the main directory the user initaly started?

If you delete a file you would have to set the working dir to the main dir. The main user dir and the current dir is stored in the session. So it is no problem to set the directory you like (even in the plugin).

the main dir is $_SESSION["TFU_ROOT_DIR"]
the current: $_SESSION["TFU_DIR"]

- Michael


Top
 Profile  
 
PostPosted: 17. Jun 2011, 19:11 
Offline

Joined: 23. Dec 2010, 21:01
Posts: 16
Hi Michael, I want them to be returned to the main directory the user initially started in (which is the top of their user directory).

I have a function in my plugin which removes the Country folder if there are no more images left in there. It is at that point I want to return them to the top directory.

So my function reads:

if ($removeFolders) { // next reset working directory back to top?

??? then what code goes here to reset session to: $_SESSION["TFU_ROOT_DIR"];

}

Thanks!
Tracy


Top
 Profile  
 
PostPosted: 17. Jun 2011, 19:12 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 10499
$_SESSION["TFU_DIR"] = $_SESSION["TFU_ROOT_DIR"];


Top
 Profile  
 
PostPosted: 17. Jun 2011, 19:38 
Offline

Joined: 23. Dec 2010, 21:01
Posts: 16
Yay! You are the best! Thanks :D


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 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:
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO