assign(get_page_vars()); $s->assign(get_common_vars()); $s->assign("page", "downloads"); $s->display("site.html"); function get_page_vars() { $vars["title"] = "Downloads"; $r = new sql("SELECT * FROM " . TABLE . " ORDER BY position"); while ($d = $r->get_record()) { if (!is_file("files/{$d["file"]}")) continue; $data[] = $d; } $s = new smarty(); $s->assign("downloads", $data); $vars["content"] = $s->fetch("downloads.html"); $vars["menu"] = get_menu(); return $vars; } function get_menu() { $d["title"] = "Downloads"; $d["href"] = ROOT . "/downloads/"; $data[] = $d; return $data; } ?>