function Init() { LoadConfig(); LoadUsers(); LoadEntries(); LoadThemes(); LoadAssets(); InitStream(); GetNextJamDateAndTime(); }
function UnbanTheme($unbannedTheme) { global $themes, $dbConn, $ip, $userAgent; //Authorize user (logged in) $user = IsAdmin(); if ($user === false) { die("Not logged in."); } //Authorize user (is admin) if (IsAdmin() === false) { die("Only admins can delete themes."); } $unbannedTheme = trim($unbannedTheme); if ($unbannedTheme == "") { die("Theme is blank"); } $clean_unbannedTheme = mysqli_real_escape_string($dbConn, $unbannedTheme); $clean_ip = mysqli_real_escape_string($dbConn, $ip); $clean_userAgent = mysqli_real_escape_string($dbConn, $userAgent); //Check that theme actually exists $sql = "SELECT theme_id FROM theme WHERE theme_banned = 1 AND theme_text = '{$clean_unbannedTheme}'"; $data = mysqli_query($dbConn, $sql); $sql = ""; if (mysqli_num_rows($data) == 0) { die("Theme is not banned"); } $sql = "UPDATE theme SET theme_banned = 0 WHERE theme_banned = 1 AND theme_text = '{$clean_unbannedTheme}'"; $data = mysqli_query($dbConn, $sql); $sql = ""; LoadThemes(); }