<?php # Copyright by Manuel # Support www.ilch.de defined ('main') or die ( 'no direct access' ); if ( isset ( $_GET['delete']) ) { if ( $_SESSION['authright'] == -5 ) { db_query("DELETE FROM prefix_shoutbox WHERE id = ".$_GET['delete']); $_GET['archiv'] = 1; } } if ( empty($_GET['archiv']) ) { if ( $_SESSION['authright'] <= -1 ) { $shoutbox_VALUE_name = $_SESSION['authname']; } else { $shoutbox_VALUE_name = 'Nickname'; } if ( !empty($_POST['shoutbox_submit']) AND !array_key_exists('shoutbox_shouted',$_SESSION) ) { $_SESSION['shoutbox_shouted'] = TRUE; $shoutbox_nickname = escape($_POST['shoutbox_nickname'],'string'); $shoutbox_textarea = escape($_POST['shoutbox_textarea'],'textarea'); $shoutbox_textarea = str_replace('[b]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[/b]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[i]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[/i]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[u]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[/u]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[img]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[img]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('[code]','',$shoutbox_textarea); $shoutbox_textarea = str_replace('','',$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.'" , "'.$shoutbox_textarea.'" ) ' );
}
}
echo '<form action="index.php" method="POST">';
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="50">';
echo '<br /><textarea cols="15" rows="2" name="shoutbox_textarea"></textarea><br />';
echo '<input type="submit" value="Senden" name="shoutbox_submit">';
echo '</form><table width="50%" align="center" 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 == 'Cmite' ? 'Cnorm' : 'Cmite' );
echo '<tr class="'.$class.'"><td><b>'.$row->nickname.':</b> '.bbcode($row->textarea).'</td></tr>';
}
echo '</table><a class="box" href="?m=boxes/shoutbox&archiv=1" onClick="window.open(\'#\', \'external\',\'width=500,height=400,scrollbars=yes,resizable=no\')" target="external">Archiv</a>';
} else {
$title = $allgAr['title'].' :: Shoutbox Archiv';
$hmenu = 'Shoutbox Archiv';
$design = new design ( $title , $hmenu , 0 );
$design->header();
$class = 'Cnorm';
echo '<table width="50%" align="center" class="border" cellpadding="2" cellspacing="1" border="0"><tr class="Chead"><td><b>Shoutbox Archiv</b></td></tr>';
$erg = db_query('SELECT * FROM `prefix_shoutbox` ORDER BY id DESC');
while ($row = db_fetch_object($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
echo '<tr class="'.$class.'"><td>';
if ( $_SESSION['authright'] == -5 ) {
echo '<a href="?m=boxes/shoutbox&delete='.$row->id.'">DEL</a> ';
}
echo '<b>'.$row->nickname.':</b> '.bbcode($row->textarea).'</td></tr>';
}
echo '</table>';
$design->footer();
}
?>
[/code]
betroffene Homepage: psopc.net/index.php