~;
($secx,$minx,$hourx,$ddx,$mmx,$yyx,$tmpx,$tmpx,$tmpx) = localtime(time + (86400*$displayevents));
$mmx = $mmx + 1;
$yyx = ($yyx % 100);
$yyx = ($yyx < 10) ? "0".$yyx : $yyx;
$date2 = $mmx."/".$ddx."/".$yyx." at 00:00:00";
$date2 = stringtotime($date2);
# Get Calendar Notes
fopen(FILE, "$vardir/Calendar/calendar.txt") || die "$txt{'23'} - $vardir/Calendar/calendar.txt";
@calendar=;
fclose(FILE);
require "$sourcedir/Subs.pl";
&timeformat($date);
($curmon, $curday, $curyear) = split(/\//, $date);
($curyear, $trash) = split(/ /, $curyear);
$calcount=0;
if ($displayevents == 0) {
# Display the amount of Calendar notes
if ($calcount == 0) {
$yymain .= qq~$caltxt{'3'}~;
} elsif ($calcount == 1) {
$yymain .= qq~$calcount $caltxt{'4'}. ~;
} elsif ($calcount >= 2) {
$yymain .= qq~$calcount $caltxt{'5'}. ~;
}
}
foreach $calentry (sort @calendar) {
$yy=substr($calentry,2,2);
$mm=substr($calentry,4,2);
$dd=substr($calentry,6,2);
$date1=$mm."/".$dd."/".$yy." at 00:00:00";
$date1 = stringtotime($date1);
$result = ($date2 - $date1) / 86400;
if ((($displayevents == 0) && (($dd == $curday) && ($mm == $curmon) && ($yy == $curyear))) ||
(($displayevents > 0) && (($result >= 0) && ($result <= $displayevents)))) {
$filename="20".$yy.$mm.$dd.".evt";
fopen (FILE,"$vardir/Calendar/$filename");
@daysevents=;
fclose(FILE);
foreach $event (sort @daysevents) {
if ($displayevents > 0) {
($message,$postuser,$calprivate) = split( /\|/, $event);
$preubbcmessage=$message;
if($enable_ubbc) { if(!$yyYaBBCloaded) { require "$sourcedir/YaBBC.pl"; } &DoUBBC; }
$message =~ s~(\S{80})(?=\S)~$1\n~g;
if($calprivate eq 0) {
if($calcount >= 1) {
$yymain .= qq~
~;
}
$yymain .= qq~$mm/$dd/20$yy : $message - ~;
if(!$yyUDLoaded{$postuser}) { &LoadUser($postuser); }
if(exists $userprofile{$postuser}) {
$yymain .= qq~ $userprofile{$postuser}->[1]~;
}
else {
$yymain .= qq~ $postuser
~;
}
}
}
$calcount++;
}
}
}
if ($show_birthdays == 1) {
# Get Birthdays
fopen(FILE, "$memberdir/memberlist.txt") || die "$txt{'23'} - $memberdir/memberlist.txt";
@members = ;
fclose(FILE);
foreach $usernames (@members) {
chomp $usernames;
$mem = $members;
fopen(FILE, "$memberdir/$usernames.dat") || die "$txt{'23'} - $memberdir/$usernames.dat";
@userbd = ;
fclose(FILE);
chomp $userbd[16];
($matchmon, $matchday, $matchyear) = split(/\//, $userbd[16]);
if ($matchday >= 1) {
if (($matchmon < $curmon) || (($matchmon == $curmon) && ($matchday < $curday))) {
$newy = $curyear + 1;
}
else {
$newy = $curyear;
}
$date1=$matchmon."/".$matchday."/".$newy." at 00:00:00";
$date1 = stringtotime($date1);
$result = ($date2 - $date1) / 86400;
if ((($displayevents == 0) && (($matchmon == $curmon) && ($matchday == $curday))) ||
(($displayevents > 0) && (($result >= 0) && ($result <= $displayevents)))) {
if($calcount >= 1) {
$yymain .= qq~ ~;
}
($matchyear, $trash) = split(/ /, $matchyear);
$age = 2000 + $newy - $matchyear;
&datestyle;
$yymain .= qq~$datestyle : $userbd[1] $caltxt{'17'} $age $caltxt{'18'}~;
}
$calcount++;
}
}
}
$show_holidays = 1;
if ($show_holidays == 1) {
fopen(HOLIDAYS, "$vardir/Calendar/holidays.txt") || die "$txt{'23'} - $vardir/Calendar/holidays.txt";
@holidays = ;
fclose(HOLIDAYS);
foreach $holiday (sort @holidays) {
($holi_date, $holi_day) = split(/\|/, $holiday);
if (length($holi_date) == 8)
{
$matchyear=substr($holi_date,2,2);
$matchmon=substr($holi_date,4,2);
$matchday=substr($holi_date,6,2);
}
elsif (length($holi_date) == 4)
{
$matchmon=substr($holi_date,0,2);
$matchday=substr($holi_date,2,2);
$matchyear=$curyear;
}
if (($matchmon < $curmon) || (($matchmon == $curmon) && ($matchday < $curday))) {
$newy = $curyear + 1;
}
else {
$newy = $curyear;
}
$date1=$matchmon."/".$matchday."/".$matchyear." at 00:00:00";
$date1 = stringtotime($date1);
$result = ($date2 - $date1) / 86400;
if ((($displayevents == 0) && (($matchday == $curday) && ($matchmon == $curmon) && ($matchyear == $curyear))) ||
(($displayevents > 0) && (($result >= 0) && ($result <= $displayevents)))) {
if ($displayevents > 0) {
if($calcount >= 1) {$yymain .= qq~ ~;}
&datestyle;
$yymain .= qq~$datestyle : $holi_day ~;
}
$calcount++;
}
}
}
if($calcount >= 1) {$yymain .= qq~ ~;}
$yymain .= qq~
$txt{'791'} $caltxt{'1'}
|
~;
if ($minical == 1)
{
$yymain .= qq~~;&minical;$yymain .= qq~ | ~;
}
$yymain .= qq~