####################################################
#  заменить файлы                                  #
#   invite.php                                     #
#   /admin/admin_invites.php                       #
#   /templates/admin/admin_invites.tpl             #
#   /templates/default/invite.tpl                  #
####################################################
#  ОБновление с последней версии которую           #
# выкладывал я                                     #
####################################################

# 
#-----[ ФАЙЛ ]---------------------------------
# 
includes/functions_group.php

#
#-----[ В КОНЕЦ ФАЙЛА, ВСТАВИТЬ ]--------------
#
function get_groupname ($select_name, $selected_group, $groupid)
{
global $lang;
$groupname = '';
	$select_ary = array();
	$sql = "SELECT group_id, group_name
		FROM ". BB_GROUPS ."
		WHERE group_single_user = 0
		ORDER BY group_name";
	$select_ary[$lang['ENY_USER']] = '0';
	foreach (DB()->fetch_rowset($sql) as $row)
	{
		if (isset($select_ary[$row['group_name']]))
		{
			$cnt = md5($row['group_name']) .'_cnt';
			$$cnt = @$$cnt + 1;
			$row['group_name'] = $row['group_name'] . ' ['. (int) $$cnt .']';
		}
		$select_ary[$row['group_name']] = $row['group_id'];
			if ($groupid == $row['group_id']) 
			{
				$groupname = $row['group_name'];
			}
			
	}
	if(defined('IN_ADMIN')){
	return ($select_ary) ? build_select($select_name, $select_ary, $selected_group) : '';
	}
	else
	{
	return $groupname;
	}
}

#
#-----[ НАЙТИ ]-------------------------------
#
		if($bb_cfg['new_user_reg_only_by_invite']){
			if ($invite_code != '') {
				$sql = "UPDATE `invites` SET `active`='0', `new_user_id`=".$new_user_id.", `activation_date`=".time()." WHERE `invite_code`='".$invite_code."'";
				if (!($upd_querry = DB()->sql_query($sql))) message_die(GENERAL_ERROR, 'Ошибка при активации инвайта', '', __LINE__, __FILE__, $sql);
				DB()->sql_freeresult($upd_querry);
			}
		}

#
#-----[ ЗАМЕНИТЬ НА ]--------------------------
#
		if($bb_cfg['new_user_reg_only_by_invite']){
			if ($invite_code != '') {
				$sql = "UPDATE `invites` SET `active`='0', `new_user_id`=".$new_user_id.", `activation_date`=".time()." WHERE `invite_code`='".$invite_code."'";
				if (!($upd_querry = DB()->sql_query($sql))) message_die(GENERAL_ERROR, 'Could not activate invite', '', __LINE__, __FILE__, $sql);
				DB()->sql_freeresult($upd_querry);
			}
		}

#
#-----[EoM]------------------------------------
#