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 create_user($access, $nick, $pwd, $lang, $email, $country, $timezone, $dst, $newsletter = 0, $active = 1, $empty = 0, $regkey = '') { global $cs_db, $cs_main; if ($cs_db['hash'] == 'md5') { $sec_pwd = md5($pwd); } elseif ($cs_db['hash'] == 'sha1') { $sec_pwd = sha1($pwd); } $op_users = cs_sql_option(__FILE__, 'users'); $picture = empty($op_users['def_picture']) ? '' : 'nopicture.jpg'; $time = cs_time(); $limit = empty($cs_main['data_limit']) ? 20 : $cs_main['data_limit']; $users_cells = array('access_id', 'users_nick', 'users_pwd', 'users_lang', 'users_email', 'users_emailregister', 'users_country', 'users_register', 'users_laston', 'users_timezone', 'users_dstime', 'users_newsletter', 'users_active', 'users_limit', 'users_regkey', 'users_picture', 'users_hidden'); $users_save = array($access, $nick, $sec_pwd, $lang, $email, $email, $country, $time, $time, $timezone, $dst, $newsletter, $active, $limit, $regkey, $picture, 'users_email'); cs_sql_insert(__FILE__, 'users', $users_cells, $users_save); return cs_sql_insertid(__FILE__); }
<?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('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 // 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('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');
<?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']);
if (!file_exists('uploads/wars/news_' . $lang . '.txt')) { $lang = 'de'; } $text = $_POST['news_text']; $fp = fopen('uploads/wars/news_' . $lang . '.txt', 'w'); # set stream encoding if possible to avoid converting issues if (function_exists('stream_encoding')) { stream_encoding($fp, $cs_main['charset']); } fwrite($fp, $text); fclose($fp); cs_redirect($cs_lang['success'], 'options', 'roots'); } else { $data = array(); $data['head']['message'] = cs_getmsg(); $data['op'] = cs_sql_option(__FILE__, 'wars'); $pholders = array(); $pholders['{SQUADNAME}'] = $cs_lang['op_squadname']; $pholders['{SQUADURL}'] = $cs_lang['op_squadurl']; $pholders['{OPPONENTNAME}'] = $cs_lang['op_opponentname']; $pholders['{OPPONENTURL}'] = $cs_lang['op_opponenturl']; $pholders['{SCORE_1}'] = $cs_lang['op_score1']; $pholders['{SCORE_2}'] = $cs_lang['op_score2']; $pholders['{MATCH_URL}'] = $cs_lang['op_matchurl']; $pholders['{CAT_NAME}'] = $cs_lang['op_catname']; $lang = cs_substr($account['users_lang'], 0, 2); if (!file_exists('uploads/wars/news_' . $lang . '.txt')) { $lang = 'de'; } $data['news']['text'] = file_get_contents('uploads/wars/news_' . $lang . '.txt'); $data['pholders'] = array();
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('news'); $cs_get = cs_get('id,where'); $cs_option = cs_sql_option(__FILE__, 'news'); $abcode = explode(",", $cs_option['abcode']); $cs_news_id = empty($cs_get['id']) ? 0 : $cs_get['id']; if (!empty($cs_get['where'])) { $cs_news_id = $cs_get['where']; } $from = 'news nws INNER JOIN {pre}_users usr ON nws.users_id = usr.users_id INNER JOIN {pre}_categories cat ON nws.categories_id = cat.categories_id'; $select = 'nws.news_id AS news_id, nws.news_headline AS news_headline, nws.news_time AS news_time, nws.news_text AS news_text, nws.news_close AS news_close, nws.news_public AS news_public, nws.news_pictures as news_pictures, nws.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, nws.categories_id AS categories_id, cat.categories_access AS categories_access, cat.categories_picture AS categories_picture, nws.news_mirror AS news_mirror, nws.news_mirror_name AS news_mirror_name, nws.news_readmore AS news_readmore, nws.news_readmore_active AS news_readmore_active'; $cs_news = cs_sql_select(__FILE__, $from, $select, "news_id = '" . $cs_news_id . "'"); $head['head']['mod'] = $cs_lang['mod_name']; $head['head']['action'] = $cs_lang['details']; $topline = empty($cs_news['news_public']) ? 'not_public' : 'news_info'; $head['head']['topline'] = $cs_lang[$topline]; echo cs_subtemplate(__FILE__, $head, 'news', 'head'); $pub = $cs_news['categories_access'] > $account['access_news'] ? 0 : $cs_news['news_public']; if (!empty($pub)) { $com_where = "comments_mod = 'news' AND comments_fid = '" . $cs_news['news_id'] . "'"; $data['news']['comments_count'] = cs_sql_count(__FILE__, 'comments', $com_where); $start = floor($data['news']['comments_count'] / ($account['users_limit'] + 1)) * $account['users_limit']; $cs_news_com_count = $data['news']['comments_count'] - $start; $data['news']['comments_link'] = cs_link($cs_lang['comments'], 'news', 'view', 'id=' . $cs_news['news_id'] . '&start=' . $start . '#com' . $cs_news_com_count); $cs_main['page_title'] = $cs_news['news_headline']; $data['news']['news_headline'] = cs_secure($cs_news['news_headline']); $data['news']['news_time'] = cs_date('unix', $cs_news['news_time'], 1); $data['news']['news_text'] = cs_secure($cs_news['news_text'], $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('static'); $cs_option = cs_sql_option(__FILE__, 'static'); $static_id = isset($_GET['id']) ? (int) $_GET['id'] : 0; $where = "static_id = '" . $static_id . "' AND static_access <= '" . $account['access_static'] . "'"; $cells = 'static_title, static_text, static_table, static_admins, static_comments'; $cs_static = cs_sql_select(__FILE__, 'static', $cells, $where); if (empty($cs_static)) { include 'mods/errors/403.php'; return; } $cs_main['page_title'] = $cs_static['static_title']; $cs_view_static['static']['title'] = $cs_static['static_title']; $cs_view_static['static']['content'] = cs_secure($cs_static['static_text'], 1, 1, 1, 1, $cs_option['php_eval']); $theme = empty($cs_static['static_table']) ? 'view' : 'view_table'; echo cs_subtemplate(__FILE__, $cs_view_static, 'static', $theme); if (!empty($cs_static['static_comments'])) { include_once 'mods/comments/functions.php'; $where = "comments_mod = 'static' AND comments_fid = '" . $static_id . "'"; $count_com = cs_sql_count(__FILE__, 'comments', $where); if (!empty($count_com)) { echo cs_html_br(1); echo cs_comments_view($static_id, 'static', 'view', $count_com); } echo cs_comments_add($static_id, 'static'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('members'); if (!empty($_POST['submit'])) { $save = array(); $save['label'] = $_POST['label']; require_once 'mods/clansphere/func_options.php'; cs_optionsave('members', $save); cs_redirect($cs_lang['success'], 'options', 'roots'); } $data = array(); $data['op'] = cs_sql_option(__FILE__, 'members'); $data['lang']['mod_name'] = $cs_lang[$data['op']['label']]; $data['select']['members_select'] = $data['op']['label'] == 'members' ? 'selected="selected"' : ''; $data['select']['memberemployees_select'] = $data['op']['label'] == 'employees' ? 'selected="selected"' : ''; $data['select']['teammates_select'] = $data['op']['label'] == 'teammates' ? 'selected="selected"' : ''; $data['select']['classmates_select'] = $data['op']['label'] == 'classmates' ? 'selected="selected"' : ''; echo cs_subtemplate(__FILE__, $data, 'members', 'options');
$auto_text = $autoresponder['autoresponder_text']; $auto_mail = $autoresponder['autoresponder_mail']; if (!empty($autoresponder['autoresponder_close'])) { $messages_cells = array('users_id', 'messages_time', 'messages_subject', 'messages_text', 'users_id_to', 'messages_show_receiver'); $messages_save = array($users_id_to, $time, $auto_subject, $auto_text, $users_id, '1'); cs_sql_insert(__FILE__, 'messages', $messages_cells, $messages_save); } if (!empty($autoresponder['autoresponder_mail']) && !empty($cs_messages[$run]['users_email'])) { $lang = cs_sql_select(__FILE__, 'users', 'users_lang', 'users_id = "' . $users_id_to . '"'); if ($lang['users_lang'] != $account['users_lang']) { $lang_save = $account['users_lang']; $account['users_lang'] = $lang['users_lang']; $cs_lang_save = $cs_lang; $cs_lang = cs_translate('messages'); } $cs_contact = cs_sql_option(__FILE__, 'contact'); $email = $cs_messages[$run]['users_email']; $title = $cs_lang['mail_titel']; $message = $cs_lang['mail_text'] . $cs_messages[$run]['users_nick']; $message .= $cs_lang['mail_text_2'] . $cs_main['def_title'] . $cs_lang['mail_text_3']; $message .= $cs_contact['def_org'] . $cs_lang['mail_text_4']; cs_mail($email, $title, $message); if (!empty($lang_save)) { $cs_lang = $cs_lang_save; $account['users_lang'] = $lang_save; } } } cs_redirect($cs_lang['msg_create_done'], 'messages', 'center'); } $data = array();
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('linkus'); $files_gl = cs_files(); $op_linkus = cs_sql_option(__FILE__, 'linkus'); $data = array(); $img_max['width'] = $op_linkus['max_width']; $img_max['height'] = $op_linkus['max_height']; $img_max['size'] = $op_linkus['max_size']; $img_filetypes = array('image/png' => 'png', 'image/jpeg' => 'jpg', 'image/gif' => 'gif'); if (isset($_POST['submit'])) { $cs_linkus['linkus_name'] = $_POST['linkus_name']; $cs_linkus['linkus_url'] = $_POST['linkus_url']; $error = ''; if (empty($cs_linkus['linkus_name'])) { $error .= $cs_lang['no_name'] . cs_html_br(1); } if (empty($cs_linkus['linkus_url'])) { $error .= $cs_lang['no_url'] . cs_html_br(1); } if (empty($files_gl['symbol']['tmp_name'])) { $error .= $cs_lang['no_pic'] . cs_html_br(1); } elseif (!empty($files_gl['symbol']['tmp_name'])) { $error .= $cs_lang['ext_error'] . cs_html_br(1); foreach ($img_filetypes as $allowed => $new_ext) { if ($allowed == $files_gl['symbol']['type']) { $error = ''; $extension = $new_ext; }
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('messages'); $messages_id = $_REQUEST['id']; settype($messages_id, 'integer'); $messages_form = 1; $error = 0; $users_id = $account['users_id']; $from = 'messages'; $select = 'users_id,users_id_to'; $where = "messages_id = '" . $messages_id . "'"; $cs_messages = cs_sql_select(__FILE__, $from, $select, $where); $messages_users_id = $cs_messages['users_id']; $messages_users_id_2 = $cs_messages['users_id_to']; $archivbox_count = cs_sql_count(__FILE__, 'messages', "users_id = '{$users_id}' AND messages_archiv_sender = '1' OR users_id_to = '{$users_id}' AND messages_archiv_receiver = '1'"); $cs_messages_option = cs_sql_option(__FILE__, 'messages'); $max_space = $cs_messages_option['max_space']; if ($archivbox_count >= $max_space) { $error++; } if (empty($error)) { if ($messages_users_id == $users_id) { $messages_archiv_sender = '1'; $messages_show_sender = '0'; $messages_cells = array('messages_show_sender', 'messages_archiv_sender'); $messages_content = array($messages_show_sender, $messages_archiv_sender); cs_sql_update(__FILE__, 'messages', $messages_cells, $messages_content, $messages_id); } if ($messages_users_id_2 == $users_id) { $messages_archiv_receiver = '1'; $messages_show_receiver = '0';
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('ranks'); $cs_option = cs_sql_option(__FILE__, 'ranks'); $select = 'ranks_url, ranks_img, ranks_code'; $data = array(); $data['ranks'] = cs_sql_select(__FILE__, 'ranks', $select, 0, 0, 0, $cs_option['max_navlist']); $ranks_loop = count($data['ranks']); for ($run = 0; $run < $ranks_loop; $run++) { $data['ranks'][$run]['picture'] = ''; if (!empty($data['ranks'][$run]['ranks_url'])) { $picture = cs_html_img($data['ranks'][$run]['ranks_img']); $data['ranks'][$run]['picture'] = cs_html_link($data['ranks'][$run]['ranks_url'], $picture); } else { $data['ranks'][$run]['picture'] = $data['ranks'][$run]['ranks_code']; } } echo cs_subtemplate(__FILE__, $data, 'ranks', 'navlist');
<?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('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$ # Overwrite global settings by using the following array $cs_main = array('init_sql' => true, 'init_tpl' => false, 'init_mod' => true); chdir('../../'); require_once 'system/core/functions.php'; cs_init($cs_main); chdir('mods/gallery/'); global $cs_main, $account; if (!empty($_REQUEST['pic']) or !empty($_REQUEST['thumb'])) { $options = cs_sql_option(__FILE__, 'gallery'); if (!empty($_REQUEST['pic'])) { $where = $_REQUEST['pic']; } elseif (!empty($_REQUEST['thumb'])) { $where = $_REQUEST['thumb']; } $from = 'gallery'; $select = 'gallery_watermark, gallery_watermark_pos, gallery_name, gallery_time, '; $select .= 'gallery_count, gallery_count_downloads, gallery_access'; $where = "gallery_id = '" . cs_sql_escape($where) . "'"; $cs_gallery = cs_sql_select(__FILE__, $from, $select, $where); $gallery_loop = count($cs_gallery); if ($account['access_gallery'] < $cs_gallery['gallery_access']) { die(cs_error_internal(0, 'Access denied')); } $position = $cs_gallery['gallery_watermark_pos']; $temp_pos = empty($position) ? array(0, 1) : explode("|--@--|", $position); $position = $temp_pos[0]; $transparenz = $temp_pos[1];
<?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('banners'); $files = cs_files(); require_once 'mods/categories/functions.php'; $op_banners = cs_sql_option(__FILE__, 'banners'); $img_filetypes = array('gif', 'jpg', 'png'); if (isset($_POST['submit'])) { $cs_banners['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('banners', $_POST['categories_name']); $cs_banners['banners_name'] = $_POST['banners_name']; $cs_banners['banners_url'] = $_POST['banners_url']; $cs_banners['banners_picture'] = $_POST['banners_picture']; $cs_banners['banners_alt'] = $_POST['banners_alt']; $cs_banners['banners_order'] = empty($_POST['banners_order']) ? $op_banners['def_order'] : $_POST['banners_order']; $error = 0; $message = ''; $img_size = false; if (!empty($files['picture']['tmp_name'])) { $img_size = getimagesize($files['picture']['tmp_name']); } if (!empty($files['picture']['tmp_name']) and empty($img_size) or $img_size[2] > 3) { $message .= $cs_lang['ext_error'] . cs_html_br(1); $error++; } elseif (!empty($files['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('clans'); $files = cs_files(); $clans_id = $_REQUEST['id']; settype($clans_id, 'integer'); $op_clans = cs_sql_option(__FILE__, 'clans'); $img_filetypes = array('gif', 'jpg', 'png'); $users_nick = ''; $cs_clans['users_id'] = 0; if (isset($_POST['submit'])) { $cs_clans['clans_name'] = $_POST['clans_name']; $cs_clans['clans_short'] = $_POST['clans_short']; $cs_clans['clans_tag'] = $_POST['clans_tag']; $cs_clans['clans_tagpos'] = $_POST['tag_pos']; $cs_clans['clans_country'] = $_POST['clans_country']; $cs_clans['clans_url'] = $_POST['clans_url']; $cs_clans['clans_since'] = cs_datepost('since', 'date'); $picture = cs_sql_select(__FILE__, 'clans', 'clans_picture', "clans_id = " . (int) $clans_id); $cs_clans['clans_picture'] = empty($_POST['clans_picture']) ? $picture['clans_picture'] : $_POST['clans_picture']; $cs_clans['clans_pwd'] = $_POST['clans_pwd']; $users_nick = empty($_REQUEST['users_nick']) ? '' : $_REQUEST['users_nick']; $error = 0; $errormsg = ''; $where = "users_nick = '" . cs_sql_escape($users_nick) . "'"; $users_data = cs_sql_select(__FILE__, 'users', 'users_id', $where); if (empty($users_data['users_id'])) { $users_nick = ''; } else {
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('ranks'); $data = array(); if (isset($_POST['submit'])) { require_once 'mods/clansphere/func_options.php'; $save = array(); $save['max_navlist'] = (int) $_POST['max_navlist']; cs_optionsave('ranks', $save); cs_redirect($cs_lang['changes_done'], 'options', 'roots'); } $data['op'] = cs_sql_option(__FILE__, 'ranks'); echo cs_subtemplate(__FILE__, $data, 'ranks', 'options');
$msg = $cs_lang['delfalse']; } $data['thumbs'][$run]['msg'] = $msg; $data['thumbs'][$run]['name'] = 'Thumb_' . $thumb; $run++; } } elseif (!empty($_POST['del'])) { $data['if']['no_thumb'] = TRUE; } } } if (isset($_POST['submit_1'])) { $post_count = count($_POST); $post_count = $post_count - '1'; $cs_gallery_pic['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('gallery', $_POST['folders_name']); $cs_gallery_option = cs_sql_option(__FILE__, 'gallery'); $img_max['thumbs'] = $cs_gallery_option['thumbs']; for ($run = 0; $run < $post_count; $run++) { if (!empty($_POST['status_' . $run])) { $name = $_POST['name_' . $run]; if (!extension_loaded('gd')) { die(cs_error_internal(0, 'GD extension not installed.')); } if (cs_resample('uploads/gallery/pics/' . $name, 'uploads/gallery/thumbs/' . 'Thumb_' . $name, $img_max['thumbs'], $img_max['thumbs'])) { $where = "gallery_name = '" . cs_sql_escape($name) . "'"; $search = cs_sql_count(__FILE__, 'gallery', $where); if (empty($search)) { $cs_gallery_pic['users_id'] = $account['users_id']; $cs_gallery_pic['gallery_name'] = $name; $cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0; $cs_gallery_pic['gallery_access'] = isset($_POST['gallery_access']) ? $_POST['gallery_access'] : 0;
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * Special notice by Remy Wetzels <*****@*****.**>, September 14, 2010: * Permission is hereby granted by Wetzels Holding BV to the ClanSphere Project * to omit the above disclaimer in their general documentation and/or * ClanSphere about section of the code. */ $cs_lang = cs_translate('cups'); $cs_option = cs_sql_option(__FILE__, 'cups'); $datahtml = array(); $datahtml['tree'] = array(); include_once 'mods/cups/functions.php'; $cups_id = (int) $_GET['id']; /* tree.php might set the variable below */ $gridonly = isset($gridonly) && $gridonly == true || !empty($_GET['gridonly']) ? true : false; $cup = cs_sql_select(__FILE__, 'cups', '*', 'cups_id = ' . $cups_id); $rounds = cs_cups_log($cup['cups_teams']); $rounds_1 = $rounds; if ($account['access_cups'] < $cup['cups_access'] || $cup['cups_access'] == 0) { echo $cs_lang['access_denied']; return; } if (defined('IN_TREE')) { $tree = true;
function cs_cups_team($cs_lang, $type, $team_id, $team_name, $autoseed, $seed, $html = false, $grid = false) { $options = cs_sql_option(__FILE__, 'cups'); if ($grid && $options['max_gridname'] > 0) { $team_name = cs_textcut($team_name, $options['max_gridname']); } $new_name = ''; switch ($team_id) { case CS_CUPS_TEAM_UNKNOWN: $new_name = ''; break; case CS_CUPS_TEAM_BYE: $new_name = $cs_lang['bye_grid']; break; default: if (empty($team_name) and !empty($team_id)) { $new_name = '? ID:' . $team_id; } else { switch ($type) { case CS_CUPS_TYPE_USERS: if ($html) { $new_name = cs_user($team_id, $team_name); } else { $new_name = cs_secure($team_name); } break; case CS_CUPS_TYPE_TEAMS: if ($html) { $new_name = cs_link(cs_secure($team_name), 'squads', 'view', 'id=' . $team_id); } else { $new_name = cs_secure($team_name); } break; } } if ($autoseed == 0) { $new_name .= ' (#' . $seed . ')'; } break; } return $new_name; }
if (!empty($errorpage)) { return errorPage('thread_add', $cs_lang); } //Sicherheitsabfrage Ende #check mod $acc_mod = 0; $check_mod = cs_sql_select(__FILE__, 'boardmods', 'boardmods_modpanel', 'users_id = ' . (int) $account['users_id'], 0, 0, 1); if (!empty($check['boardmods_modpanel']) or $account['access_board'] == 5) { $acc_mod = 1; } $head = cs_link($cs_lang['board'], 'board', 'list', 'normalb') . ' -> '; $head .= cs_link($cs_thread['categories_name'], 'board', 'list', 'where=' . $cs_thread['categories_id'], 'normalb') . ' -> '; $head .= cs_link($cs_thread['board_name'], 'board', 'listcat', 'where=' . $cs_thread['board_id'], 'normalb'); $data['head']['boardlinks'] = $head; $bv['boardvotes_question'] = ''; $cs_board_opt = cs_sql_option(__FILE__, 'board'); $max_size = $cs_board_opt['file_size']; $filetypes = explode(',', $cs_board_opt['file_types']); $board['board_id'] = $board_id; $board['users_id'] = $account['users_id']; $board['threads_last_user'] = $account['users_id']; $board['threads_time'] = cs_time(); $board['threads_last_time'] = cs_time(); $board['threads_headline'] = ''; $board['threads_text'] = ''; $board['threads_important'] = 0; $board['threads_close'] = 0; $votes = 0; if (isset($_POST['submit']) or isset($_POST['preview']) or isset($_POST['new_votes']) or isset($_POST['election']) or isset($_POST['files+']) or isset($_POST['new_file'])) { $board['threads_headline'] = $_POST['threads_headline']; $board['threads_text'] = $_POST['threads_text'];
<?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('events'); $data = array(); $op_events = cs_sql_option(__FILE__, 'events'); $events = array(); $year = !empty($_GET['year']) ? (int) $_GET['year'] : cs_datereal('Y'); if (1970 > $year) { $year = 1970; } elseif (2037 < $year) { $year = 2037; } # limited by current operating systems $month = !empty($_GET['month']) ? (int) $_GET['month'] : cs_datereal('n'); $zero = date('m', mktime(0, 0, 0, $month, 1, $year)); $days = date('t', mktime(0, 0, 0, $month, 1, $year)); $first = date('w', mktime(0, 0, 0, $month, 1, $year)); $min = cs_datereal('U', mktime(0, 0, 0, $month, 1, $year), 1); $max = cs_datereal('U', mktime(23, 59, 59, $month, $days, $year), 1); $like = "users_age LIKE '%-" . $zero . "-%' AND users_hidden NOT LIKE '%users_age%'"; $birthdays = cs_sql_select(__FILE__, 'users', 'users_age', $like, 0, 0, 0); if (is_array($birthdays)) { foreach ($birthdays as $key => $value) { $new_key = (int) substr(strrchr($value['users_age'], '-'), 1); $events[$new_key] = 0; } } $from = 'events evs INNER JOIN {pre}_categories cat ON evs.categories_id = cat.categories_id'; $select = 'evs.events_time AS events_time';
<?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('files'); $cs_option = cs_sql_option(__FILE__, 'files'); $cs_files_id = empty($_REQUEST['where']) ? $_GET['id'] : $_REQUEST['where']; settype($cs_file_id, 'integer'); $files_gl = cs_files(); $data = array(); $img_max['width'] = $cs_option['max_width']; $img_max['height'] = $cs_option['max_height']; $img_max['size'] = $cs_option['max_size']; $img_filetypes = array('gif', 'jpg', 'png'); $file = cs_sql_select(__FILE__, 'files', 'files_previews', "files_id = '" . $cs_files_id . "'"); $file_string = $file['files_previews']; $file_pics = empty($file_string) ? array() : explode("\n", $file_string); $file_next = count($file_pics) + 1; $error = 0; $message = ''; if (!empty($_GET['delete'])) { $target = $_GET['delete'] - 1; cs_unlink('files', 'picture-' . $file_pics[$target]); cs_unlink('files', 'thumb-' . $file_pics[$target]); $file_pics[$target] = FALSE; $file_pics = array_filter($file_pics); $file_string = implode("\n", $file_pics); $cells = array('files_previews'); $content = array($file_string); cs_sql_update(__FILE__, 'files', $cells, $content, $cs_files_id); } elseif (!empty($_POST['submit'])) {