48
To koltz :
In class.event.php replace getAllEvent methode by this one :
function getAllEvent( $month, $year, $day=false, $cat=false ) {
$sql = "SELECT id, title, day, description, contact, url, email, start_date, end_date, cat_name, cat_desc, cat_color
FROM ".$this->db->prefix("extcal_events")." E INNER JOIN ".$this->db->prefix("extcal_cat")." C ON E.cat = C.cat_id
WHERE year = $year AND month = $month";
if($day) {
$sql .= " AND day = $day";
}
if($cat != 0) {
$sql .= " AND cat = $cat";
}
$sql .= " ORDER BY day ASC, start_date ASC";
$result = $this->db->query($sql);
$ret = array();
while($row = $this->db->fetchArray($result)) {
$ret[$row['day']][] = array('id'=>$row['id'], 'title'=>$this->myts->previewTarea($row['title']), 'description'=>$this->myts->previewTarea($row['description']), 'contact'=>$row['contact'], 'url'=>$this->myts->previewTarea($row['url']), 'email'=>$this->myts->previewTarea($row['email']), 'start_date'=>$row['start_date'], 'end_date'=>$row['end_date'], 'cat_name'=>$row['cat_name'], 'cat_desc'=>$row['cat_desc'], 'cat_color'=>$row['cat_color']);
}
return $ret;
}
In index.php, add that just after // Get all events for this month :
$cat = isset($HTTP_GET_VARS['cat']) ? intval($HTTP_GET_VARS['cat']) : 0;
$xoopsTpl->assign('catselected', $cat);
And modify $all_event = $event->getAllEvent... by that :
$all_event = $event->getAllEvent($info['cal']['month']['current']['month'], $info['cal']['month']['current']['year'], $cat);
I hope that code work