Skip to content

Instantly share code, notes, and snippets.

@cash
Created September 6, 2010 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cash/567591 to your computer and use it in GitHub Desktop.
Save cash/567591 to your computer and use it in GitHub Desktop.
Get user's data directory in Elgg 1.7
<?php
/**
* This is just a quick hack to get the data directory for a user
*/
// load engine - this assumes the script has been put in the root directory of Elgg
require_once(dirname(__FILE__) . "/engine/start.php");
global $CONFIG;
// enter the username of the user here
$username = 'henry';
$user = get_user_by_username($username);
if (!$user) {
echo "unable to get the user $username";
}
$time_created = date('Y/m/d', $user->time_created);
$dir = "{$CONFIG->dataroot}$time_created/$user->guid";
echo "This user's new data directory in 1.7 is $dir";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment