Page 1 of 1

[MOD] Calendar 0.0.7 Integration

Posted: 5. August 2008 09:18
by connect
:idea: Don't know where to post this. I thought it might interest somebody.

NOTES
This is basic integration of Calendar 0.0.7 and Board 3 Portal 0.2.1 Mini calendar
OPEN
/portal/block/mini_cal.php

FIND

Code: Select all

// output the days for the current month
BEFORE ADD

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;
}
FIND

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>';
REPLACE WITH

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>';
FIND

Code: Select all

$mini_cal_day = ( $mini_cal_today >= $d_mini_cal_today ) ? $mini_cal_day_link : $mini_cal_day;
REPLACE WITH

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;
USE IT ON YOUR OWN RISK

Re: [MOD] Calendar 0.0.7 Integration

Posted: 5. August 2008 09:41
by Kevin
Moved to "Blocks - In Development"

Thank you, connect! :)

Re: [MOD] Calendar 0.0.7 Integration

Posted: 5. August 2008 23:50
by thomas.d
connect wrote: NOTES
This is basic integration of Calendar 0.0.7 and Board 3 Portal 0.2.1 Mini calendar
Hi connect,

thanks for sharing.

As you stated "and Board 3 Portal 0.2.1": will this work with Board3 Portal 1.0.0 RC1?

Re: [MOD] Calendar 0.0.7 Integration

Posted: 6. August 2008 11:52
by connect
Yes, it works with RC1 1.0.0 just fine

Re: [MOD] Calendar 0.0.7 Integration

Posted: 28. September 2008 23:20
by wernermarcel
Hi,

is it possible to show a mini point or other little sign in the days for spezial events ?

Meeting --> Red Point
Playing with friends --> Blue Point

and so on.

It can be linked with the event classes, an at to top a little legend...


Thx for answer.

An spezial Thx for this little hack a searching a long term for that :-)

Mfg
Marcel

Re: [MOD] Calendar 0.0.7 Integration

Posted: 16. April 2011 15:13
by Flaiker
Somewhere where i can still download 0.0.7? Currently theres only 1.0 Beta avaible and I don't know if it works with the portal.
Another thing: I couldnt find the following line at all in mini_cal.php:

$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>';

So I couldn't replace it. Can someone help me, or is there a new implementation tutorial for 1.0?