Hi,
I'd like to be able to allow different users of my site to be able to upload images to their own folder under /UserFiles/
Can you tell me I can append a folder to /UserFiles/ dynamically. I'd like to use each user's unique username as the name of the folder so I guess I need to pass this value to config.php.
ie. $Config['UserFilesPath'] = '/UserFiles/' . $user_id . '/';
Can someone tell me how I can do this please?
Thanks,
Andy
I'd like to be able to allow different users of my site to be able to upload images to their own folder under /UserFiles/
Can you tell me I can append a folder to /UserFiles/ dynamically. I'd like to use each user's unique username as the name of the folder so I guess I need to pass this value to config.php.
ie. $Config['UserFilesPath'] = '/UserFiles/' . $user_id . '/';
Can someone tell me how I can do this please?
Thanks,
Andy
RE: personalising the /UserFiles folder using
I use a construct like this:
if($_SESSION['user_type'] == '20') //admin users
{
$fckphp_config['UserFilesPath'] = "/$user_path1" ;
}
elseif($_SESSION['user_type'] == '10') //other users
{
$fckphp_config['UserFilesPath'] = "/$user_path1" ;
}
The $_SESSION['user_type'] is set during logon of the user. I hope this helps.
Kind regards Fred Stuurman.
RE: personalising the /UserFiles folder using PHP
Can you tell me where this code should be put please?
RE: personalising the /UserFiles folder using
You should replace the current :
$fckphp_config['UserFilesPath'] definition with the construct I gave.
Kind regards Fred
RE: personalising the /UserFiles folder using
Can I use a session variable (that I register when a user logs into my web site) to form the unique folder path?
The session variable is called $session_owner_id
ie. can I use the following line within html_editor\editor\filemanager\browser\default\connectors\php\config.php
$Config['UserFilesPath'] = '/UserFiles/' . $session_owner_id . '/';
It's just that when I try this - it doesn't work.
Do I need to do something to enable config.php to be able to read the value of the session variable?
RE: personalising the /UserFiles folder using
in the logon script you do:
$session['owner_id'] = $owner_id;
in config.php you need a;
session_start();
and then you can use the $session['owner_id']
in your script.
Kind regards Fred
RE: personalising the /UserFiles folder using
I was missing the session_start();
I assumed that it had already been started.
Thanks so much for your help,
Andy