2014-01-22 68 views
0

我想检查由用户输入的购买代码。phpbb - 获取自定义配置文件字段的值

所以在注册页面上,有一个自定义配置文件字段“purchase_code”,我想使用它的值来检查代码。

所以我的问题: 用哪个函数可以获得自定义配置文件字段“purchase_code”的值?

类似“get_value_of_purchase_code” ....

+0

欢迎来到Stack Overflow!请注意,标签独立。添加'[profile]'和'[field]'并不意味着你在谈论“配置文件字段”。请务必阅读输入标签时出现的有用标签说明。 – Charles

回答

1
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); 

这在包含所有选定的用户自定义字段,包括值和所有的字段数据$ user_fields多维数组。

相关问题