Retrieving CPF Fields
Hi,
Can someone give me some advise on how ( in php) would you return a specific CPF field for a member.
ie $_username = $GLOBALS['CNS_DRIVER']->get_member_row_field($member_id, 'm_username');
returns the Username
if I had a CPF called "ScreenName" how would i get that using the $member_id.
The end goal ( if im feeling brave) is to try and modify the forum system to display the CPF "ScreenName", rather than the username. Its only the displayed text i want to change rather than any underlying links or the functionality
This is both for security to prevent people who use their e-mail address as their user name from it obviously being displayed, and convienience as some usernames are not always clear to the user.
As a fall back if the CPF is null/blank, then i would aim to continue to display the username.
Thanks
Chris
Can someone give me some advise on how ( in php) would you return a specific CPF field for a member.
ie $_username = $GLOBALS['CNS_DRIVER']->get_member_row_field($member_id, 'm_username');
returns the Username
if I had a CPF called "ScreenName" how would i get that using the $member_id.
The end goal ( if im feeling brave) is to try and modify the forum system to display the CPF "ScreenName", rather than the username. Its only the displayed text i want to change rather than any underlying links or the functionality
This is both for security to prevent people who use their e-mail address as their user name from it obviously being displayed, and convienience as some usernames are not always clear to the user.
As a fall back if the CPF is null/blank, then i would aim to continue to display the username.
Thanks
Chris
Not to answer your question directly, but there is already a 'Display name generator' feature which you can tie to a existing CPF and will likely do what you want here. Admin Zone → Setup → Configuration → User/usergroup options
Wow, that's cool - Thanks
I missed that config option completely. I'll give it a go
Chris
I missed that config option completely. I'll give it a go
Chris
Thanks Kingbast.
Works a treat.
Works a treat.
Glad to hear it
For reference, I think $GLOBALS['CNS_DRIVER']->get_member_row_field($member_id, 'field_10'); works, where 10 is the field ID. There are a few ways for reading in CPFs for members.
1 guest and 0 members have recently viewed this.
