<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('history'); empty($_REQUEST['start']) ? $start = 0 : ($start = $_REQUEST['start']); $cs_sort[1] = 'history_time DESC'; $cs_sort[2] = 'history_time ASC'; $cs_sort[3] = 'history_text DESC'; $cs_sort[4] = 'history_text ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $history_count = cs_sql_count(__FILE__, 'history'); $data = array(); $cells = 'hs.history_time AS history_time, hs.history_text AS history_text, '; $data['history'] = cs_sql_select(__FILE__, 'history', '*', 0, $order, $start, $account['users_limit']); $history_loop = count($data['history']); $data['url']['create'] = cs_url('history', 'create'); $data['count']['history'] = $history_count; $data['head']['message'] = cs_getmsg(); $data['head']['pages'] = cs_pages('history', 'manage', $history_count, $start, $sort); $data['sort']['time'] = cs_sort('history', 'manage', $start, 0, 1, $sort); $data['sort']['text'] = cs_sort('history', 'manage', $start, 0, 3, $sort); for ($run = 0; $run < $history_loop; $run++) { $data['history'][$run]['text'] = cs_secure(cs_substr($data['history'][$run]['history_text'], 0, 17)) . '...'; $data['history'][$run]['time'] = cs_date('unix', $data['history'][$run]['history_time'], 1); $data['history'][$run]['url_edit'] = cs_url('history', 'edit', 'id=' . $data['history'][$run]['history_id']); $data['history'][$run]['url_remove'] = cs_url('history', 'remove', 'id=' . $data['history'][$run]['history_id']); } echo cs_subtemplate(__FILE__, $data, 'history', 'manage');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('count'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'count_time DESC'; $cs_sort[2] = 'count_time ASC'; $cs_sort[3] = 'count_id DESC'; $cs_sort[4] = 'count_id ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $counter_count = cs_sql_count(__FILE__, 'count'); $data = array(); $data['head']['counter_count'] = $counter_count; $data['head']['counter_pages'] = cs_pages('count', 'manage', $counter_count, $start); $data['head']['message'] = cs_getmsg(); $data['sort']['count_time'] = cs_sort('count', 'manage', $start, 0, 1, $sort); $data['sort']['count_id'] = cs_sort('count', 'manage', $start, 0, 3, $sort); $cs_counter = cs_sql_select(__FILE__, 'count', '*', 0, $order, $start, $account['users_limit']); $count_loop = count($cs_counter); $data['count'] = array(); for ($run = 0; $run < $count_loop; $run++) { $data['count'][$run]['count_id'] = $cs_counter[$run]['count_id']; $data['count'][$run]['count_ip'] = $cs_counter[$run]['count_ip']; $data['count'][$run]['count_locate'] = $cs_counter[$run]['count_location']; $data['count'][$run]['count_time'] = cs_date('unix', $cs_counter[$run]['count_time'], 1); } echo cs_subtemplate(__FILE__, $data, 'count', 'manage');
$start = empty($cs_get['start']) ? 0 : $cs_get['start']; if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 2 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $cs_sort[1] = 'linkus_name DESC'; $cs_sort[2] = 'linkus_name ASC'; $cs_sort[3] = 'linkus_banner DESC'; $cs_sort[4] = 'linkus_banner ASC'; $order = $cs_sort[$sort]; $linkus_count = cs_sql_count(__FILE__, 'linkus'); $data['head']['count'] = $linkus_count; $data['head']['pages'] = cs_pages('linkus', 'manage', $linkus_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('linkus', 'manage', $start, 0, 1, $sort); $data['sort']['banner'] = cs_sort('linkus', 'manage', $start, 0, 3, $sort); $select = 'linkus_id, linkus_name, linkus_banner'; $data['linkus'] = cs_sql_select(__FILE__, 'linkus', $select, 0, $order, $start, $account['users_limit']); $linkus_loop = count($data['linkus']); for ($run = 0; $run < $linkus_loop; $run++) { $data['linkus'][$run]['name'] = cs_secure($data['linkus'][$run]['linkus_name']); $data['linkus'][$run]['banner'] = cs_secure($data['linkus'][$run]['linkus_banner']); $place = 'uploads/linkus/' . $data['linkus'][$run]['linkus_banner']; $mass = getimagesize($place); $data['linkus'][$run]['mass'] = cs_secure($mass[0] . ' x ' . $mass[1]); $data['linkus'][$run]['id'] = $data['linkus'][$run]['linkus_id']; } echo cs_subtemplate(__FILE__, $data, 'linkus', 'manage');
$data = array(); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'boardreport_time DESC'; $cs_sort[2] = 'boardreport_time ASC'; $cs_sort[3] = 'boardreport_done DESC, boardreport_time DESC'; $cs_sort[4] = 'boardreport_done ASC, boardreport_time DESC'; $cs_sort[5] = 'threads_headline DESC'; $cs_sort[6] = 'boardreport_time ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $data['lang']['getmsg'] = cs_getmsg(); $data['head']['boardreport_count'] = cs_sql_count(__FILE__, 'boardreport'); $data['head']['pages'] = cs_pages('board', 'reportlist', $data['head']['boardreport_count'], $start, 0, $sort); $data['sort']['boardreport_time'] = cs_sort('board', 'reportlist', $start, 0, 1, $sort); $data['sort']['boardreport_done'] = cs_sort('board', 'reportlist', $start, 0, 3, $sort); $data['sort']['threads_headline'] = cs_sort('board', 'reportlist', $start, 0, 5, $sort); $from = 'boardreport bdr INNER JOIN {pre}_threads thr ON bdr.threads_id = thr.threads_id'; $select = 'bdr.boardreport_time AS boardreport_time, bdr.boardreport_done AS boardreport_done, bdr.threads_id AS threads_id, thr.threads_headline AS threads_headline, bdr.comments_id AS comments_id'; $cs_report = cs_sql_select(__FILE__, $from, $select, 0, $order, $start, $account['users_limit']); $report_loop = count($cs_report); $data['boardreport'] = array(); for ($run = 0; $run < $report_loop; $run++) { $data['boardreport'][$run]['boardreport_time'] = cs_date('date', $cs_report[$run]['boardreport_time'], 1); $data['boardreport'][$run]['boardreport_done'] = empty($cs_report[$run]['boardreport_done']) ? $cs_lang['no'] : $cs_lang['yes']; $headline = cs_secure($cs_report[$run]['threads_headline']); // $comments_count = empty($cs_report[$run]['comments_id']) ? 0 : cs_sql_count(__FILE__,'comments',"comments_mod = 'board' AND comments_fid = '" . $cs_report[$run]['threads_id'] . "'"); // $goto = floor($comments_count / $account['users_limit']) * $account['users_limit'] . '#com' . $comments_count; $link = cs_link($headline, 'board', 'thread', 'where=' . $cs_report[$run]['threads_id']); // . '&start=' . $goto); $data['boardreport'][$run]['threads_headline'] = $link . ' #' . $cs_report[$run]['comments_id']; }
$medalsuser_id = cs_sql_escape($_GET['delete']); cs_sql_delete(__FILE__, 'medalsuser', $medalsuser_id); cs_redirect($cs_lang['del_true'], 'medals', 'user', 'where=' . $medals_id); } $start = empty($_GET['start']) ? 0 : $_GET['start']; $cs_sort[1] = 'md.medalsuser_date DESC'; $cs_sort[2] = 'md.medalsuser_date ASC'; $cs_sort[3] = 'usr.users_nick DESC'; $cs_sort[4] = 'usr.users_nick ASC'; $sort = empty($_GET['sort']) ? 1 : $_GET['sort']; $order = $cs_sort[$sort]; $tables = 'medalsuser md LEFT JOIN {pre}_users usr ON usr.users_id = md.users_id'; $cells = 'usr.users_nick AS users_nick, md.users_id AS users_id, usr.users_active AS users_active, usr.users_delete AS users_delete, '; $cells .= 'md.medals_id AS medals_id, md.medalsuser_date AS medalsuser_date, md.medalsuser_id AS medalsuser_id'; $where = 'medals_id = ' . $medals_id . ''; $data['medals_user'] = array(); $data['medals_user'] = cs_sql_select(__FILE__, $tables, $cells, $where, $order, $start, $account['users_limit']); $data['count']['medals_user'] = count($data['medals_user']); $data['count']['all_medals_user'] = cs_sql_count(__FILE__, 'medalsuser', $where); $data['sort']['date'] = cs_sort('medals', 'user', $start, $medals_id, 1, $sort); $data['sort']['users_nick'] = cs_sort('medals', 'user', $start, $medals_id, 3, $sort); $data['pages']['list'] = cs_pages('medals', 'user', $data['count']['all_medals_user'], $start, $medals_id, $sort); for ($i = 0; $i < $data['count']['medals_user']; $i++) { $data['medals_user'][$i]['user'] = cs_user($data['medals_user'][$i]['users_id'], $data['medals_user'][$i]['users_nick'], $data['medals_user'][$i]['users_active'], $data['medals_user'][$i]['users_delete']); $data['medals_user'][$i]['remove_url'] = cs_url('medals', 'user', 'where=' . $data['medals_user'][$i]['medals_id'] . '&delete=' . $data['medals_user'][$i]['medalsuser_id']); $data['medals_user'][$i]['medals_date'] = cs_date('unix', $data['medals_user'][$i]['medalsuser_date'], 1); } $data['medals']['id'] = $medals_id; $data['message']['medals'] = cs_getmsg(); $data['form']['dirname'] = $cs_main['php_self']['dirname']; echo cs_subtemplate(__FILE__, $data, 'medals', 'user');
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('ranks'); $cs_post = cs_post('start,sort'); $cs_get = cs_get('start,sort'); $data = array(); $start = empty($cs_get['start']) ? 0 : $cs_get['start']; if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 2 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $cs_sort[1] = 'ranks_name DESC'; $cs_sort[2] = 'ranks_name ASC'; $order = $cs_sort[$sort]; $ranks_count = cs_sql_count(__FILE__, 'ranks'); $data['head']['count'] = $ranks_count; $data['head']['pages'] = cs_pages('ranks', 'manage', $ranks_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('ranks', 'manage', $start, 0, 1, $sort); $select = 'ranks_id, ranks_name'; $data['ranks'] = cs_sql_select(__FILE__, 'ranks', $select, 0, $order, $start, $account['users_limit']); $ranks_loop = count($data['ranks']); for ($run = 0; $run < $ranks_loop; $run++) { $data['ranks'][$run]['name'] = cs_secure($data['ranks'][$run]['ranks_name']); $data['ranks'][$run]['id'] = $data['ranks'][$run]['ranks_id']; } echo cs_subtemplate(__FILE__, $data, 'ranks', 'manage');
$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; echo cs_subtemplate(__FILE__, $data, 'quotes', 'manage');
$data['in'][$run]['id'] = $data['in'][$run]['cash_id']; $text = $data['in'][$run]['cash_text']; $text = cs_substr($text, 0, 25); $data['in'][$run]['for'] = cs_secure($text); $data['in'][$run]['money'] = cs_secure($data['in'][$run]['cash_money']); $inout = $data['in'][$run]['cash_inout']; if ($inout == 'in') { $icon = 'green'; } elseif ($inout == 'out') { $icon = 'red'; } $data['in'][$run]['in_out'] = cs_html_img('symbols/clansphere/' . $icon . '.gif'); } // Auszahlungen $data['sort2']['date'] = cs_sort('cash', 'center', $start, 0, 1, $sort); $data['sort2']['money'] = cs_sort('cash', 'center', $start, 0, 3, $sort); $where = "cash_inout = 'out'"; $data['out'] = cs_sql_select(__FILE__, 'cash', '*', $where, $order, $start, $account['users_limit']); $cash_loop = count($data['out']); for ($run = 0; $run < $cash_loop; $run++) { $data['out'][$run]['date'] = cs_date('date', $data['out'][$run]['cash_time']); $data['out'][$run]['id'] = $data['out'][$run]['cash_id']; $text = $data['out'][$run]['cash_text']; $text = cs_substr($text, 0, 25); $data['out'][$run]['for'] = cs_secure($text); $data['out'][$run]['money'] = cs_secure($data['out'][$run]['cash_money']); $inout = $data['out'][$run]['cash_inout']; if ($inout == 'in') { $icon = 'green'; } elseif ($inout == 'out') { $icon = 'red';
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clans'); $op_clans = cs_sql_option(__FILE__, 'clans'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'clans_name DESC'; $cs_sort[2] = 'clans_name ASC'; $cs_sort[3] = 'clans_short DESC'; $cs_sort[4] = 'clans_short ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $clans_count = cs_sql_count(__FILE__, 'clans'); $data['lang']['mod_name'] = $cs_lang[$op_clans['label']]; $data['lang']['all'] = $cs_lang['total'] . ': '; $data['lang']['count'] = $clans_count; $data['pages']['list'] = cs_pages('clans', 'list', $clans_count, $start, 0, $sort); $select = 'clans_name, clans_short, clans_country, clans_id'; $cs_clans = cs_sql_select(__FILE__, 'clans', $select, 0, $order, $start, $account['users_limit']); $clans_loop = count($cs_clans); $data['sort']['name'] = cs_sort('clans', 'list', $start, 0, 1, $sort); $data['sort']['short'] = cs_sort('clans', 'list', $start, 0, 3, $sort); if (empty($clans_loop)) { $data['clans'] = ''; } for ($run = 0; $run < $clans_loop; $run++) { $data['clans'][$run]['country'] = cs_html_img('symbols/countries/' . $cs_clans[$run]['clans_country'] . '.png', 11, 16); $data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']); $data['clans'][$run]['short'] = cs_secure($cs_clans[$run]['clans_short']); } echo cs_subtemplate(__FILE__, $data, 'clans', 'list');
//$mof = empty($where) ? '' : " AND users_sex = '" . cs_sql_escape($where) . "'"; $where = empty($_GET['where']) ? 0 : $_GET['where']; $mof = empty($where) ? '' : " AND users_nick LIKE '" . cs_sql_escape($where) . "%'"; $condition = 'users_delete = 0 AND users_active = 1' . $mof; $users_count = cs_sql_count(__FILE__, 'users', $condition); $data['head']['mod'] = $cs_lang['mod_name']; $data['head']['action'] = $cs_lang['list']; $data['head']['total'] = $users_count; $data['head']['pages'] = cs_pages('users', 'list', $users_count, $start, $where, $sort); $sel_female = $where === 'female' ? 'selected' : ''; $data['head']['sel_female'] = $sel_female; $sel_male = $where === 'male' ? 'selected' : ''; $data['head']['sel_male'] = $sel_male; $data['sort']['nick'] = cs_sort('users', 'list', $start, $where, 1, $sort); $data['sort']['place'] = cs_sort('users', 'list', $start, $where, 3, $sort); $data['sort']['laston'] = cs_sort('users', 'list', $start, $where, 5, $sort); $select = 'users_id, users_nick, users_place, users_laston, users_country, users_hidden, users_active, users_invisible'; $cs_users = cs_sql_select(__FILE__, 'users', $select, $condition, $order, $start, $account['users_limit']); $users_loop = count($cs_users); for ($run = 0; $run < $users_loop; $run++) { $cs_users[$run]['country'] = cs_html_img('symbols/countries/' . $cs_users[$run]['users_country'] . '.png'); $cs_users[$run]['users_id'] = cs_secure($cs_users[$run]['users_id']); $cs_users[$run]['nick'] = cs_user($cs_users[$run]['users_id'], $cs_users[$run]['users_nick'], $cs_users[$run]['users_active']); $content = cs_secure($cs_users[$run]['users_place']); $hidden = explode(',', $cs_users[$run]['users_hidden']); if (in_array('users_place', $hidden)) { $content = ($account['access_users'] > 4 or $cs_users[$run]['users_id'] == $account['users_id']) ? cs_html_italic(1) . $content . cs_html_italic(0) : ''; } $cs_users[$run]['place'] = $content; $cs_users[$run]['laston'] = cs_date('unix', $cs_users[$run]['users_laston']); $cs_users[$run]['page'] = cs_userstatus($cs_users[$run]['users_laston'], $cs_users[$run]['users_invisible']);
$order = $cs_sort[$sort]; $where = empty($access_id) ? 0 : "static_access >= '" . $access_id . "'"; $static_count = cs_sql_count(__FILE__, 'static', $where); $data['head']['total'] = $static_count; $data['head']['pages'] = cs_pages('static', 'manage', $static_count, $start, $where, $sort); $data['access'] = array(); for ($levels = 0; $levels < 6; $levels++) { $sel = $access_id == $levels ? 'selected="selected"' : ''; $data['access'][$levels]['level_id'] = $levels; $data['access'][$levels]['level_name'] = $cs_lang['lev_' . $levels]; $data['access'][$levels]['selected'] = $sel; } $data['url']['new_staticpage'] = cs_url('static', 'create'); $data['url']['form'] = cs_url('static', 'manage'); $data['head']['message'] = cs_getmsg(); $data['sort']['id'] = cs_sort('static', 'manage', $start, $access_id, 1, $sort); $data['sort']['title'] = cs_sort('static', 'manage', $start, $access_id, 3, $sort); $select = 'static_id, static_title, static_access'; $cs_static = cs_sql_select(__FILE__, 'static', $select, $where, $order, $start, $account['users_limit']); $static_loop = count($cs_static); for ($run = 0; $run < $static_loop; $run++) { $cs_static[$run]['static_id'] = $cs_static[$run]['static_id']; $cs_static[$run]['static_title'] = $cs_static[$run]['static_title']; $stat_access = $cs_static[$run]['static_access']; $cs_static[$run]['static_access'] = $stat_access . ' - ' . $cs_lang['lev_' . $stat_access]; $cs_static[$run]['url_delete'] = cs_url('static', 'remove', 'id=' . $cs_static[$run]['static_id']); $cs_static[$run]['url_edit'] = cs_url('static', 'edit', 'id=' . $cs_static[$run]['static_id']); $cs_static[$run]['url_view'] = cs_url('static', 'view', 'id=' . $cs_static[$run]['static_id']); } $data['static'] = $cs_static; echo cs_subtemplate(__FILE__, $data, 'static', 'manage');
$cs_sort[6] = 'members_since ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $cru = "users_id = '" . $where . "'"; $clans_count = cs_sql_count(__FILE__, 'members', $cru); $data['lang']['mod_name'] = $cs_lang[$op_clans['label']]; $data['lang']['addons'] = cs_addons('users', 'view', $where, 'clans'); $data['pages']['list'] = cs_pages('clans', 'users', $clans_count, $start, $where, $sort); $select = 'mem.members_task AS members_task, mem.members_since AS members_since, '; $select .= 'sqd.squads_id AS squads_id, sqd.squads_name AS squads_name, '; $select .= 'cln.clans_id AS clans_id, cln.clans_name AS clans_name'; $from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id '; $from .= 'INNER JOIN {pre}_clans cln ON sqd.clans_id = cln.clans_id'; $where2 = "mem.users_id ='" . $where . "'"; $cs_clans = cs_sql_select(__FILE__, $from, $select, $where2, $order, $start, $account['users_limit']); $clans_loop = count($cs_clans); $data['sort']['clans'] = cs_sort('clans', 'users', $start, $where, 1, $sort); $data['lang']['clans'] = $cs_lang[$op_clans['label']]; $data['sort']['squads'] = cs_sort('clans', 'users', $start, $where, 3, $sort); $data['lang']['squads'] = $cs_lang[$op_squads['label']]; $data['sort']['joined'] = cs_sort('clans', 'users', $start, $where, 5, $sort); if (empty($clans_loop)) { $data['clans'] = ''; } for ($run = 0; $run < $clans_loop; $run++) { $data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']); $data['clans'][$run]['short'] = cs_link(cs_secure($cs_clans[$run]['squads_name']), 'squads', 'view', 'id=' . $cs_clans[$run]['squads_id']); $data['clans'][$run]['task'] = cs_secure($cs_clans[$run]['members_task']); $data['clans'][$run]['since'] = empty($cs_clans[$run]['members_since']) ? '-' : cs_date('date', $cs_clans[$run]['members_since']); } echo cs_subtemplate(__FILE__, $data, 'clans', 'users');
$cs_sort[4] = 'access_access ASC'; $cs_sort[5] = 'access_clansphere DESC'; $cs_sort[6] = 'access_clansphere ASC'; $sort = empty($_REQUEST['sort']) ? 5 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $access_count = cs_sql_count(__FILE__, 'access'); $data['lang']['create'] = cs_url('access', 'create'); $data['lang']['count'] = $access_count; $data['pages']['list'] = cs_pages('access', 'manage', $access_count, $start, 0, $sort); $select = 'access_id, access_name, access_access, access_clansphere'; $cs_access = cs_sql_select(__FILE__, 'access', $select, 0, $order, $start, $account['users_limit']); $access_loop = count($cs_access); $data['lang']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('access', 'manage', $start, 0, 1, $sort); $data['sort']['access'] = cs_sort('access', 'manage', $start, 0, 3, $sort); $data['sort']['clansphere'] = cs_sort('access', 'manage', $start, 0, 5, $sort); $img_edit = cs_icon('edit', 16, $cs_lang['edit']); $img_del = cs_icon('editdelete', 16, $cs_lang['remove']); $img_users = cs_icon('kdmconfig', 16, $cs_lang['remove']); if (empty($access_loop)) { $data['access'] = ''; } for ($run = 0; $run < $access_loop; $run++) { $data['access'][$run]['name'] = cs_secure($cs_access[$run]['access_name']); $data['access'][$run]['access'] = $cs_access[$run]['access_access'] . ' - ' . $cs_lang['lev_' . $cs_access[$run]['access_access']]; $data['access'][$run]['clansphere'] = $cs_access[$run]['access_clansphere'] . ' - ' . $cs_lang['clansphere_' . $cs_access[$run]['access_clansphere']]; $data['access'][$run]['edit'] = cs_link($img_edit, 'access', 'edit', 'id=' . $cs_access[$run]['access_id'], 0, $cs_lang['edit']); $data['access'][$run]['users'] = cs_link($img_users, 'access', 'users', 'id=' . $cs_access[$run]['access_id'], 0, $cs_lang['user_list']); if ($cs_access[$run]['access_id'] < 6) { $data['access'][$run]['remove'] = '-'; } else {
$cs_sort[7] = 'access_id ASC'; $cs_sort[8] = 'access_id DESC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $where = "users_delete = '0'"; $where .= empty($letter) ? '' : " AND users_nick LIKE '" . cs_sql_escape($letter) . "%'"; $where .= empty($search_name) ? '' : " AND users_nick LIKE '%" . cs_sql_escape($search_name) . "%'"; $users_count = cs_sql_count(__FILE__, 'users', $where); $data['head']['total'] = $users_count; $data['head']['pages'] = cs_pages('users', 'manage', $users_count, $start, $match, $sort); $data['url']['form'] = cs_url('users', 'manage'); $data['head']['message'] = cs_getmsg(); $data['sort']['nick'] = cs_sort('users', 'manage', $start, $match, 1, $sort); $data['sort']['laston'] = cs_sort('users', 'manage', $start, $match, 3, $sort); $data['sort']['active'] = cs_sort('users', 'manage', $start, $match, 5, $sort); $data['sort']['access'] = cs_sort('users', 'manage', $start, $match, 7, $sort); $select = 'users_id, users_nick, users_laston, users_country, users_active, users_delete, users_invisible, access_id'; $cs_users = cs_sql_select(__FILE__, 'users', $select, $where, $order, $start, $account['users_limit']); $users_loop = count($cs_users); for ($run = 0; $run < $users_loop; $run++) { $cs_users[$run]['country'] = empty($cs_users[$run]['users_country']) ? 'symbols/countries/fam.png' : 'symbols/countries/' . $cs_users[$run]['users_country'] . '.png'; $cs_users[$run]['nick'] = cs_user($cs_users[$run]['users_id'], $cs_users[$run]['users_nick'], $cs_users[$run]['users_active'], $cs_users[$run]['users_delete']); $cs_users[$run]['laston'] = cs_date('unix', $cs_users[$run]['users_laston']); $cs_users[$run]['page'] = cs_userstatus($cs_users[$run]['users_laston'], $cs_users[$run]['users_invisible']); $cs_users[$run]['active'] = cs_secure($cs_users[$run]['users_active']); $cs_users_access = cs_sql_select(__FILE__, 'access', 'access_id, access_name', "access_id = " . $cs_users[$run]['access_id'], 0, 0, 1); $cs_users[$run]['access'] = $cs_users_access['access_name']; $cs_users[$run]['url_delete'] = cs_url('users', 'remove', 'id=' . $cs_users[$run]['users_id']); $cs_users[$run]['url_edit'] = cs_url('users', 'edit', 'id=' . $cs_users[$run]['users_id']); $cs_users[$run]['url_view'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']); $cs_users[$run]['url_picture'] = cs_url('users', 'picture_edit', 'id=' . $cs_users[$run]['users_id']);
$sqd_loop = count($sqd_data); for ($run = 0; $run < $sqd_loop; $run++) { $data['squad'][$run]['selected'] = $sqd_data[$run]['squads_id'] == $squads_id ? ' selected="selected"' : ''; $data['squad'][$run]['id'] = $sqd_data[$run]['squads_id']; $data['squad'][$run]['name'] = cs_secure($sqd_data[$run]['squads_name']); } if (empty($sqd_loop)) { $data['squad'] = array(); } $data['lang']['msg'] = !empty($msg) ? $msg : ''; $select = 'mem.members_admin AS members_admin, mem.members_order AS members_order, mem.users_id AS users_id, usr.users_nick AS users_nick, usr.users_delete AS users_delete, usr.users_active AS users_active, mem.members_task, mem.members_id AS members_id'; $from = 'members mem INNER JOIN {pre}_users usr ON mem.users_id = usr.users_id'; $where = "mem.squads_id = '" . $squads_id . "'"; $cs_members = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, 0); $members_loop = count($cs_members); $data['sort']['user'] = cs_sort('members', 'center', 0, $squads_id, 1, $sort); $data['sort']['task'] = cs_sort('members', 'center', 0, $squads_id, 3, $sort); $img_edit = cs_icon('edit', 16, $cs_lang['edit']); $img_del = cs_icon('editdelete', 16, $cs_lang['remove']); if (empty($members_loop)) { $data['members'] = ''; } for ($run = 0; $run < $members_loop; $run++) { $users_nick = cs_user($cs_members[$run]['users_id'], $cs_members[$run]['users_nick'], $cs_members[$run]['users_active'], $cs_members[$run]['users_delete']); $data['members'][$run]['user'] = empty($cs_members[$run]['members_admin']) ? $users_nick : cs_html_big(1) . $users_nick . cs_html_big(0); $data['members'][$run]['task'] = cs_secure($cs_members[$run]['members_task']); $data['members'][$run]['order'] = $cs_members[$run]['members_order']; $data['members'][$run]['edit'] = cs_link($img_edit, 'members', 'change', 'id=' . $cs_members[$run]['members_id'], 0, $cs_lang['edit']); $data['members'][$run]['remove'] = cs_link($img_del, 'members', 'center', 'del_id=' . $cs_members[$run]['members_id'], 0, $cs_lang['remove']); } echo cs_subtemplate(__FILE__, $data, 'members', 'center');
if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 4 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $cs_sort[1] = 'cat.categories_name DESC'; $cs_sort[2] = 'cat.categories_name ASC'; $cs_sort[3] = 'brd.board_name DESC'; $cs_sort[4] = 'brd.board_name ASC'; $order = $cs_sort[$sort]; $where = empty($categories_id) ? 0 : "categories_id = '" . $categories_id . "'"; $board_count = cs_sql_count(__FILE__, 'board', $where); $data['head']['count_attachments'] = cs_sql_count(__FILE__, 'boardfiles'); $data['head']['count_reports'] = cs_sql_count(__FILE__, 'boardreport'); $data['head']['count'] = $board_count; $data['head']['pages'] = cs_pages('board', 'manage', $board_count, $start, $categories_id, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('board', 'manage', $start, $categories_id, 3, $sort); $data['sort']['cat'] = cs_sort('board', 'manage', $start, $categories_id, 1, $sort); $from = 'board brd INNER JOIN {pre}_categories cat ON brd.categories_id = cat.categories_id'; $select = 'brd.board_name AS board_name, cat.categories_name AS categories_name, brd.board_id AS board_id'; $data['board'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $board_loop = count($data['board']); for ($run = 0; $run < $board_loop; $run++) { $data['board'][$run]['name'] = cs_secure($data['board'][$run]['board_name']); $data['board'][$run]['cat'] = cs_secure($data['board'][$run]['categories_name']); $data['board'][$run]['id'] = $data['board'][$run]['board_id']; } echo cs_subtemplate(__FILE__, $data, 'board', 'manage');
$data['events'] = cs_sql_select(__FILE__, 'events', $columns, $where, 0, 0, 1); $data['events']['time'] = cs_date('unix', $data['events']['events_time'], 1); $count_where = "events_id = " . (int) $events_id . " AND eventguests_status = "; $data['count']['status_0'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '0'); $data['count']['status_3'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '3'); $data['count']['status_4'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '4'); $data['count']['status_5'] = cs_sql_count(__FILE__, 'eventguests', $count_where . '5'); $data['count']['status_booked'] = $data['count']['status_4'] + $data['count']['status_5']; $data['count']['status_available'] = $data['events']['events_guestsmax'] - $data['count']['status_booked']; $data['head']['count'] = $data['count']['status_0'] + $data['count']['status_3'] + $data['count']['status_booked']; $data['head']['pages'] = cs_pages('events', 'guests', $data['head']['count'], $start, $events_id, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['user'] = cs_sort('events', 'guests', $start, $events_id, 1, $sort); $data['sort']['name'] = cs_sort('events', 'guests', $start, $events_id, 3, $sort); $data['sort']['time'] = cs_sort('events', 'guests', $start, $events_id, 5, $sort); $data['sort']['status'] = cs_sort('events', 'guests', $start, $events_id, 7, $sort); $from = 'eventguests egt LEFT JOIN {pre}_users usr ON egt.users_id = usr.users_id'; $select = 'egt.eventguests_name AS eventguests_name, egt.eventguests_surname AS eventguests_surname, ' . 'egt.eventguests_since AS eventguests_since, egt.users_id AS users_id, usr.users_nick AS users_nick, ' . 'usr.users_surname AS users_surname, usr.users_hidden AS users_hidden, usr.users_active AS users_active, ' . 'usr.users_delete AS users_delete, usr.users_name AS users_name, usr.users_phone AS users_phone, ' . 'usr.users_mobile AS users_mobile, egt.eventguests_id AS eventguests_id, egt.eventguests_notice AS eventguests_notice, ' . 'egt.eventguests_phone AS eventguests_phone, egt.eventguests_mobile AS eventguests_mobile, ' . 'egt.eventguests_status AS eventguests_status'; $cs_eventguests = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $eventguests_loop = count($cs_eventguests); if (empty($eventguests_loop)) { $data['eventguests'] = ''; } for ($run = 0; $run < $eventguests_loop; $run++) { $allow = 0; if ($cs_eventguests[$run]['users_id'] == $account['users_id'] or $account['access_users'] > 4) { $allow = 1; } $hidden = explode(',', $cs_eventguests[$run]['users_hidden']); $content = cs_secure($cs_eventguests[$run]['users_surname']); if (in_array('users_surname', $hidden)) {
$data['where']['mod'] = $where; $data['head']['count'] = $categories_count; $data['head']['pages'] = cs_pages('categories', 'manage', $categories_count, $start, $where, $sort); $run = 0; $modules = cs_checkdirs('mods'); foreach ($modules as $mods) { $check_axx = empty($account['access_' . $mods['dir'] . '']) ? 0 : $account['access_' . $mods['dir'] . '']; if (!empty($mods['categories']) and $check_axx > 2) { $mods['dir'] == $where ? $sel = 1 : ($sel = 0); $data['mod'][$run]['sel'] = cs_html_option($mods['name'], $mods['dir'], $sel); $run++; } } $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('categories', 'manage', $start, $where, 1, $sort); $data['sort']['url'] = cs_sort('categories', 'manage', $start, $where, 3, $sort); $select = 'categories_id, categories_name, categories_url, categories_subid'; $data['cat'] = cs_sql_select(__FILE__, 'categories', $select, $mdp, $order, $start, $account['users_limit']); $data['cat'] = cs_catsort($data['cat']); $categories_loop = !empty($data['cat']) ? count($data['cat']) : ''; for ($run = 0; $run < $categories_loop; $run++) { $blank = ''; if (!empty($data['cat'][$run]['layer'])) { for ($i = 0; $i < $data['cat'][$run]['layer']; $i++) { $blank .= ' '; } $blank .= cs_icon('add_sub_task'); } $data['cat'][$run]['subcat_layer'] = $blank; $cs_cat_name = cs_secure($data['cat'][$run]['categories_name']); $data['cat'][$run]['category'] = cs_link($cs_cat_name, 'categories', 'view', 'id=' . $data['cat'][$run]['categories_id']);
$j = (int) (2 * $i); $data['lbrounds'][$run]['value'] = $j; $data['lbrounds'][$run]['if']['lbnotselected'] = $lb == 1 && $data['lbrounds'][$run]['value'] == $round ? false : true; $data['lbrounds'][$run]['name'] = $cs_lang['round'] . ' ' . ($j % 2 == 0 ? sprintf('%1.0F', $i) : sprintf('%1.1F', $i)); $i += 0.5; $run++; } break; } $data['vars']['matchcount'] = count($data['matches']); $data['vars']['cups_id'] = $cups_id; $data['pages']['list'] = cs_pages('cups', 'matchlist', $data['vars']['matchcount'], $start, $cups_id, $sort); $data['if']['brackets'] = $system['cups_brackets'] == CS_CUPS_SYSTEM_LB ? true : false; $data['sort']['team1'] = cs_sort('cups', 'matchlist', $start, $cups_id, 1, $sort, 'round=' . $round); $data['sort']['team2'] = cs_sort('cups', 'matchlist', $start, $cups_id, 3, $sort, 'round=' . $round); $data['sort']['bracket'] = cs_sort('cups', 'matchlist', $start, $cups_id, 5, $sort, 'round=' . $round); if ($system['cups_system'] == CS_CUPS_TYPE_USERS) { $data['lang']['team'] = $cs_lang['player']; } $notallowed = array(CS_CUPS_TEAM_UNKNOWN, CS_CUPS_TEAM_BYE); for ($i = 0; $i < $data['vars']['matchcount']; $i++) { $data['matches'][$i]['betlink'] = ''; if (!empty($account['access_bets']) && $account['access_bets'] > 3) { $cupmatch = $data['matches'][$i]; if ($cupmatch['cupmatches_winner'] == CS_CUPS_TEAM_UNKNOWN && !in_array($cupmatch['squad1_id'], $notallowed) && !in_array($cupmatch['squad2_id'], $notallowed) && empty($cupmatch['cupmatches_accepted1']) && empty($cupmatch['cupmatches_accepted2']) && empty($cupmatch['cupmatches_score1']) && empty($cupmatch['cupmatches_score2'])) { $data['matches'][$i]['betlink'] = cs_link(cs_icon('bets'), 'bets', 'create', 'cupmatchid=' . $data['matches'][$i]['cupmatches_id']); } } if ($system['cups_brackets'] == CS_CUPS_SYSTEM_LB) { $data['matches'][$i]['bracket'] = empty($data['matches'][$i]['cupmatches_loserbracket']) ? $cs_lang['winners'] : $cs_lang['losers']; }
$cs_sort[4] = 'clans_short ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $data['lang']['getmsg'] = cs_getmsg(); $data['lang']['mod_name'] = $cs_lang[$op_clans['label']]; $own = "users_id = '" . $account['users_id'] . "'"; $clans_count = cs_sql_count(__FILE__, 'clans', $own); $data['lang']['mod_name'] = $cs_lang[$op_clans['label']]; $data['lang']['new'] = cs_link($cs_lang['new_' . $op_clans['label']], 'clans', 'new'); $data['lang']['all'] = $cs_lang['total'] . ': '; $data['lang']['count'] = $clans_count; $data['pages']['list'] = cs_pages('clans', 'center', $clans_count, $start, 0, $sort); $select = 'clans_name, clans_short, clans_id'; $cs_clans = cs_sql_select(__FILE__, 'clans', $select, $own, $order, $start, $account['users_limit']); $clans_loop = count($cs_clans); $data['sort']['name'] = cs_sort('clans', 'center', $start, 0, 1, $sort); $data['sort']['short'] = cs_sort('clans', 'center', $start, 0, 3, $sort); if (empty($clans_loop)) { $data['clans'] = ''; } for ($run = 0; $run < $clans_loop; $run++) { $data['clans'][$run]['name'] = cs_link(cs_secure($cs_clans[$run]['clans_name']), 'clans', 'view', 'id=' . $cs_clans[$run]['clans_id']); $data['clans'][$run]['short'] = cs_secure($cs_clans[$run]['clans_short']); $data['clans'][$run]['edit'] = cs_link(cs_icon('edit', 16, $cs_lang['edit']), 'clans', 'change', 'id=' . $cs_clans[$run]['clans_id'], 0, $cs_lang['edit']); if ($cs_clans[$run]['clans_id'] == 1) { $data['clans'][$run]['remove'] = '-'; } else { $data['clans'][$run]['remove'] = cs_link(cs_icon('editdelete', 16, $cs_lang['remove']), 'clans', 'delete', 'id=' . $cs_clans[$run]['clans_id'], 0, $cs_lang['remove']); } } echo cs_subtemplate(__FILE__, $data, 'clans', 'center');
$order = $cs_sort[$sort]; $own = "users_id = '" . $account['users_id'] . "'"; $squads_count = cs_sql_count(__FILE__, 'members', $own); $data['head']['mod'] = $cs_lang[$op_squads['label'] . 's']; $data['lang']['new_label'] = $cs_lang['new_' . $op_squads['label']]; $data['head']['count'] = $squads_count; $data['head']['pages'] = cs_pages('squads', 'center', $squads_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['lang']['join_label'] = $cs_lang['join_' . $op_squads['label']]; if (!empty($squads_count)) { $data['if']['squad_to_leave'] = TRUE; $data['lang']['leave_label'] = $cs_lang['leave_' . $op_squads['label']]; } $data['sort']['squad_name'] = cs_sort('squads', 'center', $start, 0, 1, $sort); $data['lang']['label'] = $cs_lang[$op_squads['label']]; $data['sort']['members_task'] = cs_sort('squads', 'center', $start, 0, 3, $sort); $select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id, mem.members_task AS members_task, mem.members_admin AS members_admin'; $from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id'; $where = "mem.users_id = '" . $account['users_id'] . "'"; $data['squads'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $squads_loop = count($data['squads']); for ($run = 0; $run < $squads_loop; $run++) { $data['squads'][$run]['id'] = $data['squads'][$run]['squads_id']; $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']); $data['squads'][$run]['members_task'] = cs_secure($data['squads'][$run]['members_task']); if (!empty($data['squads'][$run]['members_admin'])) { $data['squads'][$run]['if']['squad_admin'] = TRUE; $data['squads'][$run]['if']['no_squad_admin'] = FALSE; } else { $data['squads'][$run]['if']['squad_admin'] = FALSE; $data['squads'][$run]['if']['no_squad_admin'] = TRUE;
$data = array(); $start = empty($cs_get['start']) ? 0 : $cs_get['start']; if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 2 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $cs_sort[1] = 'boardranks_min DESC'; $cs_sort[2] = 'boardranks_min ASC'; $cs_sort[3] = 'boardranks_name DESC'; $cs_sort[4] = 'boardranks_name ASC'; $order = $cs_sort[$sort]; $boardranks_count = cs_sql_count(__FILE__, 'boardranks'); $data['head']['count'] = $boardranks_count; $data['head']['pages'] = cs_pages('boardranks', 'manage', $boardranks_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['boardranks_min'] = cs_sort('boardranks', 'manage', $start, 0, 1, $sort); $data['sort']['boardranks_name'] = cs_sort('boardranks', 'manage', $start, 0, 3, $sort); $select = 'boardranks_id, boardranks_min, boardranks_name'; $cs_boardranks = cs_sql_select(__FILE__, 'boardranks', $select, 0, $order, $start, $account['users_limit']); $boardranks_loop = count($cs_boardranks); for ($run = 0; $run < $boardranks_loop; $run++) { $id = $cs_boardranks[$run]['boardranks_id']; $data['bora'][$run]['boardranks_min'] = cs_secure($cs_boardranks[$run]['boardranks_min']); $data['bora'][$run]['boardranks_name'] = cs_secure($cs_boardranks[$run]['boardranks_name']); $data['bora'][$run]['url_edit'] = cs_url('boardranks', 'edit', 'id=' . $id); $data['bora'][$run]['url_remove'] = cs_url('boardranks', 'remove', 'id=' . $id); } echo cs_subtemplate(__FILE__, $data, 'boardranks', 'manage');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('banners'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'banners_name DESC'; $cs_sort[2] = 'banners_name ASC'; $cs_sort[3] = 'banners_order DESC'; $cs_sort[4] = 'banners_order ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $banners_count = cs_sql_count(__FILE__, 'banners'); $data['count']['all'] = $banners_count; $data['pages']['list'] = cs_pages('banners', 'manage', $banners_count, $start, 0, $sort); $data['lang']['getmsg'] = cs_getmsg(); $select = 'banners_id, banners_name, banners_order'; $cs_banners = cs_sql_select(__FILE__, 'banners', $select, 0, $order, $start, $account['users_limit']); $banners_loop = count($cs_banners); $data['sort']['name'] = cs_sort('banners', 'manage', $start, 0, 1, $sort); $data['sort']['order'] = cs_sort('banners', 'manage', $start, 0, 3, $sort); if (empty($banners_loop)) { $data['banners'] = ''; } for ($run = 0; $run < $banners_loop; $run++) { $data['banners'][$run]['name'] = cs_secure($cs_banners[$run]['banners_name']); $data['banners'][$run]['order'] = cs_secure($cs_banners[$run]['banners_order']); $data['banners'][$run]['edit'] = cs_url('banners', 'edit', 'id=' . $cs_banners[$run]['banners_id']); $data['banners'][$run]['remove'] = cs_url('banners', 'remove', 'id=' . $cs_banners[$run]['banners_id']); } echo cs_subtemplate(__FILE__, $data, 'banners', 'manage');
$cs_sort[1] = 'articles_headline DESC'; $cs_sort[2] = 'articles_headline ASC'; $cs_sort[3] = 'articles_time DESC'; $cs_sort[4] = 'articles_time ASC'; $sort = empty($_REQUEST['sort']) ? 3 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $articles_count = cs_sql_count(__FILE__, 'articles'); $data['head']['articles_count'] = $articles_count; $data['head']['pages'] = cs_pages('articles', 'manage', $articles_count, $start, $categories_id, $sort); $catmod = "categories_mod = 'articles'"; $cells = 'categories_name, categories_id'; $categories_data = cs_sql_select(__FILE__, 'categories', $cells, $catmod, 'categories_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('categories_id', 'categories_name', $categories_data, $categories_id); $data['head']['message'] = cs_getmsg(); $cat_where = empty($categories_id) ? 0 : 'categories_id = ' . (int) $categories_id; $cells = 'articles_headline, articles_id, articles_time, users_id'; $cs_articles = cs_sql_select(__FILE__, 'articles', $cells, $cat_where, $order, $start, $account['users_limit']); $articles_loop = count($cs_articles); $data['sort']['headline'] = cs_sort('articles', 'manage', $start, $categories_id, 1, $sort); $data['sort']['date'] = cs_sort('articles', 'manage', $start, $categories_id, 3, $sort); for ($run = 0; $run < $articles_loop; $run++) { $id = $cs_articles[$run]['articles_id']; $cs_articles[$run]['articles_headline'] = cs_link($cs_articles[$run]['articles_headline'], 'articles', 'view', 'id=' . $id); $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', "users_id = '" . $cs_articles[$run]['users_id'] . "'"); $cs_articles[$run]['users_link'] = cs_user($cs_articles[$run]['users_id'], $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']); $cs_articles[$run]['articles_date'] = cs_date('unix', $cs_articles[$run]['articles_time'], 1); $cs_articles[$run]['url_edit'] = cs_url('articles', 'edit', 'id=' . $id); $cs_articles[$run]['url_remove'] = cs_url('articles', 'remove', 'id=' . $id); } $data['articles'] = $cs_articles; echo cs_subtemplate(__FILE__, $data, 'articles', 'manage');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'games_name DESC'; $cs_sort[2] = 'games_name ASC'; $cs_sort[3] = 'games_usk DESC'; $cs_sort[4] = 'games_usk ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $games_count = cs_sql_count(__FILE__, 'games'); $data['lang']['body'] = sprintf($cs_lang['all'], $games_count); $data['pages']['list'] = cs_pages('games', 'list', $games_count, $start, 0, $sort); $cs_games = cs_sql_select(__FILE__, 'games', '*', 0, $order, $start, $account['users_limit']); $games_loop = count($cs_games); $data['sort']['name'] = cs_sort('games', 'list', $start, 0, 1, $sort); $data['sort']['usk'] = cs_sort('games', 'list', $start, 0, 3, $sort); if (empty($games_loop)) { $data['games'] = ''; } for ($run = 0; $run < $games_loop; $run++) { $data['games'][$run]['name'] = cs_link($cs_games[$run]['games_name'], 'games', 'view', 'id=' . $cs_games[$run]['games_id']); $games_genre = cs_sql_select(__FILE__, 'categories', '*', "categories_id = '" . $cs_games[$run]['categories_id'] . "'"); $data['games'][$run]['genre'] = cs_secure($games_genre['categories_name']); $data['games'][$run]['usk'] = cs_secure($cs_games[$run]['games_usk']); $data['games'][$run]['release'] = empty($cs_games[$run]['games_released']) ? $since2 = '-' : ($since2 = cs_date('date', $cs_games[$run]['games_released'])); } echo cs_subtemplate(__FILE__, $data, 'games', 'list');
$where = "voted_mod = 'votes' AND voted_fid = '" . $votes_id . "' AND voted_ip = '" . cs_sql_escape($users_ip) . "'"; if ($users_id > 0) { $where = "voted_mod = 'votes' AND voted_fid = '" . $votes_id . "' AND users_id = '" . $users_id . "'"; } $checkit_userip = cs_sql_count(__FILE__, 'voted', $where); } $from = 'voted'; $select = 'voted_id, users_id, voted_ip, voted_answer, voted_fid'; $where = "voted_mod = 'votes'"; $cs_voted = cs_sql_select(__FILE__, $from, $select, $where, '', '0', '0'); $voted_loop = count($cs_voted); $data['head']['count'] = $votes_loop; $data['head']['pages'] = cs_pages('votes', 'list', $votes_loop, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['question'] = cs_sort('votes', 'list', $start, 0, 3, $sort); $data['sort']['ends_on'] = cs_sort('votes', 'list', $start, 0, 1, $sort); $from = 'comments'; $select = 'comments_fid'; $where = "comments_mod = 'votes'"; $cs_comments = cs_sql_select(__FILE__, $from, $select, $where, '', '0', '0'); $comments_loop = count($cs_comments); $com_count = 0; for ($run_2 = 0; $run_2 < $comments_loop; $run_2++) { $comments_fid = $cs_comments[$run_2]['comments_fid']; $votes_id = $cs_votes[0]['votes_id']; if ($comments_fid == $votes_id) { $com_count++; } } $data['votes'] = ''; for ($run = 0; $run < $votes_loop; $run++) {
$sort = empty($_REQUEST['sort']) ? 1 : (int) $_REQUEST['sort']; $order = $cs_sort[$sort]; $wars_count = cs_sql_count(__FILE__, 'wars', $where_count); $data = array(); $data['info']['warcount'] = sprintf($cs_lang['count'], $wars_count); $data['pages']['choice'] = cs_pages('wars', 'list', $wars_count, $start, $squads_id, $sort); $data['url']['form'] = cs_url('wars', 'list'); $cid = "squads_fightus = '0'"; $data['squads'] = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id', $cid, 'squads_name', 0, 0); $count_squads = count($data['squads']); for ($run = 0; $run < $count_squads; $run++) { $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']); } $data['sort']['date'] = cs_sort('wars', 'list', $start, $squads_id, 1, $sort); $data['sort']['enemy'] = cs_sort('wars', 'list', $start, $squads_id, 3, $sort); $data['sort']['category'] = cs_sort('wars', 'list', $start, $squads_id, 5, $sort); $select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.wars_status AS status, war.clans_id AS clans_id, cln.clans_short AS clans_short, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id'; $from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id '; $from .= 'INNER JOIN {pre}_clans cln ON war.clans_id = cln.clans_id '; $cs_wars = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $data['wars'] = ''; $count_wars = count($cs_wars); for ($run = 0; $run < $count_wars; $run++) { $data['wars'][$run]['gameicon'] = cs_html_img('uploads/games/' . $cs_wars[$run]['games_id'] . '.gif'); $data['wars'][$run]['date'] = cs_date('unix', $cs_wars[$run]['wars_date']); $data['wars'][$run]['enemyurl'] = cs_url('clans', 'view', 'id=' . $cs_wars[$run]['clans_id']); $data['wars'][$run]['enemy'] = cs_secure($cs_wars[$run]['clans_short']); $data['wars'][$run]['caturl'] = cs_url('categories', 'view', 'id=' . $cs_wars[$run]['categories_id']); $data['wars'][$run]['category'] = cs_secure($cs_wars[$run]['categories_name']); $data['wars'][$run]['url'] = cs_url('wars', 'view', 'id=' . $cs_wars[$run]['wars_id']); $data['wars'][$run]['result'] = $cs_wars[$run]['wars_score1'] . ' : ' . $cs_wars[$run]['wars_score2'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $data = array(); $cs_lang = cs_translate('maps'); $data['count']['all'] = cs_sql_count(__FILE__, 'maps'); $data['lang']['curr_maps'] = sprintf($cs_lang['curr_maps'], $data['count']['all']); $cs_sort = array(); $cs_sort[1] = 'mp.maps_name ASC'; $cs_sort[2] = 'mp.maps_name DESC'; $cs_sort[3] = 'gm.games_name ASC'; $cs_sort[4] = 'gm.games_name DESC'; $sort = empty($_GET['sort']) ? 1 : (int) $_GET['sort']; $start = empty($_GET['start']) ? 0 : (int) $_GET['start']; $order = $cs_sort[$sort]; $data['pages']['list'] = cs_pages('maps', 'list', $data['count']['all'], $start, 0, $sort); $data['sort']['maps_name'] = cs_sort('maps', 'list', $start, 0, 1, $sort); $data['sort']['games_name'] = cs_sort('maps', 'list', $start, 0, 3, $sort); $tables = 'maps mp INNER JOIN {pre}_games gm ON mp.games_id = gm.games_id'; $cells = 'mp.maps_id AS maps_id, mp.maps_name AS maps_name, mp.games_id AS games_id, gm.games_name AS games_name'; $data['maps'] = cs_sql_select(__FILE__, $tables, $cells, 0, $order, $start, $account['users_limit']); $count_maps = count($data['maps']); for ($run = 0; $run < $count_maps; $run++) { $data['maps'][$run]['maps_name'] = cs_secure($data['maps'][$run]['maps_name']); } echo cs_subtemplate(__FILE__, $data, 'maps', 'list');
if (empty($user_gb)) { $user_gb = empty($_GET['user_gb']) ? 0 : $_GET['user_gb']; } if (!empty($user_gb)) { $where = "users_nick = '" . cs_sql_escape($user_gb) . "'"; $cs_user = cs_sql_select(__FILE__, 'users', 'users_id', $where); $id = $cs_user['users_id']; } $where = "gbook_users_id ='" . $id . "'"; $gbook_count = cs_sql_count(__FILE__, 'gbook', $where); $data['head']['count'] = $gbook_count; $data['head']['pages'] = cs_pages('gbook', 'manage', $gbook_count, $start, $id, $sort); $data['head']['user_gb'] = empty($user_gb) ? '' : $user_gb; $data['head']['getmsg'] = cs_getmsg(); $data['sort']['email'] = cs_sort('gbook', 'manage', $start, $id, 3, $sort); $data['sort']['time'] = cs_sort('gbook', 'manage', $start, $id, 1, $sort); $from = 'gbook gbk LEFT JOIN {pre}_users usr ON gbk.users_id = usr.users_id'; $select = 'gbk.gbook_id AS gbook_id, gbk.users_id AS users_id, gbk.gbook_time AS gbook_time, gbk.gbook_nick AS gbook_nick, '; $select .= 'gbk.gbook_email AS gbook_email, gbk.gbook_lock AS gbook_lock, gbk.gbook_ip AS gbook_ip, '; $select .= 'usr.users_nick AS users_nick, usr.users_email AS users_email'; $cs_gbook = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $gbook_loop = count($cs_gbook); for ($run = 0; $run < $gbook_loop; $run++) { if ($cs_gbook[$run]['users_id'] > 0) { $gbook[$run]['nick'] = cs_secure($cs_gbook[$run]['users_nick']); $gbook[$run]['email'] = cs_secure($cs_gbook[$run]['users_email']); } else { $gbook[$run]['nick'] = cs_secure($cs_gbook[$run]['gbook_nick']); $gbook[$run]['email'] = cs_secure($cs_gbook[$run]['gbook_email']); } $gbook[$run]['time'] = cs_date('unix', $cs_gbook[$run]['gbook_time'], 1);
$data = array(); $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']; } $cid = "users_id = '" . $account['users_id'] . "'"; $cs_sort[1] = 'computers_name DESC'; $cs_sort[2] = 'computers_name ASC'; $cs_sort[3] = 'computers_since ASC'; $cs_sort[4] = 'computers_since DESC'; $order = $cs_sort[$sort]; $computers_count = cs_sql_count(__FILE__, 'computers', $cid); $data['head']['count'] = $computers_count; $data['head']['pages'] = cs_pages('computers', 'center', $computers_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['sort']['name'] = cs_sort('computers', 'center', $start, 0, 1, $sort); $data['sort']['since'] = cs_sort('computers', 'center', $start, 0, 3, $sort); $select = 'computers_name, computers_since, computers_id'; $data['com'] = cs_sql_select(__FILE__, 'computers', $select, $cid, $order, $start, $account['users_limit']); $computers_loop = count($data['com']); for ($run = 0; $run < $computers_loop; $run++) { $id = $data['com'][$run]['computers_id']; $data['com'][$run]['name'] = cs_secure($data['com'][$run]['computers_name']); $data['com'][$run]['since'] = cs_date('unix', $data['com'][$run]['computers_since'], 1); $data['com'][$run]['id'] = $id; } echo cs_subtemplate(__FILE__, $data, 'computers', 'center');