query($sql); $navSections = array(); while ($row = mysql_fetch_array($result)) { $navSections[$row['id']]['id'] = $row['id']; $navSections[$row['id']]['name'] = $row['name']; } //$navSections["resources"]['name'] = "Resources"; //////////////////////////////////////////////////////////////////////////////// if ($_GET['cal'] == "now") { // this is for the calendar if ($_GET['cal'] == "now") { $pageTitle = "Events Calendar"; $sql = "SELECT *, year(`date`) as y, month(`date`) as m FROM calendar WHERE `date` > NOW() ORDER BY date"; $result = $mysql->query($sql); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_array($result)) { $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['id'] = $row['id']; $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['desc'] = $row['desc']; $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['title'] = $row['title']; // $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['date'] = date('l j F, Y \a\t H:i', strtotime($row['date'])); $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['date'] = date('l j F, Y - H:i', strtotime($row['date'])); $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['category'] = $row['category']; $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['owner'] = $row['owner']; $calData[$row['y']][date('F', mktime(0,0, 0, $row['m']))][$row['id']]['location'] = $row['location']; } } } } //////////////////////////////////////////////////////////////////////////////// // Assign contents to variables for the template $smarty->assign('title', $pageTitle); // This is the page title, as displayed in the title bar $smarty->assign('calData', $calData); // This is the calendar data! $smarty->assign('navSections', $navSections); // This is the links for the navigation bar $smarty->assign('insideSections', $insideSections); // This is for the sub-sections of this section $smarty->assign('sectionPages', $sectionPages); // This is for all the pages which belong to this category //////////////////////////////////////////////////////////////////////////////// $smarty->display('calendar.tpl'); ?>