escape($_POST['edit_usergroup_name']);
$edit_usergroup_description = $wpdb->escape($_POST['edit_usergroup_description']);
$edit_usergroup_id = $wpdb->escape($_POST['edit_usergroup_id']);
if(!$edit_usergroup_name)
echo "
".__("You must specify a name for the User Group", "mingleforum")."
";
else if($wpdb->get_var("SELECT id FROM ".$table_prefix."forum_usergroups WHERE name = '$edit_usergroup_name' AND id <> $edit_usergroup_id"))
echo "".__("You have choosen a name that already exists in the database, please specify another", "mingleforum")."
";
else{
$wpdb->query("UPDATE ".$table_prefix."forum_usergroups SET name = '$edit_usergroup_name', description = '$edit_usergroup_description' WHERE id = $edit_usergroup_id" );
echo "".__("User Group updated successfully", "mingleforum")."
";
}
}
else{
$ug_id = (is_numeric($_GET['usergroup_id']))?$_GET['usergroup_id']:0;
global $mingleforum;
$name = $mingleforum->get_usergroup_name($ug_id);
echo "".__("Edit User Group", "mingleforum"). " \"$name\"
";
echo "";
}
}
else
{
echo 'Nice TRY!
';
}