<center>
<?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, 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_shoutbox` VALUES ( "" , "'
.
$shoutbox_nickname
.
'" , "'
.
$shoutbox_textarea
.
'" ) '
);
$anz
= db_count_query(
'SELECT COUNT(id) FROM `prefix_shoutbox`'
);
if
(
$anz
> 50) {
db_query(
'DELETE FROM `prefix_shoutbox` ORDER BY id LIMIT 0,'
.
$anz
-50);
}
}
echo
'<form action="index.php" method="POST">'
;
echo
'<input type="hidden" name="shoutbox_nickname" value="'
.
$shoutbox_VALUE_name
.
'" />'
;
echo
'<br /><textarea cols="26" rows="2" name="shoutbox_textarea"></textarea><br />'
;
echo
'<input type="submit" value="'
.
$lang
[
'formsub'
].
'" name="shoutbox_submit">'
;
}
else
{
echo
"<font color=#FFFFFF><b><br>Zum Posten<br>Bitte Einloggen!<p></p></b></font>"
;
echo
"Deine IP:<br><b>$shoutbox_VALUE_name</b><br><br>"
;
echo
'</form><table width="138" align="center" class="border" cellpadding="2" cellspacing="1" border="0">'
;
}
echo
'</form><table width="138" class="border" cellpadding="2" cellspacing="1" border="0">'
;
$erg
= db_query(
'SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT 6'
);
$class
=
'Cnorm'
;
while
(
$row
= db_fetch_object(
$erg
) ) {
$class
= (
$class
==
'Cmite'
?
'Cnorm'
:
'Cmite'
);
echo
'<tr class="'
.
$class
.
'"><td><b>'
.
$row
->nickname.
':</b> '
.preg_replace(
'/([^s]{22})(?=[^s])/'
,
"$1n"
,
$row
->textarea).
'</td></tr>'
;
}
echo
'</table><a class="box" href="index.php?shoutbox">'
.
$lang
[
'archiv'
].
'</a>'
;
?>
</center>