############################################### 
##   Hack Title:   Default Group on Register 
##   Hack Version:   0.0.1
##   Author:      Antony Bailey 
##   Description:   Automatically adds a user to a set defualt group upon registration.
##			The group is selected by an SQL query. 
##   Compatibility:   2.0.4 
## 
##   Installation Level: Easy
##   Installation Time: 3 minutes 
##   Files To Edit: 1
##      usercp_register.php 
## 
##   History: 
##      0.0.1:    Initial release.
## 
##   Author Notes: 
##      Rember the SQL is very important, the value selects the group.
## 
##   Support:      http://www.phpbbhacks.com/forums 
##   Copyright:      2003 Default Group on Register 0.0.1 - Antony Bailey
## 
############################################### 
##   You downloaded this hack from phpBBHacks.com, the #1 source for phpBB related downloads. 
##   Please visit http://www.phpbbhacks.com/forums for support. 
############################################### 
## 
############################################### 
##   This hack is released under the GPL License. 
##   This hack can be freely used, but not distributed, without permission. 
##   Intellectual Property is retained by the hack author(s) listed above. 
############################################### 
# 
#-----[ OPEN ]------------------------------------------ 
# 
includes/usercp_register.php
# 
#-----[ FIND ]------------------------------------------ 
# 
         $sql = "INSERT INTO " . GROUPS_TABLE . " (group_id, group_name, group_description, group_single_user, group_moderator) 
            VALUES ($group_id, '', 'Personal User', 1, 0)"; 
         if ( !($result = $db->sql_query($sql)) ) 
         { 
            message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql); 
         } 
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
         $sql = "INSERT INTO " . USER_GROUP_TABLE . " (user_id, group_id, user_pending) 
            VALUES ($user_id, ".$board_config['initial_group_id'].", 0)"; 
         if( !($result = $db->sql_query($sql)) ) 
         { 
            message_die(GENERAL_ERROR, 'Could not insert data into groups table', '', __LINE__, __FILE__, $sql); 
	  }
# 
#-----[ SAVE & CLOSE ALL FILES ]-------------------------- 
# 
#-----[ SQL ]------------------------------------------ 
#
# Change the 1 to the group ID of the default user group.
#
INSERT INTO phpbb_config (config_name, config_value) VALUES ( 'initial_group_id', '1');
# 
#End 