PDA

View Full Version : Change directory for users


vanroojdotcom
04-02-2009, 01:38 PM
Hi there:

I've located this line of code in the config.php file (when uploading images)

$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image/' ;



Which creates an 'image' directory when an image is uploaded:

example.com/userfiles/image/shutterstock_948326.jpg




If I change the setting to = $Config['UserFilesPath'] . 'newfolder/' ;

It creates a 'newfolder' directory when an image is uploaded:

example.com/userfiles/newfolder/shutterstock_948326.jpg


Now the interesting thing is that you can only see the relevant image in the uploaded to server window depending on the settings in the file. And so here is the question:




How can I change the 'image'/ setting to a variable setting depending on a user's ID in the database... something like below would be great

$Config['FileTypesPath']['Image'] = $Config['UserFilesPath'] . 'image.echo $row_rstVisitor['VisitorID']/' ;



Which would hopefully create the address

example.com/userfiles/image123/shutterstock_948326.jpg


Any ideas?

Many thanks
vanrooj

Ray Borduin
04-02-2009, 01:42 PM
Store the directory as a session variable and refer to the session variable as the path. That way you wouldn't need the rstVisitor recordset on each page.