template_dir = './templates'; $smarty->compile_dir = './templates_c'; $smarty->cache_dir = './smarty/cache'; $smarty->config_dir = './smarty/configs'; $smarty->assign('site_name', 'SwishCMS Test'); $smarty->assign('rootpath', './'); $smarty->display('index.tpl'); // Lets prep the recent news. $dbfunctions->sqlconnect(); $sql = 'SELECT * FROM news ORDER BY id LIMIT 5'; $result = mysql_query($sql); while ($item = mysql_fetch_array($result, MYSQL_ASSOC)) { $recent[$i] = array('id' => $item['id'], 'title' => $item['title']); $i++; } mysql_close(); $smarty->assign('recentd', $recent); // Now where are we going to go today? if (isset($_GET['q']) && file_exists('modules/' . $_GET['q'] . '.php')) { $page = $_GET['q']; } else { $page = 'news'; } include('modules/' . $page . '.php'); $smarty->display($page.".tpl"); $smarty->display("footer.tpl"); ?>