# yChat - Copyright by Paul C. Bütow ########################### Dieser Teil bestimmt die Standart-Variabeln. ##STANDART-CONFIGURATION:## (CSS, Farben, Version etc.) ########################### $datum = "11.02.01"; $version = "0.4.9"; $title = "yChat [$version]"; $gfxpath = "../../yChat"; $style = < body { background-color: #005146 } body.blank { background-color: #000000 } body.online { background-color: #000000 } div { font-family: arial, verdana, helvetiva; font-size: 9pt; color: #ffffff } div.b { font-weight: bold; color: #ffa500 } a { color: #ffffef; } a:hover { color: #ffffff; } p { font-family:verdana, arial, geneva, helvetica, sans-serif; color:#FFFFFF; font-size:12px; } ENDCSS ############### Dieser TeFil enthält Programmcode, der an verschiedenen ##SHARED-SUBS## Stellen ausgeführt werden muß und jedem Skript zur ############### Verfügung steht. sub printfile { # Liest eine externe Datei ein und gibt sie mit print aus my ($file2print,$pagetitle,$bodyclass) = @_; if ($pagetitle ne "") { &start_html($pagetitle,$bodyclass); } open(FILE2PRINT,"<$file2print"); @file2print = ; close FILE2PRINT; print @file2print; } sub start_html { # Der HEADER einer HTML-Datei print ""; print "" if ($_[1] eq "online"); print < $title - $_[0] $_[2] $style END if ($_[1] eq "start") { print ""; } elsif ($_[1] ne "") { print ""; } else { print ""; } } sub post { # Öffentliche Nachricht posten. my ($room,$msg2post,$secroom) = @_; my @rooms = $room; @rooms = ($room,$secroom) if ($room ne $secroom); foreach $raum (@rooms) { open(MSGFILE,">>data/msgs/$raum"); print MSGFILE "!<;".time."<;!<;!<;$msg2post<;\n"; close MSGFILE; opendir(PID,"data/online/pids/$raum"); my @pids = readdir(PID); closedir(PID); foreach(@pids) { if (-f "data/online/pids/$raum/$_") { kill USR1 => $_; } } } &log($msg2post) if ($room eq "Cyberbar"); } sub post_prv { # Private Nachricht posten (flüstern). my ($alias2post,$msg2post) = @_; opendir(DIR,"data/online/rooms"); my @dir = readdir(DIR); closedir(DIR); foreach $raum (@dir) { opendir(DIR,"data/online/rooms/$raum"); my @chatter = readdir(DIR); closedir(DIR); foreach $chatter (@chatter) { if ($chatter eq $alias2post) { open(MSGFILE,">>data/msgs/$raum"); print MSGFILE "$alias2post<;".time."<;!<;!<;$msg2post<;\n"; close MSGFILE; opendir(PID,"data/online/pids/$raum"); my @pids = readdir(PID); closedir(PID); foreach(@pids) { if (-f "data/online/pids/$raum/$_") { kill USR1 => $_; } } goto ENDPRV; } } } ENDPRV: } sub log { # Protokollieren der Nachrichten etc. local $msg2log = $_[0]; &zeit; my $js; ($msg2log,$js) = split(/