query($sql); $navSections = array(); while ($row = mysql_fetch_array($result)) { $navSections[$row['id']]['id'] = $row['id']; $navSections[$row['id']]['name'] = $row['name']; } $sectionPages[1]['id'] = "podcasts"; $sectionPages[1]['title'] = "Podcasts"; //$sectionPages[2]['id'] = "logos"; //$sectionPages[2]['title'] = "Graphics"; $smarty->assign('sectionPages', $sectionPages); // This is for all the pages which belong to this category if (isset($_GET['page']) && $_GET['page'] == "podcasts") { // we want podcasts $sql = "SELECT * FROM eucu_podcasts ORDER BY datetime DESC"; $result = $mysql->query($sql); while ($row = mysql_fetch_array($result)) { $podcasts[$row['id']]['title'] = $row['title']; $podcasts[$row['id']]['summary'] = $row['summary']; $podcasts[$row['id']]['duration'] = $row['duration']; $podcasts[$row['id']]['date'] = date('D, d M Y', strtotime($row['datetime'])); $podcasts[$row['id']]['filename'] = $row['filename']; } //////////////////////////////////////////////////////////////////////////////// // Assign contents to variables for the template $smarty->assign('title', "Podcasts"); // This is the page title, as displayed in the title bar $smarty->assign('navSections', $navSections); // This is the links for the navigation bar $smarty->assign('podcasts', $podcasts); $smarty->display('podcasts.tpl'); } else if (isset($_GET['page']) && $_GET['page'] == "logos") { // we want logos } else { // we want the overview of resources $sql = "SELECT default_page FROM sections WHERE id = 56"; $result = $mysql->query($sql); $def_page = mysql_result($result, 0, "default_page"); $sql = "SELECT title, content FROM pages WHERE id = $def_page"; $result = $mysql->query($sql); $content = mysql_result($result, 0, "content"); $title = mysql_result($result, 0, "title"); $smarty->assign('title', $title); $smarty->assign('content', $content); $smarty->assign('navSections', $navSections); //////////////////////////////////////////////////////////////////////////////// $smarty->display('page.tpl'); } ?>