I dont really want to learn MODX for this one project, if I had my way I'd rebuild the whole thing in ASP
It seems crazy that you can create a members section and allow them to write text but they cannot upload images even when you have given them load privlages?
Would it not make sence to give/make them a folder that they have access to that they can upload to?
-
☆ A M B ☆
- 24,524 Posts
-
☆ A M B ☆
- 1,780 Posts
You can do that, with Media Sources and permissions.
http://rtfm.modx.com/revolution/2.x/administering-your-site/media-sources
Limit your users to a specific media source, although you still need to create the new directory for each user. You could use a snippet to create a new directory in the media source when the user is created.
This is fairly detailed, but it appears to accomplish the goal (just add a special Media Source for those users):
https://forums.modx.com/thread/?thread=44067&page=1
I found this interesting but it uses Gravatar instead of allowing file uploads:
http://www.leofec.com/modx-revolution/robust-personal-profile-created-and-edited-only-by-specific-user.html
-
☆ A M B ☆
- 24,524 Posts
I just spent most of the morning playing with Bruno's migxResourceMediaPath snippet. A little fiddling and now each user has his own directory automatically. Add this to the snippet at the end of all the $path str_replace lines
if ($user = $modx->user) {
$path = str_replace('{username}', $modx->user->get('username'), $path);
}
then use this for your media source's path and URL (both are relative)
[[migxResourceMediaPath? &pathTpl=`assets/images/{username}/` &createFolder=`1`]]
I cannot find any migxResourceMediaPath snippet?
its included with the MIGX - package, but you can create a simplyfied version, which just handles the user-specific part
I dont really want to learn MODX for this one project, if I had my way I'd rebuild the whole thing in ASP
perhaps, you should ask someone, who knows MODX, todo that part for you.
Think, that should be faster, than rebuilding the whole thing in ASP or learning MODX