Hello ive installed the mod which works really well for admin but not for users! i mean i used 0 as default for the textarea used right name and stuff but it still does not remember the collapsed categories for user. do you have an idea?
i tried making the textarea visible for edit in profil and it keeps beeing on 0 if i collapse a category (for user i mean not for admins)
sorry for my bad english im belgian :p
edit : well indeed it works if do one setting myself when the field is visible in profile (i mean if i go to my profile and set the field to f.e. 3, it works and keep working but the first setting cant be done automatically! : /)
one more edit : it seems that the mod does not aumatically write in the db i mean i ve got four test users and only 3 are in the profile_fields_data table. (those three are the one for which i made settings myself)
user_id pf_fcol
2 [BLOB - 2 o]
53 [BLOB - 0 o]
54 [BLOB - 0 o]
you see i dont see the fourth user : /
well i guess it shoukd write in that table at registration should it? dunno plz help
So my solution is : there should be a if/else somewhere that insert into profile_fields_data table 0 if there is no value for the user (but i dont know how to :p)
ok fixed it :
Code: Select all
function get_user_collapse()
{
global $user;
if (!($user->data['is_registered']))
{
return(array());
}
else
{
$user->get_profile_fields($user->data['user_id']);
$collapse_list=$user->profile_fields['pf_fcol'];
if(!isset ($collapse_list))
{
$user_id=$user->data['user_id'];
mysql_query("INSERT INTO profile_fields_data VALUES('$user_id', '0')");
}
$collapse_array=explode(',',$collapse_list);
if (is_array($collapse_array))
{
return($collapse_array);
}
else
{
return(array());
}
}
}
if someone could translate my query into a good phpbb query it would be great
here is the query that be translated
if(!isset ($collapse_list))
{
$user_id=$user->data['user_id'];
mysql_query("INSERT INTO profile_fields_data VALUES('$user_id', '0')");
}