function cs_categories_dropdown($mod, $categories_id) { global $account; $where = "categories_mod='" . $mod . "'"; $list_data = cs_sql_select(__FILE__, 'categories', 'categories_id, categories_name', $where, 'categories_order ASC, categories_name', 0, 0); $data = array(); $data['categories']['dropdown'] = cs_dropdown('categories_id', 'categories_name', $list_data, $categories_id); $data['if']['cat_access'] = $account['access_categories'] >= 3 ? true : false; return cs_subtemplate(__FILE__, $data, 'categories', 'cat_dropdown'); }
if (!isset($_POST['submit'])) { $data['lang']['head'] = $cs_lang['body_mail']; } elseif (!empty($error)) { $data['lang']['head'] = cs_icon('important') . cs_html_br(1); $data['lang']['head'] .= $errormsg; } else { $data['lang']['head'] = $cs_lang['success']; } if (!empty($error) or !isset($_POST['submit'])) { $data['if']['form'] = TRUE; $data['if']['done'] = FALSE; $categories_data = cs_sql_select(__FILE__, 'categories', '*', "categories_mod = 'contact'", 'categories_order ASC, categories_name', 0, 0); foreach ($mail as $key => $value) { $data['mail'][$key] = cs_secure($value); } $data['mail']['categories_id'] = cs_dropdown('categories_id', 'categories_name', $categories_data, $mail['categories_id']); if (!empty($captcha)) { $data['if']['captcha'] = 1; } } else { $data['if']['form'] = FALSE; $data['if']['done'] = TRUE; $categories_data = cs_sql_select(__FILE__, 'categories', 'categories_name', "categories_id = '" . $mail['categories_id'] . "'"); $message = sprintf($cs_lang['mailtxt'], date('d.m.Y'), date('H:i'), $ip, $mail['name'], $mail['firm'], $mail['icq'], $mail['email'], $categories_data['categories_name'], $mail['why'], $mail['text']); settype($mail['icq'], 'integer'); $mail_cells = array('mail_name', 'mail_time', 'mail_ip', 'mail_email', 'mail_icq', 'mail_jabber', 'mail_firm', 'categories_id', 'mail_subject', 'mail_message'); $mail_save = array($mail['name'], cs_time(), $ip, $mail['email'], $mail['icq'], $mail['jabber'], $mail['firm'], $mail['categories_id'], $mail['why'], $mail['text']); cs_sql_insert(__FILE__, 'mail', $mail_cells, $mail_save); cs_cache_delete('count_mail_unread'); cs_mail($cs_contact['def_mail'], $mail['why'], $message, $mail['email']); }
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('abcode'); $data = array(); $data['lang']['getmsg'] = cs_getmsg(); if (!isset($_POST['submit'])) { $data['options'] = cs_sql_option(__FILE__, 'abcode'); $rte_html_array = cs_checkdirs('mods', 'abcode/rte_html'); $rte_more_array = cs_checkdirs('mods', 'abcode/rte_more'); $data['dropdown']['rte_html'] = cs_dropdown('rte_html', 'name', $rte_html_array, $data['options']['rte_html'], 'dir'); $data['dropdown']['rte_more'] = cs_dropdown('rte_more', 'name', $rte_more_array, $data['options']['rte_more'], 'dir'); $abc[0]['def_func'] = 'img'; $abc[0]['name'] = $cs_lang['img']; $abc[1]['def_func'] = 'str'; $abc[1]['name'] = $cs_lang['str']; $data['dropdown']['def_func'] = cs_dropdown('def_func', 'name', $abc, $data['options']['def_func']); $data['checked']['def_abcode'] = empty($data['options']['def_abcode']) ? '' : ' checked="checked"'; echo cs_subtemplate(__FILE__, $data, 'abcode', 'options'); } else { require_once 'mods/clansphere/func_options.php'; $save = array(); $save['rte_html'] = $_POST['rte_html']; $save['rte_more'] = $_POST['rte_more']; $save['max_width'] = (int) $_POST['max_width']; $save['max_height'] = (int) $_POST['max_height']; $save['max_size'] = (int) $_POST['max_size']; $save['def_func'] = $_POST['def_func']; $save['image_width'] = $_POST['image_width']; $save['image_height'] = $_POST['image_height']; $save['word_cut'] = $_POST['word_cut'] > 65535 ? 65535 : (int) $_POST['word_cut']; $save['def_abcode'] = empty($_POST['def_abcode']) ? 0 : 1;
$views[2]['name'] = $cs_lang['compatible']; $data['setup']['view_type'] = cs_dropdown('users_view', 'name', $views, $cs_user['users_view'], 0, 1); $mode[0]['users_invisible'] = 0; $mode[0]['name'] = $cs_lang['off']; $mode[1]['users_invisible'] = 1; $mode[1]['name'] = $cs_lang['on']; $data['setup']['users_invisible'] = cs_dropdown('users_invisible', 'name', $mode, $cs_user['users_invisible'], 0, 1); $mode[0]['users_abomail'] = 0; $mode[0]['name'] = $cs_lang['off']; $mode[1]['users_abomail'] = 1; $mode[1]['name'] = $cs_lang['on']; $data['setup']['users_abomail'] = cs_dropdown('users_abomail', 'name', $mode, $cs_user['users_abomail'], 0, 1); $mode[0]['users_ajax'] = 0; $mode[0]['name'] = $cs_lang['off']; $mode[1]['users_ajax'] = 1; $mode[1]['name'] = $cs_lang['on']; $data['setup']['users_ajax'] = cs_dropdown('users_ajax', 'name', $mode, $cs_user['users_ajax']); $data['if']['ajax_allowed'] = $cs_main['ajax'] == 1 ? 1 : 0; echo cs_subtemplate(__FILE__, $data, 'users', 'setup'); } else { $cs_user['users_readtime'] = $cs_user['users_readtime'] * 86400; $users_cells = array_keys($cs_user); $users_save = array_values($cs_user); cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']); if (!empty($cs_main['mod_rewrite'])) { header('Location: ../../' . $cs_main['php_self']['basename']); } else { $account['users_ajax'] = empty($cs_main['ajax']) ? 0 : $cs_user['users_ajax']; cs_redirect($cs_lang['success'], 'users', 'settings', 'lang=' . $cs_user['users_lang']); } }
cs_board_comments($cs_board_id); } cs_redirect($cs_lang['del_true'], 'board'); } if (isset($_POST['cancel'])) { $board_form = 0; cs_redirect($cs_lang['del_false'], 'board'); } if (!empty($board_form)) { $data['action']['form'] = cs_url('board', 'remove'); $data['lang']['body'] = sprintf($cs_lang['del_rly'], $board_id); if (!empty($threads_loop)) { $data['if']['threads_loop'] = true; $cs_board['change_threads'] = 0; if ($cs_board['change_threads'] == 0) { $data['remove']['checked'] = ''; } else { $data['remove']['checked'] = 'checked="checked"'; } $cs_board['board_id'] = 0; $where = "board_id != '" . $board_id . "'"; $board_data = cs_sql_select(__FILE__, 'board', '*', $where, 'board_name', 0, 0); $data['remove']['dropdown'] = cs_dropdown('board_id', 'board_name', $board_data, $cs_board['board_id']); } else { $data['if']['threads_loop'] = false; } $data['remove']['id'] = $board_id; $board_name = cs_sql_select(__FILE__, 'board', 'board_name', "board_id = '" . $board_id . "'"); $data['remove']['name'] = cs_secure($board_name['board_name']); } echo cs_subtemplate(__FILE__, $data, 'board', 'remove');
$data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { foreach ($cs_squads as $key => $value) { $data['squads'][$key] = cs_secure($value); } $data['head']['mod'] = $cs_lang[$op_squads['label'] . 's']; $data['squads']['abcode'] = cs_abcode_features('squads_text'); $data['lang']['own_label'] = $cs_lang['own_' . $op_clans['label']]; $checked = 'checked="checked"'; $data['squads']['own_check'] = empty($cs_squads['squads_own']) ? '' : $checked; $data['squads']['joinus_check'] = empty($cs_squads['squads_joinus']) ? '' : $checked; $data['squads']['fightus_check'] = empty($cs_squads['squads_fightus']) ? '' : $checked; $data['lang']['clan_label'] = $cs_lang[$op_clans['label']]; $cs_clans = cs_sql_select(__FILE__, 'clans', 'clans_name,clans_id', 0, 'clans_name', 0, 0); $data['squads']['clan_sel'] = cs_dropdown('clans_id', 'clans_name', $cs_clans, $cs_squads['clans_id']); if ($data['if']['gamesmod'] == TRUE) { $data['games'] = array(); $el_id = 'game_1'; $cs_games = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); $games_count = count($cs_games); for ($run = 0; $run < $games_count; $run++) { $sel = $cs_games[$run]['games_id'] == $cs_squads['games_id'] ? 1 : 0; $data['games'][$run]['sel'] = cs_html_option($cs_games[$run]['games_name'], $cs_games[$run]['games_id'], $sel); } $url = 'uploads/games/' . $cs_squads['games_id'] . '.gif'; $data['squads']['games_img'] = cs_html_img($url, 0, 0, 'id="' . $el_id . '"'); } $matches[1] = $cs_lang['secure_stages']; $matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1);
} } } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_create']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $cs_links; $data['cat']['dropdown'] = cs_categories_dropdown('links', $cs_links['categories_id']); $linksstat[0]['links_stats'] = 'on'; $linksstat[0]['name'] = $cs_lang['online']; $linksstat[1]['links_stats'] = 'off'; $linksstat[1]['name'] = $cs_lang['offline']; $data['status']['dropdown'] = cs_dropdown('links_stats', 'name', $linksstat, $cs_links['links_stats']); if (empty($cs_main['rte_html'])) { $data['if']['abcode'] = TRUE; $data['abcode']['smileys'] = cs_abcode_smileys('links_info', 1); $data['abcode']['features'] = cs_abcode_features('links_info', 1, 1); } else { $data['if']['rte_html'] = TRUE; $data['rte']['html'] = cs_rte_html('links_info', $cs_links['links_info']); } $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'] . $img_max['width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $img_max['height'] . ' px' . cs_html_br(1);
if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['create_users']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['data'] = $create; $data['lang']['opts'] = ''; $languages = cs_checkdirs('lang'); foreach ($languages as $lang) { $lang['name'] == $create['users_lang'] ? $sel = 1 : ($sel = 0); $data['lang']['opts'] .= cs_html_option($lang['name'], $lang['name'], $sel); } $where = "access_clansphere <= '" . $account['access_clansphere'] . "'"; $access_data = cs_sql_select(__FILE__, 'access', 'access_name, access_id, access_clansphere', $where, 'access_name', 0, 0); $data['access']['dropdown'] = cs_dropdown('access_id', 'access_name', $access_data, $create['access_id']); if (empty($conv_joinus)) { $data['if']['simple'] = TRUE; $data['if']['convert'] = FALSE; $matches[1] = $cs_lang['secure_stages']; $matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_3'] . $cs_lang['stage_3_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_4'] . $cs_lang['stage_4_text']; $data['clip']['pw_sec'] = cs_abcode_clip($matches); } else { $data['if']['simple'] = FALSE; $data['if']['convert'] = TRUE; $code_id = generate_code(8); $data['hidden']['password'] = $code_id; $data['hidden']['conv'] = $conv_joinus;
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('squads'); $cs_post = cs_post('id'); $op_squads = cs_sql_option(__FILE__, 'squads'); $label = $op_squads['label']; if (isset($_POST['agree'])) { $squads_id = $cs_post['id']; $where = "squads_id = '" . $squads_id . "' AND users_id = '" . $account['users_id'] . "'"; $getme = cs_sql_select(__FILE__, 'members', 'members_id', $where); cs_sql_delete(__FILE__, 'members', $getme['members_id']); cs_redirect($cs_lang['sq_del_true'], 'squads', 'center'); } if (isset($_POST['cancel'])) { cs_redirect($cs_lang['del_false'], 'squads', 'center'); } else { $data['head']['mod'] = $cs_lang[$label . 's']; $data['lang']['label'] = $cs_lang[$label]; $where = "mem.users_id = '" . $account['users_id'] . "'"; $select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id'; $from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id'; $sqd_data = cs_sql_select(__FILE__, $from, $select, $where, 'sqd.squads_name', 0, 0); $data['squads']['squad_sel'] = cs_dropdown('id', 'squads_name', $sqd_data, 0, 'squads_id'); echo cs_subtemplate(__FILE__, $data, 'squads', 'leave'); }
$find_user = cs_sql_select(__FILE__, 'boardmods', 'users_id', $check, 0, 0); if (!empty($find_user)) { $error++; $errormsg .= $cs_lang['user_exists'] . cs_html_br(1); } } else { $data['bm']['boardmods_modpanel'] = 0; $data['bm']['boardmods_edit'] = 0; $data['bm']['boardmods_del'] = 0; } if (!isset($_POST['submit']) and empty($error)) { $data['head']['body'] = $cs_lang['body']; } elseif (!empty($error)) { $data['head']['body'] = $errormsg; } if (!empty($error) or !isset($_POST['submit'])) { $categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id']; $data['bm']['cat_dropdown'] = cs_categories_dropdown('boardmods', $categories_id); $users = cs_sql_select(__FILE__, 'users', 'users_nick, users_id', 'users_active = 1 AND users_delete = 0', 'users_nick ASC', 0, 0); $data['bm']['users_dropdown'] = cs_dropdown('users_id', 'users_nick', $users, $data['bm']['users_id']); $data['bm']['boardmods_modpanel'] = $data['bm']['boardmods_modpanel'] == 1 ? 'checked="checked"' : ''; $data['bm']['boardmods_edit'] = $data['bm']['boardmods_edit'] == 1 ? 'checked="checked"' : ''; $data['bm']['boardmods_del'] = $data['bm']['boardmods_del'] == 1 ? 'checked="checked"' : ''; $data['users']['nick'] = $users_nick; } else { $boardmods_cells = array_keys($data['bm']); $boardmods_save = array_values($data['bm']); cs_sql_insert(__FILE__, 'boardmods', $boardmods_cells, $boardmods_save); cs_redirect($cs_lang['create_done'], 'boardmods'); } echo cs_subtemplate(__FILE__, $data, 'boardmods', 'create');
$data['categories'] = cs_dropdownsel($data_categories, $cs_wars['categories_id'], 'categories_id'); $data['clans'] = cs_dropdownsel($data_clans, $cs_wars['clans_id'], 'clans_id'); $data_clans_count = count($data['clans']); for ($run = 0; $run < $data_clans_count; $run++) { $data['clans'][$run]['clans_name'] = cs_secure($data['clans'][$run]['clans_name']); } $data['squads'] = cs_dropdownsel($data_squads, $cs_wars['squads_id'], 'squads_id'); $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['players'] = array(); for ($run = 1; $run <= $players; $run++) { $data['players'][$run - 1]['run'] = $run; $data['players'][$run - 1]['value'] = !empty($cs_players['player' . $run]) ? $cs_players['player' . $run] : ''; $data['players'][$run - 1]['dropdown'] = cs_dropdown('playerid' . $run, 'users_nick', $cs_members, 0, 'users_id'); } $data['dropdown']['date'] = cs_dateselect('date', 'unix', $cs_wars['wars_date'], 1995); $data['abcode']['smileys'] = cs_abcode_smileys('wars_report'); $data['abcode']['features'] = cs_abcode_features('wars_report'); $data['abcode']['smileys2'] = cs_abcode_smileys('wars_report2'); $data['abcode']['features2'] = cs_abcode_features('wars_report2'); $data['form']['players'] = $players; $data['value']['opponents'] = $cs_wars['wars_opponents']; $data['value']['players1'] = $cs_wars['wars_players1']; $data['value']['players2'] = $cs_wars['wars_players2']; $data['value']['score1'] = $cs_wars['wars_score1']; $data['value']['score2'] = $cs_wars['wars_score2']; $data['value']['url'] = $cs_wars['wars_url']; $data['value']['report'] = cs_secure($cs_wars['wars_report']); $data['value']['report2'] = cs_secure($cs_wars['wars_report2']);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('wars'); $data = array(); $cs_squads = array(); $squads_id = empty($_GET['id']) ? 0 : (int) $_GET['id']; if (!empty($_POST['squads_id'])) { $squads_id = (int) $_POST['squads_id']; } $cs_squads = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id', 'squads_fightus = "0"', 'squads_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('squads_id', 'squads_name', $cs_squads, $squads_id, 'squads_id'); $squad = empty($squads_id) ? '' : "squads_id = '" . $squads_id . "'"; $squad_and = empty($squads_id) ? '' : " AND squads_id = '" . $squads_id . "'"; $squad_andwr = empty($squads_id) ? '' : "AND (wr.squads_id = '" . $squads_id . "')"; $squad_players = empty($squads_id) ? '' : "INNER JOIN {pre}_wars wr ON (wr.wars_id = ply.wars_id) WHERE (wr.squads_id = '" . $squads_id . "')"; $squad_maps = empty($squads_id) ? '' : "INNER JOIN {pre}_wars wr ON (wr.wars_id = rnd.wars_id) WHERE (wr.squads_id = '" . $squads_id . "')"; $data['wars']['all'] = cs_sql_count(__FILE__, 'wars', $squad); $data['wars']['played'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'played\'' . $squad_and); $data['wars']['upcoming'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'upcoming\'' . $squad_and); $data['wars']['canceled'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'canceled\'' . $squad_and); $data['wars']['running'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'running\'' . $squad_and); $data['wars']['won_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 > wars_score2 AND wars_status = \'played\'' . $squad_and); $data['wars']['won_percent'] = empty($data['wars']['won_count']) ? 0 : round($data['wars']['won_count'] / $data['wars']['played'] * 100); $data['wars']['lost_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 < wars_score2 AND wars_status = \'played\'' . $squad_and); $data['wars']['lost_percent'] = empty($data['wars']['lost_count']) ? 0 : round($data['wars']['lost_count'] / $data['wars']['played'] * 100); $data['wars']['draw_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 = wars_score2 AND wars_status = \'played\'' . $squad_and); $data['wars']['draw_percent'] = empty($data['wars']['draw_count']) ? 0 : round($data['wars']['draw_count'] / $data['wars']['played'] * 100); $tables = 'users usr INNER JOIN {pre}_players ply ON (ply.users_id = usr.users_id) ' . $squad_players . ' GROUP BY usr.users_id, usr.users_nick, usr.users_active, usr.users_delete'; $cells = 'usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, COUNT(ply.players_id) AS wars';
$levels++; } $checked = 'checked="checked"'; $data['check']['yes'] = !empty($board['board_read']) ? $checked : ''; $data['check']['no'] = empty($board['board_read']) ? $checked : ''; $matches[1] = $cs_lang['secure_stages']; $matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_3'] . $cs_lang['stage_3_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_4'] . $cs_lang['stage_4_text']; $data['clip']['sec_level'] = cs_abcode_clip($matches); $data['if']['pwd_remove'] = !empty($board['board_pwd']) ? TRUE : FALSE; $op_squads = cs_sql_option(__FILE__, 'squads'); $data['squads']['lang'] = $cs_lang[$op_squads['label']]; $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 'squads_own=1', 'squads_name', 0, 0); $data['squads']['dropdown'] = cs_dropdown('squads_id', 'squads_name', $data_squads, $board['squads_id']); $data['board']['id'] = $board_id; echo cs_subtemplate(__FILE__, $data, 'board', 'edit'); } else { if (!empty($new_board_pwd)) { global $cs_db; if ($cs_db['hash'] == 'md5') { $board['board_pwd'] = md5($new_board_pwd); } elseif ($cs_db['hash'] == 'sha1') { $board['board_pwd'] = sha1($new_board_pwd); } $sql_del = 1; } if (!empty($board_pwdel)) { $board['board_pwd'] = ''; $sql_del = 1;
$data['country'][$run]['short'] = $short; $data['country'][$run]['selection'] = $short == $data['join']['joinus_country'] ? ' selected="selected"' : ''; $data['country'][$run]['full'] = $full; $run++; } $data['join']['games_url'] = cs_html_img('uploads/games/0.gif', 0, 0, 'id="game"'); $data['games'] = array(); $cs_games = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); for ($run = 0; $run < count($cs_games); $run++) { $data['games'][$run]['short'] = $cs_games[$run]['games_id']; $data['games'][$run]['selection'] = $cs_games[$run]['games_id'] == $data['join']['games_id'] ? ' selected="selected"' : ''; $data['games'][$run]['name'] = $cs_games[$run]['games_name']; } $cid = "squads_own = '1' AND squads_joinus = '0'"; $squads_data = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id, squads_own, squads_joinus', $cid, 'squads_name', 0, 0); $data['squad']['list'] = cs_dropdown('squads_id', 'squads_name', $squads_data, $data['join']['squads_id']); $data['date']['join'] = cs_dateselect('join', 'date', $data['join']['joinus_date'], 2000); $data['abcode']['smileys'] = cs_abcode_smileys('joinus_more'); $data['abcode']['features'] = cs_abcode_features('joinus_more'); $data['rules']['link'] = cs_html_link(cs_url('rules', 'list'), $cs_lang['rules']); $data['joinus']['rules_selected'] = !empty($data2['join']['joinus_rules']) ? 'checked="checked"' : ''; if (!empty($captcha)) { $data['join']['captcha_img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time()); $data['if']['captcha'] = 1; } } elseif (!empty($data['if']['form'])) { if (empty($account['users_id'])) { global $cs_db; if ($cs_db['hash'] == 'md5') { $data['join']['users_pwd'] = md5($data['join']['users_pwd']); } elseif ($cs_db['hash'] == 'sha1') {
if (!empty($folder_arr)) { foreach ($folder_arr as $cond) { $where .= "OR gal.folders_id = '" . $cond['folders_id'] . "' "; } } } if (!empty($access_id) and empty($folders_id)) { $where = "gal.gallery_access = '" . $access_id . "' "; } if (!empty($access_id) and !empty($folders_id)) { $where = "gal.folders_id = '" . $folders_id . "' AND gallery_access = '" . $access_id . "'"; } $where = trim($where); $access_data = array(0 => array('access_id' => '1', 'access_name' => $cs_lang['lev_1']), 1 => array('access_id' => '2', 'access_name' => $cs_lang['lev_2']), 2 => array('access_id' => '3', 'access_name' => $cs_lang['lev_3']), 3 => array('access_id' => '4', 'access_name' => $cs_lang['lev_4']), 4 => array('access_id' => '5', 'access_name' => $cs_lang['lev_5'])); $data['dropdown']['folders'] = make_folders_select('where', $folders_id, 0, 'gallery', 0); $data['dropdown']['access'] = cs_dropdown('access', 'access_name', $access_data, $access_id, 'access_id'); $data['sort']['id'] = cs_sort('gallery', 'manage', $start, $where_x, 1, $sort); $data['sort']['name'] = cs_sort('gallery', 'manage', $start, $where_x, 3, $sort); $data['sort']['time'] = cs_sort('gallery', 'manage', $start, $where_x, 5, $sort); $data['sort']['folders'] = cs_sort('gallery', 'manage', $start, $where_x, 7, $sort); $data['sort']['status'] = cs_sort('gallery', 'manage', $start, $where_x, 9, $sort); $from = 'gallery gal INNER JOIN {pre}_users usr ON gal.users_id = usr.users_id '; $from .= 'LEFT JOIN {pre}_folders fol ON gal.folders_id = fol.folders_id'; $select = 'gal.gallery_id AS gallery_id, gal.gallery_status AS gallery_status, '; $select .= 'gal.gallery_name AS gallery_name, gal.gallery_titel AS gallery_titel, '; $select .= 'gal.users_id AS users_id, gal.gallery_time AS gallery_time, '; $select .= 'gal.folders_id AS folders_id, fol.folders_name AS folders_name, usr.users_active AS users_active'; $data['pictures'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $pictures_loop = count($data['pictures']); for ($run = 0; $run < $pictures_loop; $run++) { $id = $data['pictures'][$run]['gallery_id'];
/* select squads which are not participating */ $where = 'cs.cupsquads_id IS NULL'; $teams = cs_sql_select(__FILE__, $table, $select, $where, 'clans_tag ASC, team_name ASC', 0, 0); $run = 0; $teamarray = array(); foreach ($teams as $squad) { $teamarray[$run]['team_id'] = $squad['team_id']; $teamarray[$run]['team_name'] = cs_secure($squad['clans_tag']) . ' - ' . cs_secure($squad['team_name']); $run++; } $team_name = ''; $team_id = 0; if (isset($_POST['submit'])) { $team_id = (int) $_POST['team_id']; } $data['teams']['select'] = cs_dropdown('team_id', 'team_name', $teamarray, !empty($_POST['team_id']) ? (int) $_POST['team_id'] : 0, 'team_id', 0); /* select a specific squad */ $extra_where = ' AND sq.squads_id = %s'; } $error = ''; $team_id = ''; if (isset($_POST['submit'])) { if ($cs_cup['cups_system'] == CS_CUPS_TYPE_USERS) { $team_id = $_POST['team_name']; } else { $team_id = (int) $_POST['team_id']; } $team = cs_sql_select(__FILE__, $table, $select, $where . sprintf($extra_where, cs_sql_escape($team_id)), 0, 0, 1); if (empty($team)) { $error = $cs_lang['join_denied']; } else {
$error .= $cs_lang['collision'] . cs_html_br(1); } } else { $cells = 'squads_id, users_id, members_task, members_order, members_since, members_admin'; $cs_members = cs_sql_select(__FILE__, 'members', $cells, "members_id = '" . $members_id . "'"); $cs_users = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . (int) $cs_members['users_id']); $users_nick = $cs_users['users_nick']; } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['errors_here']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['members']['label'] = $cs_lang[$op_squads['label']]; $squads_data = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0); $data['members']['squad_sel'] = cs_dropdown('squads_id', 'squads_name', $squads_data, $cs_members['squads_id']); $data['users']['nick'] = cs_secure($users_nick); $data['members']['task'] = cs_secure($cs_members['members_task']); $data['members']['order'] = cs_secure($cs_members['members_order']); $data['members']['since'] = cs_dateselect('since', 'date', $cs_members['members_since']); $data['members']['admin'] = empty($cs_members['members_admin']) ? '' : 'checked="checked"'; $data['members']['id'] = $members_id; echo cs_subtemplate(__FILE__, $data, 'members', 'edit'); } else { settype($cs_members['members_order'], 'integer'); $members_cells = array_keys($cs_members); $members_save = array_values($cs_members); cs_sql_update(__FILE__, 'members', $members_cells, $members_save, $members_id); cs_redirect($cs_lang['changes_done'], 'members'); }
$data['player'][$x]['x'] = $x; $data['player'][$x]['x2'] = $x + 1; $data['player'][$x]['player_name'] = $cs_players[$x]; $data['player'][$x]['user_sel'] = cs_dropdown('playerid' . $x, 'users_nick', $cs_members, 0, 'users_id'); } $data['wars']['date_sel'] = cs_dateselect('date', 'unix', $cs_wars['wars_date'], 1995); $status = array(); $status[0]['wars_status'] = 'upcoming'; $status[0]['name'] = $cs_lang['upcoming']; $status[1]['wars_status'] = 'running'; $status[1]['name'] = $cs_lang['running']; $status[2]['wars_status'] = 'canceled'; $status[2]['name'] = $cs_lang['canceled']; $status[3]['wars_status'] = 'played'; $status[3]['name'] = $cs_lang['played']; $data['wars']['status_dropdown'] = cs_dropdown('wars_status', 'name', $status, $cs_wars['wars_status']); $data['abcode']['smileys'] = cs_abcode_smileys('wars_report'); $data['abcode']['features'] = cs_abcode_features('wars_report'); $data['abcode']['smileys2'] = cs_abcode_smileys('wars_report2'); $data['abcode']['features2'] = cs_abcode_features('wars_report2'); $data['wars']['check_player'] = !empty($players) ? $players : 1; $data['wars']['close_check'] = empty($cs_wars['wars_close']) ? '' : 'checked="checked"'; $data['value']['wars_topmatch_check'] = empty($cs_wars['wars_topmatch']) ? '' : 'checked="checked"'; $data['wars']['id'] = $wars_id; echo cs_subtemplate(__FILE__, $data, 'wars', 'edit'); } else { settype($cs_wars['wars_score1'], 'integer'); settype($cs_wars['wars_score2'], 'integer'); $wars_cells = array_keys($cs_wars); $wars_save = array_values($cs_wars); cs_sql_update(__FILE__, 'wars', $wars_cells, $wars_save, $wars_id);
$cs_cash['users_id'] = $account['users_id']; $cs_cash['cash_time'] = cs_date('unix', cs_time(), 0, 1, 'Y-m-d'); } if (!isset($_POST['submit']) and empty($error)) { $data['head']['body'] = $cs_lang['body_info']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['cash'] = $cs_cash; $data['cash']['cash_money'] = cs_secure($data['cash']['cash_money'], 0, 0, 0); $data['cash']['cash_text'] = cs_secure($data['cash']['cash_text'], 0, 0, 0); $data['cash']['cash_info'] = cs_secure($data['cash']['cash_info'], 0, 0, 0); $cs_users = cs_sql_select(__FILE__, 'users', 'users_nick,users_id', 'users_delete = "0"', 'users_nick', 0, 0); $data['cash']['users_sel'] = cs_dropdown('users_id', 'users_nick', $cs_users, $cs_cash['users_id']); $inoutlist[0]['cash_inout'] = 'in'; $inoutlist[0]['name'] = $cs_lang['drop_in']; $inoutlist[1]['cash_inout'] = 'out'; $inoutlist[1]['name'] = $cs_lang['drop_out']; $data['cash']['inout_sel'] = cs_dropdown('cash_inout', 'name', $inoutlist, $cs_cash['cash_inout']); $data['cash']['date_sel'] = cs_dateselect('datum', 'date', $cs_cash['cash_time'], 2000); $data['cash']['abcode_smileys'] = cs_abcode_smileys('cash_info'); $data['cash']['abcode_features'] = cs_abcode_features('cash_info'); $data['users']['nick'] = cs_secure($users_nick, 0, 0, 0); echo cs_subtemplate(__FILE__, $data, 'cash', 'create'); } else { $cash_cells = array_keys($cs_cash); $cash_save = array_values($cs_cash); cs_sql_insert(__FILE__, 'cash', $cash_cells, $cash_save); cs_redirect($cs_lang['create_done'], 'cash'); }
$games_id = empty($cs_get['where']) ? 0 : $cs_get['where']; if (!empty($cs_post['where'])) { $games_id = $cs_post['where']; } $start = empty($cs_get['start']) ? 0 : $cs_get['start']; if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 1 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $where = !empty($games_id) ? 'games_id = "' . $games_id . '"' : 0; $cs_sort[1] = 'maps_name ASC'; $cs_sort[2] = 'maps_name DESC'; $order = $cs_sort[$sort]; $maps_count = cs_sql_count(__FILE__, 'maps', $where); $data['head']['count_maps'] = $maps_count; $data['head']['pages'] = cs_pages('maps', 'manage', $maps_count, $start, $games_id, $sort); $cs_games = cs_sql_select(__FILE__, 'games', 'games_id, games_name', 0, 'games_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('where', 'games_name', $cs_games, $games_id, 'games_id'); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('maps', 'manage', $start, $games_id, 1, $sort); $cells = 'maps_id, maps_name'; $data['maps'] = cs_sql_select(__FILE__, 'maps', $cells, $where, $order, $start, $account['users_limit']); $loop_maps = count($data['maps']); for ($run = 0; $run < $loop_maps; $run++) { $data['maps'][$run]['id'] = $data['maps'][$run]['maps_id']; $data['maps'][$run]['name'] = $data['maps'][$run]['maps_name']; } echo cs_subtemplate(__FILE__, $data, 'maps', 'manage');
$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'); }
$data['head']['body'] = $error; } if (!empty($data['if']['form']) and (!empty($error) or !isset($_POST['submit']))) { foreach ($cs_fightus as $key => $value) { $data['fightus'][$key] = cs_secure($value); } $data['games'] = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); $games_count = count($data['games']); for ($i = 0; $i < $games_count; $i++) { $data['games'][$i]['games_name'] = cs_secure($data['games'][$i]['games_name']); } $url = 'uploads/games/' . $cs_fightus['games_id'] . '.gif'; $data['fightus']['games_img'] = cs_html_img($url, 0, 0, 'id="game_1"'); $cid = "squads_own = '1' AND squads_fightus = '0'"; $cs_squads = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id, squads_own, squads_fightus', $cid, 'squads_name', 0, 0); $data['fightus']['squad_sel'] = cs_dropdown('squads_id', 'squads_name', $cs_squads, $cs_fightus['squads_id']); $el_id = 'country_1'; $onc = "document.getElementById('" . $el_id . "').src='" . $cs_main['php_self']['dirname'] . "symbols/countries/' + this.form."; $onc .= "fightus_country.options[this.form.fightus_country.selectedIndex].value + '.png'"; $data['fightus']['country_sel'] = cs_html_select(1, 'fightus_country', "onchange=\"" . $onc . "\""); foreach ($cs_country as $short => $full) { $short == $cs_fightus['fightus_country'] ? $sel = 1 : ($sel = 0); $data['fightus']['country_sel'] .= cs_html_option($full, $short, $sel); } $data['fightus']['country_sel'] .= cs_html_select(0) . ' '; $url = 'symbols/countries/' . $cs_fightus['fightus_country'] . '.png'; $data['fightus']['country_img'] = cs_html_img($url, 11, 16, 'id="' . $el_id . '"'); $data['fightus']['date_sel'] = cs_dateselect('fight', 'unix', $cs_fightus['fightus_date'], 2000); $data['fightus']['abcode_smileys'] = cs_abcode_smileys('fightus_more'); $data['fightus']['abcode_features'] = cs_abcode_features('fightus_more'); if (!empty($captcha)) {
$cs_sort[1] = 'quotes_headline DESC'; $cs_sort[2] = 'quotes_headline ASC'; $cs_sort[3] = 'quotes_time DESC'; $cs_sort[4] = 'quotes_time ASC'; $sort = empty($_REQUEST['sort']) ? 3 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $quotes_count = cs_sql_count(__FILE__, 'quotes', $where); $data = array(); $data['url']['form'] = cs_url('quotes', 'manage'); $data['lang']['all'] = $cs_lang['total'] . ': '; $data['head']['count'] = $quotes_count; $data['head']['pages'] = cs_pages('quotes', 'manage', $quotes_count, $start, $categories_id, $sort); $data['head']['message'] = cs_getmsg(); $quotesmod = "categories_mod = 'quotes'"; $categories_data = cs_sql_select(__FILE__, 'categories', '*', $quotesmod, 'categories_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('where', 'categories_name', $categories_data, $categories_id, 'categories_id'); $from = 'quotes qts LEFT JOIN {pre}_users usr ON qts.users_id = usr.users_id'; $select = 'qts.quotes_headline AS quotes_headline, qts.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, qts.quotes_time AS quotes_time, qts.quotes_id AS quotes_id'; $cs_quotes = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $quotes_loop = count($cs_quotes); $data['sort']['quotes_headline'] = cs_sort('quotes', 'manage', $start, $categories_id, 1, $sort); $data['sort']['quotes_time'] = cs_sort('quotes', 'manage', $start, $categories_id, 3, $sort); for ($run = 0; $run < $quotes_loop; $run++) { $cs_quotes[$run]['quotes_headline'] = cs_secure($cs_quotes[$run]['quotes_headline']); $cs_quotes[$run]['url_edit'] = cs_url('quotes', 'edit', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['url_remove'] = cs_url('quotes', 'remove', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['url_user'] = cs_user($cs_quotes[$run]['users_id'], $cs_quotes[$run]['users_nick'], $cs_quotes[$run]['users_active'], $cs_quotes[$run]['users_delete']); $cs_quotes[$run]['url_quote'] = cs_url('quotes', 'view', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['quotes_time'] = cs_date('unix', $cs_quotes[$run]['quotes_time'], 1); } $data['quotes'] = $cs_quotes;
$sel = 0; while ($levels < 6) { $data['create']['board_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access'][$levels]['access_level'] = cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $matches[1] = $cs_lang['secure_stages']; $matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_3'] . $cs_lang['stage_3_text'] . cs_html_br(1); $matches[2] .= $cs_lang['stage_4'] . $cs_lang['stage_4_text']; $data['create']['sec_level'] = cs_abcode_clip($matches); $op_squads = cs_sql_option(__FILE__, 'squads'); $data['create']['squad_lang'] = $cs_lang[$op_squads['label']]; $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 'squads_own=1', 'squads_name', 0, 0); $data['create']['squad_drop'] = cs_dropdown('squads_id', 'squads_name', $data_squads, $data['create']['squads_id']); } else { global $cs_db; if (!empty($data['create']['board_pwd'])) { if ($cs_db['hash'] == 'md5') { $data['create']['board_pwd'] = md5($data['create']['board_pwd']); } elseif ($cs_db['hash'] == 'sha1') { $data['create']['board_pwd'] = sha1($data['create']['board_pwd']); } } $board_cells = array_keys($data['create']); $board_save = array_values($data['create']); cs_sql_insert(__FILE__, 'board', $board_cells, $board_save); cs_redirect($cs_lang['create_done'], 'board'); } echo cs_subtemplate(__FILE__, $data, 'board', 'create');
cs_redirect($cs_lang['create_done'], 'games'); } $data['url']['form'] = cs_url('games', 'create'); $data['games']['name'] = $games_name; $data['games']['version'] = $games_version; $data['games']['genre'] = cs_categories_dropdown('games', $categories_id); $data['games']['release'] = cs_dateselect('datum', 'date', $games_release); $data['games']['creator'] = $games_creator; $data['games']['homepage'] = $games_url; $usknum[0]['games_usk'] = '00'; $usknum[0]['name'] = $cs_lang['usk_00']; $usknum[1]['games_usk'] = '06'; $usknum[1]['name'] = $cs_lang['usk_06']; $usknum[2]['games_usk'] = '12'; $usknum[2]['name'] = $cs_lang['usk_12']; $usknum[3]['games_usk'] = '16'; $usknum[3]['name'] = $cs_lang['usk_16']; $usknum[4]['games_usk'] = '18'; $usknum[4]['name'] = $cs_lang['usk_18']; $data['games']['usk'] = cs_dropdown('games_usk', 'name', $usknum, $games_usk); $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add => $value) { $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['games']['clip'] = cs_abcode_clip($matches); echo cs_subtemplate(__FILE__, $data, 'games', 'create');
$data['old'][$a]['nicks'] = $old_nicks[$a]['users_nick']; } } // State selections $data['users']['state_activated'] = $cs_user['users_active'] == 1 ? $sel : ''; $data['users']['state_deactivated'] = $cs_user['users_active'] == 0 ? $sel : ''; // Access $where = "access_clansphere <= '" . $account['access_clansphere'] . "'"; $access_data = cs_sql_select(__FILE__, 'access', 'access_name, access_id, access_clansphere', $where, 'access_name', 0, 0); $data['users']['access_dropdown'] = cs_dropdown('access_id', 'access_name', $access_data, $cs_user['access_id']); // Languages $languages = cs_checkdirs('lang'); foreach ($languages as $lang) { $fixed_lang[]['data[users_lang]'] = $lang['name']; } $data['users']['language_dropdown'] = cs_dropdown('data[users_lang]', 'data[users_lang]', $fixed_lang, $cs_user['users_lang']); // Output echo cs_subtemplate(__FILE__, $data, 'users', 'edit'); } else { $cs_user['users_hidden'] = implode(',', $hidden); $old_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $users_id, 0, 0, 1); if ($old_nick['users_nick'] != $cs_user['users_nick']) { change_nick($users_id, $old_nick['users_nick']); } // DB update $users_cells = array_keys($cs_user); $users_save = array_values($cs_user); cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $users_id); cs_cache_delete('navbirth'); cs_cache_delete('nextbirth'); cs_redirect($cs_lang['changes_done'], 'users');