shoutbox2.php (include/boxes/shoutbox2.php):
<?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_shoutbox2` 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_shoutbox2` 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>';
?>
Wie du die Shoutbox anpassen mußt siehst du
hier
install.php:
<?
if(isset($_REQUEST['action']))
{
// übergebene Aktion setzen
$action = $_REQUEST['action'];
}
else
{
// Standard Aktion
$action = 'view';
}
switch($action)
{
case 'view' :
{
echo'
<form action="install.php?action=shoutbox2" method="post">
Bitte auf Weiter klicken um die zweite Shoutbox zu installieren!<br>
<input type="submit" name="shoutbox2" value="Weiter"></form>';
}
break;
case 'shoutbox2' :
define ( 'main' , TRUE );
require_once('include/includes/config.php');
require_once('include/includes/func/db/mysql.php');
db_connect();
db_query("CREATE TABLE `prefix_shoutbox2` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`nickname` varchar(50) NOT NULL default '',
`textarea` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='powered by ilch.de' AUTO_INCREMENT=1 ;
} else {
}
echo '<form action="install.php?action=fertig" method="post">
Bitte auf Weiter um die installation abzuschließen!<br>
<input type="submit" name="fertig value="Weiter"></form>';
break;
case 'fertig' :
{
header("location: http://www.ilch.de");
}
break;
}
?>
Konnte aber leider nicht testen.