<?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
(
$_SESSION
[
'authright'
] <= -1 ) {
if
( loggedin() ) {
$shoutbox_VALUE_name
=
$_SESSION
[
'authname'
];
}
else
{
$shoutbox_VALUE_name
=
'Nickname'
;
}
if
( !
empty
(
$_POST
[
'shoutbox_submit'
]) ) {
$shoutbox_nickname
= escape(
$_POST
[
'shoutbox_nickname'
],
'string'
);
$shoutbox_nickname
=
substr
(
$shoutbox_nickname
, 0, 20);
$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(
'DELETE FROM `prefix_shoutbox` WHERE nickname = "'
.
$shoutbox_VALUE_name
.
'" AND textarea = "'
.
$shoutbox_textarea
.
'"'
);
db_query(
'INSERT INTO `prefix_shoutbox` VALUES ( "" , "'
.
$shoutbox_VALUE_name
.
''
.
$zeit
.
'<br>'
.
$datum
.
'" , "'
.
$shoutbox_textarea
.
'" ) '
);
}
}
}
echo
'<form action="index.php" method="POST">'
;
echo
' <div style=
"width:99%; height:150px; overflow:auto; border:1px solid #347; margin:0px;"
>
<table width=
"100%"
cellpadding=
"2"
cellspacing=
"1"
border=
"0"
>';
$erg
= db_query(
'SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT 20'
);
$class
=
'Cnorm'
;
while
(
$row
= db_fetch_object(
$erg
) ) {
$class
= (
$class
==
'Cmite'
?
'Cnorm'
:
'Cmite'
);
echo
' <tr class="'
.
$class
.'">
<td style=
"font-size:9px;"
><b>
'.$row->nickname.'
</b>:</td><td style=
"font-size:10px;"
>
'.preg_replace( '
/([^\s]{
'.$allgAr['
sb_maxwordlength
'].'
})(?=[^\s])/
', "$1\n", BBcode($row->textarea)).'
</td>
</tr>';
}
echo
'</table></div>'
;
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="20">'
;
echo
'<br /><textarea cols="59" rows="5" name="shoutbox_textarea"></textarea><br />'
;
echo
'<input type="submit" value="'
.
$lang
[
'formsub'
].
'" name="shoutbox_submit">'
;
echo
'</table><center><a class="box" href="index.php?shoutbox">'
.
$lang
[
'archiv'
].
'</a>'
;
echo
"<br>Heute ist der<b> $datum</b> es ist<b> $zeit Uhr</b> und Deine IP (Name)ist:<br><b> $shoutbox_VALUE_name</b><br>"
;
?>