if (isset($_POST['addfaction'])) { $faction_name = $_POST['factionname']; $faction_icon = $_POST['factionicon']; if ($faction_icon != "" && $faction_name != "") { add_faction($game_id, $faction_icon, $faction_name); } //dbg: echo "Faction: $game_id, $faction_icon, $faction_name"; header("Location: admin_config.php?eb_games&gameid={$game_id}"); exit; } if (isset($_POST['edit_faction']) && $_POST['edit_faction'] != "") { $faction = $_POST['edit_faction']; $faction_name = $_POST['factionname' . $faction]; $faction_icon = $_POST['factionicon' . $faction]; if ($faction_icon != "" && $faction_name != "") { update_faction($faction, $faction_icon, $faction_name); } //dbg: echo "Update Faction: $faction, $faction_icon, $faction_name"; header("Location: admin_config.php?eb_games&gameid={$game_id}"); exit; } if (isset($_POST['del_faction']) && $_POST['del_faction'] != "") { $faction = $_POST['del_faction']; delete_faction($faction); header("Location: admin_config.php?eb_games&gameid={$game_id}"); exit; } if (isset($_POST['addmap'])) { $map_name = $_POST['mapname']; $map_image = $_POST['mapimage']; $map_description = $_POST['mapdescription'];
} break; case 1: // Edit faction check_authorization(); $body = new Template("templates/faction/faction.edit.tmpl.php"); $faction_data = faction_info(); if ($faction_data['faction_info']) { $body->set('faction_info', $faction_data['faction_info']); } $breadcrumbs .= " >> Edit Faction"; break; case 2: // Update faction check_authorization(); update_faction(); header("Location: index.php?editor=faction&fid={$fid}"); exit; case 3: // Search factions check_authorization(); $body = new Template("templates/faction/faction.searchresults.tmpl.php"); $results = ""; if (isset($_POST['faction_id']) && $_POST['faction_id'] != "ID") { $results = search_factions_by_id(); } else { $results = search_factions_by_name(); } if ($results) { $body->set("results", $results); }