also was muss mann eigentlich statt $sid und $uid einsetzen
die formulare:
start:
<perl>
if($sid=do_chat "/login", "nutzer")
{
out <<EOF;
<frameset rows="*,0,40" frameborder="0" border=0 framespacing="0" border="0">
<frameset cols="*,200" frameborder="0" border=0 framespacing="0" border="0">
<frame name="output" src="baseportal.pl?htx=/ailien5rpg_maker/chat/empty" frameborder="no">
<frame name="who" src="baseportal.pl?htx=/ailien5rpg_maker/chat/who" frameborder="no">
</frameset>
<frame name="dummy" src="baseportal.pl?htx=/ailien5rpg_maker/chat/wait&uid=$uid&sid=$sid" marginwidth="0" marginheight="0" scrolling="no" frameborder="no">
<frame name="input" src="baseportal.pl?htx=/ailien5rpg_maker/chat/input&uid=$uid&sid=$sid" marginwidth="0" marginheight="0" scrolling="no" frameborder="no">
</frameset>
EOF
} else
out "<center><br>";
out "<b>Anmeldung fehlgeschlagen!</b><p>" if $uid ne "";
out <<EOF;
Bitte melden Sie sich an:<p>
<table><form action="baseportal.pl?htx=/ailien5rpg_maker/chat/start" method="post" enctype="multipart/form-data">
<input type="hidden" name="htx=" value="/ailien5rpg_maker/chat/start">
<tr><td align=right><font face=arial size=3>Name:</td><td><input type=text name="uid=" value="$_get{uid}" size=12></td></tr>
<tr><td align=right><font face=arial size=3>Passwort:</td><td><input type=password name="upw=" size=12></td></tr>
<tr><td></td><td><input type=submit value="Anmelden"></td></tr>
</form></table>
</perl>
$eingabe="" if $eingabe eq "/hello" || $eingabe eq "/bye";
@chat=do_chat $eingabe, "", $farbe;
$out="";
out "<script>a=parent.who.document.forms[0];b=parent.output;c=b.document;";
for(my $i=0; $i<@chat; $i++)
{
$c=$chat[$i]; chomp $c;
my ($line,$name,$time,$text,$ort,$farbe)=split /\|/,$c;
my $an="";
if($text=~ /^:([^ ]*) (.*)/)
{
$an=$1; $text=$2;
}
$newline||=$line;
last if $thisline ne "" && $thisline>=$line;
$cmd="";
if(($cmd,$params)=$text=~ /^\/([^ ]*) (.*)/)
{
if($out_who eq "" && ($cmd eq "who" || $cmd eq "hello" || $cmd eq "bye"))
{
$out_who="w=parent.who.document;w.open();w.write('<script>function f() { window.setTimeout(\"parent.input.document.forms[0].elements[2].focus();\",50) }</sc');w.writeln('ript><body bgcolor=f0f0f0><form>";
$out_who.="<table cellpadding=2 cellspacing=3 width=100%><tr><td><input type=radio name=\"an\" value=\"$_\" onclick=\"f()\" checked></td><td width=100% bgcolor=ffffff>ALLE</td></tr><tr><td></td></tr>";
foreach (split / /,$params)
{
if($_ eq $uid)
{
$out_who.="<tr><td></td><td> <b>$_</b></td></tr>";
} else
{
$out_who.="<tr><td><input type=radio name=\"an\" value=\"$_\" onclick=\"f()\"></td><td bgcolor=ffffff> $_</td><td><input type=checkbox name=\"$_\" onclick=\"f()\"></td></tr>";
}
}
$out_who.="</table></form>');w.close();";
next if $cmd eq "who";
}
}
if($an eq "" || $uid=~ /^$an/i || $uid eq $name)
{
my $xname=$name; $xname=~ s/'/\\'/g;
$name="($name)" if $ort eq "b";
$name="$name flüstert Dir zu" if $an ne "" && $uid=~ /^$an/i;
$name="Du flüsterst $an zu" if $an ne "" && $uid eq $name;
($name, $text)=("[System]", "+++ <b>$name</b> betritt den Chat +++") if $cmd eq "hello";
($name, $text)=("[System]", "--- <b>$name</b> verlässt den Chat ---") if $cmd eq "bye";
$out="if(parent.line<$newline && (!a.elements['$xname'] || !a.elements['$xname'].checked)) c.writeln('<font color=$farbe><b>$name <font size=2>($time)</font>:</b> $text</font><br>');$out";
}
}
out "${out}b.scroll(1,99999);${out_who}parent.line=$newline;window.setTimeout(\"location.href='baseportal.pl?htx=/ailien5rpg_maker/chat/output&thisline=$newline&uid=$uid&sid=$sid\",8000);</script>";
</perl>
input:
<script>
function do_submit()
{
if(navigator.appName!="Netscape" || parseInt(navigator.appVersion)!=4)
{
rb=parent.who.document.forms[0].an;
for(i=1; i<rb.length; i++)
{
if(rb[i].checked)
{
f.elements[2].value=":"+rb[i].value+" "+f.elements[2].value;
break;
}
}
}
f.elements[1].value=parent.line;
f.submit();
window.setTimeout("f.elements[2].value='';",10);
}
</script>
<body bgcolor=e0e0e0 onload="parent.line=1; f=document.forms[0]; f.elements[2].focus()">
<form action="baseportal.pl?htx=/ailien5rpg_maker/chat/output" method="get" target="dummy" onSubmit="do_submit();return false;" autocomplete="off">
<table height=100%><tr><td valign=top nowrap>
<input type="hidden" name="htx" value="/ailien5rpg_maker/chat/output">
<input type="hidden" name="thisline" value="">
Text: <input type="text" name="eingabe" size=60 maxlength=500>
</td><td valign=top nowrap>Farbe: <select name="farbe" onChange="f.elements[2].focus();"><option value="black">Schwarz<option value="blue">Blau<option value="red">Rot<option value="green">Grün<option value="darkorange">Orange</select>
<input type="hidden" name="uid" value="$uid">
<input type="hidden" name="sid" value="$sid">
</td></table>
</form>
</body>
wait:
<script>
window.setTimeout("location.href='baseportal.pl?htx=/ailien5rpg_maker/chat/output&uid=$uid&sid=$sid'",1000)
</script>