function cs_newsletter_emails($select) { $from = ''; $where = ''; $check_to = explode('?', $select); switch ($check_to[0]) { case 1: $from = 'users usr'; $where = ''; break; break; case 2: $from = 'access acs INNER JOIN {pre}_users usr ON usr.access_id = acs.access_id '; $where = "acs.access_id = " . (int) $check_to[1]; break; break; case 3: $from = 'squads squ INNER JOIN {pre}_members meb ON meb.squads_id = squ.squads_id ' . 'INNER JOIN {pre}_users usr ON meb.users_id = usr.users_id'; $where = "squ.squads_id = " . (int) $check_to[1]; break; break; case 4: $from = 'clans cln INNER JOIN {pre}_squads squ ON squ.clans_id = cln.clans_id ' . 'INNER JOIN {pre}_members meb ON meb.squads_id = squ.squads_id ' . 'INNER JOIN {pre}_users usr ON meb.users_id = usr.users_id'; $where = "cln.clans_id = " . (int) $check_to[1]; break; break; } $select = 'usr.users_email AS email'; $where_add = 'usr.users_newsletter = 1 AND usr.users_active = 1 AND usr.users_delete = 0'; $where = empty($where) ? $where_add : $where . ' AND ' . $where_add; return cs_sql_select(__FILE__, $from, $select, $where, 0, 0, 0); }
function cs_pictures_upload($file, $mod, $fid, $ajaxclean = 1) { if (!empty($_POST['del_picture'])) { cs_pictures_delete($_POST['del_picture']); } if (empty($file['tmp_name'])) { return true; } settype($fid, 'integer'); $types_allowed = array('image/jpeg', 'image/png', 'image/pjpeg', 'image/x-png'); if (!in_array($file['type'], $types_allowed)) { return false; } $exts = array('image/jpeg' => 'jpg', 'image/png' => 'png', 'image/pjpeg' => 'jpg', 'image/x-png' => 'png'); $ext = $exts[$file['type']]; $where = "pictures_fid = '" . $fid . "' AND pictures_mod = '" . $mod . "'"; $already = cs_sql_select(__FILE__, 'pictures', 'pictures_id', $where); $pictures_id = $already['pictures_id']; if (empty($already)) { $vars = array(); $vars['pictures_mod'] = $mod; $vars['pictures_fid'] = $fid; cs_sql_insert(__FILE__, 'pictures', array_keys($vars), array_values($vars)); $pictures_id = cs_sql_insertid(__FILE__); } if (!cs_upload('pictures', 'picture-' . $pictures_id . '.' . $ext, $file['tmp_name'], $ajaxclean)) { cs_sql_delete(__FILE__, 'pictures', $pictures_id); return false; } $cells = array('pictures_file'); $content = array('picture-' . $pictures_id . '.' . $ext); cs_sql_update(__FILE__, 'pictures', $cells, $content, $pictures_id); return true; }
function cs_find_move($folders_id, $usersgallery_id) { $sql_tmp = cs_sql_select(__FILE__, 'usersgallery', 'usersgallery_id', 'folders_id = ' . $folders_id, 'usersgallery_id DESC', 0, 0); $tmp = 0; foreach ($sql_tmp as $search_tmp) { if (in_array($usersgallery_id, $search_tmp)) { return $tmp; } $tmp++; } return FALSE; }
function notifymods_mail($mod, $users_id = 0, $var = NULL) { // $mail_text[$lang] = cs_translate('notifymods'); // not implicitly necessary if (!is_array($var)) { $var = array($var); } $mails_send = 0; $from = "notifymods ntm INNER JOIN {pre}_users usr ON ntm.notifymods_user = usr.users_id"; $where = "ntm.notifymods_user != '" . $users_id . "' \n AND usr.users_delete != 1\n AND usr.users_active = 1\n AND ntm.notifymods_" . $mod . " = 1"; $ntm_users = cs_sql_select(__FILE__, $from, 'usr.users_lang, usr.users_email', $where, 0, 0, 0); $pattern1 = '/\'(?<mod>.*)_text\'\\](\\s*)=(\\s*)\'(?<value>.*)\';/'; $pattern2 = '/\'(?<mod>.*)_subject\'\\](\\s*)=(\\s*)\'(?<value>.*)\';/'; if (!empty($ntm_users)) { foreach ($ntm_users as $mail_user) { $lang = empty($mail_user['users_lang']) ? $cs_main['def_lang'] : $mail_user['users_lang']; if (empty($mail_text[$lang][$mod . '_text'])) { $mail_text[$lang] = cs_cache_load('lang_notifymods_' . $lang); if ($mail_text[$lang] === FALSE and file_exists('lang/' . $lang . '/notifymods.php')) { // read lang-file and search for text- & subject-placeholder $fp = fopen('lang/' . $lang . '/notifymods.php', 'r'); $file_content = ''; while (!feof($fp)) { $file_content .= fgets($fp, 4096); } fclose($fp); preg_match_all($pattern1, $file_content, $match); $run = 0; foreach ($match['mod'] as $lang_mod) { $mail_text[$lang][$lang_mod . '_text'] = $match['value'][$run]; $run++; } preg_match_all($pattern2, $file_content, $match); $run = 0; foreach ($match['mod'] as $lang_mod) { $mail_text[$lang][$lang_mod . '_subject'] = $match['value'][$run]; $run++; } cs_cache_save('lang_notifymods_' . $lang, $mail_text[$lang]); } } if (empty($text[$lang])) { $text[$lang] = empty($var) ? $mail_text[$lang][$mod . '_text'] : vsprintf($mail_text[$lang][$mod . '_text'], $var); } if (cs_mail($mail_user['users_email'], $mail_text[$lang][$mod . '_subject'], $text[$lang])) { $mails_send++; } } return $mails_send; } }
function cs_captchacheck($input, $mini = 0) { if (!extension_loaded('gd')) { return true; } $ip = cs_getip(); $timeout = cs_time() - 900; $string = empty($mini) ? cs_sql_escape($input) : 'mini_' . cs_sql_escape($input); $cond = 'captcha_ip = \'' . cs_sql_escape($ip) . '\' AND '; $cond .= 'captcha_time > \'' . $timeout . '\' AND '; $cond .= 'captcha_string = \'' . $string . '\''; $hash_db = cs_sql_select(__FILE__, 'captcha', 'captcha_id', $cond); if (empty($hash_db)) { return false; } cs_sql_delete(__FILE__, 'captcha', $hash_db['captcha_id']); return true; }
function cs_board_last($board_id) { settype($board_id, 'integer'); $from = 'threads thr LEFT JOIN {pre}_users usr ON thr.users_id = usr.users_id LEFT JOIN {pre}_users uco ON thr.threads_last_user = uco.users_id'; $where = "thr.board_id = '" . $board_id . "'"; $cells = 'thr.threads_last_time AS board_last_time, thr.threads_headline AS board_last_thread, thr.threads_id AS board_last_threadid, ' . 'thr.threads_last_user AS board_last_userid, uco.users_nick AS board_last_user, ' . 'usr.users_nick AS create_user, usr.users_id AS create_userid, thr.threads_time AS create_time'; $last_sql = cs_sql_select(__FILE__, $from, $cells, $where, 'thr.threads_last_time DESC'); if (empty($last_sql)) { $last_sql = array('board_last_time' => 0, 'board_last_thread' => 0, 'board_last_threadid' => 0, 'board_last_user' => 0, 'board_last_userid' => 0); } else { # fallback to creation if no last data is available if (empty($last_sql['board_last_user'])) { $last_sql['board_last_user'] = $last_sql['create_user']; $last_sql['board_last_userid'] = $last_sql['create_userid']; $last_sql['board_last_time'] = $last_sql['create_time']; } unset($last_sql['create_user'], $last_sql['create_userid'], $last_sql['create_time']); } cs_sql_update(__FILE__, 'board', array_keys($last_sql), array_values($last_sql), $board_id); return $last_sql; }
function cs_categories_dropdown2($mod, $categories_id = 0, $new = 1, $name = 'categories_id') { global $account; $data = array(); $cells = 'categories_id, categories_name, categories_subid'; $categories = cs_sql_select(__FILE__, 'categories', $cells, "categories_mod = '" . $mod . "' AND categories_access <= '" . $account['access_news'] . "'", 'categories_subid ASC, categories_name', 0, 0); $categories = cs_catsort($categories); $data['categories']['options'] = ''; if (!empty($categories)) { foreach ($categories as $cat) { $blank = ''; if (!empty($cat['layer'])) { for ($i = 0; $i < $cat['layer']; $i++) { $blank .= ' '; } $blank .= '»'; } $data['categories']['options'] .= cs_html_option($blank . $cat['categories_name'], $cat['categories_id'], $cat['categories_id'] == $categories_id); } } $data['if']['new'] = !empty($new) ? TRUE : FALSE; $data['dropdown']['name'] = $name; return cs_subtemplate(__FILE__, $data, 'categories', 'cat_dropdown2'); }
} else { $cs_maps['games_id'] = (int) $_POST['games_id']; $cs_maps['maps_name'] = $_POST['maps_name']; $cs_maps['server_name'] = $_POST['server_name']; $cs_maps['maps_text'] = $_POST['maps_text']; $maps_id = (int) $_POST['maps_id']; if (empty($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) { $cells = array_keys($cs_maps); $values = array_values($cs_maps); cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id); } elseif (isset($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) { $select = cs_sql_select(__FILE__, 'maps', 'maps_picture', 'maps_id = \'' . $maps_id . '\''); cs_unlink('maps', $select['maps_picture']); $cs_maps['maps_picture'] = ''; $cells = array_keys($cs_maps); $values = array_values($cs_maps); cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id); } else { $select = cs_sql_select(__FILE__, 'maps', 'maps_picture', 'maps_id = \'' . $maps_id . '\''); $url = 'uploads/maps/' . $select['maps_picture']; cs_unlink('maps', $select['maps_picture']); $filename = 'picture-' . $maps_id . '.' . $extension; cs_upload('maps', $filename, $files_gl['picture']['tmp_name']); $cs_maps['maps_picture'] = $filename; $cells = array_keys($cs_maps); $values = array_values($cs_maps); cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id); } cs_redirect($cs_lang['changes_done'], 'maps'); } }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $thisday = cs_datereal('m-d'); $output = array(); $data = array(); $data = cs_cache_load('navbirth'); $cs_lang = cs_translate('users'); $options = cs_sql_option(__FILE__, 'users'); if ($data['day'] != $thisday) { $data['day'] = $thisday; $select = 'users_id, users_nick, users_age'; $where = "users_age LIKE '%-" . $data['day'] . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = 1"; $order = 'users_nick ASC'; $data['users'] = cs_sql_select(__FILE__, 'users', $select, $where, $order, 0, 0); cs_cache_save('navbirth', $data); } if (empty($data['users'])) { echo $cs_lang['no_data']; } else { $count = empty($options['navbirth_max_users']) ? count($data['users']) : min(count($data['users']), $options['navbirth_max_users']); for ($run = 0; $run < $count; $run++) { $birth = explode('-', $data['users'][$run]['users_age']); $output['users'][$run]['age'] = cs_datereal('Y') - $birth[0]; $output['users'][$run]['day'] = $birth[2]; $output['users'][$run]['month'] = $birth[1]; $output['users'][$run]['year'] = $birth[0]; $output['users'][$run]['user'] = cs_user($data['users'][$run]['users_id'], $data['users'][$run]['users_nick']); $output['users'][$run]['messageurl'] = cs_url('messages', 'create', 'to_id=' . $data['users'][$run]['users_id']); }
$birth = explode('-', $cs_clan['clans_since']); $age = cs_datereal('Y') - $birth[0]; if (cs_datereal('m') <= $birth[1]) { $age--; } if (cs_datereal('d') >= $birth[2] and cs_datereal('m') == $birth[1]) { $age++; } $content .= ' (' . $age . ')'; $data['clans']['since'] = $content; } else { $data['clans']['since'] = '-'; } $select = 'squads_name, games_id, squads_id'; $where = "clans_id = '" . $cs_clans_id . "'"; $cs_squads = cs_sql_select(__FILE__, 'squads', $select, $where, 'squads_order, squads_name', 0, 0); $squads_loop = count($cs_squads); $data['lang']['game'] = $cs_lang['game']; $data['lang']['squads'] = $cs_lang[$op_squads['label']]; $data['lang']['members'] = $cs_lang[$op_members['label']]; if (empty($squads_loop)) { $data['squads'] = ''; } for ($run = 0; $run < $squads_loop; $run++) { if (!empty($cs_squads[$run]['games_id'])) { $data['squads'][$run]['game'] = cs_html_img('uploads/games/' . $cs_squads[$run]['games_id'] . '.gif'); } else { $data['squads'][$run]['game'] = ''; } $data['squads'][$run]['squads'] = cs_link(cs_secure($cs_squads[$run]['squads_name']), 'squads', 'view', 'id=' . $cs_squads[$run]['squads_id']); $where = "squads_id='" . $cs_squads[$run]['squads_id'] . "'";
} 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'] . "'"); $data['preview']['user'] = cs_user($history['users_id'], $cs_user['users_nick'], $cs_user['users_active']); $data['preview']['text'] = cs_secure($history['history_text'], 1, 1, 1, 1); } if (!empty($error) or !isset($_POST['submit']) or isset($_POST['preview'])) { if (empty($cs_main['rte_html'])) { $data['if']['no_rte_html'] = 1; $data['history']['abcode_smileys'] = cs_abcode_smileys('history_text', 1); $data['history']['abcode_features'] = cs_abcode_features('history_text', 1, 1); $data['history']['text'] = $history['history_text']; $data['if']['rte_html'] = 0; } else { $data['if']['rte_html'] = 1; $data['if']['no_rte_html'] = 0; $data['history']['rte_html'] = cs_rte_html('history_text', $history['history_text']); }
// 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'); } $data['signature']['text'] = cs_secure($data['signature']['text']); echo cs_subtemplate(__FILE__, $data, 'board', 'signature');
$data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $levels = 0; $data['show']['options'] = ''; while ($levels < 2) { $cs_gallery['gallery_status'] == $levels ? $sel = 1 : ($sel = 0); $data['show']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['show_' . $levels], $levels, $sel); $levels++; } $cs_gallery['gallery_watermark'] = ''; $gallery_watermark_trans = '20'; if (extension_loaded('gd')) { $no_watermark = $cs_lang['no_watermark']; $no_cat_data_watermark = array('0' => array('categories_id' => '', 'categories_mod' => 'gallery-watermark', 'categories_name' => $no_watermark, 'categories_picture' => '')); $cat_data_watermark_1 = cs_sql_select(__FILE__, 'categories', '*', "categories_mod = 'gallery-watermark'", 'categories_name', 0, 0); if (empty($cat_data_watermark_1)) { $cat_data_watermark = $no_cat_data_watermark; } else { $cat_data_watermark = array_merge($no_cat_data_watermark, $cat_data_watermark_1); } $search_value = $cs_gallery['gallery_watermark']; if (!empty($search_value)) { foreach ($cat_data_watermark as $key => $row) { foreach ($row as $cell) { if (strpos($cell, $search_value) !== FALSE) { $watermark_id = $key; } } } }
} if (empty($cs_clans['clans_short'])) { $error++; $errormsg .= $cs_lang['no_short'] . cs_html_br(1); } $where = "clans_name = '" . cs_sql_escape($cs_clans['clans_name']) . "'"; $where .= " AND clans_id != " . (int) $clans_id; $search = cs_sql_count(__FILE__, 'clans', $where); if (!empty($search)) { $error++; $errormsg .= $cs_lang['name_exists'] . cs_html_br(1); } } else { $cells = 'clans_name, clans_short, clans_tag, clans_tagpos, clans_country, clans_url, clans_since, clans_pwd, clans_picture, users_id'; $cs_clans = cs_sql_select(__FILE__, 'clans', $cells, "clans_id = " . (int) $clans_id); $cs_users = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . (int) $cs_clans['users_id']); $users_nick = $cs_users['users_nick']; } if (!isset($_POST['submit'])) { $data['lang']['body'] = $cs_lang['errors_here']; } if (!empty($error)) { $data['lang']['body'] = $errormsg; } if (!empty($error) or !isset($_POST['submit'])) { $data['lang']['mod'] = $cs_lang[$op_clans['label']]; $data['clans']['name'] = cs_secure($cs_clans['clans_name']); $data['clans']['short'] = cs_secure($cs_clans['clans_short']); $data['clans']['tag'] = cs_secure($cs_clans['clans_tag']); if ($cs_clans['clans_tagpos'] == '1') { $data['select']['before'] = 'selected="selected"';
if (!empty($_POST['games_creator'])) { $games_creator = $_POST['games_creator']; } if (!empty($_POST['games_url'])) { $games_url = $_POST['games_url']; } if (!empty($_POST['games_version'])) { $games_version = $_POST['games_version']; } $data['lang']['body'] = !isset($_POST['submit']) ? $cs_lang['body_create'] : $errormsg; if (isset($_POST['submit']) && empty($games_error) && empty($symbol_error)) { $games_cells = array('games_name', 'games_version', 'games_released', 'games_creator', 'categories_id', 'games_url', 'games_usk'); $games_save = array($games_name, $games_version, $games_release, $games_creator, $categories_id, $games_url, $games_usk); cs_sql_insert(__FILE__, 'games', $games_cells, $games_save); $where = "games_name = '" . cs_sql_escape($games_name) . "'"; $getid = cs_sql_select(__FILE__, 'games', 'games_id', $where); if (!empty($files['symbol']['tmp_name']) and $symbol_error == 0) { $filename = $getid['games_id'] . '.' . $extension; cs_upload('games', $filename, $files['symbol']['tmp_name']); } else { copy('uploads/games/0.gif', 'uploads/games/' . (int) $getid['games_id'] . '.gif'); } cs_redirect($cs_lang['create_done'], 'games'); } $data['url']['form'] = cs_url('games', 'create'); $data['games']['name'] = $games_name; $data['games']['version'] = $games_version; $data['games']['genre'] = cs_categories_dropdown('games', $categories_id); $data['games']['release'] = cs_dateselect('datum', 'date', $games_release); $data['games']['creator'] = $games_creator; $data['games']['homepage'] = $games_url;
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('users'); $five_min = cs_time() - 300; $select = 'users_id, users_nick, users_country, users_active, users_invisible, users_picture'; $invisible = $account['access_users'] > 4 ? '' : " AND users_invisible = '0'"; $upcome = "users_laston > " . $five_min . " AND users_active = '1'" . $invisible; $order = 'users_laston DESC'; $cs_users = cs_sql_select(__FILE__, 'users', $select, $upcome, $order, 0, 8); $data = array(); if (empty($cs_users)) { $data['lang']['no_users'] = $cs_lang['no_data']; echo cs_subtemplate(__FILE__, $data, 'users', 'no_users'); } else { $count_users = count($cs_users); for ($run = 0; $run < $count_users; $run++) { if (!empty($cs_users[$run]['users_picture'])) { $data['users'][$run]['picture'] = 'uploads/users/' . $cs_users[$run]['users_picture']; } else { $data['users'][$run]['picture'] = 'symbols/users/no_pic.png'; } if (empty($invisible) and !empty($cs_users[$run]['users_invisible'])) { $data['users'][$run]['nick'] = cs_html_italic(1) . $cs_users[$run]['users_nick'] . cs_html_italic(0); } else { $data['users'][$run]['nick'] = $cs_users[$run]['users_nick']; } $data['users'][$run]['url'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']); } echo cs_subtemplate(__FILE__, $data, 'users', 'navonline_pic');
$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');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('gallery', 1); $cs_post = cs_post('id'); $cs_get = cs_get('id'); $data = array(); require_once 'mods/gallery/functions.php'; $gallery_id = empty($cs_get['id']) ? 0 : $cs_get['id']; if (!empty($cs_post['id'])) { $gallery_id = $cs_post['id']; } settype($gallery_id, 'integer'); $edit = cs_sql_select(__FILE__, 'usersgallery', '*', "usersgallery_id = '" . (int) $gallery_id . "'"); $cs_option = cs_sql_option(__FILE__, 'gallery'); $gallery_count_reset = 0; $new_time = 0; if (isset($_POST['submit'])) { $edit['usersgallery_titel'] = $_POST['gallery_titel']; $edit['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('usersgallery', $_POST['folders_name'], $account['users_id']); $edit['usersgallery_access'] = $_POST['gallery_access']; $edit['usersgallery_status'] = $_POST['gallery_status']; $edit['usersgallery_description'] = $_POST['gallery_description']; $edit['usersgallery_vote'] = isset($_POST['gallery_vote']) ? $_POST['gallery_vote'] : 0; if (!empty($_POST['new_time'])) { $edit['usersgallery_time'] = cs_time(); } if (!empty($_POST['gallery_count_reset'])) { $edit['usersgallery_count'] = 0; }
flush(); } } } } cs_cache_save($cache_name, $data, $cache_time); } elseif (empty($data)) { $data = array('servers' => array()); $data['if']['noquery'] = true; /* if fsockopen deactive, list servers */ $tables = 'servers srv INNER JOIN {pre}_games gam ON srv.games_id = gam.games_id'; $select = 'srv.servers_name AS servers_name, srv.servers_ip AS servers_ip, srv.servers_port AS servers_port'; $select .= ', srv.servers_info AS servers_info, srv.servers_slots AS servers_slots, srv.servers_type AS servers_type'; $select .= ', gam.games_name AS games_name, gam.games_id AS games_id'; $order = 'srv.servers_order'; $cs_servers = cs_sql_select(__FILE__, $tables, $select, 0, $order, 0, 0); $cs_servers_count = count($cs_servers); $data['servers'] = array(); for ($serv = 0; $serv < $cs_servers_count; $serv++) { $data['servers'][$serv]['name'] = $cs_servers[$serv]['servers_name']; $data['servers'][$serv]['url'] = $cs_servers[$serv]['servers_ip'] . ':' . $cs_servers[$serv]['servers_port']; switch ($cs_servers[$serv]['servers_type']) { case 1: $data['servers'][$serv]['type'] = $cs_lang['clanserver']; break; case 2: $data['servers'][$serv]['type'] = $cs_lang['pubserver']; break; case 3: $data['servers'][$serv]['type'] = $cs_lang['voiceserver']; break;
<?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');
function cs_cups_addteam2match($cups_id, $teamid, $prevmatchid, $prevmatchround, $prevmatchlb, $matchid, $is_admin) { $return = true; $match = cs_sql_select(__FILE__, 'cupmatches', '*', 'cups_id = ' . $cups_id . ' AND cupmatches_match = ' . $matchid, 0, 0, 1); if (empty($match['cupmatches_id'])) { cs_error(__FILE__, 'ERROR: unknown match #' . $matchid . ' for cup #' . $cups_id, 1); return false; } /* get the other match which is referencing to this match */ $othermatch = cs_sql_select(__FILE__, 'cupmatches', '*', 'cups_id = ' . $cups_id . ' AND (cupmatches_nextmatch = ' . $matchid . ' OR cupmatches_nextmatchlb = ' . $matchid . ') AND cupmatches_match <> ' . $prevmatchid, 0, 0, 1); if (empty($match['cupmatches_id'])) { cs_error(__FILE__, 'ERROR: unknown other match for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); return false; } /* determine on which position this team has to be put */ if ($match['cupmatches_loserbracket'] == 0) { if ($match['cupmatches_match'] != 0) { /* this match is in the winner bracket, so both previous matches should be from the same round */ if ($prevmatchround != $othermatch['cupmatches_round']) { cs_error(__FILE__, 'ERROR: other match for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid . ' not in the same round', 1); $return = false; } /* place the team according to match number */ if ($prevmatchid < $othermatch['cupmatches_match']) { /* place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } else { /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } else { /* grand final or 3rd place match */ if ($prevmatchlb == 1 || $othermatch['cupmatches_loserbracket'] == 1) { /* grand final, since one of them comes from a loserbracket */ if ($prevmatchlb == 0) { /* team coming from wb */ /* place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB GF: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB GF: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } else { /* team coming from lb */ /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB GF: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB GF: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } else { /* 3rd place match */ /* place the team according to match number */ if ($prevmatchid < $othermatch['cupmatches_match']) { /* place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB 3RD: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB 3RD: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } else { /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING WB 3RD: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR WB 3RD: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } } } else { if ($prevmatchlb == 0 || $othermatch['cupmatches_loserbracket'] == 0) { /* one of them comes from the winner bracket, so it's a half round match */ if ($prevmatchlb == 0) { /* team comes from wb */ if ($othermatch['cupmatches_loserbracket'] == 0) { /* both come from wb (first round LB) */ if ($prevmatchid < $othermatch['cupmatches_match']) { /* place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING LB 1RD: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB 1RD: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } else { /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING LB 1RD: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB 1RD: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } else { /* this team comes from wb, place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING LB FWB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB FWB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } } else { /* team comes from lb */ /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING LB FWB: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB FWB: position2 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } else { /* both of them coming from LB */ /* place the team according to match number */ if ($prevmatchid < $othermatch['cupmatches_match']) { /* place on position 1 */ if ($match['squad1_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNIGN LB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad1_id'); } else { /* place on position 2 */ if ($match['squad2_id'] != CS_CUPS_TEAM_UNKNOWN) { if ($is_admin) { cs_error(__FILE__, 'WARNING LB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } else { cs_error(__FILE__, 'ERROR LB: position1 in use other for match #' . $matchid . ' for cup #' . $cups_id . ' and prevmatch #' . $prevmatchid, 1); } $return = false; } $cells = array('squad2_id'); } } } /* we have determined the position */ $values = array($teamid); cs_sql_update(__FILE__, 'cupmatches', $cells, $values, $match['cupmatches_id']); if (function_exists('cs_datacache_load')) { cs_datacache_clear('cups'); } /* if there were any admin matchedits, fix tree recursively */ cs_cups_autofix($cups_id); return $return; }
// ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('board'); $cs_usertime = cs_sql_select(__FILE__, 'users', 'users_readtime', "users_id = '" . $account["users_id"] . "'"); $cs_readtime = cs_time() - $cs_usertime['users_readtime']; $from = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id'; $conditions = "frm.board_access <= '" . $account['access_board'] . "' AND frm.board_pwd = ''"; $cs_count = cs_sql_count(__FILE__, $from, $conditions); $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0; $data['lang']['count'] = $cs_count; $data['pages']['list'] = cs_pages('board', 'active', $cs_count, $start); $from = "threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id INNER JOIN {pre}_users usr ON thr.threads_last_user = usr.users_id LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = '" . $account['users_id'] . "'"; $select = 'thr.threads_id AS threads_id, thr.threads_headline AS threads_headline, thr.threads_view AS threads_view, thr.threads_comments AS threads_comments, thr.threads_important AS threads_important, thr.threads_close AS threads_close, thr.threads_last_time AS threads_last_time, usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, red.read_since AS read_since'; $order = 'thr.threads_view DESC, thr.threads_last_time DESC'; $cs_threads = cs_sql_select(__FILE__, $from, $select, $conditions, $order, $start, $account['users_limit']); if (empty($cs_threads)) { $data['if']['not_active'] = true; $data['if']['active'] = false; } else { $data['if']['not_active'] = false; $data['if']['active'] = true; $run = 0; foreach ($cs_threads as $thread) { if (empty($thread['threads_comments'])) { include_once 'mods/board/repair.php'; $thread['threads_comments'] = cs_threads_comments($thread['threads_id']); } $icon = 'post_'; $tid = $thread['threads_id']; if (!empty($account['users_id']) and $thread['threads_last_time'] > $cs_readtime and $thread['threads_last_time'] > $thread['read_since']) {
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('users'); $cs_get = cs_get('id'); $data = array(); $users_id = empty($cs_get['id']) ? 0 : $cs_get['id']; $nick_temp = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $users_id); if (isset($_GET['agree'])) { $nick = $nick_temp['users_nick']; $chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; $chars_count = strlen($chars) - 1; $mail = ''; $given = 1; while (!empty($given)) { for ($i = 0; $i < 40; $i++) { $rand = rand(0, $chars_count); $mail .= $chars[$rand]; } $given = cs_sql_count(__FILE__, 'users', "users_email = '" . $mail . "'"); } $array_data = array('access_id' => 0, 'users_nick' => $nick, 'users_pwd' => '', 'users_name' => '', 'users_surname' => '', 'users_sex' => '', 'users_age' => '', 'users_height' => 0, 'users_lang' => '', 'users_country' => "fam", 'users_postalcode' => '', 'users_place' => '', 'users_adress' => '', 'users_icq' => 0, 'users_jabber' => '', 'users_skype' => '', 'users_email' => $mail, 'users_url' => '', 'users_phone' => '', 'users_mobile' => '', 'users_laston' => 0, 'users_picture' => '', 'users_avatar' => '', 'users_signature' => '', 'users_info' => '', 'users_regkey' => '', 'users_register' => 0, 'users_delete' => 1); $array_keys = array_keys($array_data); $array_values = array_values($array_data); cs_sql_update(__FILE__, 'users', $array_keys, $array_values, $users_id); cs_sql_delete(__FILE__, 'members', $users_id, 'users_id'); cs_cache_clear(); cs_redirect($cs_lang['del_true'], 'users'); } if (isset($_GET['cancel'])) {
<?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');
$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); if (empty($user_gb)) { $active = cs_link(cs_icon('cancel'), 'gbook', 'manage', 'active=' . $cs_gbook[$run]['gbook_id'], 0, $cs_lang['active']); $deactive = cs_link(cs_icon('submit'), 'gbook', 'manage', 'deactive=' . $cs_gbook[$run]['gbook_id'], 0, $cs_lang['deactive']); } else { $active = cs_link(cs_icon('cancel'), 'gbook', 'manage', 'active=' . $cs_gbook[$run]['gbook_id'] . '&user_gb=' . $user_gb, 0, $cs_lang['active']);
$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'); } $data['squads'][$sq_run]['squad_name'] = cs_secure($data['squads'][$sq_run]['squads_name']); $data['squads'][$sq_run]['count_members'] = $members_loop; if (empty($members_loop)) { $data['squads'][$sq_run]['members'] = array(); } $tr = 0; for ($run = 0; $run < $members_loop; $run++) { $members = $data['squads'][$sq_run]['members']; $hidden = explode(',', $members[$run]['users_hidden']); $allow = $members[$run]['users_id'] == $account['users_id'] or $account['access_users'] > 4 ? 1 : 0;
if (cs_trashmail($cs_user['users_email'])) { $error++; $errormsg .= $cs_lang['email_false'] . cs_html_br(1); } if (!empty($cs_user['users_sex'])) { $cs_user['users_sex'] = $cs_user['users_sex'] == 'male' ? 'male' : 'female'; } $country = $cs_user['users_country']; $cs_user['users_country'] = isset($cs_country[$country]) ? $cs_user['users_country'] : 'fam'; if ((int) $_POST['age_year'] . $_POST['age_month'] . $_POST['age_day'] > (int) cs_datereal('Ymd')) { $error++; $errormsg .= $cs_lang['age_false'] . cs_html_br(1); } } else { $cells = 'users_nick, users_name, users_surname, users_sex, users_age, users_height, users_country, users_postalcode, users_place, users_adress, users_icq, users_jabber, users_skype, users_email, users_url, users_phone, users_mobile, users_info, users_hidden'; $cs_user = cs_sql_select(__FILE__, 'users', $cells, "users_id = '" . $account['users_id'] . "'"); $hidden = explode(',', $cs_user['users_hidden']); } if (!isset($_POST['submit'])) { $data['users']['body'] = $cs_lang['errors_here']; } elseif (!empty($error)) { $data['users']['body'] = $errormsg; } else { $data['users']['body'] = $cs_lang['changes_done']; } if (!empty($error) or !isset($_POST['submit'])) { $hidden = array_flip($hidden); if (empty($cs_user['users_height'])) { $cs_user['users_height'] = ''; } if (empty($cs_user['users_icq'])) {
$data['threads']['id'] = $thread_edit['threads_id']; $head = cs_link($cs_lang['board'], 'board', 'list', 'normalb') . ' -> '; $head .= cs_link($thread_edit['categories_name'], 'board', 'list', 'where=' . $thread_edit['categories_id'], 'normalb') . ' -> '; $head .= cs_link($thread_edit['board_name'], 'board', 'listcat', 'where=' . $board_id, 'normalb') . ' -> '; $head .= cs_link($thread_edit['threads_headline'], 'board', 'thread', 'where=' . $thread_edit['threads_id'], 'normalb'); $data['head']['links'] = $head; $data['if']['move'] = FALSE; $data['if']['rename'] = FALSE; //move if (!empty($_POST['move'])) { $data['if']['move'] = TRUE; $tables = "board boa INNER JOIN {pre}_categories cat ON boa.categories_id = cat.categories_id"; $select = "boa.board_id AS board_id, boa.board_name AS board_name, cat.categories_name AS categories_name"; $axx_where = "boa.board_access <= '" . $account['access_board'] . "'"; $sorting = 'cat.categories_name ASC, boa.board_name ASC'; $board_data = cs_sql_select(__FILE__, $tables, $select, $axx_where, $sorting, 0, 0); $data['board']['select'] = ''; foreach ($board_data as $board) { $sel = $board_id == $board['board_id'] ? 1 : 0; $content = $board['categories_name'] . ' -> ' . $board['board_name']; $data['board']['select'] .= cs_html_option($content, $board['board_id'], $sel); } $data['checked']['closed'] = empty($thread_edit['threads_close']) ? '' : 'checked="checked" '; $data['checked']['notclosed'] = !empty($thread_edit['threads_close']) ? '' : 'checked="checked" '; } //rename if (!empty($_POST['rename'])) { $data['if']['rename'] = TRUE; $data['val']['thread_headline'] = $thread_headline; } echo cs_subtemplate(__FILE__, $data, 'board', 'modpanel_q');
<?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$ # 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); $term = empty($_GET['term']) ? '' : $_GET['term']; # Mods like messages support multiple users and that must be considered $term_array = explode(';', $term); $current = is_array($term_array) ? end($term_array) : $term; # Strip current search term from search_users content $old = substr($term, 0, strlen($term) - strlen($current)); if (!empty($current)) { $data = array(); $data['data']['old'] = htmlspecialchars($old); $data['data']['target'] = empty($_GET['target']) ? 'users_nick' : $_GET['target']; $where = "users_nick LIKE '%" . cs_sql_escape(trim($current)) . "%' AND users_active = 1 AND users_delete = 0"; $data['result'] = cs_sql_select(__FILE__, 'users', 'users_nick', $where, 0, 0, 7); if (!empty($data['result'])) { $loop = count($data['result']); for ($run = 0; $run < $loop; $run++) { $data['result'][$run]['users_nick'] = cs_secure($data['result'][$run]['users_nick']); } echo cs_subtemplate(__FILE__, $data, 'ajax', 'search_users'); } }