<?php
# Copyright by Manuel Staechele
# Support www.ilch.de
# modifieziert von: Burli
defined (
'main'
)
or
die
(
'no direct access'
);
function
shoutboxsmileys(
$string
){
$smileys
=
array
(
':-)'
=>
':smilie:#@#-_-_-#@#smile.gif'
,
':-$'
=>
':unknow:#@#-_-_-#@#dntknw.gif'
,
':-('
=>
':sad:#@#-_-_-#@#sad.gif'
,
';-)'
=>
':blinking:#@#-_-_-#@#blinking.gif'
,
'8-)'
=>
':cool:#@#-_-_-#@#cool.gif'
,
':-P'
=>
':tongueout:#@#-_-_-#@#tongueout.gif'
,
':´-('
=>
':cray:#@#-_-_-#@#cray.gif'
,
'lol'
=>
':*lol*:#@#-_-_-#@#lol.gif'
,
'joke'
=>
':joke:#@#-_-_-#@#jokingly.gif'
,
'tease'
=>
':tease:#@#-_-_-#@#tease.gif'
,
'yahoo'
=>
':yahoo:#@#-_-_-#@#yahoo.gif'
,
'happy'
=>
':happy:#@#-_-_-#@#happy.gif'
,
'good'
=>
':good:#@#-_-_-#@#good.gif'
,
'quiet'
=>
':quiet:#@#-_-_-#@#quiet.gif'
,
'blush'
=>
':blush:#@#-_-_-#@#blush.gif'
,
'give_rose'
=>
':give_rose:#@#-_-_-#@#give_rose.gif'
,
'give_heart'
=>
':give_heart:#@#-_-_-#@#give_heart.gif'
,
'n8'
=>
':n8:#@#-_-_-#@#n8.gif'
,
'help'
=>
':help:#@#-_-_-#@#help.gif'
,
'grr'
=>
':grr:#@#-_-_-#@#diablo.gif'
,
'prost'
=>
':prost:#@#-_-_-#@#drinks.gif'
);
foreach
(
$smileys
as
$icon
=>
$info
) {
list(
$emo
,
$url
) =
explode
(
'#@#-_-_-#@#'
,
$info
);
$string
=
str_replace
(
$icon
,
'<img src="include/images/shoutboxsmileys/'
.
$url
.
'" border="0" alt="'
.
$emo
.
'" title="'
.
$emo
.
'" />'
,
$string
);
}
return
$string
;
}
$shoutbox_VALUE_name2
=
getenv
(
"REMOTE_ADDR"
);
$datum
=
date
(
"j.n.Y"
);
$zeit
=
date
(
" H:i "
);
$width
=
$allgAr
[
'sbbox_width'
];
$height
=
$allgAr
[
'sbbox_height'
];
echo
'<style type=
"text/css"
>
{
width:
'.$width.'
;
height:
'.$height.'
;
}
</style>';
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, 25);
$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
(is_admin() ){
if
(!
empty
(
$shoutbox_textarea
) ) {
db_query(
'INSERT INTO `prefix_shoutbox` VALUES ( "" , "'
.
$datum
.
'/'
.
$zeit
.
'<font color=#FF0033>'
.
$shoutbox_nickname
.
'</font>" , "'
.
$shoutbox_textarea
.
'" ) '
);
}
}
else
{
if
(has_right(-3) ){
if
(!
empty
(
$shoutbox_textarea
) ) {
db_query(
'INSERT INTO `prefix_shoutbox` VALUES ( "" , "'
.
$datum
.
'/'
.
$zeit
.
'<font color=#00FF00>'
.
$shoutbox_nickname
.
'</font>" , "'
.
$shoutbox_textarea
.
'" ) '
);
}
}
else
{
if
( !
empty
(
$shoutbox_nickname
) AND !
empty
(
$shoutbox_textarea
) ) {
db_query(
'INSERT INTO `prefix_shoutbox` VALUES ( "" , "'
.
$datum
.
'/'
.
$zeit
.
''
.
$shoutbox_nickname
.
'" , "'
.
$shoutbox_textarea
.
'" ) '
);
}
}
}
}
if
(has_right(
$allgAr
[
'sb_recht'
])){
echo
'<form action="index.php?'
.
$menu
->get_complete().
'" method="POST" name="shoutbox">'
;
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="15">'
;
echo
'<br /><textarea style="width: 80%" cols="15" rows="2" name="shoutbox_textarea"></textarea><br />'
;
echo
get_antispam (
'shoutbox'
, 0);
echo
'<center><b>Adminfarbe: ROT</center></b>'
;
echo
'<center><b>Memberfarbe: GRÜN</center></b>'
;
echo
'<br><br>'
;
echo
'<div style="overflow:no; width: '
.
$width
.
';">'
;
?>
<script type=
"text/javascript"
>
function
switchlayer(Layer_Name)
{
var
GECKO = document.getElementById? 1:0 ;
var
NS = document.layers? 1:0 ;
var
IE = document.all? 1:0 ;
if
(GECKO)
{document.getElementById(Layer_Name).style.display=
(document.getElementById(Layer_Name).style.display==
'block'
) ?
'none'
:
'block'
;}
else
if
(NS)
{document.layers[Layer_Name].display=(document.layers[Layer_Name].display==
'block'
) ?
'none'
:
'block'
;}
else
if
(IE)
{document.all[Layer_Name].style.display=(document.all[Layer_Name].style.display==
'block'
) ?
'none'
:
'block'
;}
}
</script>
<a href=
"include/boxes/smileys.php"
onclick="javascript:switchlayer(
'smileys'
);
return
false;"><b><center>Hier für Smilies klicken</center></b></a><br/>
<ul id=
"smileys"
type=
"circle"
style=
"display:none;"
>
<script type=
"text/javascript"
>
var
tagOpen =
'['
;
var
tagClos =
']'
;
var
tagEnde =
'/'
;
function
simple(name) {
aTag = tagOpen + name + tagClos;
eTag = tagOpen + tagEnde + name + tagClos;
simple_insert ( aTag, eTag );
}
function
simple_insert_sb(aTag,eTag) {
var
input = document.forms[
'shoutbox'
].elements[
'shoutbox_textarea'
];
input.focus();
if
(typeof document.selection !=
'undefined'
) {
var
range = document.selection.createRange();
var
insText = range.text;
range.text = aTag + insText + eTag;
range = document.selection.createRange();
if
(insText.length == 0) {
range.move(
'character'
, -eTag.length);
}
else
{
range.moveStart(
'character'
, aTag.length + insText.length + eTag.length);
}
range.select();
}
else
if
(typeof input.selectionStart !=
'undefined'
)
{
var
start = input.selectionStart;
var
end
= input.selectionEnd;
var
insText = input.value.substring(start,
end
);
input.value = input.value.
substr
(0, start) + aTag + insText + eTag + input.value.
substr
(
end
);
var
pos;
if
(insText.length == 0) {
pos = start + aTag.length;
}
else
{
pos = start + aTag.length + insText.length + eTag.length;
}
input.selectionStart = pos;
input.selectionEnd = pos;
}
else
{
var
pos = input.value.length;
var
insText = prompt(
"Bitte geben Sie den zu formatierenden Text ein:"
);
input.value = input.value.
substr
(0, pos) + aTag + insText + eTag + input.value.
substr
(pos);
}
}
function
simple_insert(aTag,eTag) {
var
input = document.forms[
'form'
].elements[
'txt'
];
input.focus();
if
(typeof document.selection !=
'undefined'
) {
var
range = document.selection.createRange();
var
insText = range.text;
range.text = aTag + insText + eTag;
range = document.selection.createRange();
if
(insText.length == 0) {
range.move(
'character'
, -eTag.length);
}
else
{
range.moveStart(
'character'
, aTag.length + insText.length + eTag.length);
}
range.select();
}
else
if
(typeof input.selectionStart !=
'undefined'
)
{
var
start = input.selectionStart;
var
end
= input.selectionEnd;
var
insText = input.value.substring(start,
end
);
input.value = input.value.
substr
(0, start) + aTag + insText + eTag + input.value.
substr
(
end
);
var
pos;
if
(insText.length == 0) {
pos = start + aTag.length;
}
else
{
pos = start + aTag.length + insText.length + eTag.length;
}
input.selectionStart = pos;
input.selectionEnd = pos;
}
else
{
var
pos = input.value.length;
var
insText = prompt(
"Bitte geben Sie den zu formatierenden Text ein:"
);
input.value = input.value.
substr
(0, pos) + aTag + insText + eTag + input.value.
substr
(pos);
}
}
function
simple_liste () {
var
x =
''
;
var
l =
''
;
while
( x != null ) {
x = prompt (
"Um die Liste zu beenden 'Abbrechen' eingeben"
);
if
( x != null ) {
l = l +
"[*]"
+ x +
"\n"
;
}
}
if
( l !=
''
) {
l =
"[list]\n"
+ l +
"[/list]"
;
simple_insert ( l,
''
);
}
}
function
put ( towrite ) {
simple_insert ( towrite,
''
);
}
function
put_sb ( towrite ) {
simple_insert_sb ( towrite,
''
);
}
function
check() {
if
( form.txt.value ==
''
) {
alert (
'Bis jetzt wurde wohl noch nichts eingegeben, also schnell nachholen!'
);
return
false;
}
else
{
if
( form.pageName.value ==
''
) {
alert (
'Bitte gib noch schnell einen Namen ein!'
);
return
false;
}
else
{
return
true;
}
}
}
</script>
<?php
echo
'<a href=
"javascript:put_sb(\':-)\')"
><img src=
"include/images/shoutboxsmileys/smile.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\':-$\')"
><img src=
"include/images/shoutboxsmileys/dntknw.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\':-(\')"
><img src=
"include/images/shoutboxsmileys/sad.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\';-)\')"
><img src=
"include/images/shoutboxsmileys/blinking.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'8-)\')"
><img src=
"include/images/shoutboxsmileys/cool.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\':-P\')"
><img src=
"include/images/shoutboxsmileys/tongueout.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\':´-(\')"
><img src=
"include/images/shoutboxsmileys/cray.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'lol\')"
><img src=
"include/images/shoutboxsmileys/lol.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'joke\')"
><img src=
"include/images/shoutboxsmileys/jokingly.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'tease\')"
><img src=
"include/images/shoutboxsmileys/tease.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'happy\')"
><img src=
"include/images/shoutboxsmileys/happy.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'yahoo\')"
><img src=
"include/images/shoutboxsmileys/yahoo.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'good\')"
><img src=
"include/images/shoutboxsmileys/good.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'quiet\')"
><img src=
"include/images/shoutboxsmileys/quiet.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'blush\')"
><img src=
"include/images/shoutboxsmileys/blush.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'give_rose\')"
><img src=
"include/images/shoutboxsmileys/give_rose.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'give_heart\')"
><img src=
"include/images/shoutboxsmileys/give_heart.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'n8\')"
><img src=
"include/images/shoutboxsmileys/n8.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'help\')"
><img src=
"include/images/shoutboxsmileys/help.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'grr\')"
><img src=
"include/images/shoutboxsmileys/diablo.gif"
border =
"0"
/></a>
<a href=
"javascript:put_sb(\'prost\')"
><img src=
"include/images/shoutboxsmileys/drinks.gif"
border =
"0"
/></a>';
echo
'</ul>'
;
echo
'</div>'
;
echo
'<br>'
;
echo
'<input type="submit" value="'
.
$lang
[
'formsub'
].
'" name="shoutbox_submit">'
;
echo
'</form>'
;
}
echo
'<div style="overflow:auto; width: '
.
$width
.
'; height: '
.
$height
.
';">'
;
echo
'<table width="100%" class="border" cellpadding="2" cellspacing="1" border="0">'
;
$erg
= db_query(
'SELECT * FROM `prefix_shoutbox` ORDER BY id DESC LIMIT '
.(
is_numeric
(
$allgAr
[
'sb_limit'
])?
$allgAr
[
'sb_limit'
]:5));
$class
=
'Cnorm'
;
while
(
$row
= db_fetch_object(
$erg
) ) {
$class
= (
$class
==
'Cmite'
?
'Cnorm'
:
'Cmite'
);
echo
'<tr class="'
.
$class
.
'"><td><b>'
.
$row
->nickname.
':</b> '
.shoutboxsmileys(bbcode(preg_replace(
'/([^\s]{'
.
$allgAr
[
'sb_maxwordlength'
].
'})(?=[^\s])/'
,
"$1\n"
,
$row
->textarea))).
'</td></tr>'
;
}
echo
"</table></div><center><br>Es ist der: $datum <br>um $zeit <br>Deine IP:<b><blink> $shoutbox_VALUE_name2</b></blink><br>wird gespeichert"
;
echo
'<br><b><a class="box" href="index.php?shoutbox">'
.
$lang
[
'archiv'
].
'</a></b></center>'
;
?>