Hi Hannah,
A calender system has been bought to my attention in another post created by Zick, you can find the code here:
http://www.interactivetools.com/forum/forum-posts.php?Calendar-populated-with-CMS-Builder-records-71673
and an example of the finished script here:
http://thecmsbcookbook.com/calendar5.php
If you wanted to use the fullcalender system you'd have to use the ajax system to display the data from CMS Builder. If you download the latest copy of the plugin from here:
http://arshaw.com/fullcalendar/download/
There is a demo called json.html, that you can use, to get it to display events from my blog section I modified the json-events.php file to this:
<?php
/* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('C:/wamp/www/test/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }
// load records from 'blog'
list($blogRecords, $blogMetaData) = getRecords(array(
'tableName' => 'blog',
'loadUploads' => true,
'allowSearch' => false,
));
$ajaxEvents = array();
foreach($blogRecords as $key => $blog){
$ajaxEvents[$key]['id'] = $key;
$ajaxEvents[$key]['title'] = $blog['title'];
$ajaxEvents[$key]['start'] = date('Y-m-d', strtotime($blog['createdDate']));
$ajaxEvents[$key]['end'] = date('Y-m-d', strtotime($blog['createdDate']));
$ajaxEvents[$key]['url'] = $blog['createdDate'];
}
echo json_encode($ajaxEvents);
This is just example code, so you'll have to make some changes to get it working with your site. Specifically the tableName that is used to retrieve data, and the date field that you want displaying on the calendar.
So this script will loop through all of my blog posts and create an array item for each record. In this case it's using the createdDate, but you could use any date field.
After all of the event items have been created the json_encode function is used to return a json encoded array of items, which the json.html page then uses to display the calendar items.
Let me know if you have any questions.
Thanks!
Greg
Greg Thomas
PHP Programmer - interactivetools.com