############################################################################### # EventCalSet.pl # ############################################################################### # YaBB: Yet another Bulletin Board # # Open-Source Community Software for Webmasters # # Version: YaBB 3.0 Beta # # Packaged: October 05, 2010 # # Distributed by: http://www.yabbforum.com # # =========================================================================== # # Copyright (c) 2000-2010 YaBB (www.yabbforum.com) - All Rights Reserved. # # Software by: The YaBB Development Team # # with assistance from the YaBB community. # ############################################################################### $eventcalsetplver = 'YaBB 3.0 Beta $Revision: 328 $'; if ($action eq 'detailedversion') { return 1; } &LoadLanguage('EventCal'); eval { require "$vardir/eventcalset.txt"; }; if ($Show_EventCal eq '') { &EventCalSet2; } ## Calendar Setting ## sub EventCalSet { &is_admin_or_gmod; my ($caleventprivatechecked); # figure out what to print my $status_calendar = "red1.gif"; my $status_bdlist = "red1.gif"; if (!$Scroll_Events) { $aevt1 = ' selected="selected"'; } elsif ($Scroll_Events == 1) { $aevt2 = ' selected="selected"'; } elsif ($Scroll_Events == 2) { $aevt3 = ' selected="selected"'; } elsif ($Scroll_Events == 3) { $aevt4 = ' selected="selected"'; } if (!$Show_EventCal) { $bevt1 = ' selected="selected"'; } elsif ($Show_EventCal == 1) { $bevt2 = ' selected="selected"'; $status_calendar = "green1.gif"; } elsif ($Show_EventCal == 2) { $bevt3 = ' selected="selected"'; $status_calendar = "green1.gif"; } if (!$Show_EventButton) { $cevt1 = ' selected="selected"'; } elsif ($Show_EventButton == 1) { $cevt2 = ' selected="selected"'; } elsif ($Show_EventButton == 2) { $cevt3 = ' selected="selected"'; } if (!$Show_BirthdaysList) { $devt1 = ' selected="selected"'; } elsif ($Show_BirthdaysList == 1) { $devt2 = ' selected="selected"'; $status_bdlist = "green1.gif"; } elsif ($Show_BirthdaysList == 2) { $devt3 = ' selected="selected"'; $status_bdlist = "green1.gif"; } if (!$Show_BirthdayButton) { $eevt1 = ' selected="selected"'; } elsif ($Show_BirthdayButton == 1) { $eevt2 = ' selected="selected"'; } elsif ($Show_BirthdayButton == 2) { $eevt3 = ' selected="selected"'; } if (!$Show_BirthdayDate) { $fevt1 = ' selected="selected"'; } elsif ($Show_BirthdayDate == 1) { $fevt2 = ' selected="selected"'; } elsif ($Show_BirthdayDate == 2) { $fevt3 = ' selected="selected"'; } if (!$Show_EventBirthdays) { $gevt1 = ' selected="selected"'; } elsif ($Show_EventBirthdays == 1) { $gevt2 = ' selected="selected"'; } elsif ($Show_EventBirthdays == 2) { $gevt3 = ' selected="selected"'; } if ($Show_BirthdaysList) { $onbirthlistchecked = "checked='checked'" } if ($Show_MiniCalIcons) { $onminiiconchecked = "checked='checked'" } if ($ShowSunday) { $onsundaychecked = "checked='checked'" } if ($CalEventPrivate) { $caleventprivatechecked = "checked='checked'" } if ($DisplayCalEvents) { $dcaleventschecked = "checked='checked'" } if ($Show_ColorLinks) { $oncolorlinkschecked = "checked='checked'" } if ($No_ShortUbbc) { $onnosubbcchecked = "checked='checked'" } if ($Show_BdColorLinks) { $onbdcolorlinkschecked = "checked='checked'" } if (!$Event_TodayColor) { $Event_TodayColor = "#ff0000"; } else { $Event_TodayColor = lc($Event_TodayColor); } if (!$Delete_EventsUntil) { $Delete_EventsUntil = "0"; } if (!$CalEventNoName) { $noname1 = ' selected="selected"'; } elsif ($CalEventNoName == 1) { $noname2 = ' selected="selected"'; } elsif ($CalEventNoName == 2) { $noname3 = ' selected="selected"'; } require "$admindir/ManageBoards.pl"; $CalEventPerms =~ s/,/, /g; $CalEventPerms = &DrawPerms($CalEventPerms); $yymain .= qq~
$event_cal{'1'}
$event_cal{'21'}
     
$event_cal{'22'}

$event_cal{'23'}
$event_cal{'49'}



~; ## Calendar Event-Icon Setting ## eval{ require "$vardir/eventcalIcon.txt"; }; $yymain .= qq~
~; $i=0; while($CalIconURL[$i]) { $yymain .= qq~ ~; $i++ } $yymain .= qq~ ~; $inew = 0; while ($inew <= "3") { $yymain .= qq~ ~; $i++; $inew++; } $yymain .= qq~
$event_cal{'26'}

$event_cal{'33'}

$event_cal{'27'} $event_cal{'28'} $event_cal{'29'} $var_cal{'caldel'}
$event_cal{'30'}
 

~; $yytitle = $event_cal{'1'}; $action_area = "eventcal_set"; &AdminTemplate; exit; } ## Save Calendar Setting ## sub EventCalSet2 { &is_admin_or_gmod; if ($FORM{'rebuiltbd'} eq "$event_cal{'54'}") { &delete_DBorFILE("$vardir/eventcalbday.db"); my @eventcalbday; &ManageMemberinfo("load"); foreach (keys %memberinf) { my (undef, undef, undef, undef, undef, undef, $membday) = split(/\|/, $memberinf{$_}, 7); if ($membday) { my ($user_month, $user_day, $user_year) = split(/\//, $membday); if ($user_month < 10 && length($user_month) == 1) { $user_month = "0$user_month"; } if ($user_day < 10 && length($user_day) == 1) { $user_day = "0$user_day"; } push(@eventcalbday, qq~$user_year|$user_month|$user_day|$_\n~); } } &write_DBorFILE(0,'',$vardir,'eventcalbday','db',@eventcalbday); undef %memberinf; $yySetLocation = qq~$adminurl?action=eventcal_set;rebok=1~; &redirectexit; } else { # Set 1 or 0 if box was checked or not map { ${$_} = $FORM{$_} ? 1 : 0; } qw/Show_MiniCalIcons CalEventPrivate DisplayCalEvents ShowSunday Show_ColorLinks No_ShortUbbc Show_BdColorLinks/; # If empty fields are submitted, set them to default-values to save yabb from crashing $DisplayEvents = $FORM{'DisplayEvents'}; $DisplayEvents =~ s~[^\d]~~g; $DisplayEvents = $DisplayEvents || 0; $Scroll_Events = $FORM{'Scroll_Events'} || 0; $Show_EventCal = $FORM{'Show_EventCal'} || 0; $Show_EventButton = $FORM{'Show_EventButton'} || 0; $Show_EventButton = $Show_EventCal if $Show_EventButton > $Show_EventCal; $Show_EventBirthdays = $FORM{'Show_EventBirthdays'} || 0; $Show_EventBirthdays = $Show_EventCal if $Show_EventBirthdays > $Show_EventCal; $Show_BirthdaysList = $FORM{'Show_BirthdaysList'} || 0; $Show_BirthdayButton = $FORM{'Show_BirthdayButton'} || 0; $Show_BirthdayButton = $Show_BirthdaysList if $Show_BirthdayButton > $Show_BirthdaysList; $Show_BirthdayDate = $FORM{'Show_BirthdayDate'} || 0; $CalEventNoName = $FORM{'CalEventNoName'} || 0; $Event_TodayColor = uc($FORM{'Event_TodayColor'} || "#FF0000") . '000000'; $Event_TodayColor =~ s/[^a-fA-F0-9#]//g; $Event_TodayColor = substr($Event_TodayColor,0,7); $Delete_EventsUntil = $FORM{'Delete_EventsUntil'} || 0; $CalShortEvent = $FORM{'CalShortEvent'}; $CalShortEvent =~ s~[^\d]~~g; $CalShortEvent = $CalShortEvent || 0; $CalEventPerms = $FORM{'CalEventPerms'} || ""; $CalEventPerms =~ s~^\s*,\s*|\s*,\s*$~~g; $CalEventPerms =~ s~\s*,\s*~,~g; $CalEventMods = $FORM{'CalEventMods'} || ""; $CalEventMods =~ s~^\s*,\s*|\s*,\s*$~~g; $CalEventMods =~ s~\s*,\s*~,~g; require "$admindir/NewSettings.pl"; &SaveSettingsTo('Settings.pl'); $yySetLocation = qq~$adminurl?action=eventcal_set~; &redirectexit; } } ## Save Calendar Event-Icon Setting ## sub EventCalSet3 { &is_admin_or_gmod; my $count = 0; my $tempA = 0; my @eventcalIcon; while ($FORM{"caliimg[$tempA]"}) { if ($FORM{"calidelbox[$tempA]"} != 1) { push(@eventcalIcon, qq~\$CalIconURL[$count] = "$FORM{"caliimg[$tempA]"}";\n\$CalIDescription[$count] = "$FORM{"calidescr[$tempA]"}";\n\n~); $count++; } $tempA++; } push(@eventcalIcon, "1;"); &write_DBorFILE(0,'',$vardir,'eventcalIcon','txt',@eventcalIcon); $yySetLocation = qq~$adminurl?action=eventcal_set~; &redirectexit; } 1;