2 blueyed Sep 28, 2006 00:42

That if statement appears to fail, therefore nothing happens even though I am logged in as administrator and the group ID is 1.
The first if of the added block of code, that is.
Use
pre_dump($current_User->group_ID);
to see if your group is really 1.
Use
pre_dump( gettype($user_FileRoot) );
before
if( $user_FileRoot )
to see, if you get any FileRoot.
I get NULL as group ID. 8|
Oh.. then use
if( $current_User->Group->ID == 1 )
instead (for 1.8.x). The original patch above is for 1.9+.
That worked fine but then it goes and creates a media folder for every registered user no matter their user level. Level 0 users are only allowed to comment on posts and that is the default user level. They do not need a media folder. People allowed to post new messages are level 1 and those are the ones that will have images to use in posts.
Yes.. the problem is that media dirs get created, if the get queried.
The fix would be to have an extra param to User::get_media_dir, let this default to false and call it with "true", if it's used e.g. in the Filemanager itself.
I'll look into having this for 1.9, but for 1.8 you'd have to hack it yourself.
The problem is that I don't know PHP. :( I do know how to change skins and such and can follow the logic to some extent but I cannot go into the actual coding. I do know how to code in Perl but this is very different.
Thanks anyway.
Well not all hope is lost. Looking at the snippet of code above I could probably filter out the level 0 users on the SQL query. I will try that later.
Yes, would be the way to go in your case.
It worked!!! :D
foreach( $DB->get_col( 'SELECT user_ID FROM T_users WHERE user_level != 0 AND user_ID != '.$current_User->ID ) as $other_user_ID )
Thanks a lot for your help.
Add the lines marked with "+" to blogs/inc/MODEL/files/_file.funcs.php. The patch is against CVS HEAD, but is probably alright for 1.8.