Question

I want to check a purchase code, entered by a user.

So on registration page, there is a custom profile field "purchase_code", which value I want to use, to check the code.

So my question: With which function I can get value of the custom profile field "purchase_code"?

Something like "get_value_of_purchase_code"....

Was it helpful?

Solution

include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
$user_id = 2; //The id of the user that you want to get the custom profiles fields
$cp = new custom_profile();
$user_fields = $cp->generate_profile_fields_template('grab', $user_id);

This creates a multidimensional array in $user_fields containing all the selected users custom fields, including the value and all the field data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top