Code: Select all
define('ZEBRA_TABLE', $table_prefix . 'zebra');
Code: Select all
define('DEFAULT_FRIEND', 2);
Code: Select all
// Insert Custom Profile Fields
if ($cp_data !== false && sizeof($cp_data))
{
$cp_data['user_id'] = (int) $user_id;
if (!class_exists('custom_profile'))
{
include_once($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
}
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
$db->sql_build_array('INSERT', custom_profile::build_insert_sql_array($cp_data));
$db->sql_query($sql);
}
Code: Select all
$sql = 'INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' =>(int) $user_id,
'zebra_id' => (int) DEFAULT_FRIEND,
'friend' => 1,
'foe' => 0)
);
$db->sql_query($sql);
I just did this mod in phpBB 3.0.7-PL1 and it works fine. Has anyone figured out how to put the newly registered user to the forum's admin friend's list after registering. So everytime a new member joins, they are automatically added to the admin's friend list.PowWowPalace wrote:This works great. Can someone modify it so that when a new user becomes a member they appear on the Admin's (2) friend list also. Right now this only adds the Admin (2) to the new member's friend list.
Thanks
Code: Select all
$sql = 'INSERT INTO ' . ZEBRA_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) DEFAULT_FRIEND,
'zebra_id' => (int) $user_id,
'friend' => 1,
'foe' => 0)
);
$db->sql_query($sql);