':happy:#@#-_-_-#@#smile.gif', ':(' => ':sad:#@#-_-_-#@#sad.gif', ':-O' => ':eek:#@#-_-_-#@#eek.gif', ':D' => ':biggrin:#@#-_-_-#@#biggrin.gif', ':/' => ':evil:#@#-_-_-#@#evil.gif', ':\'(' => ':frown:#@#-_-_-#@#frown.gif', ':P' => ':*g*:#@#-_-_-#@#lol.gif', ':X' => ':face:#@#-_-_-#@#x-face.gif' );
foreach ($smileys as $icon => $info) {
list($emo, $url) = explode('#@#-_-_-#@#', $info);
$string = str_replace($icon,'',$string);
}
return $string;
}
//Shoutbox Smileys Funktion ENDE
if ( loggedin() ) {
$shoutbox_VALUE_name = $_SESSION['authname'];
} else {
$shoutbox_VALUE_name = 'Nickname';
}
if ( !empty($_POST['shoutbox_submit']) AND chk_antispam ('shoutbox')) {
$shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string');
$shoutbox_nickname1 = substr($shoutbox_nickname, 0, 15).'@'.date('H:i');
$shoutbox_textarea = escape($_POST['shoutbox_textarea'],'textarea');
$shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i","",$shoutbox_textarea);
//IP speichern START
$shoutbox_ip = getip();
//IP speichern ENDE
$shoutbox_textarea = strip_tags($shoutbox_textarea);
//Beitraege autoamtisch loeschen START
$anz = db_count_query('SELECT COUNT(id) FROM `prefix_shoutbox`');
$limit = 5; //Limit der Shoutbox
if ($anz > $limit) {
db_query('DELETE FROM `prefix_shoutbox` ORDER BY id LIMIT '.($anz-$limit));
}
//Beitraege autoamtisch loeschen ENDE
$restricted = explode(',',$allgAr['restricted']); //Auslesen von verbotenen Namen
if ( !empty($shoutbox_nickname) AND !empty($shoutbox_textarea) AND (!in_array(strtolower($shoutbox_nickname),$restricted) OR in_array(strtolower($_SESSION['authname']),$restricted) )) {
db_query('INSERT INTO `prefix_shoutbox` VALUES ( "" , "'.$shoutbox_nickname1.'" , "'.$shoutbox_textarea.'", "'.$shoutbox_ip.'" ) ' );
}
//Doppen Eintraege verhindern START
$ref = strstr($_SERVER['HTTP_REFERER'],'index.php?');
$ref = strlen($ref) < 10 ? 'index.php' : $ref;
header('Location: '.$ref);
}
//Doppen Eintraege verhindern ENDE
if (has_right($allgAr['sb_recht'])){
echo '
| '.$row->nickname.': '.shoutboxsmileys(preg_replace( '/([^\s]{'.$allgAr['sb_maxwordlength'].'})(?=[^\s])/', "$1\n", $row->textarea)).' |