I use phpBB 3.0.7-PL1 (upgrading soon) with CentOS 5.5 and PostgreSQL 8.4.6 and have the following additional question shown to new users on their registration to prevent SPAM:
What is your gender please? Answers: Robot/Man/Woman
I have found the corresponding entries in the database:
pref=> select * from phpbb_profile_lang;
field_id | lang_id | lang_name | lang_explain | lang_default_value
----------+---------+-----------+-----------------------------+--------------------
5 | 2 | Sex | Please specify your gender |
(1 row)
pref=> select * from phpbb_profile_fields_lang;
field_id | lang_id | option_id | field_type | lang_value
----------+---------+-----------+------------+------------
5 | 2 | 0 | 5 | Robot
5 | 2 | 1 | 5 | Man
5 | 2 | 2 | 5 | Woman
(3 rows)
My problem is: I would like to find out now, which user is Man and which user is Woman (I need it for the game integrated in my forum in Russian language, so that I can refer to the players correctly).
But I can't find, where these values are stored, in which "phpbb_xxxx" table and field. Does anybody please know?
Thank you! Alex
Ok, I've found it by changing a user's gender and diffing the database dumps - it is in the table phpbb_profile_fields_data
And I've fetched that value in index.php with:
$sql = 'SELECT pf_sex FROM ' .
PROFILE_FIELDS_DATA_TABLE .
' WHERE user_id=' . $user->data['user_id'];
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result))
$pf_sex = $row['pf_sex'];
$db->sql_freeresult($result);