per user paths

Events happening in the community are now at Drupal community events on www.drupal.org.
nelson77bs's picture

Hi all,
i'm going to implement a public site that will offer to the user that register a personal gallery. I use the image module but i find that i can't get a personal image folder on the server (all the files are stored in the folder you choose in filesystem settings). I have to modify the image module? other way to get personal upload folders?

I have already created a function to get the per user upload folder in image_import.module with the following code, but i think pheraps there would be a better way to go...

function _get_image_import_path() {
global $user;
$ipath_root = variable_get('image_import_path', '');
$ipath = $ipath_root . '/' . $user->uid;
if (!is_dir($ipath) && is_dir($ipath_root)) {
@mkdir($ipath_root);
@mkdir($ipath);
}
return $ipath;
}

any advice?

thanks a lot,
nelson

Image

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: