is it possible to set the config.php using the drupal shorthands such as %u ?

im trying to think of a way of enabling each of my users with a private folder for his media&files.

Comments

wwalc’s picture

In modules\fckeditor\fckeditor\editor\filemanager\connectors\php\config.php after including filemanager.config.php you have access to Drupal session/variables.
You can't use the Drupal shorthand in config file directly, however you can use the $user object.
For example to get user id, use $user->uid.

Actually, if you really want to use shorthand notation, there is a way to do it, simply assign the shortened path and then replace it with the correct values:

$Config['UserFilesAbsolutePath'] = "/path/to/files/%u";
$Config['UserFilesAbsolutePath'] = strtr($Config['UserFilesAbsolutePath'], array("%f" => file_directory_path(), "%u" => $user->uid, "%b" => base_path(), "%d" => $_SERVER['DOCUMENT_ROOT']));
Jorrit’s picture

Status: Active » Closed (fixed)