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_update_rss($mod, $action, $name, $desc, $array, $abcode = 0) { global $cs_main; $cs_main['rss'] = 1; $abcode = is_array($abcode) ? $abcode : array(0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 0); $target = 'uploads/rss/'; $name_sec = htmlspecialchars($name, ENT_NOQUOTES, $cs_main['charset']); $desc_sec = htmlspecialchars($desc, ENT_NOQUOTES, $cs_main['charset']); if (is_writeable($target)) { include_once 'system/output/rss_20.php'; $content = cs_rss_mode(1); $content .= cs_rss_channel(1, $mod, $name_sec, $cs_main['php_self']['website'], $desc_sec); if (!empty($array)) { foreach ($array as $item) { if (!empty($item['id']) and !empty($item['title']) and !empty($item['text'])) { $title = htmlspecialchars($item['title'], ENT_NOQUOTES, $cs_main['charset']); $link = $cs_main['php_self']['website'] . cs_url($mod, $action, 'id=' . $item['id'], 'index'); $text = empty($item['readmore']) ? $item['text'] : $item['readmore']; $text = cs_secure($text, $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]); $text = '<![CDATA[ ' . $text . ' ]]>'; if (!empty($abcode[3])) { # use full uri if needed in html content $url_pre = $cs_main['php_self']['website'] . $cs_main['php_self']['dirname']; $pattern = "=(background|href|src)\\=\"(?!http|\\/)(.*?)\"=i"; $text = preg_replace($pattern, "\\1=\"" . $url_pre . "\\2\"", $text); } $date = empty($item['time']) ? 0 : date('D, d M Y H:i:s', $item['time']) . ' +0000'; # author is presented as 'email (nick)' $author = (empty($item['nick']) or empty($item['author'])) ? '' : $item['author'] . ' (' . cs_secure($item['nick']) . ')'; $category = empty($item['cat']) ? '' : htmlspecialchars($item['cat'], ENT_NOQUOTES, $cs_main['charset']); $content .= cs_rss_item($title, $link, $text, $date, $author, $category); } } } $content .= cs_rss_channel(0); $content .= cs_rss_mode(0); $save_file = fopen($target . $mod . '.xml', 'w'); # set stream encoding if possible to avoid converting issues if (function_exists('stream_encoding')) { stream_encoding($save_file, $cs_main['charset']); } fwrite($save_file, $content); fclose($save_file); @chmod($target . $mod . '.xml', 0755); } else { cs_error($target, 'cs_update_rss - Unable to write into directory'); } $cs_main['rss'] = 0; }
$data['users']['users_surname'] = cs_secure($cs_user['users_surname']); $data['users']['users_age'] = cs_dateselect('age', 'date', $cs_user['users_age']); $data['users']['male_check'] = $cs_user['users_sex'] == 'male' ? $sel : ''; $data['users']['female_check'] = $cs_user['users_sex'] == 'female' ? $sel : ''; $data['users']['users_height'] = cs_secure($cs_user['users_height']); $data['users']['users_postalcode'] = cs_secure($cs_user['users_postalcode']); $data['users']['users_place'] = cs_secure($cs_user['users_place']); $data['users']['users_adress'] = cs_secure($cs_user['users_adress']); $data['users']['users_icq'] = cs_secure($cs_user['users_icq']); $data['users']['users_jabber'] = cs_secure($cs_user['users_jabber']); $data['users']['users_skype'] = cs_secure($cs_user['users_skype']); $data['users']['users_email'] = cs_secure($cs_user['users_email']); $data['users']['users_url'] = cs_secure($cs_user['users_url']); $data['users']['users_phone'] = cs_secure($cs_user['users_phone']); $data['users']['users_mobile'] = cs_secure($cs_user['users_mobile']); $data['users']['users_info'] = cs_secure($cs_user['users_info']); $data['users']['country_url'] = cs_html_img('symbols/countries/' . $cs_user['users_country'] . '.png', 0, 0, 'id="country_1"'); $data['hidden']['users_name'] = isset($hidden['users_name']) ? $checked : ''; $data['hidden']['users_surname'] = isset($hidden['users_surname']) ? $checked : ''; $data['hidden']['users_age'] = isset($hidden['users_age']) ? $checked : ''; $data['hidden']['users_height'] = isset($hidden['users_height']) ? $checked : ''; $data['hidden']['users_postalcode'] = isset($hidden['users_postalcode']) ? $checked : ''; $data['hidden']['users_place'] = isset($hidden['users_place']) ? $checked : ''; $data['hidden']['users_adress'] = isset($hidden['users_adress']) ? $checked : ''; $data['hidden']['users_icq'] = isset($hidden['users_icq']) ? $checked : ''; $data['hidden']['users_jabber'] = isset($hidden['users_jabber']) ? $checked : ''; $data['hidden']['users_skype'] = isset($hidden['users_skype']) ? $checked : ''; $data['hidden']['users_email'] = isset($hidden['users_email']) ? $checked : ''; $data['hidden']['users_url'] = isset($hidden['users_url']) ? $checked : ''; $data['hidden']['users_phone'] = isset($hidden['users_phone']) ? $checked : ''; $data['hidden']['users_mobile'] = isset($hidden['users_mobile']) ? $checked : '';
$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'] . "'"; $data['squads'][$run]['members'] = cs_sql_count(__FILE__, 'members', $where); } echo cs_subtemplate(__FILE__, $data, 'clans', 'view');
function cs_cups_get_teams($cups_id, $cups_type, $cs_lang) { switch ($cups_type) { case CS_CUPS_TYPE_TEAMS: $tables = 'cupsquads cs LEFT JOIN {pre}_'; $tables .= 'squads team ON cs.squads_id = team.squads_id'; $cells = 'cs.cupsquads_id AS cupsquads_id, cs.cupsquads_time AS cupsquads_time, cs.squads_id AS squads_id, '; $cells .= 'cs.cupsquads_seed AS cupsquads_seed, cs.cupsquads_autoseed AS cupsquads_autoseed, '; $cells .= 'team.squads_name AS squads_name'; break; case CS_CUPS_TYPE_USERS: $tables = 'cupsquads cs LEFT JOIN {pre}_'; $tables .= 'users team ON cs.squads_id = team.users_id'; $cells = 'cs.cupsquads_id AS cupsquads_id, cs.cupsquads_time AS cupsquads_time, cs.squads_id AS squads_id, '; $cells .= 'cs.cupsquads_seed AS cupsquads_seed, cs.cupsquads_autoseed AS cupsquads_autoseed, '; $cells .= 'team.users_nick AS squads_name, team.users_active AS users_active, team.users_delete AS users_delete'; break; } $teams = cs_sql_select(__FILE__, $tables, $cells, 'cs.cups_id = ' . $cups_id, 'cupsquads_autoseed ASC, cupsquads_seed ASC', 0, 0); if (!count($teams)) { return NULL; } foreach ($teams as $key => $team) { if (empty($team['cupsquads_autoseed'])) { $teams[$key]['seed_text'] = $team['cupsquads_seed']; $teams[$key]['autoseed_on'] = ''; $teams[$key]['autoseed_off'] = 'checked'; } else { $teams[$key]['seed_text'] = $cs_lang['auto']; $teams[$key]['autoseed_on'] = 'checked'; $teams[$key]['autoseed_off'] = ''; } $teams[$key]['join'] = cs_date('unix', $teams[$key]['cupsquads_time'], 1); switch ($cups_type) { case CS_CUPS_TYPE_TEAMS: $teams[$key]['link'] = cs_link(cs_secure($team['squads_name']), 'squads', 'view', 'id=' . $team['squads_id']); break; case CS_CUPS_TYPE_USERS: $teams[$key]['link'] = cs_user($team['squads_id'], $team['squads_name'], $team['users_active'], $team['users_delete']); break; } } return $teams; }
$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');
for ($run = 0; $run < $count_squads; $run++) { $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']); } $data['sort']['date'] = cs_sort('wars', 'list', $start, $squads_id, 1, $sort); $data['sort']['enemy'] = cs_sort('wars', 'list', $start, $squads_id, 3, $sort); $data['sort']['category'] = cs_sort('wars', 'list', $start, $squads_id, 5, $sort); $select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.wars_status AS status, war.clans_id AS clans_id, cln.clans_short AS clans_short, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id'; $from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id '; $from .= 'INNER JOIN {pre}_clans cln ON war.clans_id = cln.clans_id '; $cs_wars = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $data['wars'] = ''; $count_wars = count($cs_wars); for ($run = 0; $run < $count_wars; $run++) { $data['wars'][$run]['gameicon'] = cs_html_img('uploads/games/' . $cs_wars[$run]['games_id'] . '.gif'); $data['wars'][$run]['date'] = cs_date('unix', $cs_wars[$run]['wars_date']); $data['wars'][$run]['enemyurl'] = cs_url('clans', 'view', 'id=' . $cs_wars[$run]['clans_id']); $data['wars'][$run]['enemy'] = cs_secure($cs_wars[$run]['clans_short']); $data['wars'][$run]['caturl'] = cs_url('categories', 'view', 'id=' . $cs_wars[$run]['categories_id']); $data['wars'][$run]['category'] = cs_secure($cs_wars[$run]['categories_name']); $data['wars'][$run]['url'] = cs_url('wars', 'view', 'id=' . $cs_wars[$run]['wars_id']); $data['wars'][$run]['result'] = $cs_wars[$run]['wars_score1'] . ' : ' . $cs_wars[$run]['wars_score2']; $data['wars'][$run]['if']['upcoming'] = $cs_wars[$run]['status'] == 'upcoming' ? true : false; $data['wars'][$run]['if']['played'] = $cs_wars[$run]['status'] == 'played' ? true : false; $data['wars'][$run]['if']['running'] = $cs_wars[$run]['status'] == 'running' ? true : false; $data['wars'][$run]['if']['canceled'] = $cs_wars[$run]['status'] == 'canceled' ? true : false; $result = $cs_wars[$run]['wars_score1'] - $cs_wars[$run]['wars_score2']; $icon = $result >= 1 ? 'green' : 'red'; $icon = !empty($result) ? $icon : 'grey'; $data['wars'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon . '.gif'); } echo cs_subtemplate(__FILE__, $data, 'wars', 'list');
$gbook[$run]['icon_icq'] = empty($icq) ? '' : cs_html_link("http://www.icq.com/{$icq}", cs_icon('licq')); $jabber = cs_secure($cs_gbook[$run]['users_jabber']); if (in_array('users_jabber', $hidden)) { $jabber = empty($allow) ? '' : $jabber; } $gbook[$run]['icon_jabber'] = empty($jabber) ? '' : cs_html_jabbermail($jabber, cs_icon('jabber_protocol')); $skype = cs_secure($cs_gbook[$run]['users_skype']); $url = 'http://mystatus.skype.com/smallicon/' . $skype; $skype = cs_html_link('skype:' . $cs_gbook[$run]['users_skype'] . '?userinfo', cs_html_img($url, '16', '16', '0', 'Skype'), '0'); if (in_array('users_skype', $hidden)) { $skype = empty($allow) ? '' : $skype; } $gbook[$run]['icon_skype'] = empty($cs_gbook[$run]['users_skype']) ? '' : $skype; $url = cs_secure($cs_gbook[$run]['users_url']); if (in_array('users_url', $hidden)) { $url = empty($allow) ? '' : $url; } $gbook[$run]['icon_url'] = empty($url) ? '' : cs_html_link("http://{$url}", cs_icon('gohome')); } $gbook[$run]['text'] = cs_secure($cs_gbook[$run]['gbook_text'], 1, 1); $gbook[$run]['time'] = cs_date('unix', $cs_gbook[$run]['gbook_time'], 1); if ($cs_gbook[$run]['gbook_lock'] == 0) { $gbook[$run]['class'] = 'notpublic'; $gbook[$run]['de_activate'] = cs_link(cs_icon('submit'), 'gbook', 'center', 'unhide=' . $cs_gbook[$run]['gbook_id'], 0, $cs_lang['unhide']); } else { $gbook[$run]['class'] = ''; $gbook[$run]['de_activate'] = cs_link(cs_icon('editcut'), 'gbook', 'center', 'hide=' . $cs_gbook[$run]['gbook_id'], 0, $cs_lang['hide']); } } $data['gbook'] = !empty($gbook) ? $gbook : ''; echo cs_subtemplate(__FILE__, $data, 'gbook', 'center');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('rules'); $cs_get = cs_get('id'); $data = array(); $categories_id = empty($cs_get['id']) ? 0 : $cs_get['id']; $where = "categories_id = '" . $categories_id . "' AND categories_access <= '" . $account['access_rules'] . "'"; $data['cat_data'] = cs_sql_select(__FILE__, 'categories', 'categories_name, categories_text', $where, 0, 0); if (isset($data['cat_data']['name'])) { $data['cat_data']['name'] = cs_secure($data['cat_data']['categories_name']); $data['cat_data']['text'] = cs_secure($data['cat_data']['categories_text'], 1); } else { $data['cat_data']['name'] = ''; $data['cat_data']['text'] = ''; } $select = 'rules_order, rules_title, rules_rule'; $data['rules'] = cs_sql_select(__FILE__, 'rules', $select, "categories_id = '" . $categories_id . "'", 'rules_order ASC', 0, 0); $rules_loop1 = count($data['rules']); for ($run = 0; $run < $rules_loop1; $run++) { $data['rules'][$run]['order'] = cs_secure($data['rules'][$run]['rules_order']); $data['rules'][$run]['title'] = cs_secure($data['rules'][$run]['rules_title']); $data['rules'][$run]['rule'] = cs_secure($data['rules'][$run]['rules_rule'], 1); } echo cs_subtemplate(__FILE__, $data, 'rules', 'listcat');
if ($data['match']['squad1_id'] == CS_CUPS_TEAM_UNKNOWN || $data['match']['squad2_id'] == CS_CUPS_TEAM_UNKNOWN) { echo $cs_lang['edit_denied']; return; } if ($system['cups_system'] == CS_CUPS_TYPE_TEAMS) { $data['match']['team1_id'] = $data['match']['squad1_id']; $data['match']['team2_id'] = $data['match']['squad2_id']; if (empty($data['match']['squad1_id'])) { $data['match']['team1_name'] = $cs_lang['bye']; } else { $data['match']['team1_name'] = empty($data['match']['squad1_name']) ? '? ID:' . $data['match']['squad1_id'] : cs_secure($data['match']['squad1_name']); } if (empty($data['match']['squad2_id'])) { $data['match']['team2_name'] = $cs_lang['bye']; } else { $data['match']['team2_name'] = empty($data['match']['squad2_name']) ? '? ID:' . $data['match']['squad2_id'] : cs_secure($data['match']['squad2_name']); } } else { $data['match']['team1_id'] = $data['match']['squad1_id']; $data['match']['team2_id'] = $data['match']['squad2_id']; if (empty($data['match']['squad1_id'])) { $data['match']['team1_name'] = $cs_lang['bye']; } else { $data['match']['team1_name'] = $data['match']['user1_nick']; } if (empty($data['match']['squad2_id'])) { $data['match']['team2_name'] = $cs_lang['bye']; } else { $data['match']['team2_name'] = $data['match']['user2_nick']; } }
$cs_buddys = cs_sql_select(__FILE__, 'buddys', $cells, "buddys_id = '" . $buddys_id . "'"); } if (isset($_POST['preview'])) { $data['if']['preview'] = TRUE; $data['if']['form'] = TRUE; $data['if']['done'] = FALSE; $data['edit']['buddys_notice'] = cs_secure($cs_buddys['buddys_notice'], 1, 1); $data['edit']['id'] = $buddys_id; } if (isset($_POST['preview']) or !isset($_POST['submit'])) { if (!isset($_POST['preview'])) { $data['if']['preview'] = FALSE; $data['if']['form'] = TRUE; $data['if']['done'] = FALSE; } $data['edit']['abcode_smileys'] = cs_abcode_smileys('buddys_notice'); $data['edit']['abcode_features'] = cs_abcode_features('buddys_notice'); $data['edit']['buddys_notice'] = cs_secure($cs_buddys['buddys_notice']); $data['edit']['id'] = $buddys_id; } else { $buddys_id = $_POST['id']; settype($buddys_id, 'integer'); $data['if']['preview'] = FALSE; $data['if']['form'] = FALSE; $data['if']['done'] = TRUE; $buddys_cells = array_keys($cs_buddys); $buddys_save = array_values($cs_buddys); cs_sql_update(__FILE__, 'buddys', $buddys_cells, $buddys_save, $buddys_id); cs_redirect($cs_lang['changes_done'], 'buddys', 'center'); } echo cs_subtemplate(__FILE__, $data, 'buddys', 'edit');
} $wars['war']['report'] = empty($cs_wars['wars_report']) ? '-' : cs_secure($cs_wars['wars_report'], 1, 1); $wars['war']['report2'] = empty($cs_wars['wars_report2']) ? '-' : cs_secure($cs_wars['wars_report2'], 1, 1); $tables2 = 'rounds rnd INNER JOIN {pre}_maps mps ON rnd.maps_id = mps.maps_id'; $cells2 = 'rnd.rounds_score1 AS rounds_score1, rnd.rounds_score2 AS rounds_score2, ' . 'rnd.rounds_description AS rounds_description, mps.maps_name AS maps_name, ' . 'rnd.maps_id AS maps_id'; $wars['rounds'] = cs_sql_select(__FILE__, $tables2, $cells2, 'rnd.wars_id = \'' . $wars_id . '\'', 'rnd.rounds_order ASC', 0, 0); if (!empty($wars['rounds'])) { $count_rounds = count($wars['rounds']); for ($run = 0; $run < $count_rounds; $run++) { $wars['rounds'][$run]['mapurl'] = cs_url('maps', 'view', 'id=' . $wars['rounds'][$run]['maps_id']); $wars['rounds'][$run]['maps_name'] = cs_secure($wars['rounds'][$run]['maps_name']); $result2 = $wars['rounds'][$run]['rounds_score1'] - $wars['rounds'][$run]['rounds_score2']; $icon2 = $result2 >= 1 ? 'green' : 'red'; $icon2 = !empty($result2) ? $icon2 : 'grey'; $wars['rounds'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon2 . '.gif'); $wars['rounds'][$run]['rounds_description'] = cs_secure($wars['rounds'][$run]['rounds_description'], 1, 1); } } else { $wars['rounds'] = array(); } if ($wars_status == 'upcoming') { $condition = 'users_id = \'' . $account['users_id'] . '\' AND squads_id = \'' . $cs_squad['squads_id'] . '\''; $squadmember = cs_sql_count(__FILE__, 'members', $condition); $wars_access = empty($account['access_wars']) ? 0 : $account['access_wars']; if (!empty($squadmember) or $wars_access >= 3) { $wars['if']['squadmember'] = TRUE; $wars['if']['no_players'] = FALSE; $wars['if']['status'] = FALSE; $tables = 'players ply INNER JOIN {pre}_users usr ON ply.users_id = usr.users_id'; $cells = 'ply.users_id AS users_id, ply.players_status AS players_status, ' . 'ply.players_time AS players_time, usr.users_nick AS users_nick, usr.users_active AS users_active'; $nplayers = cs_sql_select(__FILE__, $tables, $cells, 'ply.wars_id = \'' . $wars_id . '\'', 'ply.players_status DESC', 0, 0);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('links'); $data = array(); $links_count = cs_sql_count(__FILE__, 'links', 'links_sponsor = 1'); $data['head']['body'] = sprintf($cs_lang['all1'], $links_count); $select = 'links_name, links_url, links_banner, links_info'; $data['links'] = cs_sql_select(__FILE__, 'links', $select, 'links_sponsor = 1', 0, 0, 0); $links_loop = count($data['links']); for ($run = 0; $run < $links_loop; $run++) { $data['links'][$run]['name'] = cs_secure($data['links'][$run]['links_name']); $target = 'http://' . $data['links'][$run]['links_url']; $data['links'][$run]['url_img'] = cs_html_link($target, $data['links'][$run]['links_url']); if (!empty($data['links'][$run]['links_banner'])) { $place = 'uploads/links/' . $data['links'][$run]['links_banner']; $img = cs_html_img($place, 0, 0, 0, $data['links'][$run]['links_name']); $data['links'][$run]['url_img'] = cs_html_link($target, $img); } $data['links'][$run]['info'] = cs_secure($data['links'][$run]['links_info'], 1, 1, 1, 1); } echo cs_subtemplate(__FILE__, $data, 'links', 'sponsors');
$cs_computers['computers_memory'] = ''; $cs_computers['computers_processors'] = ''; $cs_computers['computers_graphics'] = ''; $cs_computers['computers_sounds'] = ''; $cs_computers['computers_harddisks'] = ''; $cs_computers['computers_drives'] = ''; $cs_computers['computers_screens'] = ''; $cs_computers['computers_interfaces'] = ''; $cs_computers['computers_networks'] = ''; $cs_computers['computers_more'] = ''; } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_create']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { foreach ($cs_computers as $key => $value) { $data['com'][$key] = cs_secure($value); } $data['com']['referer'] = empty($_SERVER['HTTP_REFERER']) ? 'center' : $_SERVER['HTTP_REFERER']; echo cs_subtemplate(__FILE__, $data, 'computers', 'create'); } else { $cs_computers['computers_since'] = cs_time(); $computers_cells = array_keys($cs_computers); $computers_save = array_values($cs_computers); cs_sql_insert(__FILE__, 'computers', $computers_cells, $computers_save); #$referrer = strpos($_POST['referer'],'manage') === false ? 'center' : 'manage'; $referrer = $account['access_computers'] < 3 ? 'center' : 'manage'; cs_redirect($cs_lang['create_done'], 'computers', $referrer); }
$data['head']['mod'] = $cs_lang[$op_squads['label'] . 's']; $data['lang']['new_label'] = $cs_lang['new_' . $op_squads['label']]; $data['head']['count'] = $squads_count; $data['head']['pages'] = cs_pages('squads', 'center', $squads_count, $start, 0, $sort); $data['head']['getmsg'] = cs_getmsg(); $data['lang']['join_label'] = $cs_lang['join_' . $op_squads['label']]; if (!empty($squads_count)) { $data['if']['squad_to_leave'] = TRUE; $data['lang']['leave_label'] = $cs_lang['leave_' . $op_squads['label']]; } $data['sort']['squad_name'] = cs_sort('squads', 'center', $start, 0, 1, $sort); $data['lang']['label'] = $cs_lang[$op_squads['label']]; $data['sort']['members_task'] = cs_sort('squads', 'center', $start, 0, 3, $sort); $select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id, mem.members_task AS members_task, mem.members_admin AS members_admin'; $from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id'; $where = "mem.users_id = '" . $account['users_id'] . "'"; $data['squads'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $squads_loop = count($data['squads']); for ($run = 0; $run < $squads_loop; $run++) { $data['squads'][$run]['id'] = $data['squads'][$run]['squads_id']; $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']); $data['squads'][$run]['members_task'] = cs_secure($data['squads'][$run]['members_task']); if (!empty($data['squads'][$run]['members_admin'])) { $data['squads'][$run]['if']['squad_admin'] = TRUE; $data['squads'][$run]['if']['no_squad_admin'] = FALSE; } else { $data['squads'][$run]['if']['squad_admin'] = FALSE; $data['squads'][$run]['if']['no_squad_admin'] = TRUE; } } echo cs_subtemplate(__FILE__, $data, 'squads', 'center');
$data['folders']['select'] = make_folders_select('folders_id', $edit['folders_id'], $account['users_id'], 'usersgallery'); $data['access']['options'] = ''; $levels = 0; while ($levels < 6) { $edit['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $data['status']['options'] = ''; $levels = 0; while ($levels < 2) { $edit['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0); $data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel); $levels++; } $data['abcode']['smileys'] = cs_abcode_smileys('gallery_description'); $data['abcode']['features'] = cs_abcode_features('gallery_description'); $checked = 'checked="checked"'; $data['check']['newtime'] = empty($new_time) ? '' : $checked; $data['check']['count'] = empty($gallery_count_reset) ? '' : $checked; $data['hidden']['id'] = $gallery_id; $data['data']['usersgallery_name'] = cs_secure($data['data']['usersgallery_name']); $data['data']['usersgallery_titel'] = cs_secure($data['data']['usersgallery_titel']); $data['data']['usersgallery_description'] = cs_secure($data['data']['usersgallery_description']); echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'users_edit'); } else { $cells = array_keys($edit); $save = array_values($edit); cs_sql_update(__FILE__, 'usersgallery', $cells, $save, $gallery_id); cs_redirect($cs_lang['changes_done'], 'usersgallery', 'center'); }
if (!empty($account['users_id']) and $thread['threads_last_time'] > $cs_readtime and $thread['threads_last_time'] > $thread['read_since']) { $icon .= 'unread_'; } if (!empty($thread['threads_close'])) { $icon .= 'close_'; } if ($thread['threads_important']) { $icon .= 'important_'; } $data['threads'][$run]['icon'] = cs_html_img('symbols/board/' . $icon . '.png'); if (!empty($thread['threads_important'])) { $data['threads'][$run]['important'] = $cs_lang['important'] . ' '; } else { $data['threads'][$run]['important'] = ''; } $headline = cs_secure($thread['threads_headline']); $data['threads'][$run]['headline'] = cs_link($headline, 'board', 'thread', 'where=' . $thread['threads_id']); if ($thread['threads_comments'] > $account['users_limit']) { $data['threads'][$run]['pages'] = cs_html_br(1); $data['threads'][$run]['pages'] .= $cs_lang['page'] . ' '; $data['threads'][$run]['pages'] .= cs_pages('board', 'thread', $thread['threads_comments'], 0, $thread['threads_id'], 0, 0, 1); } else { $data['threads'][$run]['pages'] = ''; } $data['threads'][$run]['comments'] = $thread['threads_comments']; $data['threads'][$run]['view'] = $thread['threads_view']; if (!empty($thread['threads_last_time'])) { $date = cs_date('unix', $thread['threads_last_time'], 1); $comments = $thread['threads_comments'] == 0 ? 0 : $thread['threads_comments'] - 1; $goto = floor($comments / $account['users_limit']) * $account['users_limit']; $goto .= '#com' . $thread['threads_comments'];
$cs_news['news_close'] = isset($_POST['news_close']) ? $_POST['news_close'] : 0; $cs_news['news_public'] = isset($_POST['news_public']) ? $_POST['news_public'] : 0; $cs_news['news_attached'] = isset($_POST['news_attached']) ? $_POST['news_attached'] : 0; $cs_news['news_headline'] = $_POST['news_headline']; $cs_news['news_time'] = cs_time(); $cs_news['news_publishs_at'] = isset($_POST['publish_at']) ? cs_datepost('date', 'unix') : 0; $cs_news['news_readmore_active'] = isset($_POST['news_readmore_active']) ? $_POST['news_readmore_active'] : 0; $cs_news['news_text'] = empty($cs_main['rte_html']) ? $_POST['news_text'] : cs_abcode_inhtml($_POST['news_text'], 'add'); $cs_news['news_readmore'] = empty($cs_main['rte_html']) ? $_POST['news_readmore'] : cs_abcode_inhtml($_POST['news_readmore'], 'add'); $_POST['run_loop']++; } if (!empty($error) or isset($_POST['preview']) or !isset($_POST['submit'])) { $data['categories']['dropdown'] = cs_categories_dropdown('news', $cs_news['categories_id']); $data['news']['news_headline'] = cs_secure($cs_news['news_headline']); $data['news']['news_text'] = cs_secure($cs_news['news_text']); $data['news']['news_readmore'] = cs_secure($cs_news['news_readmore']); if (isset($_POST['mirror'])) { $run_loop = isset($_POST['run_loop']) ? $_POST['run_loop'] : 1; } else { $temp_mirror = explode("\n", $cs_news['news_mirror']); $temp_mirror_name = explode("\n", $cs_news['news_mirror_name']); $run_loop = count($temp_mirror); } $tpl_run = 0; $run = empty($cs_news['news_mirror']) ? 0 : 1; for ($run; $run < $run_loop; $run++) { $num = empty($cs_news['news_mirror']) ? $run + 1 : $run; if (isset($_POST['mirror'])) { $cs_news["news_mirror_{$num}"] = isset($_POST["news_mirror_{$num}"]) ? $_POST["news_mirror_{$num}"] : ''; $cs_news["news_mirror_name_{$num}"] = isset($_POST["news_mirror_name_{$num}"]) ? $_POST["news_mirror_name_{$num}"] : ''; } else {
$allow = $members[$run]['users_id'] == $account['users_id'] or $account['access_users'] > 4 ? 1 : 0; if (empty($members[$run]['users_picture'])) { $members[$run]['picture'] = $cs_lang['nopic']; } else { $place = 'uploads/users/' . $members[$run]['users_picture']; $size = getimagesize($cs_main['def_path'] . '/' . $place); $members[$run]['picture'] = cs_html_img($place, $size[1], $size[0]); } $url = 'symbols/countries/' . $members[$run]['users_country'] . '.png'; $members[$run]['country'] = cs_html_img($url, 11, 16) . ' '; $members[$run]['nick'] = $data['squads'][$sq_run]['clans_tagpos'] == 1 ? $data['squads'][$sq_run]['clans_tag'] . ' ' : ''; $members[$run]['nick'] .= cs_user($members[$run]['users_id'], $members[$run]['users_nick'], $members[$run]['users_active'], $members[$run]['users_delete']); $members[$run]['nick'] .= $data['squads'][$sq_run]['clans_tagpos'] == 2 ? ' ' . $data['squads'][$sq_run]['clans_tag'] : ''; $users_name = !in_array('users_name', $hidden) || !empty($allow) ? $members[$run]['users_name'] : ''; $users_surname = !in_array('users_surname', $hidden) || !empty($allow) ? $members[$run]['users_surname'] : ''; $members[$run]['surname'] = empty($users_name) && empty($users_surname) ? ' - ' : $users_name . ' ' . $users_surname; $members[$run]['task'] = cs_secure($members[$run]['members_task']); $since = empty($members[$run]['members_since']) ? '-' : cs_date('date', $members[$run]['members_since']); $members[$run]['since'] = $since; $tr++; $members[$run]['if']['td'] = FALSE; $members[$run]['if']['end_row'] = FALSE; if ($tr % 2 != 0 && $tr == $members_loop) { $members[$run]['if']['td'] = TRUE; } elseif ($tr % 2 == 0 && $tr != $members_loop) { $members[$run]['if']['end_row'] = TRUE; } $data['squads'][$sq_run]['members'] = $members; } } echo cs_subtemplate(__FILE__, $data, 'members', 'pictured');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'boardreport_time DESC'; $cs_sort[2] = 'boardreport_time ASC'; $cs_sort[3] = 'boardreport_done DESC, boardreport_time DESC'; $cs_sort[4] = 'boardreport_done ASC, boardreport_time DESC'; $cs_sort[5] = 'threads_headline DESC'; $cs_sort[6] = 'boardreport_time ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $data['lang']['getmsg'] = cs_getmsg(); $data['head']['boardreport_count'] = cs_sql_count(__FILE__, 'boardreport'); $data['head']['pages'] = cs_pages('board', 'reportlist', $data['head']['boardreport_count'], $start, 0, $sort); $data['sort']['boardreport_time'] = cs_sort('board', 'reportlist', $start, 0, 1, $sort); $data['sort']['boardreport_done'] = cs_sort('board', 'reportlist', $start, 0, 3, $sort); $data['sort']['threads_headline'] = cs_sort('board', 'reportlist', $start, 0, 5, $sort); $from = 'boardreport bdr INNER JOIN {pre}_threads thr ON bdr.threads_id = thr.threads_id'; $select = 'bdr.boardreport_time AS boardreport_time, bdr.boardreport_done AS boardreport_done, bdr.threads_id AS threads_id, thr.threads_headline AS threads_headline, bdr.comments_id AS comments_id'; $cs_report = cs_sql_select(__FILE__, $from, $select, 0, $order, $start, $account['users_limit']); $report_loop = count($cs_report); $data['boardreport'] = array(); for ($run = 0; $run < $report_loop; $run++) { $data['boardreport'][$run]['boardreport_time'] = cs_date('date', $cs_report[$run]['boardreport_time'], 1); $data['boardreport'][$run]['boardreport_done'] = empty($cs_report[$run]['boardreport_done']) ? $cs_lang['no'] : $cs_lang['yes']; $headline = cs_secure($cs_report[$run]['threads_headline']); // $comments_count = empty($cs_report[$run]['comments_id']) ? 0 : cs_sql_count(__FILE__,'comments',"comments_mod = 'board' AND comments_fid = '" . $cs_report[$run]['threads_id'] . "'"); // $goto = floor($comments_count / $account['users_limit']) * $account['users_limit'] . '#com' . $comments_count; $link = cs_link($headline, 'board', 'thread', 'where=' . $cs_report[$run]['threads_id']); // . '&start=' . $goto); $data['boardreport'][$run]['threads_headline'] = $link . ' #' . $cs_report[$run]['comments_id']; } echo cs_subtemplate(__FILE__, $data, 'board', 'reportlist');
<?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'); } }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('banners'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'banners_name DESC'; $cs_sort[2] = 'banners_name ASC'; $cs_sort[3] = 'banners_order DESC'; $cs_sort[4] = 'banners_order ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $banners_count = cs_sql_count(__FILE__, 'banners'); $data['count']['all'] = $banners_count; $data['pages']['list'] = cs_pages('banners', 'manage', $banners_count, $start, 0, $sort); $data['lang']['getmsg'] = cs_getmsg(); $select = 'banners_id, banners_name, banners_order'; $cs_banners = cs_sql_select(__FILE__, 'banners', $select, 0, $order, $start, $account['users_limit']); $banners_loop = count($cs_banners); $data['sort']['name'] = cs_sort('banners', 'manage', $start, 0, 1, $sort); $data['sort']['order'] = cs_sort('banners', 'manage', $start, 0, 3, $sort); if (empty($banners_loop)) { $data['banners'] = ''; } for ($run = 0; $run < $banners_loop; $run++) { $data['banners'][$run]['name'] = cs_secure($cs_banners[$run]['banners_name']); $data['banners'][$run]['order'] = cs_secure($cs_banners[$run]['banners_order']); $data['banners'][$run]['edit'] = cs_url('banners', 'edit', 'id=' . $cs_banners[$run]['banners_id']); $data['banners'][$run]['remove'] = cs_url('banners', 'remove', 'id=' . $cs_banners[$run]['banners_id']); } echo cs_subtemplate(__FILE__, $data, 'banners', 'manage');
// 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');
<?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'); }
$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']); } echo cs_subtemplate(__FILE__, $data, 'history', 'create'); } else {
<?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');
$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']); $deactive = cs_link(cs_icon('submit'), 'gbook', 'manage', 'deactive=' . $cs_gbook[$run]['gbook_id'] . '&user_gb=' . $user_gb, 0, $cs_lang['deactive']); } $gbook[$run]['lock'] = empty($cs_gbook[$run]['gbook_lock']) ? $active : $deactive; $gbook[$run]['id'] = $cs_gbook[$run]['gbook_id']; $gbook[$run]['ip'] = ''; if ($account['access_gbook'] >= 4) { $ip = $cs_gbook[$run]['gbook_ip']; if ($account['access_gbook'] == 4) {
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'games_name DESC'; $cs_sort[2] = 'games_name ASC'; $cs_sort[3] = 'games_usk DESC'; $cs_sort[4] = 'games_usk ASC'; $sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $games_count = cs_sql_count(__FILE__, 'games'); $data['lang']['body'] = sprintf($cs_lang['all'], $games_count); $data['pages']['list'] = cs_pages('games', 'list', $games_count, $start, 0, $sort); $cs_games = cs_sql_select(__FILE__, 'games', '*', 0, $order, $start, $account['users_limit']); $games_loop = count($cs_games); $data['sort']['name'] = cs_sort('games', 'list', $start, 0, 1, $sort); $data['sort']['usk'] = cs_sort('games', 'list', $start, 0, 3, $sort); if (empty($games_loop)) { $data['games'] = ''; } for ($run = 0; $run < $games_loop; $run++) { $data['games'][$run]['name'] = cs_link($cs_games[$run]['games_name'], 'games', 'view', 'id=' . $cs_games[$run]['games_id']); $games_genre = cs_sql_select(__FILE__, 'categories', '*', "categories_id = '" . $cs_games[$run]['categories_id'] . "'"); $data['games'][$run]['genre'] = cs_secure($games_genre['categories_name']); $data['games'][$run]['usk'] = cs_secure($cs_games[$run]['games_usk']); $data['games'][$run]['release'] = empty($cs_games[$run]['games_released']) ? $since2 = '-' : ($since2 = cs_date('date', $cs_games[$run]['games_released'])); } echo cs_subtemplate(__FILE__, $data, 'games', 'list');
<?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'); }
} else { $data['select']['next'] = ''; } $el_id = 'country_1'; $onc = "document.getElementById('" . $el_id . "').src='" . $cs_main['php_self']['dirname'] . "symbols/countries/' + this.form."; $onc .= "clans_country.options[this.form.clans_country.selectedIndex].value + '.png'"; $data['clans']['country'] = cs_html_select(1, 'clans_country', "onchange=\"" . $onc . "\""); include_once 'lang/' . $account['users_lang'] . '/countries.php'; foreach ($cs_country as $short => $full) { $short == $cs_clans['clans_country'] ? $sel = 1 : ($sel = 0); $data['clans']['country'] .= cs_html_option($full, $short, $sel); } $data['clans']['country'] .= cs_html_select(0) . ' ' . cs_html_img('symbols/countries/' . $cs_clans['clans_country'] . '.png', 11, 16, 'id="' . $el_id . '"'); $data['clans']['url'] = cs_secure($cs_clans['clans_url']); $data['clans']['since'] = cs_dateselect('since', 'date', $cs_clans['clans_since']); $data['clans']['password'] = cs_secure($cs_clans['clans_pwd']); $data['users']['nick'] = $users_nick; if (empty($cs_clans['clans_picture'])) { $data['clans']['pic'] = $cs_lang['nopic']; } else { $place = 'uploads/clans/' . $cs_clans['clans_picture']; $size = getimagesize($cs_main['def_path'] . '/' . $place); $data['clans']['pic'] = cs_html_img($place, $size[1], $size[0]); } $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $op_clans['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $op_clans['max_height'] . ' px' . cs_html_br(1);