function cs_search($mod) { $cs_lang = cs_translate('search'); $data = array(); $data['search']['mod'] = $mod; echo cs_subtemplate(__FILE__, $data, 'search', 'search_function'); }
function cs_subtemplate($source, $data, $mod, $action = 'list', $navfiles = 0) { global $account, $cs_lang, $cs_main; $cs_lang = cs_translate($mod); $data = is_array($data) ? $data : array(); $string = cs_cache_theme($mod, $action, $navfiles); $string = cs_conditiontemplate($string, $data); $string = cs_looptemplate($source, $string, $data); $string = preg_replace_callback("={lang:([\\S]*?)}=i", 'cs_templatelang', $string); if ($cs_main['xsrf_protection'] === true) { $string = preg_replace_callback("/<form(.*?)method=\"post\"(.*?)>/i", 'cs_xsrf_protection_field', $string); } if (!empty($navfiles)) { $string = cs_tokenizer_split($string); $theme = cs_tokenizer_parse($string); $string = ''; foreach ($theme as $num => $content) { $string .= $content; } } if (!empty($cs_main['themebar']) and (!empty($cs_main['developer']) or $account['access_clansphere'] > 4)) { include_once 'mods/clansphere/themebar.php'; $string = cs_themebar($source, $string, $mod, $action); } return $string; }
function cs_abcode_smileys($name, $keep = 0) { global $cs_main; if (!empty($cs_main['rte_more']) and empty($keep)) { return ''; } $cs_lang = cs_translate('system/abcodes', 1); $select = 'abcode_pattern, abcode_file'; $loop_abc = cs_sql_select(__FILE__, 'abcode', $select, "abcode_func = 'img'", "abcode_order DESC, abcode_id", 0, 10, 'abcode_smileys'); $abc_count = count($loop_abc); $data = array(); $data['if']['features'] = $abc_count == 10 ? 1 : 0; $data['if']['row3'] = $abc_count > 6 ? 1 : 0; $data['if']['row2'] = $abc_count > 3 ? 1 : 0; $data['if']['row1'] = $abc_count > 0 ? 1 : 0; if ($abc_count < 3) { $data['var'] = array('img2' => '', 'pattern2' => '', 'img3' => '', 'pattern3' => ''); } elseif ($abc_count < 6) { $data['var'] = array('img5' => '', 'pattern5' => '', 'img6' => '', 'pattern6' => ''); } elseif ($abc_count < 9) { $data['var'] = array('img8' => '', 'pattern8' => '', 'img9' => '', 'pattern9' => ''); } $run = 0; $abc_while = $abc_count > 9 ? 9 : $abc_count; while ($abc_while > $run) { $data['var']['img' . ($run + 1)] = cs_html_img('uploads/abcode/' . $loop_abc[$run]['abcode_file']); $data['var']['pattern' . ($run + 1)] = $loop_abc[$run]['abcode_pattern']; $run++; } $data['var']['textarea'] = $name; return empty($abc_count) ? '' : cs_subtemplate(__FILE__, $data, 'abcode', 'imgbox'); }
function cs_newsletter_to($select) { $cs_lang = cs_translate('newsletter'); $op_squads = cs_sql_option(__FILE__, 'squads', 'label'); $op_clans = cs_sql_option(__FILE__, 'clans', 'label'); $dp = cs_html_option('----', '0', 1); $dp .= cs_html_option($cs_lang['all_users'], '1'); $dp .= cs_html_option('»' . $cs_lang['ac_group'], ''); $usergroups = cs_sql_select(__FILE__, 'access', 'access_id,access_name', 'access_id != 1', 0, 0, 0); foreach ($usergroups as $value) { $dp .= cs_html_option(' ' . cs_secure($value['access_name']), '2?' . $value['access_id']); } $dp .= cs_html_option(' »' . $cs_lang[$op_squads['label']], ''); $squads = cs_sql_select(__FILE__, 'squads', 'squads_id, squads_name', 0, 'squads_name', 0, 0); $squads = empty($squads) ? array() : $squads; foreach ($squads as $squad) { $dp .= cs_html_option(' ' . cs_secure($squad['squads_name']), '3?' . $squad['squads_id']); } $dp .= cs_html_option('»' . $cs_lang[$op_clans['label']], ''); $clans = cs_sql_select(__FILE__, 'clans', 'clans_id, clans_name', 0, 'clans_name', 0, 0); $clans = empty($clans) ? array() : $clans; foreach ($clans as $clan) { $dp .= cs_html_option(' ' . cs_secure($clan['clans_name']), '4?' . $clan['clans_id']); } $data['nl']['to_dropdown'] = $dp; return $dp; }
function cs_installerror($old_query = '') { global $cs_db, $cs_lang, $account; $cs_lang = cs_translate('install'); $error = empty($cs_db['last_error']) ? 'Unknown' : $cs_db['last_error']; $msg = 'Error: ' . $error . cs_html_br(2) . 'Query: ' . $old_query . cs_html_br(4); $msg .= cs_link($cs_lang['remove_and_again'], 'install', 'sql', 'lang=' . $account['users_lang'] . '&uninstall=1'); die(cs_error_internal('sql', $msg)); }
function cs_gray($imgfile) { $info = getimagesize($imgfile); switch ($info[2]) { case 1: $cs_lang = cs_translate('gallery'); $message = $cs_lang['gray_error'] . cs_html_br(1); $g_error = 1; break; case 2: $sourceImage = imagecreatefromjpeg($imgfile); break; case 3: $sourceImage = imagecreatefrompng($imgfile); break; } if (empty($g_error)) { $img_width = imagesx($sourceImage); $img_height = imagesy($sourceImage); for ($y = 0; $y < $img_height; $y++) { for ($x = 0; $x < $img_width; $x++) { $rgb = imagecolorat($sourceImage, $x, $y); $red = $rgb >> 16 & 0xff; $green = $rgb >> 8 & 0xff; $blue = $rgb & 0xff; $gray = round(0.299 * $red + 0.587 * $green + 0.114 * $blue); $grayR = $gray << 16; // R: red $grayG = $gray << 8; // G: green $grayB = $gray; // B: blue $grayColor = $grayR | $grayG | $grayB; imagesetpixel($sourceImage, $x, $y, $grayColor); imagecolorallocate($sourceImage, $gray, $gray, $gray); } } $destinationImage = imagecreatetruecolor($img_width, $img_height); imagecopy($destinationImage, $sourceImage, 0, 0, 0, 0, $img_width, $img_height); switch ($info[2]) { case 2: return imagejpeg($destinationImage, $imgfile); break; case 3: return imagepng($destinationImage, $imgfile); break; } imagedestroy($destinationImage); imagedestroy($sourceImage); } }
function cs_admin_menu() { global $cs_main, $account; $cs_lang = cs_translate('clansphere'); $data = array(); $recent_mod = $cs_main['mod']; $recent_action = $cs_main['action']; $link_count = 0; if (file_exists('mods/' . $recent_mod . '/manage.php') && $account['access_' . $recent_mod] >= 3) { include $cs_main['def_path'] . '/mods/' . $recent_mod . '/info.php'; # look for sql table named like mod, else use first sql table given $mod_tables = is_array($mod_info['tables']) ? $mod_info['tables'] : array(); if (in_array($recent_mod, $mod_tables)) { $sql_table = $recent_mod; } elseif (isset($mod_tables[0])) { $sql_table = $mod_tables[0]; } else { $sql_table = false; } $sql_count = empty($sql_table) ? '' : ' (' . cs_sql_count(__FILE__, $sql_table) . ')'; $link_count++; $data['menu']['manage'] = $recent_action == 'manage' ? $cs_lang['manage'] : cs_link($cs_lang['manage'], $recent_mod, 'manage') . $sql_count; $data['if']['manage'] = true; } else { $data['menu']['manage'] = ''; $data['if']['manage'] = false; } if (file_exists('mods/' . $recent_mod . '/create.php') && $account['access_' . $recent_mod] >= 3 && $recent_mod != 'shoutbox') { $link_count++; $data['menu']['create'] = $recent_action == 'create' ? $cs_lang['create'] : cs_link($cs_lang['create'], $recent_mod, 'create'); $data['if']['create'] = true; } else { $data['menu']['create'] = ''; $data['if']['create'] = false; } if (file_exists('mods/' . $recent_mod . '/options.php') && $account['access_' . $recent_mod] >= 5) { $link_count++; $data['menu']['options'] = $recent_action == 'options' ? $cs_lang['options'] : cs_link($cs_lang['options'], $recent_mod, 'options'); $data['if']['options'] = true; } else { $data['menu']['options'] = ''; $data['if']['options'] = false; } if ($link_count > 1) { $data['links']['count'] = $link_count; return cs_subtemplate(__FILE__, $data, 'clansphere', 'admin_menu'); } }
function cs_pictures_select($mod, $fid = 0) { settype($fid, 'integer'); $cs_lang = cs_translate('pictures'); $data = array(); if (empty($fid)) { $data['if']['already'] = false; } else { $where = "pictures_mod = '" . $mod . "' AND pictures_fid = " . $fid; $picture = cs_sql_select(__FILE__, 'pictures', 'pictures_file', $where); if (empty($picture)) { $data['if']['already'] = false; } else { $data['if']['already'] = true; $data['picture']['file'] = $picture['pictures_file']; } } $string = cs_subtemplate(__FILE__, $data, 'pictures', 'select'); return $string; }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('board'); $count_abo = cs_sql_count(__FILE__, 'abonements', 'users_id=' . $account['users_id']); $count_att = cs_sql_count(__FILE__, 'boardfiles', 'users_id=' . $account['users_id']); $data = array(); $data['head']['getmsg'] = cs_getmsg(); $data['count']['abos'] = $count_abo; $data['count']['attachments'] = $count_att; $data['link']['abos'] = cs_url('board', 'center'); $data['link']['attachments'] = cs_url('board', 'attachments'); $data['link']['avatar'] = cs_url('board', 'avatar'); $data['action']['form'] = cs_url('board', 'signature'); $data['signature']['smileys'] = cs_abcode_smileys('signature'); $data['signature']['abcode'] = cs_abcode_features('signature'); $signature_sql = cs_sql_select($file, 'users', 'users_signature', "users_id = '" . $account['users_id'] . "'"); $signature = $signature_sql['users_signature']; $signature = isset($_POST['signature']) ? $_POST['signature'] : $signature; $signature = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature); $signature = preg_replace_callback("=\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature); $data['signature']['text'] = $signature; $data['signature']['preview'] = cs_secure($signature, 1, 1); $data['if']['preview'] = (isset($_POST['preview']) and !empty($signature)) ? 1 : 0; if (isset($_POST['submit'])) { $signature_cells = array('users_signature'); $signature_save = array($signature); cs_sql_update(__FILE__, 'users', $signature_cells, $signature_save, $account['users_id']); cs_redirect($cs_lang['create_done'], 'board', 'signature'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('ajax'); $mod_info['name'] = $cs_lang['ajax']; $mod_info['version'] = $cs_main['version_name']; $mod_info['released'] = $cs_main['version_date']; $mod_info['creator'] = 'ClanSphere'; $mod_info['team'] = 'ClanSphere'; $mod_info['url'] = 'www.clansphere.net'; $mod_info['text'] = $cs_lang['mod_text']; $mod_info['icon'] = 'agt_reload'; $mod_info['show'] = array('options/roots' => 5); $mod_info['categories'] = FALSE; $mod_info['comments'] = FALSE; $mod_info['protected'] = FALSE; $mod_info['tables'] = array();
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('contact'); $mod_info['name'] = $cs_lang['mod_name']; $mod_info['version'] = $cs_main['version_name']; $mod_info['released'] = $cs_main['version_date']; $mod_info['creator'] = 'ClanSphere'; $mod_info['team'] = 'ClanSphere'; $mod_info['url'] = 'www.clansphere.net'; $mod_info['text'] = $cs_lang['mod_text']; $mod_info['icon'] = 'kontact'; $mod_info['show'] = array('options/roots' => 5, 'clansphere/admin' => 3, 'users/home' => 3); $mod_info['categories'] = TRUE; $mod_info['comments'] = FALSE; $mod_info['protected'] = TRUE; $mod_info['tables'] = array('mail', 'trashmail');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('servers'); $id = empty($_GET['id']) ? 0 : (int) $_GET['id']; $cache_name = 'servers_list_' . (int) $id; $cache_time = 60; $data = cs_cache_load($cache_name, $cache_time); // Test if fsockopen active if (empty($data) and fsockopen("udp://127.0.0.1", 1)) { $results = array(); $data = array('servers' => array()); $data['if']['noquery'] = false; $data['if']['server'] = false; include_once 'mods/servers/servers.class.php'; /* Get Server SQL-Data */ $select = 'servers_name, servers_ip, servers_port, servers_info, servers_query, servers_class, servers_slots, servers_stats, servers_order, servers_id'; $order = 'servers_order ASC'; $where = empty($id) ? '' : 'servers_id = \'' . $id . '\''; $cs_servers = cs_sql_select(__FILE__, 'servers', $select, $where, $order, 0, 0); $servers_count = count($cs_servers); /* if no Server in SQL */ if (empty($servers_count)) { unset($data['servers']); } else { $data['if']['server'] = true; /* Settings */ $objServers = Servers::__getInstance(); for ($run = 0; $run < $servers_count; $run++) { $server_query_ex = explode(";", $cs_servers[$run]['servers_class']);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('computers'); if (isset($_POST['submit'])) { $save = array(); $save['max_width'] = (int) $_POST['max_width']; $save['max_height'] = (int) $_POST['max_height']; $save['max_size'] = (int) $_POST['max_size']; require_once 'mods/clansphere/func_options.php'; cs_optionsave('computers', $save); cs_redirect($cs_lang['changes_done'], 'options', 'roots'); } else { $data = array(); $data['com'] = cs_sql_option(__FILE__, 'computers'); echo cs_subtemplate(__FILE__, $data, 'computers', 'options'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('events'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'events'); $from = 'events evs INNER JOIN {pre}_categories cat ON evs.categories_id = cat.categories_id'; $select = 'evs.events_id AS events_id, evs.events_name AS events_name, evs.events_time AS events_time'; $upcome = 'evs.events_time > ' . cs_time() . ' AND cat.categories_access <= ' . $account['access_events']; if (!empty($cs_get['catid'])) { $upcome .= ' AND cat.categories_id = ' . $cs_get['catid']; } $cs_events = cs_sql_select(__FILE__, $from, $select, $upcome, 'evs.events_time', 0, $cs_option['max_navnext']); $events_loop = count($cs_events); $data = array(); if (empty($cs_events)) { echo $cs_lang['no_events']; } else { for ($run = 0; $run < $events_loop; $run++) { $data['events'][$run]['date'] = cs_date('unix', $cs_events[$run]['events_time'], 1); $data['events'][$run]['name'] = cs_secure($cs_events[$run]['events_name']); $data['events'][$run]['link'] = cs_url('events', 'view', 'id=' . $cs_events[$run]['events_id']); } echo cs_subtemplate(__FILE__, $data, 'events', 'navnext'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('gallery'); $files_gl = cs_files(); require_once 'mods/gallery/functions.php'; $cs_gallery['gallery_read'] = '0'; $cs_gallery['gallery_zip_read'] = '0'; $cs_gallery['gallery_del'] = '0'; $cs_gallery['gallery_access'] = '0'; $cs_gallery['gallery_status'] = '0'; $watermark_pos = 0; $zip_file = '0'; $data = array(); $data['if']['start'] = FALSE; $data['if']['no_thumb'] = FALSE; $data['if']['nopic'] = FALSE; $data['if']['error_zip'] = FALSE; $data['if']['zipfile'] = FALSE; $data['if']['pictures_found'] = FALSE; $data['if']['pictures_done'] = FALSE; $data['if']['thumb'] = FALSE; $data['manage']['head'] = cs_subtemplate(__FILE__, $data, 'gallery', 'manage_head'); if (isset($_POST['submit'])) { if (isset($_POST['read']) or isset($_POST['del']) or isset($_POST['read_zip'])) { if (isset($_POST['read_zip'])) { if (!isset($_POST['submit_zipfile'])) { $data['if']['zipfile'] = TRUE; } else { $file = $files_gl['zipfile']['tmp_name'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('gbook'); $cs_post = cs_post('where,start,sort'); $cs_get = cs_get('where,start,sort'); $data = array(); if (!empty($_GET['active'])) { cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('1'), (int) $_GET['active']); cs_redirectmsg($cs_lang['active_done']); } if (!empty($_GET['deactive'])) { cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('0'), (int) $_GET['deactive']); cs_redirectmsg($cs_lang['deactive_done']); } $id = empty($cs_get['where']) ? 0 : $cs_get['where']; if (!empty($cs_post['where'])) { $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']; } $cs_sort[1] = 'gbk.gbook_time DESC'; $cs_sort[2] = 'gbk.gbook_time ASC'; $cs_sort[3] = 'usr.users_email DESC';
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('news'); global $cs_http; require_once 'mods/categories/functions.php'; $news_newtime = 0; $op_news = cs_sql_option(__FILE__, 'news'); $data['lang'] = $cs_lang; $data['head']['mod'] = $cs_lang['mod_name']; $data['head']['action'] = $cs_lang['create']; $data['head']['body'] = ''; $data['head']['error'] = ''; $data['if']['preview'] = false; $data['if']['no_readmore'] = true; $cs_news['categories_id'] = ''; $cs_news['news_close'] = ''; $cs_news['news_public'] = $op_news['def_public']; $cs_news['news_attached'] = ''; $cs_news['news_headline'] = ''; $cs_news['news_text'] = ''; $cs_news['news_time'] = ''; $cs_news['news_publishs_at'] = ''; $cs_news['users_id'] = $account['users_id']; $cs_news['news_mirror'] = ''; $cs_news['news_mirror_name'] = ''; $cs_news['news_readmore'] = ''; $cs_news['news_readmore_active'] = ''; if (!empty($_GET['warid'])) { $wars_id = (int) $_GET['warid'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); $data = array(); $select = 'metatags_id, metatags_name, metatags_content'; $where = 'metatags_active = 1'; $order = 'metatags_name'; $cs_metatags = cs_sql_select(__FILE__, 'metatags', $select, $where, $order, 0, 0, 'metatags'); $metatags_loop = count($cs_metatags); for ($run = 0; $run < $metatags_loop; $run++) { $cs_metatags[$run]['name'] = $cs_metatags[$run]['metatags_name']; $cs_metatags[$run]['content'] = $cs_metatags[$run]['metatags_content']; } $data['metatags'] = $cs_metatags; echo cs_subtemplate(__FILE__, $data, 'clansphere', 'navmeta');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('maps'); $files_gl = cs_files(); $data = array(); $options = cs_sql_option(__FILE__, 'maps'); $img_filetypes = array('gif', 'jpg', 'png'); if (empty($_GET['id']) and empty($_POST['submit'])) { $data['maps']['action'] = $cs_lang['edit']; $data['maps']['link'] = cs_url('maps', 'manage'); echo cs_subtemplate(__FILE__, $data, 'maps', 'no_selection'); } else { if (!empty($_POST['submit'])) { $error = ''; if (empty($_POST['maps_name'])) { $error .= cs_html_br(1) . '- ' . $cs_lang['no_name']; } if (empty($_POST['games_id'])) { $error .= cs_html_br(1) . '- ' . $cs_lang['no_game']; } $img_size = empty($files_gl['picture']['tmp_name']) ? 0 : getimagesize($files_gl['picture']['tmp_name']); if (!empty($files_gl['picture']['tmp_name']) and empty($img_size) or $img_size[2] > 3) { $error .= cs_html_br(1) . '- ' . $cs_lang['ext_error']; } elseif (!empty($files_gl['picture']['tmp_name'])) { switch ($img_size[2]) { case 1: $extension = 'gif'; break; case 2:
<?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');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); require_once 'mods/categories/functions.php'; $files = cs_files(); $options = cs_sql_option(__FILE__, 'games'); $img_filetypes = array('image/gif' => 'gif'); $games_error = 0; $games_form = 1; if (empty($_POST['datum_month']) or empty($_POST['datum_day']) or empty($_POST['datum_year'])) { $games_release = cs_date('unix', cs_time(), 0, 1, 'Y-m-d'); } else { $games_release = $_POST['datum_year'] . '-' . $_POST['datum_month'] . '-' . $_POST['datum_day']; } $symbol = empty($_POST['symbol']) ? '' : $_POST['symbol']; $games_name = ''; $games_version = ''; $games_creator = ''; $games_url = ''; $categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id']; $games_usk = empty($_POST['games_usk']) ? '' : $_POST['games_usk']; $errormsg = ''; if (!empty($_POST['games_name'])) { $games_name = $_POST['games_name']; } else { $errormsg .= $cs_lang['name_error'] . cs_html_br(1); $games_error++; } $categories_id = empty($_POST['categories_name']) ? $categories_id : cs_categories_create('games', $_POST['categories_name']);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('cash'); $data = array(); $data['op'] = cs_sql_option(__FILE__, 'cash'); $tables = 'cash ca INNER JOIN {pre}_users usr ON ca.users_id = usr.users_id'; $cells = 'ca.cash_id AS cash_id, ca.cash_time AS cash_time, ca.cash_inout AS cash_inout, ca.users_id AS users_id, usr.users_nick AS users_nick, ca.cash_text AS cash_text'; $cells .= ', ca.cash_money AS cash_money, ca.cash_id AS cash_id, usr.users_country AS users_country, usr.users_active AS users_active, usr.users_delete AS users_delete'; $cond = "cash_inout = 'in' AND ca.cash_time LIKE '" . cs_datereal('Y-m') . "%'"; $data['cash'] = cs_sql_select(__FILE__, $tables, $cells, $cond, 'cash_time DESC', 0, 0); if (!empty($data['cash'])) { $count_cash = count($data['cash']); for ($run = 0; $run < $count_cash; $run++) { $data['cash'][$run]['users_flag'] = cs_html_img('symbols/countries/' . $data['cash'][$run]['users_country'] . '.png'); $data['cash'][$run]['user'] = cs_user($data['cash'][$run]['users_id'], $data['cash'][$run]['users_nick'], $data['cash'][$run]['users_active'], $data['cash'][$run]['users_delete']); $data['cash'][$run]['date'] = cs_date('date', $data['cash'][$run]['cash_time']); $data['cash'][$run]['cash_text'] = cs_secure($data['cash'][$run]['cash_text'], 0, 0, 0); $data['cash'][$run]['cash_money'] = cs_secure($data['cash'][$run]['cash_money'], 0, 0, 0); } } echo cs_subtemplate(__FILE__, $data, 'cash', 'view_cash');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('history'); $data = array(); $data['if']['preview'] = FALSE; if (isset($_POST['submit']) or isset($_POST['preview'])) { $history['history_text'] = empty($cs_main['rte_html']) ? $_POST['history_text'] : cs_abcode_inhtml($_POST['history_text'], 'add'); $history['history_time'] = cs_time(); $history['users_id'] = $account['users_id']; $error = ''; if (empty($history['history_text'])) { $error .= $cs_lang['no_text'] . cs_html_br(1); } } else { $history['history_text'] = ''; $history['history_time'] = ''; $history['users_id'] = 0; } if (!isset($_POST['submit']) and !isset($_POST['preview'])) { $data['head']['body'] = $cs_lang['body']; } elseif (!empty($error)) { $data['head']['body'] = $error; } elseif (isset($_POST['preview'])) { $data['head']['body'] = $cs_lang['preview']; } if (isset($_POST['preview']) and empty($error)) { $data['if']['preview'] = TRUE; $data['preview']['date'] = cs_date('unix', $history['history_time'], 1); $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('linkus'); $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] = '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++) {
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clans'); $op_clans = cs_sql_option(__FILE__, 'clans'); $op_squads = cs_sql_option(__FILE__, 'squads'); $op_members = cs_sql_option(__FILE__, 'members'); $cs_clans_id = $_GET['id']; settype($cs_clans_id, 'integer'); $where = "clans_id='" . $cs_clans_id . "'"; $cs_clan = cs_sql_select(__FILE__, 'clans', '*', $where); $data['lang']['mod_name'] = $cs_lang[$op_clans['label']]; $data['clans']['name'] = cs_secure($cs_clan['clans_name']); if (empty($cs_clan['clans_picture'])) { $data['clans']['img'] = $cs_lang['nopic']; } else { $place = 'uploads/clans/' . $cs_clan['clans_picture']; $size = getimagesize($cs_main['def_path'] . '/' . $place); $data['clans']['img'] = cs_html_img($place, $size[1], $size[0]); } $data['clans']['short'] = cs_secure($cs_clan['clans_short']); if (!empty($cs_clan['clans_country'])) { include_once 'lang/' . $account['users_lang'] . '/countries.php'; $data['clans']['country'] = cs_html_img('symbols/countries/' . $cs_clan['clans_country'] . '.png', 11, 16) . ' ' . $cs_country[$cs_clan['clans_country']]; } else { $data['clans']['country'] = '-'; } if (!empty($cs_clan['clans_url'])) { $data['clans']['url'] = cs_html_link('http://' . $cs_clan['clans_url'], cs_secure($cs_clan['clans_url'])); } else {
<?php $cs_lang = cs_translate('medals'); $data = array(); if (isset($_POST['submit'])) { $medals_id = $_POST['medals_id']; if (!empty($_POST['users_nick'])) { $users_nick = cs_sql_escape($_POST['users_nick']); $users_id = cs_sql_select(__FILE__, 'users', 'users_id', "users_nick = '{$users_nick}'", 0, 0, 1); if ($users_id > 0) { $insertion = array('medals_id' => $medals_id, 'users_id' => $users_id['users_id'], 'medalsuser_date' => cs_time()); cs_sql_insert(__FILE__, 'medalsuser', array_keys($insertion), array_values($insertion)); cs_redirect($cs_lang['create_done'], 'medals', 'user', 'where=' . $medals_id); } else { cs_redirect($cs_lang['user_not_found'], 'medals', 'user', 'where=' . $medals_id); } } } else { $medals_id = $_GET['where']; } if (isset($_GET['delete'])) { $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'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('users'); include_once 'lang/' . $account['users_lang'] . '/countries.php'; include_once 'mods/users/functions.php'; $data = array(); if (isset($_POST['submit'])) { $op_users = cs_sql_option(__FILE__, 'users'); $cs_user['users_nick'] = $_POST['users_nick']; $cs_user['users_name'] = $_POST['users_name']; $cs_user['users_surname'] = $_POST['users_surname']; $cs_user['users_sex'] = $_POST['users_sex']; $cs_user['users_age'] = cs_datepost('age', 'date'); $cs_user['users_height'] = $_POST['users_height']; $cs_user['users_country'] = $_POST['users_country']; $cs_user['users_postalcode'] = $_POST['users_postalcode']; $cs_user['users_place'] = $_POST['users_place']; $cs_user['users_adress'] = $_POST['users_adress']; $cs_user['users_icq'] = str_replace('-', '', $_POST['users_icq']); $cs_user['users_jabber'] = $_POST['users_jabber']; $cs_user['users_skype'] = $_POST['users_skype']; $cs_user['users_email'] = $_POST['users_email']; $cs_user['users_url'] = $_POST['users_url']; $cs_user['users_phone'] = $_POST['users_phone']; $cs_user['users_mobile'] = $_POST['users_mobile']; $cs_user['users_info'] = $_POST['users_info']; $hidden = array(); $hidden_count = isset($_POST['hidden']) ? count($_POST['hidden']) : 0; $canhid = array('users_name', 'users_surname', 'users_age', 'users_height', 'users_adress', 'users_place', 'users_icq', 'users_jabber', 'users_skype', 'users_email', 'users_url', 'users_phone', 'users_mobile');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('wars'); $squads_id = empty($_REQUEST['where']) ? 0 : (int) $_REQUEST['where']; $where_count = empty($squads_id) ? 0 : "squads_id = '" . $squads_id . "'"; $where = empty($squads_id) ? 0 : "war.squads_id = '" . $squads_id . "'"; $start = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start']; $cs_sort[1] = 'war.wars_date DESC'; $cs_sort[2] = 'war.wars_date ASC'; $cs_sort[3] = 'cln.clans_name DESC'; $cs_sort[4] = 'cln.clans_name ASC'; $cs_sort[5] = 'cat.categories_name DESC'; $cs_sort[6] = 'cat.categories_name ASC'; $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);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('banners'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'banners'); $data = array(); $where = empty($cs_get['catid']) ? 0 : 'categories_id = ' . $cs_get['catid']; $data['banners'] = cs_sql_select(__FILE__, 'banners', 'banners_picture, banners_alt, banners_url', $where, 'banners_order ASC', 0, $cs_option['max_navlist']); $banners_loop = count($data['banners']); if (empty($data['banners'])) { echo $cs_lang['no_banners']; } else { for ($run = 0; $run < $banners_loop; $run++) { $go = cs_secure($data['banners'][$run]['banners_picture']); $picture = cs_html_img($go, 0, 0, " style=\"margin-bottom:4px\"", cs_secure($data['banners'][$run]['banners_alt'])); $data['banners'][$run]['image'] = cs_html_link('http://' . cs_secure($data['banners'][$run]['banners_url']), $picture) . ' '; } echo cs_subtemplate(__FILE__, $data, 'banners', 'navlist'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('members'); $data = array(); $op_members = cs_sql_option(__FILE__, 'members'); $op_squads = cs_sql_option(__FILE__, 'squads'); $tables = 'squads sq INNER JOIN {pre}_clans cln ON sq.clans_id = cln.clans_id'; $cells = 'sq.squads_id AS squads_id, sq.games_id AS games_id, sq.squads_name AS squads_name, '; $cells .= 'sq.clans_id AS clans_id, cln.clans_tagpos AS clans_tagpos, '; $cells .= 'cln.clans_tag AS clans_tag'; $data['squads'] = cs_sql_select(__FILE__, $tables, $cells, 'squads_own = \'1\'', 'squads_order, squads_name', 0, 0); $squads_loop = count($data['squads']); $data['head']['mod'] = $cs_lang[$op_members['label']]; $data['head']['body'] = sprintf($cs_lang['body_pictured'], $squads_loop); $data['lang']['members'] = $cs_lang[$op_members['label']]; for ($sq_run = 0; $sq_run < $squads_loop; $sq_run++) { $select = 'mem.members_admin AS members_admin, mem.members_task AS members_task, '; $select .= 'mem.members_since AS members_since, mem.users_id AS users_id, usr.users_nick AS users_nick, '; $select .= 'usr.users_name AS users_name, usr.users_surname AS users_surname, usr.users_sex AS users_sex, '; $select .= 'usr.users_age AS users_age, usr.users_place AS users_place, usr.users_country AS users_country, '; $select .= 'usr.users_picture AS users_picture, usr.users_active AS users_active, usr.users_hidden AS users_hidden, usr.users_delete AS users_delete'; $from = 'members mem INNER JOIN {pre}_users usr ON mem.users_id = usr.users_id '; $where = "mem.squads_id = '" . $data['squads'][$sq_run]['squads_id'] . "'"; $order = 'mem.members_order ASC, usr.users_nick ASC'; $data['squads'][$sq_run]['members'] = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, 0); $members_loop = count($data['squads'][$sq_run]['members']); $data['squads'][$sq_run]['games_img'] = ''; if (!empty($data['squads'][$sq_run]['games_id'])) { $data['squads'][$sq_run]['games_img'] = cs_html_img('uploads/games/' . $data['squads'][$sq_run]['games_id'] . '.gif');