Forum Replies Created
-
Hi hnla, I personally like the way I’ve written it, I find it far easier to maintain the code and helps me be consistent throughout
Hi hnla, thanks for the reply, after a slight bit of tweaking, I found this worked:
`<a href="”>`
Cheers againhi hnla, the while loop is already part of the file, it’s within the groups dir not the members dir, just incase this makes a difference?
I’m also a bit puzzled by your code, all I wish to do is display the value of my field, your code looks like it says if it equals? Perhaps I’m wrong?
TIAHi hnla,
The above seems to work just fine for me. I created the custom profile field account type and then using the above I can do what I need too.
Not sure if it helps anyone but certainly does the job for me!
Thank you, your reply certainly kick started the grey matter!
Ah I think the penny has just dropped! I need to call it as a standard field value, then compare it. So:
`standard
premium
`
Unless there is an easier way?
TIAHi hnla, I set it within the account registration page. So when you register, you select the account type.
For arguments sake, I’ve deleted the Nickname one and tried with another. Here’s my code incase I’m being a complete thicko
`-
<a href="”>
<!
><?php
$account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
if ($account_type== ‘Standard’) {
echo ‘standard’;
} else {
echo ‘premium’;
};
?><?php $Street= xprofile_get_field_data( "Street");
echo $Street;
?><!
>
`
The only thing that displays on the custom field front is the account_type of either Standard or Premium.
Yes, I’ve even tried with a couple of others. It’s so frustrating! And yes, it does also have text in the field
Sadly “ is a no go either.
I tried “
Is that what you meant? Otherwise not sure as it’s on the main loop page (groups/single/members.php)
ThanksThanks Travel-Junkie. Yeah it’s odd, as it works for account type. I thought maybe it was the way I was echoing out the info. Hmmm…
Ooops sorry “ AND “
Both to no avail..Oddly, this does work for one of my other custom fields though:
`<?php
$account_type= xprofile_get_field_data( ‘Account Type’,bp_get_member_user_id());
if ($account_type== ‘Standard’) {
echo ‘standard’;
} else {
echo ‘premium’;
};
?>`
Most confusing!! -
<a href="”>