Blog

From Easy PHP Calendar Instructions
Jump to: navigation, search

The blog style calendar allows a mini calendar and a agenda calendar on the same page and for the agenda to be updated by clicking on dates on the mini calendar. For example, if the mini calendar shows that there is an event on November 24, click on November 24, the page reloads and displays the events just for that day in the agenda style format.

To add the blog calendar to a page requires two separate elements; the mini calendar and the agenda calendar, both set to use blog style.

To insert the mini calendar:

<?php 
$EPCBLOG=1; 
require ("calendar/calendar.php"); 
?>

Replace "calendar/" with the actual path to the calendar directory relative to the directory of your web page.

To insert the agenda calendar:

<?php 
$EPCBLOG=2; 
$template="blog.php"; 
$DF = "l, F j, Y"; 
require ("calendar/calendar.php"); 
?>

Replace "calendar/" with the actual path to the calendar directory relative to the directory of your web page.

Note: Always use relative paths. Do NOT use 'http://www.YourDomainName.com/calendar/calendar.php' in the require command or the calendar will not perform as expected.

Change the $template variable to the name of another blog mode template you have created and uploaded to the templates directory.

Change the date format that is produced by altering the $DF variable. Use the same parameters as you would if using the PHP date() function. http://www.php.net/date.

Additional Template Options

Adding the codes below in the template will convert them to the variable of the displayed event:

[groupId]

The date that was clicked

[groupName]

The Julian day number of event

View the examples/blog.php file for an example of how this feature is used and implemented.