#!/usr/bin/perl use CGI qw(:standard); # /snip/ sub notify{ my ($aa, $ab, $ac, $ad, $ae)=@_; my ($et)=param("et"); if ($EMAILPROG and $EMAIL{$aa}){ if ($aa eq 'w'){$ad=" ... $ad"} $_=$ae; s/<[^>]*>/ /g; s/\s+/ /g; s/(^ | $)//g; # strip out html $ae=$_?qq! "$_"!:''; if (open (MAIL, "|$EMAILPROG $EMAIL{$aa}")){ print MAIL "Subject: [$ab]message: $ac. $ad\n"; print MAIL "texttesxttext $ab$ae:\n\n"; print MAIL "\n$et\n"; print MAIL "\n-----------------------------------------\nnoch mehr text-----------------------------------------\n"; close (MAIL); $err="Your move has been e-mailed to $NAME{$aa}. $err" } else{ $err="Warning: had problems e-mailing $NAME{$aa}. $err" } } } # /snip/ sub notify{ my ($plyr, $bd, $mvno, $mv, $title)=@_; my ($et)=param("et"); if ($EMAILPROG and $EMAIL{$plyr}){ if ($plyr eq 'w'){$mv=" ... $mv"} $_=$title; s/<[^>]*>/ /g; s/\s+/ /g; s/(^ | $)//g; # strip out html $title=$_?qq! "$_"!:''; if (open (MAIL, "|$EMAILPROG $EMAIL{$plyr}")){ print MAIL "Subject: [$bd]Chess: $mvno. $mv\n"; print MAIL "Your opponent (".$COLOUR{other($plyr)}.") just moved on board $bd$title:\n\n"; foreach (@moves){ print MAIL "$_\n" } print MAIL "\n$et\n"; print MAIL "\n\n$URL/$CGIPATH/$SCRIPT?dj=1&bd=$bd\n"; print MAIL "\n-----------------------------------------\nYou have been notified automatically by\nthe BeholderBoard Virtual Chess-set $VER\n-----------------------------------------\n"; close (MAIL); $err="Your move has been e-mailed to $COLOUR{$plyr}. $err" } else{ $err="Warning: had problems e-mailing $COLOUR{$plyr}. $err" } } } # /snip/ sub printBoard{ my $bd=shift; my ($y,$x,$isz,$timelapse,$t,$hlch,$hcch,$hmch,$fbch,$form,$status); my $onUnload=''; # /snip/ if ($plyr){ # /snip/ $emailtextLabel='your text'; $emailtextBox=''; } else{ # /snip/ } $form=< # /snip/ $emailtextLabel $emailtextBox