$db->sql("UPDATE " . $db->tb_prefix . "settings SET value='" . Security::cleanseSQL($_POST['template']) . "' WHERE name='activetemplate';", 1); } $templates = ""; if ($handle = opendir('../templates/')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && 0 == preg_match("/.*\\..*/i", $file)) { $select = ""; if ($file == $admin->getSetting("activetemplate")) { $select = "selected=\"selected\""; } $templates .= "\n <option " . $select . " value='" . $file . "'>" . $file . "</option>\n"; } } closedir($handle); } else { $admin->addError("Could not open templates dir"); } $text .= "\n<div class=\"contenttext margin_15\">\n<span class=\"undertitle\">Settings</span>\n</div>\n<form method=\"post\" action=\"index.php?page=settings\">\n <fieldset class=\"field_set margin_15\">\n <legend>Template</legend>\n <label>Current Template:</label>\n\n <select name=\"template\">\n " . $templates . "\n </select>\n <label>Add new templates by adding them into the tempalte folder</label>\n <input class=\"right\" name=\"changetemplate\" type=\"submit\" value=\"Change Template\"/>\n </fieldset>\n</form>\n "; //////////////// //Sitename if (isset($_POST['changesitename']) && isset($_POST['sitename'])) { //Todo: More valdiation :P $db->sql("UPDATE " . $db->tb_prefix . "settings SET value='" . Security::cleanseSQL($_POST['sitename']) . "' WHERE name='sitename';", 1); $admin->addSucess("Changed the sitename!"); } $text .= "\n<form method=\"post\" action=\"index.php?page=settings\">\n <fieldset class=\"field_set margin_15\">\n <legend>Sitename</legend>\n <label>Current Sitename:</label>\n <input type=\"text\" value=\"" . $admin->getSetting('sitename') . "\" name=\"sitename\" />\n <label>Text about the sitename...</label>\n <input class=\"right\" name=\"changesitename\" type=\"submit\" value=\"Change sitename\"/>\n </fieldset>\n</form>\n "; //////////////// //Slogan if (isset($_POST['change_slogan']) && isset($_POST['slogan'])) { //Todo: More valdiation :P $db->sql("UPDATE " . $db->tb_prefix . "settings SET value='" . Security::cleanseSQL($_POST['slogan']) . "' WHERE name='slogan';", 1);