hier eine Shoutbox mit der sollte es gehen , Gäste können ihren Namen nicht ändern und wenn Du eingeloggt bist steht dort nur Dein Name kannst ih auch nicht ändern .
nehme den Kompletten Text aus deine Shoutbox.php und füge diesen ein :
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 | <?php
defined ('main') or die ( 'no direct access' );
$shoutbox_VALUE_name = getenv("REMOTE_ADDR");
$shoutbox_VALUE_name2 = 'Gast';
$nore = 1;
$datum=date("j.n.Y");
$zeit=date("@H:i");
if ( isset ( $_GET['delete']) ) {
if ( $_SESSION['authright'] == -5 ) {
db_query("DELETE FROM xic_shoutbox WHERE id = ".$_GET['delete']);
$_GET['archiv'] = 1;
}
}
if ( empty($_GET['archiv']) ) {
if ( $_SESSION['authright'] <= -1 ) {
$shoutbox_VALUE_name3 = $_SESSION['authname'];
} else {
}
if ( !empty($_POST['shoutbox_submit']) ) {
$_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('
|
','',$shoutbox_textarea);
$shoutbox_textarea = str_replace('[/code]','',$shoutbox_textarea);
$shoutbox_textarea = strip_tags($shoutbox_textarea);
$erg = db_query('SELECT * FROM `xic_shoutbox` ORDER BY id DESC LIMIT 1');
while ($row = db_fetch_object($erg) )
{
$oldtext = $row->textarea;
if($oldtext == $shoutbox_textarea)
{
$nore = 0;
}
}
if ($nore)
{
if ( !empty($shoutbox_nickname) AND !empty($shoutbox_textarea ) )
{
db_query('INSERT INTO `xic_shoutbox` VALUES ( "" , "'.$shoutbox_nickname.'<hr></hr>'.$datum.''.$zeit.'" , "'.$shoutbox_textarea.'" ) ' );
}
}
}
if ( $_SESSION['authright'] <= -1 ) {
echo '<form action="index.php" method="POST">';
echo '<input readonly type="text" size="20" name="shoutbox_nickname" value="'.$shoutbox_VALUE_name3.'" onFocus="if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}" onBlur="if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}" maxlength="30">';
echo '<br /><textarea rows="4" cols="20" name="shoutbox_textarea"></textarea>';
echo '<br><input type="submit" value="...und wech" name="shoutbox_submit"></center><hr></hr>';
echo '</form><table width="100%" align="center" class="border" cellpadding="2" cellspacing="1" border="0">';
} else {
echo '<form action="index.php" method="POST">';
echo '<input readonly type="text" size="4" name="shoutbox_nickname" value="'.$shoutbox_VALUE_name2.' '.$shoutbox_VALUE_name.'" onFocus="if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}" onBlur="if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}" maxlength="30">';
echo '<br /><textarea rows="4" cols="20" name="shoutbox_textarea"></textarea>';
echo '<br><input type="submit" value="...und wech" name="shoutbox_submit"></center>';
echo '</form><table width="100%" align="center" class="border" cellpadding="2" cellspacing="1" border="0">';
}
$erg = db_query('SELECT * FROM `xic_shoutbox` ORDER BY id DESC LIMIT 5');
$class = 'Cnorm';
while ($row = db_fetch_object($erg) ) {
$class = ( $class == 'Cmite' ? 'Cnorm' : 'Cmite' );
echo "<tr class=\"Chead\"><td><b>\n$row->nickname\n</b></td></tr>\n";
$shout = "<tr class=\"$class\"><td>\n".bbcode(wordwrap($row->textarea, 20, " ",1))."\n</td></tr>";
echo "$shout\n";
}
echo '</table><a class="box" href="index.php?m=boxes/shoutbox&archiv=1" onClick="window.open(\'#\', \'external\',\'width=500,height=400,scrollbars=yes,resizable=no\')" target="external">Archiv</a><hr></hr>';
echo "<center>Es ist der<br> $datum $zeit <br>Deine IP:<br><b> $shoutbox_VALUE_name</b><br>";
} else {
$title = $allgAr['title'].' :: Shoutbox Archiv';
$hmenu = 'Shoutbox Archiv';
$design = new design ( $title , $hmenu , 0 );
$design->header();
$class = 'Cnorm';
echo '<table width="100%" 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 `xic_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 '<b><a href="index.php?m=boxes/shoutbox&delete='.$row->id.'">Loeschen</a> </b>';
}
echo ''.$row->nickname.':</b> '.bbcode($row->textarea).'</td></tr>';
}
echo '</table>';
$design->footer();
}
?> [/code]
Zuletzt geändert von Haudegen am 29.11.2005 - 18:27