File sets for users
Permalink
Hello community, was wandering is there an easy way to make sets for users and setup the files to be added to theese sets automaticaly after user uploads them.
I want to make an art community with user pages, so when they upload images they appear in their gallery.
I want to make an art community with user pages, so when they upload images they appear in their gallery.
thanx for reply, I'll try
Hi all
I tried many things, finally i got a quite easy solution, which is fine for me:
The goal:
show a fileset for download on a member page of the actual logged user.
The task contents 2 parts:
1-The Admin part
2-The programmers part (just copypaste, more or less)
****************************************************************
1-The Admin part
1. Login as admin
2. Go to Dashboard - > System & Settings
3. Go to Permission & Access -> Advanced Permissions
If it doesn't say 'Advanced permissions are turned on.'
Set it on & save
4. Go to Permission & Access -> User Permissions
5. Set permissions for Administrators and registered Users
for 'View Users Attribute'
6. Go to Dashboard -> Search Users
7. Add User (dont add him to any group, haven't tested yet)
8. Go to Dashboard -> File Sets
9. Add File Set and name it the same as the just created user name and add it.
10. Click again on the File Set and enable custom permissions for this file set. Save again.
11. Set permissions for administrators and the just created user for
'View Files' &
'Search Files in File Manager'
and all the other permissions you'd like to, but be carefull with
'Edit File Properties'
'Edit File Contents'
*************** UPDATE 2013-03-28 *************************
DON'T FORGET TO TURN ON PUBLIC PROFILES
in -> System & Settings -> LOGIN & REGISTRATION -> Public Profiles
Dashboard -> Full Sitemap turn on <Options> Show System Pages and than, up to you to decide what page each user should see. my solution:
Only Admins see the members page
the user is redirected to his profile page after login
System & Settings -> LOGIN & REGISTRATION -> Login Destination
****************************************************************
2-The programmers part
1. Go to the folder: ROOT/concrete/single-pages
2. Copy the whole 'proflie'-folder to the ROOT-folder
3. Open the view.php in ROOT/single-pages/profile
4. Replace the followig Code
with this code (example without design)
*************UPDATE********************
For downloading any file, instead of showing files in a browser window:
create a download.php with the following code inside:
and in the view.php inside the for-loop create a link similar to this:
***************************************
That's it. Don' forget to put some files in your filesets, before you want to shoot the pc-shooter
****************************************************
with version5.6.1.1 doesn't work anymore, i'll get a new solution
I tried many things, finally i got a quite easy solution, which is fine for me:
The goal:
show a fileset for download on a member page of the actual logged user.
The task contents 2 parts:
1-The Admin part
2-The programmers part (just copypaste, more or less)
****************************************************************
1-The Admin part
1. Login as admin
2. Go to Dashboard - > System & Settings
3. Go to Permission & Access -> Advanced Permissions
If it doesn't say 'Advanced permissions are turned on.'
Set it on & save
4. Go to Permission & Access -> User Permissions
5. Set permissions for Administrators and registered Users
for 'View Users Attribute'
6. Go to Dashboard -> Search Users
7. Add User (dont add him to any group, haven't tested yet)
8. Go to Dashboard -> File Sets
9. Add File Set and name it the same as the just created user name and add it.
10. Click again on the File Set and enable custom permissions for this file set. Save again.
11. Set permissions for administrators and the just created user for
'View Files' &
'Search Files in File Manager'
and all the other permissions you'd like to, but be carefull with
'Edit File Properties'
'Edit File Contents'
*************** UPDATE 2013-03-28 *************************
DON'T FORGET TO TURN ON PUBLIC PROFILES
in -> System & Settings -> LOGIN & REGISTRATION -> Public Profiles
Dashboard -> Full Sitemap turn on <Options> Show System Pages and than, up to you to decide what page each user should see. my solution:
Only Admins see the members page
the user is redirected to his profile page after login
System & Settings -> LOGIN & REGISTRATION -> Login Destination
****************************************************************
2-The programmers part
1. Go to the folder: ROOT/concrete/single-pages
2. Copy the whole 'proflie'-folder to the ROOT-folder
3. Open the view.php in ROOT/single-pages/profile
4. Replace the followig Code
with this code (example without design)
<? $user = new User(); $userId = $user::isLoggedIn(); $userName = $user->getUserName(); /** * File-Set Infos * get the Fileset(s) which the logged User has permission on. */ Loader::model("file_set"); Loader::model('file_list'); Loader::helper('concrete/file'); $fs = FileSet::getByName($userName); $fl = new FileList(); $fl->filterBySet($fs); $files = $fl->get();
Viewing 15 lines of 29 lines. View entire code block.
*************UPDATE********************
For downloading any file, instead of showing files in a browser window:
create a download.php with the following code inside:
$file = htmlspecialchars($_GET['file']); header('Content-Disposition: attachment; filename="'.$file.'"');
and in the view.php inside the for-loop create a link similar to this:
echo '<a href="/download.php?file='.$f->getFileName().'" >download '.$f->getFileName().'</a>';
***************************************
That's it. Don' forget to put some files in your filesets, before you want to shoot the pc-shooter
****************************************************
with version5.6.1.1 doesn't work anymore, i'll get a new solution
whats going on with the permissions in 5.6.1.1?!
I did'nt try it yet, just kept it away from the life(5.6.1.2) version, but if you have time, try with this tutorial and if you like, give me some news if it works
.....
OK I just forgot to enable PUBLIC PROFILES!!!!!¨
works again like a charme
.....
OK I just forgot to enable PUBLIC PROFILES!!!!!¨
works again like a charme
Nothing to do with the recent posts on permissions, but getting back to the original topic of this thread, I created Magic Data to solve this kind of problem. For example, it can be used to change (on the fly) the file set a gallery or slider block displays to show a set named in a user attribute of the current viewer or of the page owner.
http://www.concrete5.org/marketplace/addons/magic-data/...
http://www.concrete5.org/marketplace/addons/magic-data/...
ok for 35$
think i'll make a package out of it and put it in the market too, maybe for 3.5$ ?
think i'll make a package out of it and put it in the market too, maybe for 3.5$ ?
You might want to try this addon:
http://www.concrete5.org/marketplace/addons/itrio-user-folders/...
(although I'm not sure if that's exactly what you're asking for)
If I were building this out myself, I wouldn't use file sets though -- instead I'd make a single_page that lets registered users upload photos, and displays that user's photos on that page (the same page would work for all users -- it would have a sub-path that could be the user id for example, which would get passed to the single_page controller action and then you could query that user's photos and display them properly).
So I guess the answer to the question of "is there a simple way to do this" is unfortunately "no" (at least that I'm aware of).
-Jordan