Ich habe eine Fragen zu meiner Shoutbox:
<?php # Copyright by Manuel Staechele # Support www.ilch.de defined ('main') or die ( 'no direct access' ); function shoutboxsmileys($string){ $smileys = array( ':-)' => ':smilie:#@#-_-_-#@#smile.gif', ':-$' => ':unknow:#@#-_-_-#@#dntknw.gif', ':-(' => ':sad:#@#-_-_-#@#sad.gif', ';-)' => ':blinking:#@#-_-_-#@#blinking.gif', '8-)' => ':cool:#@#-_-_-#@#cool.gif', ':-P' => ':tongueout:#@#-_-_-#@#tongueout.gif', ':´-(' => ':cray:#@#-_-_-#@#cray.gif', 'lol' => ':*lol*:#@#-_-_-#@#lol.gif', 'joke' => ':joke:#@#-_-_-#@#jokingly.gif', 'tease' => ':tease:#@#-_-_-#@#tease.gif' , 'yahoo' => ':yahoo:#@#-_-_-#@#yahoo.gif', 'happy' => ':happy:#@#-_-_-#@#happy.gif', 'good' => ':good:#@#-_-_-#@#good.gif', 'quiet' => ':quiet:#@#-_-_-#@#quiet.gif', 'blush' => ':blush:#@#-_-_-#@#blush.gif', 'give_rose' => ':give_rose:#@#-_-_-#@#give_rose.gif', 'give_heart' => ':give_heart:#@#-_-_-#@#give_heart.gif', 'n8' => ':n8:#@#-_-_-#@#n8.gif', 'help' => ':help:#@#-_-_-#@#help.gif', 'spam' => ':spam:#@#-_-_-#@#spam.gif' ); foreach ($smileys as $icon => $info) { list($emo, $url) = explode('#@#-_-_-#@#', $info); $string = str_replace($icon,'<img src="include/images/sBsmileys/'.$url.'" border="0" alt="'.$emo.'" title="'.$emo.'" />',$string); } return $string; } $shoutbox_VALUE_name2 = getenv("REMOTE_ADDR"); $datum=date("j.n.Y"); $zeit=date(" H:i "); if ( loggedin() ) { $shoutbox_VALUE_name = $_SESSION['authname']; } else { $shoutbox_VALUE_name = 'Nickname'; } if ( !empty($_POST['shoutbox_submit']) AND chk_antispam ('shoutbox')) { $insert = true; if (!loggedin()) { $shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string'); $shoutbox_nickname = substr($shoutbox_nickname, 0, 25); if (db_count_query("SELECT COUNT(*) FROM prefix_user WHERE name LIKE '%$shoutbox_nickname%'") > 0) { $insert = false; echo '<center><font color="#ff0000">Benutzen sie einen anderen Namen, dieser ist bereits vergeben.</font></center><br />'; } } else { $shoutbox_nickname = escape($_SESSION['authname'],'string'); } $shoutbox_textarea = escape($_POST['shoutbox_textarea'],'textarea'); $shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i","",$shoutbox_textarea); $shoutbox_textarea = strip_tags($shoutbox_textarea); if ( !empty($shoutbox_nickname) AND !empty($shoutbox_textarea) AND $insert) { db_query('INSERT INTO `prefix_shoutbox` VALUES ( "" , "'.$datum.' <br> '.$zeit.' '.$shoutbox_nickname.'" , "'.$shoutbox_textarea.'" ) ' ); } } if (has_right($allgAr['sb_recht'])){ ?> <script type="text/javascript"> function opensmiliespopup() { smiliespopup = window.open('about:blank','smiliespopup','width=300,height=400,left=300,top=200'); smiliespopup.document.open(); smiliespopup.document.write('<script>function put_sb(toWrite) {\n' +' top.opener.put_sb(toWrite); window.focus(); \n' +' }<\/script>'); smiliespopup.document.write(' <hr>Smilies<hr>\n' +' <a href="javascript:put_sb(\':-)\')"><img src="include\/images\/sBsmileys\/smile.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':-$\')"><img src="include\/images\/sBsmileys\/dntknw.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':-(\')"><img src="include\/images\/sBsmileys\/sad.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\';-)\')"><img src="include\/images\/sBsmileys\/blinking.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'8-)\')"><img src="include\/images\/sBsmileys\/cool.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':-P\')"><img src="include\/images\/sBsmileys\/tongueout.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':´-(\')"><img src="include\/images\/sBsmileys\/cray.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'lol\')"><img src="include\/images\/sBsmileys\/lol.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'joke\')"><img src="include\/images\/sBsmileys\/jokingly.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'tease\')"><img src="include\/images\/sBsmileys\/tease.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'yahoo\')"><img src="include\/images\/sBsmileys\/yahoo.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'happy\')"><img src="include\/images\/sBsmileys\/happy.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'good\')"><img src="include\/images\/sBsmileys\/good.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'quiet\')"><img src="include\/images\/sBsmileys\/quiet.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'blush\')"><img src="include\/images\/sBsmileys\/blush.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'give_rose\')"><img src="include\/images\/sBsmileys\/give_rose.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'give_heart\')"><img src="include\/images\/sBsmileys\/give_heart.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'n8\')"><img src="include\/images\/sBsmileys\/n8.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\'help\')"><img src="include\/images\/sBsmileys\/help.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':balloons:\')"><img src="include\/images\/sBsmileys\/balloons.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':04:\')"><img src="include\/images\/sBsmileys\/04.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':1keks:\')"><img src="include\/images\/sBsmileys\/1keks.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':m028:\')"><img src="include\/images\/sBsmileys\/m028.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':m111:\')"><img src="include\/images\/sBsmileys\/m111.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':s029:\')"><img src="include\/images\/sBsmileys\/s029.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':s363:\')"><img src="include\/images\/sBsmileys\/s363.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':m168:\')"><img src="include\/images\/sBsmileys\/m168.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':m116:\')"><img src="include\/images\/sBsmileys\/m116.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':s159:\')"><img src="include\/images\/sBsmileys\/s159.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':shit:\')"><img src="include\/images\/sBsmileys\/shit.gif" border ="0"\/><\/a>\n' +' <a href="javascript:put_sb(\':smilies_xxx22:\')"><img src="include\/images\/sBsmileys\/smilies_xxx22.gif" border ="0"\/><\/a>\n' +' <hr>\n' +' <div class="Cnorm"><a href="javascript:put_sb(\'spam\')"><img src="include\/images\/sBsmileys\/spam.gif" border ="0"\/><\/a><\/div>\n' +' <hr><a href="javascript:void(0)" onclick="window.close();">Fenster schließen<\/a>'); smiliespopup.document.close(); } // S-Box-Smileys START function simple_insert_sb(aTag,eTag) { var input = document.forms['shoutbox'].elements['shoutbox_textarea']; input.focus(); /* für Internet Explorer */ if(typeof document.selection != 'undefined') { /* Einfügen des Formatierungscodes */ var range = document.selection.createRange(); var insText = range.text; range.text = aTag + insText + eTag; /* Anpassen der Cursorposition */ range = document.selection.createRange(); if (insText.length == 0) { range.move('character', -eTag.length); } else { range.moveStart('character', aTag.length + insText.length + eTag.length); } range.select(); } /* für neuere auf Gecko basierende Browser */ else if(typeof input.selectionStart != 'undefined') { /* Einfügen des Formatierungscodes */ var start = input.selectionStart; var end = input.selectionEnd; var insText = input.value.substring(start, end); input.value = input.value.substr(0, start) + aTag + insText + eTag + input.value.substr(end); /* Anpassen der Cursorposition */ var pos; if (insText.length == 0) { pos = start + aTag.length; } else { pos = start + aTag.length + insText.length + eTag.length; } input.selectionStart = pos; input.selectionEnd = pos; } /* für die übrigen Browser */ else { /* Abfrage der Einfügeposition */ var pos = input.value.length; /* Einfügen des Formatierungscodes */ var insText = prompt("Bitte geben Sie den zu formatierenden Text ein:"); input.value = input.value.substr(0, pos) + aTag + insText + eTag + input.value.substr(pos); } } function put_sb ( towrite ) { simple_insert_sb ( towrite, '' ); } // S-Box-Smileys END </script> <?php echo '<form action="index.php" method="POST" name="shoutbox">'; echo "<center><br> $datum <br /> $zeit <br> $shoutbox_VALUE_name2<br>"; echo '<input type="text" size="15" name="shoutbox_nickname" value="'.$shoutbox_VALUE_name.'" onFocus="if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}" onBlur="if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}" maxlength="25">'; echo '<br /><textarea style="width: 85%" cols="15" rows="4" name="shoutbox_textarea"></textarea><br />'; echo '<a href="javascript:void(0)" onclick="opensmiliespopup()">Smilies</a><br />'; echo get_antispam ('shoutbox', 0); echo '<input type="submit" value="'.$lang['formsub'].'" name="shoutbox_submit">'; echo '</form>'; } echo '<table width="75%" class="border" cellpadding="2" cellspacing="1" border="0">'; $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT '.(is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:5)); $class = 'Cnorm'; while ($row = db_fetch_object($erg) ) { $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); echo '<tr class="'.$class.'"><td><b>'.$row->nickname.':</b><br> '.shoutboxsmileys(preg_replace( '/([^\s]{'.$allgAr['sb_maxwordlength'].'})(?=[^\s])/', "$1\n", bbcode($row->textarea))).'</td></tr>'; } echo '</table><a class="box" href="index.php?shoutbox">'.$lang['archiv'].'</a>'; ?>
Wie stelle ich es nun an das meine Shoutbox auch die funktionen der Shoutbox Live erhält, möchte aber gerne meine Funktionen: Smilies u.s.w. behalten
Shoutbox Live:
<?php # Copyright by Manuel # Support www.ilch.de defined ('main') or die ( 'no direct access' ); $shoutbox_VALUE_name = getenv("REMOTE_ADDR"); $datum=date("j.n.y"); $zeit=date("@H:i"); if ( loggedin() ) { $shoutbox_VALUE_name2 = $_SESSION['authname']; } if ( !empty($_POST['shoutbox_submit']) ) { $shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string'); $shoutbox_nickname = substr($shoutbox_nickname, 0, 15); $shoutbox_textarea = escape($_POST['shoutbox_textarea'],'textarea'); $shoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i","",$shoutbox_textarea); $shoutbox_textarea = strip_tags($shoutbox_textarea); if ( !empty($shoutbox_nickname) AND !empty($shoutbox_textarea) ) { db_query('INSERT INTO `prefix_shoutbox` VALUES ( "" , "'.$shoutbox_nickname.' '.$datum.' '.$zeit.'" , "'.$shoutbox_textarea.'" ) ' ); } } if ( loggedin() ) { //angemeldeter user echo '<form action="index.php" method="POST">'; echo '<input readonly type="text" size="20" name="shoutbox_nickname" value="'.$shoutbox_VALUE_name2.'" onFocus="if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}" onBlur="if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}" maxlength="15">'; echo '<br /><textarea cols="27" rows="3" name="shoutbox_textarea"></textarea><br />'; echo '<input type="submit" value="'.$lang['formsub'].'" name="shoutbox_submit">'; echo '</form><table width="100%" class="border" cellpadding="2" cellspacing="1" border="0">'; } else { //Gaeste echo "<font color=#ffffff><b><br />Zum Posten<p></p>Bitte Einloggen!<p></p></b></font>"; echo '</form><table width="100%" class="border" cellpadding="2" cellspacing="1" border="0">'; } $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT 5'); $class = 'Cnorm'; while ($row = db_fetch_object($erg) ) { $class = ( $class == 'Cnorm' ? 'Cnorm' : 'Cnorm' ); echo '<tr class="'.$class.'"><td><b>'.$row->nickname.' :</b> '.preg_replace( '/([^\s]{20})(?=[^\s])/', "$1\n", $row->textarea).'</td></tr>'; } echo '</table><a class="box" href="index.php?shoutbox">'.$lang['archiv'].'</a>'; ?>
Das sollte jetzt die Box sein ,die wenn einer was schreibt andere ohne die Seite zu Aktualisieren, gleich den Eintrag sehen!
Es wäre super wenn mir da jemand helfen könnte, ich bekomme das leider nicht selber richtig hin!