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 29. Mar 2024, 01:17

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
 Post subject: Howto 16 Session for JFU
PostPosted: 12. Nov 2012, 09:34 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
Hello and thanks a lot for JFU!

I would like to set the upload-dir different in each joomla-article. I tried Howto16, but it did not work. I got the message, that the upload dir is not set or deleated. I guess it works different within Joomla. Do you have any idea how I can do this?

The easiest way would be, if I could set the upload-dir right in the plug-in code (e.g. {jfuploader type=0 id=2 mydir=images/camps/tt2 securitytoken=xy}

David

PS: I use Joomla 2.5.7 and JFU 2.17


Top
 Profile  
 
PostPosted: 12. Nov 2012, 10:36 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
currently you have to use a different profile for each article.

The problem with allowing the url at the plugin code is that everyone who can change the page can get access to other folders as well. So it should only be an option that has to be allowed explicitly.

Best,
Michael


Top
 Profile  
 
PostPosted: 12. Nov 2012, 10:47 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
Okay, then I'll do it with the profiles. Thanks for the answer!

Do you see a chance, that the dir in den plug-in code will be available anytime?

For our project only co-workers have access to change the articles, so that wouldn't be a problem. For security-reasons it might be an idea to set a folder in the plug-in as the main upload-folder (e.g. "images/upload/"). And then I can only choose folders within that main-folder in the plug-in code (e.g. mydir=aa that would be "images/upload/aa"). So no one can get himself access to the whole page dir.


Top
 Profile  
 
PostPosted: 12. Nov 2012, 11:20 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
The problem is not the code. this is easy to do.

but even when you assign one aa and the other one bb the one from aa can, if he has the rights change aa to bb and gets access this way.
An option could be added that the parameter is read but then this should only be used in an environment where everyone trusts each other...

Best, Michael


Top
 Profile  
 
PostPosted: 12. Nov 2012, 13:04 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
Yes, sure. In our project no user has editor rights - only the administrators, who have full access anyway.


Top
 Profile  
 
PostPosted: 12. Nov 2012, 13:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Then this would be possible to implement. You could do the changes directly in the plugin.

Best,
Michael


Top
 Profile  
 
PostPosted: 12. Nov 2012, 16:38 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
Can you give me a hint, how to implement this?

I allready insert on line 80:
Code:
       preg_match ( '/{jfuploader.*dir=([\w_-]+).*}/', $row->text, $treffer );
        if (isset($treffer[1])) {
           $dir = $treffer[1];
         } else {
           $dir = '';

And changed line 90 to.
Code:
      echo '<!-- JFU type: \'' . $selector . '\' id: \'' .  $id . '\' dir: \'' .  $dir . '\' -->';   

Now, where can I set $dir as my uploadfolder?


Top
 Profile  
 
PostPosted: 12. Nov 2012, 16:42 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
look for
$uploadfolder = $row->folder;

below of that is a lot of done that is done when using a master profile! If you don't have enabled that you can simply add this there.

I would add a little bit more logic that the folders are automatically created like I do for the master profiles.
If the dirs do exist simply add the folder at the line I have written.

Best, Michael


Top
 Profile  
 
PostPosted: 12. Nov 2012, 18:24 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
I tried ... and failed. Guess I'm still a rookie.

My plug-in code looks like that: {jfuploader type=0 id=2 dir=images/aa/bb/cc securitytoken=xy}

How can I get the dir parameters from the code to $uploadfolder?

Thanks for your help!


Top
 Profile  
 
PostPosted: 12. Nov 2012, 20:33 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
/ is not part of the regular expression.
I would actually not allow a full path here but only a relative one to the one of the profile.

Use echo that you see an output at different steps.

Best, Michael


Top
 Profile  
 
PostPosted: 12. Nov 2012, 22:45 
Offline

Joined: 12. Nov 2012, 09:21
Posts: 6
It works now perfectly. Thank you for encouraging me to try it myself.
David


Top
 Profile  
 
PostPosted: 12. Nov 2012, 23:06 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
;). You are welcome.

Best,
Michael


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 17 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