|
[x]
Posted via EE Mobile
|
|
| Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again. |
|
|
|
|
Asked by stimart in phpBB
Hi, :)
In the "session.php" I want to add a script (or a function) that checks if a user have NOT filled all "required custom profiles fields" and if so it redirect to control panel to force user to complete his profile.
I write this code and I put it inside session.php, but It doesn't work.
I need help!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
|
function control_field()
{
global $phpbb_root_path, $phpEx;
if (!defined('IN_ADMIN') && !defined('ADMIN_START') && !defined('IN_LOGIN') && $user->data['is_registered'])
{
if ($user->page['page_name'] != "ucp.$phpEx" || strpos($user->page['query_string'], 'mode=profile_info') === false)
{
if ($user->page['page_name'] != "posting.$phpEx" || (strpos($user->page['query_string'], 'mode=post') === false && strpos($user->page['query_string'], 'mode=reply') === false && strpos($user->page['query_string'], 'mode=edit') === false))
{
$sql = 'SELECT field_name
FROM ' . PROFILE_FIELDS_TABLE . '
WHERE field_active = 1
AND field_required = 1
AND field_show_profile = 1 AND user_id = ' . $user->data['user_id'];
$result = $db->sql_query($sql);
$db->sql_freeresult($result);
while ($row = $db->sql_fetchrow($result))
{
$pf_name[] = 'pf_' . $row['field_name'];
}
for ($i = 0, $j = sizeof($pf_name); $i < $j; $i++)
{
if (!isset($user_fields['$pf_name[$i]']))
{
$message = "Update your profile data";
meta_refresh(3, append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile'));
trigger_error($message, E_USER_WARNING);
}
}
}
}
}
}
|
20091111-EE-VQP-92 - Hierarchy / EE_QW_EXPERT_20070906