Also hab noch ein bisschen getestet, mußte noch was rausnehmen, aber jetzt klappts, super.
Vielen Dank.
Hier mein geänderter Code
$uum = $menu->get(2);
switch ( $uum ) {
case 'new' :
# neue pm schreiben und eintragen
$show_formular = true;
$txt = '';
$bet = '';
if (isset($_POST['sub'])) {
$txt = escape($_POST['txt'], 'textarea');
$bet = escape($_POST['bet'], 'string');
$name = escape($_POST['name'], 'string');
$namensarray = explode(',', $name);
foreach ($namensarray as $name1)
if (1 == db_result(db_query("SELECT count(*) FROM prefix_user WHERE name = BINARY '".$name1."'"),0)) {
$show_formular = false;
} else {
echo 'Der Empfänger '.$name1.' konnte nicht gefunden werden';
}
}
if ($show_formular === true) {
$name = '';
$empfid = 0;
if (isset($_REQUEST['empfid'])) {
$empfid = escape($_REQUEST['empfid'],'integer');
}
$empfid = escape($empfid, 'integer');
if ($empfid > 0) {
$name = db_result(db_query("SELECT name FROM prefix_user WHERE id = ".$empfid),0);
}
$ar = array (
'name' => $name,
'SMILIES' => getsmilies(),
'TXT' => $txt,
'BET' => $bet,
);
if (isset($_REQUEST['text'])) {
$ar['TXT'] = unescape(escape($_REQUEST['text'], 'textarea'));
}
if (isset($_REQUEST['anhang'])) {
$x = explode("n", unescape(escape(urldecode($_REQUEST['anhang']), 'textarea')));
$n = '';
for ($i=0; $i<=count($x); $i++) {
if (empty($x[$i])) { continue; }
$n .= '> '.$x[$i]."n";
}
$ar['TXT'] .= "nn".$n;
}
if (isset($_POST['bet'])) {
$ar['BET'] = unescape(escape($_REQUEST['bet'], 'string'));
}
if (isset($_POST['re']) AND strpos ($ar['BET'],'re') === FALSE AND strpos ($ar['BET'],'Re') === FALSE AND strpos ($ar['BET'],'RE') === FALSE) {
$ar['BET'] = 'Re(1): '.$ar['BET'];
} elseif (isset($_POST['re'])) {
$x = preg_replace("/re((d+)):.*/i", "\1", trim($ar['BET']));
if (is_numeric($x)) {
$x = $x+1;
$ar['BET'] = preg_replace("/(re)(d+):(.*)/i", "\1(".$x."):\2", $ar['BET']);
}
}
$tpl = new tpl ( 'forum/pm/new' );
$tpl->set_ar_out($ar,0);
} else {
foreach ($namensarray as $name1) {
$eid = db_result(db_query("SELECT id FROM prefix_user WHERE name = BINARY '".$name1."'"),0);
sendpm($_SESSION['authid'], $eid, $bet, $txt);}
if (count($namensarray) > 1) {$plur1 = 'en'; $plur2 = 'n';}
wd('index.php?forum-privmsg','Die Nachricht'.$plur1.' wurde'.$plur2.' erfolgreich gesendet');
}
break;
samo
Ain't no use running, fool! I know where your mama parks your house