Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
IEvo Posted September 18, 2016 Posted September 18, 2016 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!
IEvo Posted September 19, 2016 Author Posted September 19, 2016 Still need help with this! Just need a line of php to get the value of the field or check if there is any data in the field!
Zen Geek Posted September 21, 2016 Posted September 21, 2016 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']}"); or $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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.