By Marc on Friday, 18 December 2015
Posted in General Issues
Replies 1
Likes 0
Views 414
Votes 0
We use a checkbox to mark profiles as verified.
This means that the custom field will only be recorded if the checkbox has been ticked.
We want to display this on the members profile header and popup

I have tried using the following code

<?php if( $user->getFieldValue('cb_memstate') == "Verified" ){ ?>
<i class="fa fa-diamond"></i> <?php echo $user->getFieldValue('cb_memstate'); ?>
<?php } ?>


This works perfectly where the table contains a record for the field cb_memstate but returns an error when the field doesn't exist for a member.

How can we show this record only if it exists (eg use in-array or isset or whatever)?
Hey Marc,

Please do take note that our support policy doesn't cover customization requests / support. Anyway, based on your codes, I believe you should perform a check to see the return value of $user->getFieldValue('cb_memstate') if there is no value for this field.
·
Saturday, 19 December 2015 14:14
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post