We have a content type 'activity' that we want the calendar to track. We had wrote a hook for the calendar_block to track the content type. The events still do not show on the calendar_block. Below is the calendar_hook that we wrote. Could some one tell me what did we do wrong? Or do we need to also install text_slider?
function CalDates_calendar_block(&$date, $op) {
switch ($op) {
case 'alter':
$sql = "SELECT content_type_activity.field_activitydate_value, content_type_activity.nid FROM content_type_activity;";
$result = db_query( $sql );
$dateDates = array();
while ($node = db_fetch_object( $result))
{
$dateDates[] = node_load ( array( 'nid' => $node->nid));
}
foreach ($dateDates as $var){
$thisPath = $var->path;
$thisDate = substr($var->field_activitydate[0]['value'],0,10);
$realDate = substr($thisDate, 5, 2) . "-" . substr($thisDate, 8,2)."-". substr($thisDate, 0, 4);
if ($date->date == $realDate) {
$date->content = l($date->day, "activity-calendar/".$thisDate);
}
}
break;
case 'load':
/* $sql = "SELECT content_type_event.field_eventdate_value, content_type_event.nid FROM content_type_event;";
$result = db_query( $sql );
while ($node = db_fetch_object( $result))
{
$dateDates[] = node_load ( array( 'nid' => $node->nid));
}
foreach ($dateDates as $var){
print $var->field_eventdate[0]['value'] . " - " . $var->path . "
";
$thisPath = $var->path;
$thisDate = $var->field_eventdate[0]['value'];
$realDate = substr($thisDate, 5, 2) . "-" . substr($thisDate, 8,2)."-". substr($thisDate, 0, 4);
print "-".$realDate . "-
";
}
*/
break;
}
}