Hallo alle Mann, ich möchte meine V-ShoutBox erweitern.
- my Original ist so - 16.05.2017 | 10:41:41 Uhr
- & ich möchte es aber so haben - {TAG}, 16.{MON}.2017 | 10:41 Uhr
- desweiteren möchte ich das beim NickNamen noch ein DELETE Icon ist so das man nicht mehr in´s archiv muss.
Kann mir da bitte einer Weiterhelfen? :D
<?php defined ('main') or die ('no direct access'); // code by Lord|Schirmer // anzeige // 0 = alle besucher // 1 = nur registrierte personen $anzeige = 0; // antispam // 0 = aus // 1 = ein $antispam = 1; $title = $allgAr['title'].' :: Frontabschnitt Mitteilung'; $hmenu = 'Frontabschnitt Mitteilung'; $design = new design ( $title , $hmenu ); $design->header(); // start if (($anzeige == 1 && loggedin()) || $anzeige == 0) { // spalte time anlegen $erg = db_query("SHOW COLUMNS FROM `prefix_shoutbox` WHERE FIELD = 'time'"); if (!db_num_rows($erg)) { db_query("ALTER TABLE `prefix_shoutbox` ADD `time` BIGINT(20) NOT NULL DEFAULT '0'"); } // smilies anzeigen function smiliesshb() { global $lang; $zeilen = 5; $i = 0; $b = '<script language="JavaScript" type="text/javascript">function moreSmilies() {'; $b .= 'var x = window.open("about:blank", "moreSmilies", "width=250,height=200,left=100,top=100,status=no,scrollbars=yes,resizable=yes");'; $a = ''; $erg = db_query('SELECT `emo`, `ent`, `url` FROM `prefix_smilies`'); while ($row = db_fetch_object($erg)) { $b .= 'x.document.write ("<a href=\"javascript:opener.put_smilies(\'vshoutbox_textarea\',\' ' . addslashes(addslashes($row->ent)) . ' \')\">");'; $b .= 'x.document.write ("<img style=\"border: 0px; padding: 5px;\" src=\"include/images/smiles/' . $row->url . '\" title=\"' . $row->emo . '\"></a>");'; if ($i<0) { if($i%$zeilen == 0 AND $i <> 0) { $a .= '<br /><br />'; } $a .= '<a href="javascript:put_smilies(\'vshoutbox_textarea\',\' '.addslashes($row->ent).' \')">'; $a .= '<img style="margin: 2px;" src="include/images/smiles/' . $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 .= '<a class="button" href="javascript:moreSmilies();">Smilies</a>'; } $a = $b.$a; return ($a); } // template definieren $tpl = new tpl ('v_shoutbox.htm'); // name festsetzen if (loggedin()) { $vshoutbox_VALUE_name = $_SESSION['authname']; $disabled = 'disabled'; } else { $vshoutbox_VALUE_name = 'Nickname'; $disabled = ''; } // formular absenden und daten speichern if ((!empty($_POST['vshoutbox_submit']) && $antispam == 1 && $_POST['vshoutbox_antispam'] == $_SESSION['loesung']) || (!empty($_POST['vshoutbox_submit']) && $antispam == 0)) { if (loggedin()) { $vshoutbox_nickname = $_SESSION['authname']; } else { $vshoutbox_nickname = escape($_POST['vshoutbox_nickname'], 'string'); $vshoutbox_nickname = substr($vshoutbox_nickname, 0, 15); if (db_count_query("SELECT COUNT(*) FROM `prefix_user` WHERE `name` LIKE '%$vshoutbox_nickname%'") > 0) { $vshoutbox_nickname = '[STHM]_Gast'; } } $vshoutbox_textarea = escape($_POST['vshoutbox_textarea'], 'textarea'); $vshoutbox_textarea = preg_replace("/\[.?(url|b|i|u|img|code|quote)[^\]]*?\]/i", "", $vshoutbox_textarea); $vshoutbox_textarea = strip_tags($vshoutbox_textarea); if (!empty($vshoutbox_nickname) AND !empty($vshoutbox_textarea)) { db_query('DELETE FROM `prefix_shoutbox` WHERE nickname = "' . $vshoutbox_nickname . '" AND textarea = "' . $vshoutbox_textarea . '"'); db_query('INSERT INTO `prefix_shoutbox` VALUES ("" , "' . $vshoutbox_nickname . '" , "' . $vshoutbox_textarea . '" , "' . time() . '" )'); } } // ausgabe der shoutbox $erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY `id` DESC LIMIT ' . (is_numeric($allgAr['sb_limit'])?$allgAr['sb_limit']:20)); $tpl->out(0); while ($row = db_fetch_object($erg)) { $erg1 = db_query('SELECT `id`, `avatar` FROM `prefix_user` WHERE `name` = "' . $row->nickname . '"'); if (db_num_rows($erg1)) { $row1 = db_fetch_object($erg1); if ($row1->avatar && file_exists($row1->avatar)) { $avatar = '<a href="?user-details-' . $row1->id . '" title=""><img src="' . $row1->avatar . '" alt="Avatar" border="0" width="60"></a>'; } else { $avatar = '<a href="?user-details-' . $row1->id . '" title=""><img src="include/images/avatars/wurstegal.jpg" alt="Avatar" border="0" width="60"></a>'; } } else { $avatar = '<img src="include/images/avatars/wurstegal.jpg" alt="Avatar" border="0" width="60">'; } $ar = array ( 'NAME' => $row->nickname, 'AVATAR' => $avatar, 'DATE' => $row->time==0?' ':date('d.m.Y | H:i:s \U\h\r', $row->time), 'TEXT' => preg_replace('/([^\s]{' . $allgAr['sb_maxwordlength'] . '})(?=[^\s])/', "$1\n", BBcode($row->textarea)), ); $tpl->set_ar_out($ar, 1); } $tpl->out(2); // ausgabe formular ja nach berechtigung if (has_right($allgAr['sb_recht'])) { if ($antispam == 1) { $zahl1 = mt_rand(1, 10); $zahl2 = mt_rand(1, 10); eval("\$_SESSION['loesung'] = {$zahl1} + {$zahl2};"); } $ar = array ( 'URL' => $menu->get_complete(), 'VALUE_NAME' => $vshoutbox_VALUE_name, 'DISABLED' => $disabled, 'SMILIES' => smiliesshb(), 'ANTISPAM' => $antispam, 'RECHNUNG' => ($antispam==1)?$zahl1 . ' + ' . $zahl2:'' ); $tpl->set_ar_out($ar, 3); } else { // ausgabe wenn mann nicht einlog ist echo '<div class="shb_login">Bitte erst einloggen um in der Shoutbox schreiben zu können!</div>'; } // ende $tpl->out(4); } $design->footer(); ?>
MFG
BennY
betroffene Homepage: sthm.projekt-ab.de.w00cb272.kasserver.com/index.php?shoutbox