Ejemplo n.º 1
0
                 $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);
     $admin->addSucess("Changed the slogan!");
 }
 $text .= "\n<form method=\"post\" action=\"index.php?page=settings\">\n    <fieldset class=\"field_set margin_15\">\n        <legend>Slogan</legend>\n        <label>Current slogan:</label>\n        <input type=\"text\" value=\"" . $admin->getSetting('slogan') . "\" name=\"slogan\" />\n        <label>This is your slogan... Make it count!</label>\n        <input class=\"right\" name=\"change_slogan\" type=\"submit\" value=\"Change slogan\"/>\n    </fieldset>\n</form>\n    ";
 ////////////////
 //Footer
 if (isset($_POST['change_footer']) && isset($_POST['footer'])) {
     //Todo: More valdiation :P
     $db->sql("UPDATE " . $db->tb_prefix . "settings SET value='" . Security::cleanseSQL($_POST['footer']) . "' WHERE name='footer';", 1);