Posted: Wed Oct 15, 2003 2:51 pm
Ok, actually the setting was ignored (because of NULL value) only in the memberlist. For other spot, the $userdata[]/$view_userdata[] array is used, and it is correctly filled. The users table field value is not changed on purpose, to avoid to process all the users table as long as it isn't necessary. The users row will be really updated the next time the users will be, but the value of the users table field is not necessary to take care of this overwrite.
I had to enhance the sql def classes definition to take care of this settings (that's the beauty of this way to proceed : quite all are parameters
), so pick up this new definition in order to replace the $classes_fields array definition in profilcp/def/def_userfields.php (don't be too frightened by the sql definition itself : the admin tool provide it with only filling the three fields
) :
I had to enhance the sql def classes definition to take care of this settings (that's the beauty of this way to proceed : quite all are parameters


Code: Select all
//--------------------------------------------------------------------------------------------------
//
// $classes_fields array
//
// key = name of the class,
//
// config_field : the config value field set by the admin to force the usage of the class,
// admin_field : the users table field set by the admin to restrict to a particular user the class display,
// user_field : the users table field set by the user (preferences) to restrict the class display,
// sql_def : sql definition of the condition field
//
//--------------------------------------------------------------------------------------------------
$classes_fields = array(
'email' => array(
'config_field' => 'allow_viewemail',
'admin_field' => 'user_allow_email',
'user_field' => 'user_viewemail',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewemail] <> 0 OR [board.allow_viewemail_over] <> 1 ) AND [USERS].user_allow_email = 1 AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_viewemail = 1 OR ([board.allow_viewemail] = 1 AND [board.allow_viewemail_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_viewemail = 2 OR ([board.allow_viewemail] = 2 AND [board.allow_viewemail_over] = 1) ) ) ) )',
),
'generic' => array(
'config_field' => '',
'admin_field' => '',
'user_field' => '',
'sql_def' => '',
),
'messangers' => array(
'config_field' => 'allow_viewmessengers',
'admin_field' => 'user_allow_messanger',
'user_field' => 'user_viewmessanger ',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewmessengers] <> 0 OR [board.allow_viewmessengers_over] <> 1 ) AND [USERS].user_allow_messanger = 1 AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_viewmessanger = 1 OR ([board.allow_viewmessengers] = 1 AND [board.allow_viewmessengers_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_viewmessanger = 2 OR ([board.allow_viewmessengers] = 2 AND [board.allow_viewmessengers_over] = 1) ) ) ) )',
),
'pm' => array(
'config_field' => 'allow_viewpm',
'admin_field' => 'user_allow_pm',
'user_field' => 'user_viewpm',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewpm] <> 0 OR [board.allow_viewpm_over] <> 1 ) AND [USERS].user_allow_pm = 1 AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_viewpm = 1 OR ([board.allow_viewpm] = 1 AND [board.allow_viewpm_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_viewpm = 2 OR ([board.allow_viewpm] = 2 AND [board.allow_viewpm_over] = 1) ) ) ) )',
),
'real' => array(
'config_field' => 'allow_viewreal',
'admin_field' => 'user_allow_real',
'user_field' => 'user_viewreal',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewreal] <> 0 OR [board.allow_viewreal_over] <> 1 ) AND [USERS].user_allow_real = 1 AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_viewreal = 1 OR ([board.allow_viewreal] = 1 AND [board.allow_viewreal_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_viewreal = 2 OR ([board.allow_viewreal] = 2 AND [board.allow_viewreal_over] = 1) ) ) ) )',
),
'viewonline' => array(
'config_field' => 'allow_viewonline',
'admin_field' => '',
'user_field' => 'user_allow_viewonline',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewonline] <> 0 OR [board.allow_viewonline_over] <> 1 ) AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_allow_viewonline = 1 OR ([board.allow_viewonline] = 1 AND [board.allow_viewonline_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_allow_viewonline = 2 OR ([board.allow_viewonline] = 2 AND [board.allow_viewonline_over] = 1) ) ) ) )',
),
'webdisplay' => array(
'config_field' => 'allow_viewwebsite',
'admin_field' => 'user_allow_website',
'user_field' => 'user_viewwebsite',
'sql_def' => '[USERS].user_id = [view.user_id] OR ( ( [BUDDY_MY].buddy_ignore <> 1 OR [BUDDY_MY].buddy_ignore IS NULL ) AND ( [board.allow_viewwebsite] <> 0 OR [board.allow_viewwebsite_over] <> 1 ) AND [USERS].user_allow_website = 1 AND ( [BUDDY_OF].buddy_visible = 1 OR ( [USERS].user_viewwebsite = 1 OR ([board.allow_viewwebsite] = 1 AND [board.allow_viewwebsite_over] = 1) ) OR ( [BUDDY_OF].buddy_ignore = 0 AND ( [USERS].user_viewwebsite = 2 OR ([board.allow_viewwebsite] = 2 AND [board.allow_viewwebsite_over] = 1) ) ) ) )',
),
);