$sm->assign("reCAPTCHAPublic", reCAPTCHAPublic); //Assign other template sets $sets = array(); //Read template sets $it = opendir(THpath . "tpl/"); while (($set = readdir($it)) !== false) { //echo($set); if (in_array($set, array(".", "..", ".svn", "_admin", "_compd", "profiles")) == false && is_dir(THpath . "tpl/" . $set)) { $sets[] = $set; } } $sm->assign_by_ref("tplsets", $sets); $sm->assign("boards", $db->getindex(array('full' => true), $sm)); $sm->display("admingen.tpl"); } elseif ($_GET['a'] == "sp") { $static_pages = $db->getstaticpages(); $single_page = null; $sm->assign_by_ref("pages", $static_pages); $sm->assign("single_page", $single_page); $sm->display("adminstatic.tpl"); } elseif ($_GET['a'] == "spe") { if (!isset($_GET['id'])) { THdie("No static page ID specified!"); } $static_pages = $db->getstaticpages(); $single_page = null; // Search through looking for a specific page foreach ($static_pages as $static_page) { if ($static_page['id'] == $_GET['id']) { $single_page = $static_page; break;