<perl>
out qq(<b>Tag-Form</b> zum "TESTEN", siehe <a href="http://baseportal.de/cgi-bin/baseportal.pl?show=/bei123/FORUM">Code</a><hr>);

$bp_user=(split(/\//,$htx))[1];  ## baseportal-Account merken
#--------------------------------------------------------------
if($FO eq "put")
{##
$_put{Eintrag} =~ s#\n\n\n#\n#g; # zuviele Leerzeilen entfernen
$_put{Eintrag} =~ s/\n/&#182;/g; # Umbrüche ersetzen
$_put{Betreff} = convert_html($_put{Betreff});
#-------------------------------------------------------------- Eingabe in htx schreiben
put qq(<forum _sid_="$_session" _time_=").time().qq(" _name_="$_put{Name}" _btr_="$_put{Betreff}"  _input_="$_put{Nr}">$_put{Eintrag}</forum>), "/$bp_user/_FORUM.htx";

#outl dump(%_put);

}##

##-------------------------------------------------------------- Tag-Hash definieren
%FORUM_TAGS=("forum" =>sub{
$x++;
my $_ein_="$_";
$_ein_ =~ s/&#182;/\n/g;
$Forum{Input}{"$_time_.$_sid_"}=["$_input_","$_time_","$_name_","$_btr_","$_ein_"];
$Forum{_fnr}{"$x"}="$_time_.$_sid_";
$Forum{_fid}{"$_time_.$_sid_"}="$x";
$Forum{_amount}=$x;
#-------------------------------------------------------------- Anzahl der Texte des Namen
$Forum{Texte}{${$Forum{Input}{"$_time_.$_sid_"}}[2]}{Anzahl}++;
#-------------------------------------------------------------- Weitere Eintrags-Nr(_fnr) des Namen
push(@{$Forum{Texte}{${$Forum{Input}{"$_time_.$_sid_"}}[2]}{Nr}},$Forum{_fid}{"$_time_.$_sid_"}); 
},);

##------------------------------------------------------------- Eingaben aus htx einlesen
my @i=get "/$bp_user/_FORUM.htx","raw";
##------------------------------------------------------------- Eingaben über Tag-Hash parsen
parse "@i",\%FORUM_TAGS;

#outl dump(%Forum);

##------------------------------------------------------------- gewählten Listeneintrag anzeigen
if($Nr > 0)
{##
out qq(<div style="background:#c0d0f0;border-bottom:1px solid silver">);
out "<span style='background:#f0f0f0;padding:2px'><b>".${$Forum{Input}{$Forum{_fnr}{$Nr}}}[2]."</b></span>  <span style='font-size:0.81em'>| ";
outl &time4me(${$Forum{Input}{$Forum{_fnr}{$Nr}}}[1])." | Einträge gesamt: $Forum{Texte}{${$Forum{Input}{$Forum{_fnr}{$Nr}}}[2]}{Anzahl} | </span>";
out ${$Forum{Input}{$Forum{_fnr}{$Nr}}}[3];
out "<p style='padding:2px;font-size:0.9em;background:#f0f0f0'>".convert_br(convert_links(${$Forum{Input}{$Forum{_fnr}{$Nr}}}[4]))."</p>";
out "</div>";
}##

##--------------------------------------------------------------- Formular für Neu-Eintrag anzeigen
out &formular();

##--------------------------------------------------------------- Einträge als Liste ausgeben 
foreach (reverse(sort {${$Forum{_fnr}}{$a} <=> ${$Forum{_fnr}}{$b}}( keys(%{$Forum{_fnr}} ))))
{##
out qq(<div style="background:#f0f0f0;border-bottom:1px solid silver">);
out "<span style='background:#e0e0e0;border-bottom:1px solid #ffffff'>".${$Forum{Input}{$Forum{_fnr}{$_}}}[2]." <span style='font-size:0.81em'> | ".&time4me(${$Forum{Input}{$Forum{_fnr}{$_}}}[1])." | Einträge gesamt: $Forum{Texte}{${$Forum{Input}{$Forum{_fnr}{$_}}}[2]}{Anzahl}|</span></span><br> ";
out qq(<span style="font-size:0.81em"><a href="$_link&Nr=$Forum{_fid}{$Forum{_fnr}{$_}}">${$Forum{Input}{$Forum{_fnr}{$_}}}[3]</a></span></div>);
}##

sub formular
{## simples Eingabeformular für NEU
#oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
my $rF=qq(<fieldset><legend>Forum/Beitrag NEU</legend>
<form name="Forum" action="$_link" method="post" enctype="multipart/form-data">
<input type="hidden" name="ID" value="$ID">
<input type="hidden" name="FO" value="put">
<input type="hidden" name="sid" value="$_session">
<table><tr><td>Name:</td><td><input type="text" name="Name:=" size="50" maxlength="50"></td></tr>
<tr><td>Betr.:</td><td><input type="text" name="Betreff:=" size="100" maxlength="200"></td></tr>
<tr><td>Text:</td><td><textarea rows="10" cols="80" type="text" name="Eintrag:="></textarea></td></tr>
<tr><td></td><td><input type="submit" value="Senden"><input type="reset" value="Reset"></td></tr>
</table></form></fieldset>);
return($rF);
#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
}##

sub time4me
{## Kurz Datum mit Uhrzeit ausgeben
#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
my @timeT=split(/,/,datum(($_[0]||time()),($_[1]||"Wochentag, Tag0.Monat0.Jahr - Stunde:Minute.Sekunde")));
return(substr($timeT[0],0,2).". ".$timeT[1]);
#ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
}##
</perl>