NOTES
OPENThis is basic integration of Calendar 0.0.7 and Board 3 Portal 0.2.1 Mini calendar
/portal/block/mini_cal.php
FIND
Code: Select all
// output the days for the current month
Code: Select all
// Recieve calendar events for this month
$mini_cal_month_lastday_time = strtotime($mini_cal_this_year."-".$mini_cal_this_month."-".$mini_cal_month_days." 23:59");
$mini_cal_month_firstday_time = strtotime($mini_cal_this_year."-".$mini_cal_this_month."-01 00:00");
$sql = "SELECT
event_access_level,
sort_timestamp
FROM
`".$table_prefix."calendar_events`
WHERE
event_access_level = 2 and
sort_timestamp > ".$mini_cal_month_firstday_time." and
sort_timestamp < ".$mini_cal_month_lastday_time."
"; // public events only
$result = $db->sql_query($sql);
while ( $row = $db->sql_fetchrow($result) )
{
$mini_cal_events[date("d-m-Y",$row['sort_timestamp'])] = 1;
}
Code: Select all
$mini_cal_day_link = '<a href="' . append_sid($phpbb_root_path . "search.$phpEx?search_id=unanswered&st=" . $nix_mini_cal_today) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
Code: Select all
$mini_cal_day_link = '<a href="' . append_sid($phpbb_root_path . "calendar.$phpEx?view=day&calD=".$mini_cal_this_day."&calM=".$mini_cal_this_month."&calY=".$mini_cal_this_year) . '" class="' . MINI_CAL_DAY_LINK_CLASS . '" style="color: ' . $portal_config['portal_minicalendar_day_link_color'] . ';">' . ( $mini_cal_day ) . '</a>';
Code: Select all
$mini_cal_day = ( $mini_cal_today >= $d_mini_cal_today ) ? $mini_cal_day_link : $mini_cal_day;
Code: Select all
// add zeros
$mini_day = (strlen($mini_cal_this_day) == 1) ? ( $mini_day = '0'.$mini_cal_this_day) : ($mini_day = $mini_cal_this_day);
$mini_month = (strlen($mini_cal_this_month) == 1) ? ( $mini_month = '0'.$mini_cal_this_month) : ($mini_month = $mini_cal_this_month);
if ($mini_cal_events[ "$mini_day-$mini_month-$mini_cal_this_year" ] == 1)
{
// ok, we've got an event here
$mini_cal_day_link = "<u>".$mini_cal_day_link."</u>"; // change event marking as you like
}
$mini_cal_day = $mini_cal_day_link;