Hi ich hab mal eine fragen
Kann mann Shoutbox mit bbcode Versehen ???
würde gerne die Shoutbox als news ist so das jeder schreiben kann
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
1 2 3 4 | < form name = "form" > <!-- BB Code START --> {__BBCodeButtons__} <!-- BB Code ENDE --> < textarea name = "txt" ></ textarea > </ form > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | <?php # Copyright by Manuel # Support www.ilch.de defined ( 'main' ) or die ( 'no direct access' ); //Smilies in der Textarea ausgeben function smilies ( $string ) { global $smilies_array ; if (!isset( $smilies_array )) { $smilies_array = array (); $erg = db_query( "SELECT ent, url, emo FROM `prefix_smiliesshb`" ); while ( $row = db_fetch_object( $erg ) ) { $smilies_array [ $row ->ent] = $row ->emo. '#@#-_-_-#@#' . $row ->url; } } foreach ( $smilies_array as $k => $v ) { list( $emo , $url ) = explode ( '#@#-_-_-#@#' , $v ); $string = str_replace ( $k , '<img src="include/images/smiliesshb/' . $url . '" border="0" alt="' . $emo . '" title="' . $emo . '" />' , $string ); } return $string ; } //Smilies in die Textarea übermitteln function smiliesshb () { global $lang ; $zeilen = 5; $i = 0; $b = '<script language="JavaScript" type="text/javascript">function moreSmilies () { var x = window.open("about:blank", "moreSmilies", "width=250,height=200,left=200,top=300,status=no,scrollbars=yes,resizable=yes"); ' ; $a = '' ; $erg = db_query( 'SELECT emo, ent, url FROM `prefix_smiliesshb`' ); while ( $row = db_fetch_object( $erg ) ) { $b .= 'x.document.write ("<a href=\"javascript:opener.put_shb(\'' . addslashes ( addslashes ( $row ->ent)). '\')\">");' ; $b .= 'x.document.write ("<img style=\"border: 0px; padding: 5px;\" src=\"include/images/smiliesshb/' . $row ->url. '\" title=\"' . $row ->emo. '\"></a>");' ; if ( $i <0) { # float einbauen if ( $i % $zeilen == 0 AND $i <> 0) { $a .= '<br /><br />' ; } $a .= '<a href="javascript:put_shb(\'' . addslashes ( $row ->ent). '\')">' ; $a .= '<img style="margin: 2px;" src="include/images/smilesshb/' . $row ->url. '" border="0" title="' . $row ->emo. '"></a>' ; } $i ++; } $b .= ' x.document.write("<br /><br /><center><a href=\"javascript:window.close();\">' . $lang [ 'close' ]. '</a></center>"); x.document.close(); }</script>' ; if ( $i >0) { $a .= '<br /><center><a href="javascript:moreSmilies();">Smilies</a></center>' ; } $a = $b . $a ; return ( $a ); } // IP und Zeit ausgeben $shoutbox_VALUE_name2 = getenv ( "REMOTE_ADDR" ); $datum = date ( "j.n.Y" ); $zeit = date ( " H:i " ); //Avatar prüfen und ggf. anzeigen $abf = 'SELECT avatar FROM prefix_user WHERE name = "' . $_SESSION [ 'authname' ]. '"' ; $erg = db_query( $abf ); $row = db_fetch_object( $erg ); if ( $allgAr [ 'sh_avatar' ] == 1) { if (loggedin ()) { if ( file_exists ( $row ->avatar)) { $avatar = $row ->avatar; // $row->avatar sollte den Pfad zum Bild enthalten } else { $avatar = 'include/images/avatars/noavatar.jpg' ; } } else { $avatar = 'include/images/avatars/gast.png' ; } $avatar = '<img class="gradualfader" src="' . $avatar . '" border="0" width="50" height="63"/>' ; } else { $avatar = '' ; } //Nickname und Gast if ( loggedin() ) { $shoutbox_VALUE_name = $_SESSION [ 'authname' ]; } else { $shoutbox_VALUE_name = 'Gast' ; } //Shoutbox , Namenschutz if (has_right( $allgAr [ 'sb_recht' ])){ 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, 15); 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` (`nickname`,`textarea`,`time`) VALUES ( "' . $shoutbox_nickname . '" , "' . $shoutbox_textarea . '", ' . time() . ' ) ' ); } } ?> <form name= "form" > <!-- BB Code START -->{__BBCodeButtons__}<!-- BB Code ENDE --> <textarea name= "txt" ></textarea> </form> <script type= "text/javascript" > // S-Box-Smileys START function simple_insert_shb(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_shb ( towrite ) { simple_insert_shb ( towrite, '' ); } // S-Box-Smileys END </script> <?php echo '<form action="index.php" method="POST" name="shoutbox">' ; echo '<table width= "100%" class = "" cellpadding= "2" cellspacing= "1" border= "0" > </table>'; echo '<table width= "100%" class = "" cellpadding= "2" cellspacing= "1" border= "0" > <tr><td align= "center" /> <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= "15" > <textarea style= "width: 85%" cols= "15" rows= "4" name= "shoutbox_textarea" ></textarea> '.smiliesshb (' shoutbox ', 0).' </td></tr> </table>'; echo '<table width= "100%" class = "" cellpadding= "2" cellspacing= "1" border= "0" > <tr><td align= "center" > '.get_antispam (' shoutbox ', 0).' <input type= "submit" value= "'.$lang['formsub'].'" name= "shoutbox_submit" ></td></tr> </table>'; echo '</form>' ; } else { //Gaeste echo '<table width= "100%" class = "" cellpadding= "2" cellspacing= "1" border= "0" > <tr><td style= "font-size:11px; text-align:center;" ><b>Zum Posten<br />Bitte Einloggen!<br /></tr> </table>'; } echo '<table width="100%" class="border" cellpadding="2" cellspacing="1" border="0">' ; $erg = db_query( 'SELECT `prefix_shoutbox`.*, `prefix_user`.name, `prefix_user`.avatar FROM `prefix_shoutbox` LEFT JOIN `prefix_user` ON `prefix_user`.name = `prefix_shoutbox`.nickname ORDER BY id DESC LIMIT ' . ( is_numeric ( $allgAr [ 'sb_limit' ])? $allgAr [ 'sb_limit' ]:5)); $class = 'Cnorm' ; while ( $row = db_fetch_object( $erg )) { // Avatar prüfen und ggf. anzeigen if ( $allgAr [ 'sh_avatar' ] == 1) { if ( $row ->name) { if ( file_exists ( $row ->avatar)) { $avatar = $row ->avatar; // $row->avatar sollte den Pfad zum Bild enthalten } else { $avatar = 'include/images/avatars/noavatar.jpg' ; } } else { $avatar = 'include/images/avatars/gast.png' ; } $avatar = '<img class="gradualfader" src="' . $avatar . '" border="0" width="50" height="63"/>' ; } else { $avatar = '' ; } $class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' ); $time = is_null ( $row ->time) ? '<br />' : '<br /><em style="font-size:0.9em;">' . date ( 'd.m.y - H:i' , $row ->time). ' Uhr</em><br />' ; echo '<tr class="' . $class . '"><td><div style="float:left; width:40%;">' . $avatar . '</div><div style="float:left; text-align:left; width:60%;"><b>' . $row ->nickname. ': ' . $time .'</b></div></td></tr> <tr class = "'.$class.'" ><td> '.smilies(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>' ; ?> |
Geschlossen | ||
![]() |
Zurück zu Allgemein |