Jump to content

Check if data in members custom profile field


Recommended Posts

Hi all, I was hoping someone might be able to help.

I would like to make a check in php if basically the user had put some text in a custom field.

The plan is to make a video section on the profile, add a custom user field for the user to enter the url and then add a check in the theme if member has added something to the field display block else don't. I've been experimenting and can do everything apart from the if statement.

If you have any ideas please let me know!

Link to comment
Share on other sites

Back in IPS3.x I used to know how to do this. I'm sure it's changed since then, but maybe this can give you a starting point for IPS4.

You can put the custom field into a php variable like:

$varX= substr("{$post['author']['custom_fields']['profile_info']['customField5']}");


$varX = {$this->memberData['field_17']}

Than use an if test:

<if test="$varX != ''"> //tests is there was any text in the customField5 or field_17


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...