Node images path with variables - how to use them?

cyc - June 18, 2009 - 09:51
Project:Node Images
Version:6.x-2.1
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Node images path setting have a possibility to add variables as %uid, %username, but directories HAVE TO EXIST prior to using this feature.
This makes it useless in large sites with many users - e.g. admin would have to manually create hundreds of directiories with usernames:-(

or maybe I'm missing something?..

I would like to have something like that:
sites/default/files/user_pictures/%username/node_images/

this will help to keep order in all user files, uploaded via other modules

is it possible or not?

#1

hozt - June 25, 2009 - 14:37

That looks like it should work. You would have to create the user_picture directory and make sure it the server can write to the directory. I am doing something similar with the %username path and it does get created when images are uploaded. I am not sure if you have node_images as another sub-directory, but it may not be needed.

#2

cyc - June 26, 2009 - 12:59

My point is I would like node images module to check if some subdirs already exists and create some if not.
E.g. for user 'admin':

If 'sites/default/files/user_pictures/admin' path doesn't exist, create it, as well as the following 'node_images' part

If 'sites/default/files/user_pictures/admin' already exists, only add 'node_images' part at the end

In both cases images should be placed in 'sites/default/files/user_pictures/admin/node_images/' subdir.

Is it possible via SMALL module code modifications?

 
 

Drupal is a registered trademark of Dries Buytaert.