1 luisr Sep 27, 2006 21:26
3 luisr Sep 28, 2006 03: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.
4 blueyed Sep 30, 2006 00:16
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.
5 luisr Sep 30, 2006 00:54
I get NULL as group ID. 8|
6 blueyed Sep 30, 2006 15:23
Oh.. then use
if( $current_User->Group->ID == 1 )
instead (for 1.8.x). The original patch above is for 1.9+.
7 luisr Sep 30, 2006 16:56
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.
8 blueyed Sep 30, 2006 17:05
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.
9 luisr Sep 30, 2006 17:11
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.
10 luisr Sep 30, 2006 17:19
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.
11 blueyed Sep 30, 2006 17:27
Yes, would be the way to go in your case.
12 luisr Sep 30, 2006 18:35
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.