} } } if (empty($_POST['submit']) || !empty($error)) { $maps_id = empty($_POST['submit']) ? (int) $_GET['id'] : $_POST['maps_id']; $cells = 'games_id, maps_name, maps_text, maps_picture, server_name'; $data['maps'] = cs_sql_select(__FILE__, 'maps', $cells, 'maps_id = \'' . $maps_id . '\''); $data['maps']['maps_id'] = empty($error) ? (int) $_GET['id'] : (int) $_POST['maps_id']; $data['maps']['message'] = empty($error) ? $cs_lang['fill_in'] : $cs_lang['error_occured'] . $error; $data['maps']['maps_name'] = empty($_POST['maps_name']) ? $data['maps']['maps_name'] : $_POST['maps_name']; $data['maps']['maps_text'] = empty($_POST['maps_text']) ? $data['maps']['maps_text'] : $_POST['maps_text']; $data['abcode']['smileys'] = cs_abcode_smileys('maps_text'); $data['abcode']['features'] = cs_abcode_features('maps_text'); $data['maps']['action'] = cs_url('maps', 'edit'); $data['games'] = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); $data['games'] = cs_dropdownsel($data['games'], $data['maps']['games_id'], 'games_id'); $data['maps']['picture'] = empty($data['maps']['maps_picture']) ? '-' : cs_html_img('uploads/maps/' . $data['maps']['maps_picture']); $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $options['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $options['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($options['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['maps']['matches'] = cs_abcode_clip($matches); $data['if']['picture_remove'] = !empty($data['maps']['maps_picture']) ? TRUE : FALSE; echo cs_subtemplate(__FILE__, $data, 'maps', 'edit'); } else { $cs_maps['games_id'] = (int) $_POST['games_id'];
$error++; $errormsg .= $cs_lang['no_event_url'] . cs_html_br(1); } if (empty($cs_awards['games_id']) and empty($cs_games['games_name'])) { $error++; $errormsg .= $cs_lang['no_game'] . cs_html_br(1); } if (empty($cs_awards['awards_rank'])) { $error++; $errormsg .= $cs_lang['no_rank'] . cs_html_br(1); } } if (!isset($_POST['submit']) or isset($_POST['submit']) and !empty($error)) { $data = array(); $data['head']['body_create'] = !isset($_POST['submit']) ? $cs_lang['body_create'] : $errormsg; $data['awards']['awards_event_url'] = $cs_awards['awards_event_url']; $data['awards']['awards_event'] = $cs_awards['awards_event']; $data['awards']['awards_rank'] = $cs_awards['awards_rank']; $games = cs_sql_select(__FILE__, 'games', 'games_name, games_id', 0, 1, 1, 0); $data['select']['game'] = cs_dropdown('games_id', 'games_name', $games, $cs_awards['games_id']); $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0); $data['squads'] = cs_dropdownsel($data_squads, $cs_awards['squads_id'], 'squads_id'); $data['select']['date'] = cs_dateselect('datum', 'date', $cs_awards['awards_time']); echo cs_subtemplate(__FILE__, $data, 'awards', 'create'); } if (isset($_POST['submit']) and empty($error)) { $awards_cells = array_keys($cs_awards); $awards_save = array_values($cs_awards); cs_sql_insert(__FILE__, 'awards', $awards_cells, $awards_save); cs_redirect($cs_lang['create_done'], 'awards'); }
} if (empty($cs_ranks['ranks_url']) and empty($cs_ranks['ranks_code'])) { $error .= $cs_lang['no_url'] . cs_html_br(1); } if (empty($cs_ranks['ranks_img']) and empty($cs_ranks['ranks_code'])) { $error .= $cs_lang['no_img'] . cs_html_br(1); } $where = "ranks_name = '" . cs_sql_escape($cs_ranks['ranks_name']) . "'"; $where .= " AND ranks_id != '" . $ranks_id . "'"; $search = cs_sql_count(__FILE__, 'ranks', $where); if (!empty($search)) { $error .= $cs_lang['rank_exists'] . cs_html_br(1); } } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_edit']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['ranks'] = $cs_ranks; $data['ranks']['id'] = $ranks_id; $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0); $data['squads'] = cs_dropdownsel($data_squads, $cs_ranks['squads_id'], 'squads_id'); echo cs_subtemplate(__FILE__, $data, 'ranks', 'edit'); } else { $ranks_cells = array_keys($cs_ranks); $ranks_save = array_values($cs_ranks); cs_sql_update(__FILE__, 'ranks', $ranks_cells, $ranks_save, $ranks_id); cs_redirect($cs_lang['changes_done'], 'ranks'); }
$data = array(); $start = !empty($_GET['start']) ? (int) $_GET['start'] : 0; $games_id = !empty($_REQUEST['games_id']) ? (int) $_REQUEST['games_id'] : 0; // we are only interested in cups which have started, // so at least 1 cupmatch must exist $table = 'cups cup LEFT JOIN {pre}_cupmatches cm ON cm.cups_id = cup.cups_id LEFT JOIN {pre}_games ga ON ga.games_id = cup.games_id'; $where = 'cm.cupmatches_id IS NOT NULL AND cup.cups_access <= ' . $account['access_cups'] . ' AND cup.cups_access <> 0'; if ($games_id > 0) { $where .= ' AND cup.games_id = ' . $games_id; } else { $games_id = 0; } $select = 'DISTINCT(cup.cups_id), cup.*, ga.games_name'; $order = 'cup.cups_start DESC'; $data_games = cs_sql_select(__FILE__, 'games', 'games_name, games_id', 0, 'games_name', 0, 0); $data['games'] = cs_dropdownsel($data_games, $games_id, 'games_id'); $count = cs_sql_count(__FILE__, $table, $where, 'cup.cups_id'); if ($start < 0 || $start >= $count) { $start = 0; } $key = 'lang=' . $account['users_lang'] . '&games_id=' . $games_id . '&start=' . $start . '&access=' . $account['access_cups']; if (function_exists('cs_datacache_load')) { $cachedata = cs_datacache_load('cups', 'halloffame', $key, false); } else { $cachedata = false; } if ($cachedata !== false) { echo $cachedata; return; } if ($count) {
if (!isset($_POST['submit']) or isset($_POST['submit']) and !empty($error)) { $data = array(); if (!isset($_POST['submit'])) { $data['head']['body_create'] = $cs_lang['body_create']; } else { $data['head']['body_create'] = $errormsg; } $data['awards']['awards_event_url'] = $awards_edit['awards_event_url']; $data['awards']['awards_event'] = $awards_edit['awards_event']; $data['awards']['awards_rank'] = $awards_edit['awards_rank']; $data['awards']['awards_id'] = $awards_edit['awards_id']; $games = cs_sql_select(__FILE__, 'games', 'games_id, games_name', 0, 1, 1, 0); $data['select']['game'] = cs_dropdown('games_id', 'games_name', $games, $awards_edit['games_id']); $data['select']['date'] = cs_dateselect('datum', 'date', $awards_edit['awards_time']); $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0); $data['squads'] = cs_dropdownsel($data_squads, $awards_edit['squads_id'], 'squads_id'); echo cs_subtemplate(__FILE__, $data, 'awards', 'edit'); } if (isset($_POST['submit']) and empty($error)) { if (!empty($cs_games['games_name']) and empty($cs_games['games_id'])) { $games_cells = array_keys($cs_games); $games_save = array_values($cs_games); cs_sql_insert(__FILE__, 'games', $games_cells, $games_save); $lastid = cs_sql_insertid(__FILE__); $cs_awards['games_id'] = $lastid; } else { $awards_cells = array_keys($cs_awards); $awards_save = array_values($cs_awards); cs_sql_update(__FILE__, 'awards', $awards_cells, $awards_save, $awards_id); cs_redirect($cs_lang['changes_done'], 'awards'); }
$cs_members['squads_id'] = $cs_joinus['squads_id']; $cs_members['members_since'] = $cs_joinus['joinus_date']; $users_nick = $cs_joinus['joinus_nick']; $where = "users_nick = '" . cs_sql_escape($users_nick) . "'"; $cs_member = cs_sql_select(__FILE__, 'users', 'users_id', $where); $cs_members['users_id'] = $cs_member['users_id']; } } } if (!empty($error) or !isset($_POST['submit'])) { $data['lang']['squad'] = $cs_lang[$op_squads['label']]; $data['head']['text'] = !empty($error) ? $error : $cs_lang['errors_here']; $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0); $data_squads_count = count($data_squads); for ($run = 0; $run < $data_squads_count; $run++) { $data_squads[$run]['squads_name'] = cs_secure($data_squads[$run]['squads_name']); } $data['squads'] = cs_dropdownsel($data_squads, $cs_members['squads_id'], 'squads_id'); $data['users']['nick'] = cs_secure($users_nick); $data['value']['task'] = cs_secure($cs_members['members_task']); $data['value']['order'] = cs_secure($cs_members['members_order']); $data['value']['admin_sel'] = empty($cs_members['members_admin']) ? '' : ' checked="checked"'; $data['dropdown']['since_year'] = cs_dateselect('since', 'date', $cs_members['members_since']); echo cs_subtemplate(__FILE__, $data, 'members', 'create'); } else { settype($cs_members['members_order'], 'integer'); $members_cells = array_keys($cs_members); $members_save = array_values($cs_members); cs_sql_insert(__FILE__, 'members', $members_cells, $members_save); cs_redirect($cs_lang['create_done'], 'members'); }