rendered paste bodyglobal $CONFIG;// Main user directoryif ( !is_dir($CONFIG['USERFILES_PATH'].$arrParams[0]) ) { mkdir($CONFIG['USERFILES_PATH'].$arrParams[0], 0777); // the mkdir doesn't always properly set the permissions to 0777 so we're gonna chmod it ourselves chmod($CONFIG['USERFILES_PATH'].$arrParams[0], 0777); chdir($CONFIG['USERFILES_PATH'].$arrParams[0]); $dirs = array('Desktop','Documents','Images','Audio-Video'); $x = 0; while($x != count($dirs)) { mkdir($dirs[$x], 0777); chmod($dirs[$x], 0777); $x++; }}