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, 19:38

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  [ 6 posts ] 
Author Message
PostPosted: 3. Sep 2008, 18:46 
Offline

Joined: 22. Aug 2008, 15:21
Posts: 4
Hi,
I think I'm not understanding something about how JFU works, but I cant see how to automatically assign new users a default group?? at the moment I have to manually assign users to a group otherwise they see nothing. How do I set a group to be default? in fact I only need one group anyway though I currently have 2, one for the admin, and the other for everyone else.

Please help
Cheers


Top
 Profile  
 
 Post subject:
PostPosted: 3. Sep 2008, 21:34 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
By default all users not assigned to a profile will be in the default profile. The default is the one without any users.

My intention is that you use JFU on a page only registered users can access. If JFU finds in the config that the user is a a different profile then this profile is used. If not the default profile is used.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 4. Sep 2008, 11:13 
Offline

Joined: 22. Aug 2008, 15:21
Posts: 4
Cool thanks for that, all I needed to do was remove all users from the profile and now all users have that profile. Cheers...

BTW I've now successfully adapted JFU to give all users access only to their own directory, which is automatically generated the first time they try to upload anything. It seems to be working well so I can post how to do this if anyone is interested


Top
 Profile  
 
 Post subject:
PostPosted: 18. Sep 2008, 19:31 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Feel free to post it.

I'll add this feature with a nice frontend in the next version too.

/Michael


Top
 Profile  
 
 Post subject: folder assignment....
PostPosted: 19. Sep 2008, 14:07 
Offline

Joined: 22. Aug 2008, 15:21
Posts: 4
Ok, so first edit the file joomla_flash_uploader.php in the com_joomla_flash_uplaoder folder.

You want to change the showFlashComponent function to look like this...
Code:
function showFlashComponent($id) {
   $user =& JFactory::getUser();          //my mod********************************
    $database = &JFactory::getDBO();
    $row = new joomla_flash_uploader($database);
    $row->load($id);
    if ($row->id == null) { // no profile found or no id!
       HTML_joomla_flash_uploader::wrongId($id);
    } else {
      $uploadfolder = $row->folder;
   
   $uploadfolder = "path/to/files/".$user->username;         //My mod *******************************************

      // we go back to the main folder!
       if ($uploadfolder == "") {
         $folder =  "./../../../..";
       } else {
         $folder =  "./../../../../" . $uploadfolder;
       }

       JFUHelper::setJFUSession($row, $folder);
       unset($_SESSION["IS_ADMIN"]);
       $_SESSION["IS_FRONTEND"] = "TRUE";
       JFUHelper::fixSession();
       HTML_joomla_flash_uploader::showFlash( $row, $uploadfolder );
      
    }
}


Obviously change the path/to/files to something sensible. This will now ignore what you set in the backend and will now point to path/to/files/username

next you need to change the joomla_flash_uplaoder.html.php file in the same directory. Add the following somewhere early in the show flash function.

Code:
   $user =& JFactory::getUser();
      if (!file_exists($realfolder) && $realfolder != "") { //my mod *************************************************
        mkdir($realfolder);
        $output .= 'The destination folder does not exist, creating new folder... ';
        $output .= 'If this is not your first upload then contact an administrator';   
      }



So this checks to see if the folder exists, and if not then it makes it.
Simple!


Top
 Profile  
 
 Post subject:
PostPosted: 5. Nov 2008, 11:45 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
JFU 2.8 RC 1 is available in the forum. This features is now integrated as well! Feel free to try it.

/Michael


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

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 8 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