<?php
defined (
'main'
)
or
die
(
'no direct access'
);
$datum
=
date
(
" j.n.Y"
);
$zeit
=
date
(
" H:i"
);
if
(loggedin()) {
$shoutbox_VALUE_name
=
$_SESSION
[
'authname'
];
}
else
{
$shoutbox_VALUE_name
=
'Nickname'
;
}
if
(!
empty
(
$_POST
[
'shoutbox_submit'
]) AND chk_antispam (
'shoutbox'
)) {
$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(
'DELETE FROM `prefix_shoutbox` WHERE nickname = "'
.
$shoutbox_VALUE_name
.
'" AND textarea = "'
.
$shoutbox_textarea
.
'"'
);
db_query(
'INSERT INTO `prefix_shoutbox` VALUES ( "" , "'
.
$shoutbox_VALUE_name
.
'" , "'
.
$shoutbox_textarea
.
'" ) '
);
}
}
echo
'
<div style=
"width:99%; height:100px; 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'
);
while
(
$row
= db_fetch_object(
$erg
) ) {
$class
= (
$class
==
'Cmite'
?
'Cnorm'
:
'Cmite'
);
## Avatar
$width
=
"80"
;
$height
=
"80"
;
$ava
= db_fetch_assoc(db_query(
'SELECT `avatar`, `geschlecht` FROM `prefix_user` WHERE `name` = "'
.
$row
->nickname .
'"'
));
if
(!
empty
(
$ava
[
'avatar'
]) AND
file_exists
(
$ava
[
'avatar'
])) {
$avatar
=
'<img src="'
.
$ava
[
'avatar'
] .
'" width="'
.
$width
.
'" height="'
.
$height
.
'" alt="Avatar" border="0" />'
;
}
else
{
$ar
=
array
( 0 =>
$lang
[
'itdoesntmatter'
], 1 =>
$lang
[
'male'
], 2 =>
$lang
[
'female'
] );
$avatar
=
'<img src="include/images/avatars/'
.
$ar
[
$ava
[
'geschlecht'
]] .
'.jpg" width="'
.
$width
.
'" height="'
.
$height
.
'" alt="'
.
$ar
[
$ava
[
'geschlecht'
]] .
'" border="0" />'
;
}
echo
'
<tr
class
=
"'.$class.'"
>
<td style=
"font-size:9px;"
>
' . $avatar . '
<br /><b>
'.$row->nickname.'
</b>:</td><td style=
"font-size:8px;"
>
'.preg_replace( '
/([^\s]{
'.$allgAr['
sb_maxwordlength
'].'
})(?=[^\s])/
', "$1\n", BBcode($row->textarea)).'
</td>
</tr>';
}
echo
'</table></div>'
;
if
(has_right(
$allgAr
[
'sb_recht'
])) {
echo
'
<form method=
"post"
name=
"post"
action=
"index.php"
>
<input type=
"text"
name=
"shoutbox_textarea"
value=
""
size=
"87%"
onselect=
"storeCaret(this);"
onclick=
"storeCaret(this);"
onkeyup=
"storeCaret(this);"
>';
echo
get_antispam (
'shoutbox'
, 0);
echo
'
<input type=
"submit"
value=
"'.$lang['formsub'].'"
name=
"shoutbox_submit"
>
<input type=
"text"
size=
"1"
style=
"visibility:hidden;"
name=
"shoutbox_nickname"
value=
"'.$shoutbox_VALUE_name.'"
onFocus=
"if (value == \''.$shoutbox_VALUE_name.'\') {value = \'\'}"
onBlur=
"if (value == \'\') {value = \''.$shoutbox_VALUE_name.'\'}"
maxlength=
"15"
>
<a
class
=
"box"
href=
"index.php?shoutbox"
>
'.$lang['
archiv
'].'
</a>
</form>';
}