Given that marked dates are identical on every calendar page, you will probably need to clear them and set a new bunch of marked dates when the month is changed. These are best stored in a file or files, e.g.
<?php function new_month($calendar) { $calendar->clear_marks(); $selected = $calendar->get_date(); $month = ($selected[1]+1); $year = $selected[0]; if(file_exists("diary/$year/marked_dates_$month.txt")) { $dates = fopen("diary/$year/marked_dates_$month.txt", 'r'); $string = explode(',', fgets($dates)); $calendar->freeze(); for($i = 0; $i < 31; $i++) { if($string[$i]==true) $calendar->mark_day($i+1); } $calendar->thaw(); fclose($dates); } } $calendar->connect('month-changed', 'new_month'); ?> |