Das ist die joinus.php
<?php
# Copyright by: Manuel Staechele
# Support: www.ilch.de
defined ('main') or die ( 'no direct access' );
//-----------------------------------------------------------|
$title = $allgAr['title'].' :: Joinus';
$hmenu = 'Joinus';
$design = new design ( $title , $hmenu );
$design->header();
if ( 0 == db_count_query("SELECT COUNT(*) FROM prefix_groups WHERE show_joinus = 1") ) {
echo $lang['noteamthere'];
$design->footer();
exit ();
}
$skill_ar = array (
1 => $lang['verybad'],
2 => $lang['bad'],
3 => $lang['middle'],
4 => $lang['good'],
5 => $lang['verygood'],
);
$far = array (
'name',
'online',
'mail',
'steam',
'esl',
'age',
'hometown',
'squad',
'ground',
'rules',
'char', // Ab hier beginnen meine eigenen JoinUs-Felder
'prof',
'g',
'geschl',
'impreb',
'genretyp'// und hier enden sie.
);
$x = 0;
foreach ($far as $v) {
if (!empty($_POST[$v])) {
$$v = escape($_POST[$v], 'string');
$x++;
} else {
$$v = '';
}
}
$xname = escape_nickname($name);
$ch_name = false;
if (loggedin()) {
$ch_name = true;
} elseif (isset($_POST['sub']) AND $name == $xname AND !empty($name)
AND 0 == db_result(db_query("SELECT COUNT(*) FROM prefix_user WHERE name = BINARY '".$name."'"),0)) {
$ch_name = true;
}
if (count($far) <> $x OR $ch_name == false) {
$tpl = new tpl ( 'joinus.htm' );
$squad = dblistee ($squad, "SELECT id,name FROM prefix_groups WHERE show_joinus = 1 ORDER BY pos");
if (loggedin()) { $name = $_SESSION['authname']; }
foreach($far as $v) {
if ($x > 0 AND empty($_POST[$v])) {
echo 'Es fehlt: '.$lang[$v].'<br />';
}
$tpl->set ($v, $$v);
}
if ($x > 0 AND $name != $xname) {
echo $lang['wrongnickname'].'<br />';
} elseif ($x > 0 AND $ch_name == false) {
echo $lang['namealreadyinuse'].'<br />';
}
$name = $xname;
$tpl->set('readonly', (loggedin()?' readonly': ''));
$tpl->out(0);
} else { # eintragen
$name = $xname;
$userreg = $lang['no'];
if (!loggedin()) {
$x = user_regist ($name,$mail,genkey(8));
$userreg = $lang['yes'];
}
db_query("INSERT INTO prefix_usercheck (`check`,name,datime,ak) VALUES ('".genkey(8)."','".$name."',NOW(),4)");
$squad = escape($squad, 'integer');
$abf = "SELECT `mod1`, `mod2`, `mod4`, name FROM prefix_groups WHERE id = ".$squad;
$erg = db_query($abf);
$row = db_fetch_assoc($erg);
$rulz = (isset($_POST['rules'])?$_POST['rules']:$lang['no']);
# bitte in der richtigen reihenfolge angeben, sonst das nicht gehen tun, kann.
$mailtxt = sprintf ($lang['joinusprivmsg'],
$name,
$row['name'],
$online,
$mail,
$hometown,
$age,
$ground,
$rulz,
$char, // Hier fangen meine eigenen an.
$prof,
$g,
$geschl,
$impreb,
$genretyp, // und hier enden sie.
$userreg
);
# pm an den leader
sendpm ($_SESSION['authid'], $row['mod1'], 'Joinus Anfrage',$mailtxt, -1);
# Wenn Co Leader != Leader
if ($row['mod2'] != $row['mod1']){
sendpm ($_SESSION['authid'], $row['mod2'], 'Joinus Anfrage',$mailtxt, -1);
}
if ($row['mod4'] != $row['mod1'] AND $row['mod2'] != $row['mod4']){
sendpm ($_SESSION['authid'], $row['mod4'], 'Joinus Anfrage',$mailtxt, -1);
}
if (!loggedin()) {
echo $lang['amailhasbeensenttoyouwithmailandpass'].'<br /><br />';
}
echo sprintf($lang['leaderofxalert'], $row['name']);
}
$design->footer();
?>
Das ist das bearbeitete aus der de.php
## Eigene Language-Variablen
'char'=>'Charaktername',
'prof'=>'Proffession',
'games'=>'Games',
'fraktion'=>'Fraktion',
'genretyp'=>'Genretyp',
'geschl'=>'Geschlecht',
'joinusprivmsg' => "Hallo,\n%s möchte %s beitreten.\n\nFolgende Angaben hat er gemacht:\nOnline: %s\neMail: %s\nWohnort: %s\nAlter: %s\nGrund: %s\nRegeln_akzeptiert: %s\nCharname: %s\nProf: %s\ng: %s\nGeschlecht: %s\nFraktion: %s\n\nEr ist vom Playertyp her: %s\n\nWurde direkt als User registriert: %s\nWenn dort nein steht dann war er zum Zeitpunkt der Anfrage schon User.\n\nIm Adminmenu unter Teams kannst du ihn freischalten, oder die Anfrage loeschen. Wenn er als User registriert wurde, muss er die Registrierung jenach Einstellung erst bestaetigen.",
### Die jetztige Reihenfolge wie sie in der PM sein muss:
# 'name',
# 'online',
# 'steam',
# 'mail',
# 'age',
# 'hometown',
# 'squad',
# 'ground',
# 'rules',
# 'char',
# 'prof',
# 'games',
# 'geschl',
# 'impreb',
# 'genretyp'
###
'ende' => 'ende'
);
$x = array();
foreach ($lang as $k => $v) { $x[$k] = 'NIX'; }
#$lang = $x;
?>
Und das die joinus.htm
<form action="index.php?joinus" method="POST">
<fieldset>
<legend><b>{_lang_yourdata}:<br>
</b></legend>
<label style="float:left; width:100px; "><i>{_lang_joininfo}:</i></label><i>{_lang_plsfilloutallfields}</i><br />
<label style="float:left; width:100px; ">{_lang_name}:</label><input name="name"{readonly} maxlength="15" value="{name}" /><br />
<label style="float:left; width:100px; ">Onlinezeit?</label><select name="online">{online}
<option>Sehr oft</option>
<option>Mittelmäßig</option>
<option>Selten</option>
<option>Am Wochenede</option>
<option>Unterschiedlich</option>
</select><br />
<label style="float:left; width:100px; ">E-Mail:</label><input type="text" name="mail" value="{mail}" /><br />
<label style="float:left; width:100px; ">Steam:</label><input type="text" name="steam" value="{steam}" /><br />
<label style="float:left; width:100px; ">ESL:</label><input type="text" name="esl" value="{esl}" /><br />
<label style="float:left; width:100px; ">{_lang_age}:</label><input type="text" name="age" value="{age}" /><br />
<label style="float:left; width:100px; ">{_lang_hometown}:</label><input type="text" name="hometown" value="{hometown}" /><br />
<label style="float:left; width:100px; ">{_lang_squad}:</label><select name="squad">{squad}</select /><br />
<label style="float:left; width:100px; ">Bewerbungstext:</label><textarea name="ground" cols="40" rows="5">{ground}</textarea>
<br>
</fieldset>
<fieldset>
<legend><b>Spielerinformation:</b><br>
<br></legend>
<label style="float:left; width:100px; ">{_lang_char}:</label>
<input type="text" name="char" value="{char}" /><br />
<label style="float:left; width:100px; ">{_lang_prof}:</label>
<input type="text" name="prof" value="{prof}" /><br />
<label style="float:left; width:100px; ">{_lang_games}:</label>
<input type="text" name="games" value="{games}" maxlength="20" size="20"/><br />
<label style="float:left; width:100px; ">{_lang_geschl}:</label>
<select name="geschl">
<option>männlich</option>
{geschl}
<option>weiblich</option>
</select /><br />
<label style="float:left; width:100px; ">{_lang_fraktion}:</label>
<select name="impreb">
<option>Neutral</option>
{impreb}
<option>Gut</option>
<option>Böse</option>
</select /><br />
<label style="float:left; width:100px; ">{_lang_genretyp}:</label>
<select name="genretyp">
<option>Shooter</option>
{playertyp}
<option>Rennsimulation</option>
<option>Sonstige</option>
<option>Alles</option>
</select />
<br>
</fieldset>
<fieldset>
<legend><b>Regeln:</b>
<br></legend>
<label style="float:left; width:100px; ">{_lang_rules}:</label><input type="checkbox" name="rules" value="{_lang_yes}" />{_lang_rulzreaded}<br />
<br />
<label style="float:left; width:100px; "> </label><input type="submit" name="sub" value="{_lang_formsub}" /><br />
</fieldset>
</form>