dfgergrfdegfdg fdgdfgdfgdfgfd
Forum Replies Created
-
Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsThank You Andrea! Worked like a charm!
Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsAndrea, the code you gave me works,but I realized I asked for the wrong thing.
I have 2 fields, ‘Gender’ field ID 2 and ‘Searching for’ field ID 2552.
I need the users gender to automatically populate in the searching for field instead of gender.
This code perfectly brings up the gender in gender field, so I am guessing there is a way to use this to achieve it?
add_action (‘bps_field_before_search_form’, ‘set_default’);
function set_default ($f)
{
if ($f->code == ‘field_224’) // 224 field no. for country
{
// assign the default value
$f->value = ‘India’;
}
else if ($f->code == ‘field_2’) // 2 field no.for gender
{
$user_id = bp_loggedin_user_id ();
if ($user_id != 0)
{
$gender = xprofile_get_field_data (2, $user_id); // 2 fieldID for gender
$f->value = $gender;
}
}
}Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsSorry Andrea,got it working now on the first code!
Thanks for your help! Awesome plugin!
Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsI got this error from the code:
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 1:syntax error, unexpected ‘&’
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsSorry, Please ignore last code,I tried this code and got the error given before.
add_action ('bps_field_before_search_form', 'set_default');
function set_default ($f)
{
if ($f->code == 'field_224') // 224 field ID for country
{
// assign the default value
$f->value = 'India';
}
else if ($f->code == 'field_2') // 2 field ID for gender
{
$user_id = bp_loggedin_user_id ();
if ($user_id != 0)
{
$gender = xprofile_get_field_data (2, $user_id); // field ID for gender 2
$f->value = $gender;
}
}
}Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsThanks Andrea
I Tried this a few times and get the following error.
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 2:syntax error, unexpected ‘&’
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
I did the following:
add_action ('bps_field_before_search_form', 'set_default');
function set_default ($f)
{
if ($f->code == 'field_224') // 224 field no. for country
{
// assign the default value
$f->value = 'India';
}
else if ($f->code == 'field_2') // 2 field no.for gender
{
$user_id = bp_loggedin_user_id ();
if ($user_id != 0)
{
$gender = xprofile_get_field_data (2, $user_id); // 2 fieldID for gender
$f->value = $gender;
}
}
}Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsThanks, totally works now! Appreciate your help!
I was wondering if there is a solution for the following?
I have a gender field and I need the default value in the search bar to be the same as the users gender Us this possible?
Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsSo acording to your code, I would type the following if my field is ‘Country’ abd default value is ‘India”
add_action (‘bps_field_before_search_form’, ‘set_default’);
function set_default ($f)
{
if ($f->code == ‘field_Ciuntry’) // replace 34 with your field ID
{
// assign the default value
$f->value = India;
}
}Sorry not advanced user so just trying to make sure!
Also, I tried above using Snippet plugin and it didn’t work. Although I cannot find the bp-custom.php file in my plugins folder. Just to note, I am using Buddyboss.
Forum: Plugins
In reply to: [BP Profile Search] Default Value in Search FormsOr if I have a search form with shortcode ..ie [bps_form id=44]
Is there a way for it to display results for the country as India, with field hidden in search bar?
Thanks,that works and makes sense!
Just 2 questions:
1) Is it possible to increase avatar size? It seems too small on my test site.
2) When I try and change my avatar or send a message, nothing comes uo, the page only shows my Avatar. BUt on my regular theme works ok. Are there additional widgets I need to create?