This question has been answered by BobRay. See the first response.
/* Path of containing folder - make sure it ends in a trailing slash */
$path = MODX_ASSETS_PATH . 'myDirs/';
$id = $modx->user->get('id');
if (! is_dir($path . $id)) {
mkdir($path . $id);
}If it's the current user you're doing this for, this should work:
/* Path of containing folder - make sure it ends in a trailing slash */ $path = MODX_ASSETS_PATH . 'myDirs/'; $id = $modx->user->get('id'); if (! is_dir($path . $id)) { mkdir($path . $id); }
return true;
Does the hook end with this?forgot to put that...
return true;
What snippet has the ID of 47? You need to find out where in_array() is being called (it should be around lines 30-40 of that snippet) and where the second argument comes from.