Still having problems with this.
I want to modifying the snippet slightly so the user image is uploaded to my new directory. But hit a slight problem. I think what is happening is the image is being uploaded to the folder before the folder is actually created as if i create the folder before hand the image uploads fine to that directory.
The code i have modified is on line 2600
// Output
$userImageFilePath = $modx->config['base_path'].'assets/snippets/webloginpe/userimages/'.str_replace(' ', '_', strtolower($currentWebUser['username'])).$ext;
I’ve changed it to:
$newImageLocation = $modx->config['base_path'].'assets/comp/'.str_replace(' ', '_', strtolower($currentWebUser['username']));
// Output
$userImageFilePath = $newImageLocation.'/'.str_replace(' ', '_', strtolower($currentWebUser['username'])).$ext;
I had to re define the image location folder as the variable $webUserDir i had defined earlier on line 601 wasn’t being recognised. Not sure what I need to do be able to use them here as well. I also know i have to changed the other lines of code for the URL ect but just want to get this working first.
I’ve also tried adding the code to create new directory just above this code but still no luck. I thought PHP processed code in order as in if the dir creation is first then that will be created then it would do the next line of code which is to upload the image.
Is there no one out there who has successfully modified webloginpe to allow multiple images/files.
Ben