Hallo, ich hätte gerne, dass der $reply Text in einer anderen Farbe dargestellt wird, als der aktuelle Nachrichtentext; kann mir hierbei jmd. helfen?
<?php / ************************************* //\* Original script \*/ /\* Written by Zeggy \*/ /\* \*/ /\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/ include("lib.php"); define("PAGENAME", "Mail"); $player = check\_user($secret\_key, $db); //$db-\>EXECUTE("set names 'utf8'"); // Pagination variables $limit = 14; // Set the amount per page $page\_max = 10; // max amount of pagination pages shown $page = (intval($\_GET['p']) == 0)?1:intval($\_GET['p']); //Start on page 1 or $\_GET['p'] $begin = ($limit \* $page) - $limit; //Starting point for query $total\_mails = $db-\>getone ("select count(to) as `count` from `mail` where 'to'=?", array($player-\>id)); $numpages = ceil($total\_mails / $limit); //$lastpage = (($total\_mails - $limit) "; $errors = 0; if ($\_POST['sendmail']) { //Process mail info, show success message $query = $db-\>execute("select `id` from `players` where `username`=?", array($\_POST['to'])); if ($query-\>recordcount() == 0) { $errormsg .= "Diesen Spieler gibt es nicht! "; $errors = 1; } if (!$\_POST['body']) { $errormsg .= "Eine Nachricht solltest Du schon eingeben! "; $errors = 1; } if ($errors != 1) { $sendto = $query-\>fetchrow(); $insert['to'] = $sendto['id']; $insert['from'] = $player-\>id; $insert['body'] = $\_POST['body']; //$insert['body'] = str\_replace("&", "&", $insert['body']); //$insert['body'] = str\_replace("", "\>", $insert['body']); //$insert['body'] = str\_replace("\"", """, $insert['body']); //$insert['body'] = str\_replace("\>", "\>", $insert['body']); //Hehe, found an easier way of doing that ^ with htmlentities(): $insert['body'] = htmlentities($\_POST['body'], ENT\_QUOTES); //Smilie-Ersetzung!!! $insert['body'] = str\_replace(":\*", "", $insert['body']); // TEST // $insert['body'] = str\_replace($insert['body'], "" . $insert['body'] . "", $insert['body']); //$insert['body'] = (!get\_magic\_quotes\_gpc())?addslashes($insert['body']):blush:insert['body']; $insert['subject'] = ($\_POST['subject'] == "")?"...kein Betreff":blush:\_POST['subject']; //$insert['subject'] = (!get\_magic\_quotes\_gpc())?addslashes($insert['subject']):blush:insert['subject']; $insert['time'] = time(); // $db-\>EXECUTE("set names utf8"); $query = $db-\>execute("insert into `mail` (`to`, `from`, `body`, `subject`, `time`) values (?, ?, ?, ?, ?)", array($insert['to'], $insert['from'], $insert['body'], $insert['subject'], $insert['time'])); // $db-\>EXECUTE("set names utf8"); $query = $db-\>execute("insert into `mail_a` (`to`, `from`, `body`, `subject`, `time`) values (?, ?, ?, ?, ?)", array($insert['to'], $insert['from'], $insert['body'], $insert['subject'], $insert['time'])); //E-Mail Benachrichtigung $querymail = $db-\>execute("select `email` from `players` where `id`=?", array($insert['to'])); $mailaddy = substr($querymail,6); $subject = "Du hast eine neue Nachricht in XYZ"; $message = " Hallo ". $\_POST['to'] .", $player-\>username hat Dir in XYZ eine neue Nachricht geschrieben! Neugierig, was $player-\>username Dir mitzuteilen hat? Na dann nix wie auf nach XYZ :smiley: [http://www.XYZ.com](http://www.XYZ.com) Wir warten auf Dich! Gehabe Dich wohl (c; Ming"; $headers = "From: [[email protected]](mailto:stuck_out_tongue:[email protected])\r\nReply-To: [[email protected]](mailto:[email protected])"; mail( $mailaddy, $subject, $message, $headers ); if ($query) { include("templates/private\_header.php"); //HeaderPic echo ""; //MUSTER echo ' '; echo ''; echo ''; echo "**|---Deine Nachricht wurde erfolgreich an " . $\_POST['to'] . " verschickt!---|**"; echo ' '; echo ''; echo "[zurück](mail.php)"; echo ''; echo ' '; //echo "Deine Nachricht wurde erfolgreich an " . $\_POST['to'] . " verschickt!"; include("templates/private\_footer.php"); exit; } else { $errormsg .= "Sorry, Deine Nachricht konnnte nicht verschickt werden."; //Add to admin error log, or whatever, maybe for another version :wink: } } } $errormsg .= " \n"; include("templates/private\_header.php"); //HeaderPic echo ""; ?\> function checkAll() { count = document.inbox.elements.length; for (i=0; i \< count; i++) { if(document.inbox.elements[i].checked == 1) {document.inbox.elements[i].checked = 0; document.inbox.check.checked=0;} else {document.inbox.elements[i].checked = 1; document.inbox.check.checked=1;} } } [Posteingang](mail.php) [Mail schreiben](mail.php?act=compose) <?php switch($_GET['act'])
{ case "read": //Reading a message $query = $db-\>execute("select `id`, `to`, `from`, `subject`, `body`, `time`, `status` from `mail` where `id`=? and `to`=?", array($\_GET['id'], $player-\>id)); if ($query-\>recordcount() == 1) { $msg = $query-\>fetchrow(); echo "\n"; echo " **an:** [" . $player-\>username . "](%255C%2522profile.php?id=%2522)\n"; $from = $db-\>GetOne("select `username` from `players` where `id`=?", array($msg['from'])); echo " **von:** [" . $from . "](%255C%2522profile.php?id=%2522)\n"; echo " **Datum:**" . date("d.m.Y, H:i", $msg['time']) . ""; echo " **Betreff:**" . stripslashes($msg['subject']) . ""; echo " **Nachricht:**" . stripslashes(nl2br($msg['body'])) . ""; echo ""; if ($msg['status'] == "unread") { $query = $db-\>execute("update `mail` set `status`='read' where `id`=?", array($msg['id'])); } echo " \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $reply = explode("\n", $msg['body']); foreach($reply as $key=\>$value) { $reply[$key] = "\>\>" . $value; } $reply = implode("\n", $reply); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } break; case "compose": //Composing mail (justt he form, processing is at the top of the page) echo $errormsg; echo "\n"; echo "\n"; echo " **an:** \n"; echo " **Betreff:** \n"; echo " **Nachricht:**"; echo ($\_POST['body'] != "")?stripslashes(stripslashes($\_POST['body'])):stripslashes(stripslashes($\_GET['body'])); echo "\n"; echo "\n"; echo "\n"; echo "\n"; break; case "delete": if ($\_POST['delone']) //Deleting message from viewing page, single delete { if (!$\_POST['id']) { echo ' '; echo ''; echo ''; echo " **|---Du musst eine Nachricht auswählen!---|**"; echo ' '; } else { $query = $db-\>getone("select count(\*) as `count` from `mail` where `id`=? and `to`=?", array($\_POST['id'], $player-\>id)); if ($query['count'] = 0) { //In case there are some funny guys out there :wink: echo ' '; echo ''; echo ''; echo " **|---Scherzkeks! Diese Nachricht gehört NICHT Dir!---|**"; echo ' '; } else { if (!$\_POST['deltwo']) { echo " Bist Du sicher, dass Du diese Nachricht(en) löschen möchtest? \n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; ?\> echo "[Lieber doch nicht!](%255C%2522mail.php%255C%2522) "; echo ""; } else { $query = $db-\>execute("delete from `mail` where `id`=?", array($\_POST['id'])); echo ' '; echo ''; echo ''; echo "**|---Die Nachricht(en) wurde(n) erfolgreich gelöscht!---|**"; echo ' '; //Redirect back to inbox, or show success message //Can be changed in the admin panel } } } } else if ($\_POST['delmultiple']) //Deleting messages from inbox, multiple selections { if (!$\_POST['id']) { echo ' '; echo ''; echo ''; echo " **|---Du musst eine Nachricht auswählen!---|**"; echo ' '; } else { foreach($\_POST['id'] as $msg) { $query = $db-\>getone("select count(\*) as `count` from `mail` where `id`=? and `to`=?", array($msg, $player-\>id)); if ($query['count'] = 0) { //In case there are some funny guys out there :wink: echo "Diese Nachrichten gehören nicht Dir"; $delerror = 1; } } if (!$delerror) { if (!$\_POST['deltwo']) { echo " Bist Du sicher, dass Du diese Nachrichten löschen möchtest? \n"; echo "\n"; foreach($\_POST['id'] as $msg) { echo "\n"; } echo "\n"; echo "\n"; ?\> echo "[Lieber doch nicht!](%255C%2522mail.php%255C%2522) "; echo ""; } else { foreach($\_POST['id'] as $msg) { $query = $db-\>execute("delete from `mail` where `id`=?", array($msg)); } echo ' '; echo ''; echo ''; echo "**|---Die Nachricht(en) wurde(n) erfolgreich gelöscht!---|**"; echo ' '; //Redirect back to inbox, or show success message //Can be changed in the admin panel (TODO) } } } } break; default: //Show inbox echo "\n"; echo "\n"; echo "\n"; echo "alle löschen\n"; echo " **von** \n"; echo " **Betreff** \n"; echo " **Datum** \n"; echo "\n"; $query = $db-\>execute("SELECT \* FROM `mail` where `to`=? order by `time` DESC, subject LIMIT ?,?", array($player-\>id, $begin, $limit)); if ($query-\>recordcount() \> 0) { $bool = 1; while($msg = $query-\>fetchrow()) { echo "\n"; echo "\n"; $from = $db-\>GetOne("select `username` from `players` where `id`=?", array($msg['from'])); echo ""; //echo ($msg['status'] == "unread")?"**":""; echo "[" . $from . "](%255C%2522profile.php?id=%2522)"; //echo ($msg['status'] == "unread")?"**":""; echo "\n"; echo ""; echo ($msg['status'] == "unread")?" ":""; //echo ($msg['status'] == "unread")?"**":""; echo "[" . stripslashes($msg['subject']) . "](%255C%2522mail.php?act=read&id=%2522)"; //echo ($msg['status'] == "unread")?"**":""; echo "\n"; echo "" . date("d.m.Y, H:i", $msg['time']) . "\n"; echo "\n"; $bool = ($bool==1)?2:1; } } else { echo "\n"; echo "**Keine (weiteren) Nachrichten vorhanden**\n"; echo "\n"; } echo "\n"; echo "\n"; echo ""; break; } //Start of Pagination echo ''; echo ''; echo ''; echo ' '; //Display 'Previous' link echo ""; echo "[◄](mail.php?p=%2522)"; echo "[-1-](mail.php?p=1)"; echo "[-2-](mail.php?p=2)"; echo "[-3-](mail.php?p=3)"; echo "[-4-](mail.php?p=4)"; echo "[-5-](mail.php?p=5)"; echo "[-6-](mail.php?p=6)"; echo "[-7-](mail.php?p=7)"; echo "[-8-](mail.php?p=8)"; echo "[-9-](mail.php?p=9)"; echo "[-10-](mail.php?p=10)"; echo "[►](mail.php?p=%2522)"; echo ""; echo ' '; echo ''; echo ''; // End of Pagination include("templates/private\_footer.php"); ?\> Besten Dank fürs Kopfzerbrechen^^ LG Ming