// User eintragen
if (!$error) {
if ($_POST['newsletter'] == 0 and $_POST['paidmails'] == 0) $mailstatus = 0;
if ($_POST['newsletter'] == 1 and $_POST['paidmails'] == 0) $mailstatus = 1;
if ($_POST['newsletter'] == 0 and $_POST['paidmails'] == 1) $mailstatus = 2;
if ($_POST['newsletter'] == 1 and $_POST['paidmails'] == 1) $mailstatus = 3;
$req=mysql_query("SELECT werberpraemie, startguthaben FROM ".$db_prefix."_start_praemie");
while ($row = mysql_fetch_array($req)) {
$werberpraemie=$row[werberpraemie];
$startguthaben=$row['startguthaben'];
}
db_query("INSERT INTO ".$db_prefix."_userdaten (nickname,vorname,nachname,angemeldet_seit) VALUES ('".$nickname."','".$_POST['vorname']."','".$_POST['nachname']."','".time()."')");
$personendaten = mysql_fetch_array(db_query("SELECT `uid` FROM ".$db_prefix."_userdaten WHERE nickname='".$nickname."' LIMIT 1"));
$new_uid = $personendaten['uid'];
db_query("INSERT INTO ".$db_prefix."_emaildaten (uid,emailadresse,freigabe_fuer) VALUES ('".$new_uid."','".$_POST['emailadresse']."','".$mailstatus."')");
db_query("INSERT INTO ".$db_prefix."_kontodaten (uid,passwort,status,hinweis,kontostand) VALUES ('".$new_uid."','".md5($_POST['passwort_1'])."','0','','0')");
$ws = db_query("SELECT * FROM ".$db_prefix."_werberdaten WHERE uid='".$new_uid."'");
db_query("INSERT INTO ".$db_prefix."_werberdaten (uid,werber,umsatz,zuordnungszeit) VALUES ('".$new_uid."','".$_SESSION['werber']."','0','".time()."')");
$ak = md5($_POST['uid'].''.time());
db_query("INSERT INTO ".$db_prefix."_aktivierungen (uid,ak) VALUES ('".$new_uid."','".$ak."')");