base directory
-
Hi, love your plugin. Any chance that we can get more than 5 base directories?
-
Sub attribute extends base directory. There’s no way you need more than one. 5 is a placebo.
thanks
No prob.
ok got that to work but how would I designate a particular username that is say a contributor to be able to upload files to that sub directory only? Let’s say I placed 3 sub attributes on the same page to upload to and based on who logs in that attribute will be the only one that appears?
Is it based on user role, or user name or what?
well each user would be a contributor but we will have 3 contributors to upload files to three different sub directories.
for user role:
[fileup sub="sub1" showto="administrator,editor"][fileup sub="sub2" showto="author"][fileup sub="sub3" showto="subscriber"]If it’s based on a specific user, you can create custom user-meta for your users. So, create a user-meta called, for example, “fileaway-subdir”, then for the relevant users, set the value of that user-meta to be the name of the sub-directory. E.g., users 1, 5, and 25: fileaway-subdir would be “sub1”, but for users 2, 3, 4, and 75: fileaway-subdir would be “sub2”. Then in your shortcode, you simply do this:
[fileup sub=”path/to/fa-usermeta(fileaway-subdir)”]
Then whoever is logged in will have an upload directory pointing to whatever the value is for their user-meta key.
Fixed typo:
[fileup sub=”path/to/fa-usermeta(fileaway-subdir)”]I’ll give it a whirl…thanks!
Or, if it’s simply three contributors, you can name the subdirectories for their user-id or their username or their first and last name (one-word lowercase), and do this:
[fileup sub=”path/to/fa-userid”] or [fileup sub=”path/to/fa-username”] or [fileup sub=”path/to/fa-firstlast”]
or a combo: [fileup sub=”fa-user-id_fa-firstlast”] or whatever you want.
ok that will work
Fixed a typo in that last comment too. All the instructions on these “dynamic paths” options are in the tutorials tab.
So while referencing fa-username and renaming the directory to that respective username does work. However, when logged in as admin I cannot see the upload buttons. I tried adding showto=administrator but then neither works.
So is there a way to allow both the user that is logged in access to that directory and the admin to everything?
Yes:
[fileup hidefrom=”administrator” sub=”fa-username”][fileup showto=”administrator”]
that only allows the admin to see base 1 but not base 2 or 3. A destination dropdown appears and only base 1 directory is listed.
The topic ‘base directory’ is closed to new replies.