function cs_description_pack() { if(!isset($GLOBALS['cs_pack_actuel'])) return ''; return debut_cadre_relief('', true) . "<h3 class='titrem'><img src='"._DIR_IMG_PACK."puce-verte.gif' width='9' height='9' alt='-' /> " . _T('couteauprive:pack_titre') . '</h3>' . ((strlen($temp = cs_action_rapide('pack')))?"<div class='cs_action_rapide' id='cs_action_rapide'>$temp</div>":'') . propre(_T('couteauprive:pack_descrip', array('pack'=> _T('couteauprive:pack_actuel', array('date'=>cs_date())))) . "\n\n" . _T('couteauprive:contrib', array('url'=>'[->'._URL_CONTRIB.'2552]'))) . '<br/><textarea rows=40 cols=500 style="width:100%; font-size:90%;">'.htmlentities($GLOBALS[cs_pack_actuel], ENT_QUOTES, $GLOBALS['meta']['charset']).'</textarea>' . fin_cadre_relief(true); }
function pack_sauve_pack_action() { // pour inserer un pack de config dans config/mes_options.php $titre0 = $titre = _T('couteauprive:pack_actuel', array('date'=>cs_date())); $n=0; if(isset($GLOBALS['cs_installer'][$titre])) while(isset($GLOBALS['cs_installer']["$titre (".++$n.')'])); if($n) $titre = "$titre ($n)"; include_spip(_DIR_CS_TMP.'config'); $fct = md5($titre.time()); $config = $GLOBALS['cs_installer'][$titre0]; if(function_exists($config)) $config = $config(); $pack = "\n# Le Couteau Suisse : pack de configuration du ".date("d M Y, H:i:s")."\n\$GLOBALS['cs_installer']['$titre'] = 'cs_$fct'; function cs_$fct() { return " . var_export($config, true) . ";\n} # $titre #\n"; cs_ecrire_config(',\?'.'>\s*$,m', $pack.'?'.'>', $pack); }
$cs_sort[1] = 'articles_headline DESC'; $cs_sort[2] = 'articles_headline ASC'; $cs_sort[3] = 'articles_time DESC'; $cs_sort[4] = 'articles_time ASC'; $sort = empty($_REQUEST['sort']) ? 3 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $articles_count = cs_sql_count(__FILE__, 'articles'); $data['head']['articles_count'] = $articles_count; $data['head']['pages'] = cs_pages('articles', 'manage', $articles_count, $start, $categories_id, $sort); $catmod = "categories_mod = 'articles'"; $cells = 'categories_name, categories_id'; $categories_data = cs_sql_select(__FILE__, 'categories', $cells, $catmod, 'categories_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('categories_id', 'categories_name', $categories_data, $categories_id); $data['head']['message'] = cs_getmsg(); $cat_where = empty($categories_id) ? 0 : 'categories_id = ' . (int) $categories_id; $cells = 'articles_headline, articles_id, articles_time, users_id'; $cs_articles = cs_sql_select(__FILE__, 'articles', $cells, $cat_where, $order, $start, $account['users_limit']); $articles_loop = count($cs_articles); $data['sort']['headline'] = cs_sort('articles', 'manage', $start, $categories_id, 1, $sort); $data['sort']['date'] = cs_sort('articles', 'manage', $start, $categories_id, 3, $sort); for ($run = 0; $run < $articles_loop; $run++) { $id = $cs_articles[$run]['articles_id']; $cs_articles[$run]['articles_headline'] = cs_link($cs_articles[$run]['articles_headline'], 'articles', 'view', 'id=' . $id); $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', "users_id = '" . $cs_articles[$run]['users_id'] . "'"); $cs_articles[$run]['users_link'] = cs_user($cs_articles[$run]['users_id'], $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']); $cs_articles[$run]['articles_date'] = cs_date('unix', $cs_articles[$run]['articles_time'], 1); $cs_articles[$run]['url_edit'] = cs_url('articles', 'edit', 'id=' . $id); $cs_articles[$run]['url_remove'] = cs_url('articles', 'remove', 'id=' . $id); } $data['articles'] = $cs_articles; echo cs_subtemplate(__FILE__, $data, 'articles', 'manage');
$data['clans']['img'] = cs_html_img($place, $size[1], $size[0]); } $data['clans']['short'] = cs_secure($cs_clan['clans_short']); if (!empty($cs_clan['clans_country'])) { include_once 'lang/' . $account['users_lang'] . '/countries.php'; $data['clans']['country'] = cs_html_img('symbols/countries/' . $cs_clan['clans_country'] . '.png', 11, 16) . ' ' . $cs_country[$cs_clan['clans_country']]; } else { $data['clans']['country'] = '-'; } if (!empty($cs_clan['clans_url'])) { $data['clans']['url'] = cs_html_link('http://' . $cs_clan['clans_url'], cs_secure($cs_clan['clans_url'])); } else { $data['clans']['url'] = ''; } if (!empty($cs_clan['clans_since'])) { $content = cs_date('date', $cs_clan['clans_since']); $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 . "'";
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; }
$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');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('count'); $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $cs_sort[1] = 'count_time DESC'; $cs_sort[2] = 'count_time ASC'; $cs_sort[3] = 'count_id DESC'; $cs_sort[4] = 'count_id ASC'; $sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $counter_count = cs_sql_count(__FILE__, 'count'); $data = array(); $data['head']['counter_count'] = $counter_count; $data['head']['counter_pages'] = cs_pages('count', 'manage', $counter_count, $start); $data['head']['message'] = cs_getmsg(); $data['sort']['count_time'] = cs_sort('count', 'manage', $start, 0, 1, $sort); $data['sort']['count_id'] = cs_sort('count', 'manage', $start, 0, 3, $sort); $cs_counter = cs_sql_select(__FILE__, 'count', '*', 0, $order, $start, $account['users_limit']); $count_loop = count($cs_counter); $data['count'] = array(); for ($run = 0; $run < $count_loop; $run++) { $data['count'][$run]['count_id'] = $cs_counter[$run]['count_id']; $data['count'][$run]['count_ip'] = $cs_counter[$run]['count_ip']; $data['count'][$run]['count_locate'] = $cs_counter[$run]['count_location']; $data['count'][$run]['count_time'] = cs_date('unix', $cs_counter[$run]['count_time'], 1); } echo cs_subtemplate(__FILE__, $data, 'count', 'manage');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); $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('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'); }
if (!empty($surname) and !empty($name)) { $data['eventguests'][$run]['name'] = $surname . ', ' . $name; } elseif (!empty($surname) or !empty($name)) { $data['eventguests'][$run]['name'] = $surname . $name; } else { $data['eventguests'][$run]['name'] = ''; } if (empty($cs_eventguests[$run]['eventguests_phone'])) { if (in_array('users_phone', $hidden)) { $cs_eventguests[$run]['eventguests_phone'] = empty($allow) ? '' : cs_html_italic(1) . $cs_eventguests[$run]['users_phone'] . cs_html_italic(0); } elseif (!empty($allow)) { $cs_eventguests[$run]['eventguests_phone'] = $cs_eventguests[$run]['users_phone']; } } if (empty($cs_eventguests[$run]['eventguests_mobile'])) { if (in_array('users_mobile', $hidden)) { $cs_eventguests[$run]['eventguests_mobile'] = empty($allow) ? '' : cs_html_italic(1) . $cs_eventguests[$run]['users_mobile'] . cs_html_italic(0); } elseif (!empty($allow)) { $cs_eventguests[$run]['eventguests_mobile'] = $cs_eventguests[$run]['users_mobile']; } } $data['eventguests'][$run]['user'] = empty($cs_eventguests[$run]['users_id']) ? '-' : cs_user($cs_eventguests[$run]['users_id'], $cs_eventguests[$run]['users_nick'], $cs_eventguests[$run]['users_active'], $cs_eventguests[$run]['users_delete']); $data['eventguests'][$run]['since'] = cs_date('unix', $cs_eventguests[$run]['eventguests_since']); $data['eventguests'][$run]['phone'] = empty($cs_eventguests[$run]['eventguests_phone']) ? ' ' : cs_html_img('symbols/' . $cs_main['img_path'] . '/16/linphone.' . $cs_main['img_ext'], 16, 16, 'title="' . $cs_eventguests[$run]['eventguests_phone'] . '"'); $data['eventguests'][$run]['mobile'] = empty($cs_eventguests[$run]['eventguests_mobile']) ? ' ' : cs_html_img('symbols/' . $cs_main['img_path'] . '/16/sms_protocol.' . $cs_main['img_ext'], 16, 16, 'title="' . $cs_eventguests[$run]['eventguests_mobile'] . '"'); $data['eventguests'][$run]['status'] = $cs_lang['status_' . $cs_eventguests[$run]['eventguests_status']]; $data['eventguests'][$run]['notice'] = empty($cs_eventguests[$run]['eventguests_notice']) ? ' ' : cs_icon('txt', 16, $cs_lang['notice']); $data['eventguests'][$run]['edit'] = cs_link(cs_icon('edit', 16, $cs_lang['edit']), 'events', 'guestsadm', 'id=' . $cs_eventguests[$run]['eventguests_id'], 0, $cs_lang['edit']); $data['eventguests'][$run]['remove'] = cs_link(cs_icon('editdelete', 16, $cs_lang['remove']), 'events', 'guestsdel', 'id=' . $cs_eventguests[$run]['eventguests_id'], 0, $cs_lang['remove']); } echo cs_subtemplate(__FILE__, $data, 'events', 'guests');
$cs_news = cs_sql_select(__FILE__, $from, $select, "news_id = '" . $cs_news_id . "'"); $head['head']['mod'] = $cs_lang['mod_name']; $head['head']['action'] = $cs_lang['details']; $topline = empty($cs_news['news_public']) ? 'not_public' : 'news_info'; $head['head']['topline'] = $cs_lang[$topline]; echo cs_subtemplate(__FILE__, $head, 'news', 'head'); $pub = $cs_news['categories_access'] > $account['access_news'] ? 0 : $cs_news['news_public']; if (!empty($pub)) { $com_where = "comments_mod = 'news' AND comments_fid = '" . $cs_news['news_id'] . "'"; $data['news']['comments_count'] = cs_sql_count(__FILE__, 'comments', $com_where); $start = floor($data['news']['comments_count'] / ($account['users_limit'] + 1)) * $account['users_limit']; $cs_news_com_count = $data['news']['comments_count'] - $start; $data['news']['comments_link'] = cs_link($cs_lang['comments'], 'news', 'view', 'id=' . $cs_news['news_id'] . '&start=' . $start . '#com' . $cs_news_com_count); $cs_main['page_title'] = $cs_news['news_headline']; $data['news']['news_headline'] = cs_secure($cs_news['news_headline']); $data['news']['news_time'] = cs_date('unix', $cs_news['news_time'], 1); $data['news']['news_text'] = cs_secure($cs_news['news_text'], $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]); if (empty($cs_news['news_readmore_active'])) { $data['news']['news_readmore'] = ''; } else { $data['news']['news_readmore'] = cs_secure($cs_news['news_readmore'], $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]); $data['news']['news_readmore'] .= cs_html_br(2); } $data['news']['users_link'] = cs_user($cs_news['users_id'], $cs_news['users_nick'], $cs_news['users_active'], $cs_news['users_delete']); $data['if']['catimg'] = empty($cs_news['categories_picture']) ? false : true; $data['news']['url_catimg'] = empty($data['if']['catimg']) ? '' : 'uploads/categories/' . $cs_news['categories_picture']; $data['news']['pictures'] = ''; if (!empty($cs_news['news_pictures'])) { $news_pics = explode("\n", $cs_news['news_pictures']); $data['news']['pictures'] = cs_html_br(2); foreach ($news_pics as $pic) {
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('awards'); $cs_awards['users_id'] = $account['users_id']; $now = cs_time(); $awards_year = isset($_POST['datum_year']) ? $_POST['datum_year'] : cs_date('unix', $now, 0, 1, 'Y'); $awards_month = isset($_POST['datum_month']) ? $_POST['datum_month'] : cs_date('unix', $now, 0, 1, 'm'); $awards_day = isset($_POST['datum_day']) ? $_POST['datum_day'] : cs_date('unix', $now, 0, 1, 'd'); $cs_awards['awards_time'] = $awards_year . '-' . $awards_month . '-' . $awards_day; $cs_awards['games_id'] = isset($_POST['games_id']) ? (int) $_POST['games_id'] : 0; $cs_awards['awards_rank'] = isset($_POST['awards_rank']) ? (int) $_POST['awards_rank'] : 0; $cs_awards['awards_event'] = isset($_POST['awards_event']) ? $_POST['awards_event'] : ''; $cs_awards['awards_event_url'] = isset($_POST['awards_event_url']) ? $_POST['awards_event_url'] : ''; $cs_awards['squads_id'] = isset($_POST['squads_id']) ? (int) $_POST['squads_id'] : 0; $error = 0; $errormsg = ''; settype($cs_awards['awards_rank'], 'integer'); if (isset($_POST['submit'])) { $awards_check_time = str_replace('-', '', $cs_awards['awards_time']); if ($awards_check_time <= '000') { $error++; $errormsg .= $cs_lang['no_date'] . cs_html_br(1); } if (empty($cs_awards['awards_event'])) { $error++; $errormsg .= $cs_lang['no_event'] . cs_html_br(1); } if (empty($cs_awards['awards_event_url'])) { $error++;
$title = $cs_lang['mail_titel']; $message = $cs_lang['mail_text'] . $cs_messages[$run]['users_nick']; $message .= $cs_lang['mail_text_2'] . $cs_main['def_title'] . $cs_lang['mail_text_3']; $message .= $cs_contact['def_org'] . $cs_lang['mail_text_4']; cs_mail($email, $title, $message); if (!empty($lang_save)) { $cs_lang = $cs_lang_save; $account['users_lang'] = $lang_save; } } } cs_redirect($cs_lang['msg_create_done'], 'messages', 'center'); } $data = array(); $data['if']['preview'] = false; $data['lang']['body_create'] = empty($messages_error) ? nl2br($cs_lang['body_create']) : $cs_lang['error_occured'] . cs_html_br(1) . $errormsg; if (isset($_POST['preview']) && empty($messages_error)) { $data['if']['preview'] = true; $data['var']['subject'] = cs_secure($_POST['messages_subject']); $data['var']['date'] = cs_date('unix', $time, 1); $data['to'] = $cs_messages; $data['var']['text'] = cs_secure($_POST['messages_text'], 1, 1); } $data['msg']['to'] = cs_secure($messages_to); $data['msg']['subject'] = cs_secure($messages_subject); $data['msg']['smileys'] = cs_abcode_smileys('messages_text'); $data['msg']['abcode'] = cs_abcode_features('messages_text'); $data['msg']['text'] = cs_secure($messages_text); $data['checked']['show_sender'] = empty($messages_show_sender) ? '' : ' checked="checked"'; $data['var']['reply_id'] = $reply_id; echo cs_subtemplate(__FILE__, $data, 'messages', 'create');
$comments_fid = $cs_comments[$run_2]['comments_fid']; $votes_id = $cs_votes[0]['votes_id']; if ($comments_fid == $votes_id) { $com_count++; } } $data['votes'] = ''; for ($run = 0; $run < $votes_loop; $run++) { $question = cs_secure($cs_votes_archiv[$run]['votes_question']); $com_count = 0; for ($run_2 = 0; $run_2 < $comments_loop; $run_2++) { $comments_fid = $cs_comments[$run_2]['comments_fid']; $votes_id = $cs_votes_archiv[$run]['votes_id']; if ($comments_fid == $votes_id) { $com_count++; } } $answers_count = 0; $votes_id = $cs_votes_archiv[$run]['votes_id']; for ($run_2 = 0; $run_2 < $voted_loop; $run_2++) { $voted_fid = $cs_voted[$run_2]['voted_fid']; if ($voted_fid == $votes_id) { $answers_count++; } } $data['votes'][$run]['question_link'] = cs_link($question, 'votes', 'view', 'where=' . $cs_votes_archiv[$run]['votes_id']); $data['votes'][$run]['com_count'] = $com_count; $data['votes'][$run]['elect_count'] = $answers_count; $data['votes'][$run]['ends_on'] = cs_date('unix', $cs_votes_archiv[$run]['votes_end'], 1); } echo cs_subtemplate(__FILE__, $data, 'votes');
if ($cat_id_a == $gal_cat_id) { $pic_loop++; if ($last_update <= $cs_gallery[$run_2]['usersgallery_time']) { $last_update = $cs_gallery[$run_2]['usersgallery_time']; } } } if ($pic_loop == 1) { $cat[$run]['pic_count'] = sprintf($cs_lang['pic_1'], $pic_loop); if (!empty($last_update)) { $cat[$run]['last_update'] = $cs_lang['pic_akt'] . cs_date('unix', $last_update, 1); } } else { $cat[$run]['pic_count'] = sprintf($cs_lang['pic_2'], $pic_loop); if (!empty($last_update)) { $cat[$run]['last_update'] = $cs_lang['pic_akt'] . cs_date('unix', $last_update, 1); } else { $cat[$run]['last_update'] = ''; } } $run++; } } } $cs_gallery_move = cs_gallery_move($cs_gallery, $options['list_sort']); if (!empty($cs_gallery) and $options['top_5_views'] == '1') { $cs_gallery = cs_array_sort($cs_gallery_move, SORT_DESC, 'usersgallery_count'); if ($gallery_loop > $rows) { $run_to = $rows; } else { $run_to = $gallery_loop;
$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');
$medalsuser_id = cs_sql_escape($_GET['delete']); cs_sql_delete(__FILE__, 'medalsuser', $medalsuser_id); cs_redirect($cs_lang['del_true'], 'medals', 'user', 'where=' . $medals_id); } $start = empty($_GET['start']) ? 0 : $_GET['start']; $cs_sort[1] = 'md.medalsuser_date DESC'; $cs_sort[2] = 'md.medalsuser_date ASC'; $cs_sort[3] = 'usr.users_nick DESC'; $cs_sort[4] = 'usr.users_nick ASC'; $sort = empty($_GET['sort']) ? 1 : $_GET['sort']; $order = $cs_sort[$sort]; $tables = 'medalsuser md LEFT JOIN {pre}_users usr ON usr.users_id = md.users_id'; $cells = 'usr.users_nick AS users_nick, md.users_id AS users_id, usr.users_active AS users_active, usr.users_delete AS users_delete, '; $cells .= 'md.medals_id AS medals_id, md.medalsuser_date AS medalsuser_date, md.medalsuser_id AS medalsuser_id'; $where = 'medals_id = ' . $medals_id . ''; $data['medals_user'] = array(); $data['medals_user'] = cs_sql_select(__FILE__, $tables, $cells, $where, $order, $start, $account['users_limit']); $data['count']['medals_user'] = count($data['medals_user']); $data['count']['all_medals_user'] = cs_sql_count(__FILE__, 'medalsuser', $where); $data['sort']['date'] = cs_sort('medals', 'user', $start, $medals_id, 1, $sort); $data['sort']['users_nick'] = cs_sort('medals', 'user', $start, $medals_id, 3, $sort); $data['pages']['list'] = cs_pages('medals', 'user', $data['count']['all_medals_user'], $start, $medals_id, $sort); for ($i = 0; $i < $data['count']['medals_user']; $i++) { $data['medals_user'][$i]['user'] = cs_user($data['medals_user'][$i]['users_id'], $data['medals_user'][$i]['users_nick'], $data['medals_user'][$i]['users_active'], $data['medals_user'][$i]['users_delete']); $data['medals_user'][$i]['remove_url'] = cs_url('medals', 'user', 'where=' . $data['medals_user'][$i]['medals_id'] . '&delete=' . $data['medals_user'][$i]['medalsuser_id']); $data['medals_user'][$i]['medals_date'] = cs_date('unix', $data['medals_user'][$i]['medalsuser_date'], 1); } $data['medals']['id'] = $medals_id; $data['message']['medals'] = cs_getmsg(); $data['form']['dirname'] = $cs_main['php_self']['dirname']; echo cs_subtemplate(__FILE__, $data, 'medals', 'user');
$data['join']['icq'] = '-'; } else { $data['join']['icq'] = cs_html_link('http://www.icq.com/people/' . $cs_joinus['joinus_icq'], $cs_joinus['joinus_icq']); } if (empty($cs_joinus['joinus_jabber'])) { $data['join']['jabber'] = '-'; } else { $cs_joinus['joinus_jabber'] = cs_secure($cs_joinus['joinus_jabber']); $data['join']['jabber'] = cs_html_jabbermail($cs_joinus['joinus_jabber']); } if (empty($cs_joinus['games_id'])) { $data['join']['game'] = '-'; } else { $img = cs_html_img('uploads/games/' . $cs_joinus['games_id'] . '.gif'); $where = "games_id = '" . $cs_joinus['games_id'] . "'"; $cs_game = cs_sql_select(__FILE__, 'games', 'games_name, games_id', $where); $link = cs_link($cs_game['games_name'], 'games', 'view', 'id=' . $cs_game['games_id']); $data['join']['game'] = $img . ' ' . $link; } if (empty($cs_joinus['squads_id'])) { $data['join']['squad'] = '-'; } else { $where = "squads_id = '" . $cs_joinus['squads_id'] . "'"; $cs_squad = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id', $where); $data['join']['squad'] = cs_link($cs_squad['squads_name'], 'squads', 'view', 'id=' . $cs_squad['squads_id']); } $data['join']['webcon'] = empty($cs_joinus['joinus_webcon']) ? '-' : cs_secure($cs_joinus['joinus_webcon']); $data['join']['lanact'] = empty($cs_joinus['joinus_lanact']) ? '-' : cs_secure($cs_joinus['joinus_lanact']); $data['join']['date'] = cs_date('date', $cs_joinus['joinus_date']); $data['join']['more'] = empty($cs_joinus['joinus_more']) ? '-' : cs_secure($cs_joinus['joinus_more'], 1, 1); echo cs_subtemplate(__FILE__, $data, 'joinus', 'view');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('cash'); $data = array(); $data['op'] = cs_sql_option(__FILE__, 'cash'); $tables = 'cash ca INNER JOIN {pre}_users usr ON ca.users_id = usr.users_id'; $cells = 'ca.cash_id AS cash_id, ca.cash_time AS cash_time, ca.cash_inout AS cash_inout, ca.users_id AS users_id, usr.users_nick AS users_nick, ca.cash_text AS cash_text'; $cells .= ', ca.cash_money AS cash_money, ca.cash_id AS cash_id, usr.users_country AS users_country, usr.users_active AS users_active, usr.users_delete AS users_delete'; $cond = "cash_inout = 'in' AND ca.cash_time LIKE '" . cs_datereal('Y-m') . "%'"; $data['cash'] = cs_sql_select(__FILE__, $tables, $cells, $cond, 'cash_time DESC', 0, 0); if (!empty($data['cash'])) { $count_cash = count($data['cash']); for ($run = 0; $run < $count_cash; $run++) { $data['cash'][$run]['users_flag'] = cs_html_img('symbols/countries/' . $data['cash'][$run]['users_country'] . '.png'); $data['cash'][$run]['user'] = cs_user($data['cash'][$run]['users_id'], $data['cash'][$run]['users_nick'], $data['cash'][$run]['users_active'], $data['cash'][$run]['users_delete']); $data['cash'][$run]['date'] = cs_date('date', $data['cash'][$run]['cash_time']); $data['cash'][$run]['cash_text'] = cs_secure($data['cash'][$run]['cash_text'], 0, 0, 0); $data['cash'][$run]['cash_money'] = cs_secure($data['cash'][$run]['cash_money'], 0, 0, 0); } } echo cs_subtemplate(__FILE__, $data, 'cash', 'view_cash');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_temp = cs_translate('clansphere'); $dir = empty($_GET['dir']) ? '' : $_GET['dir']; if (empty($dir) or !preg_match("=^[_a-z0-9-]+\$=i", $dir)) { $dir = $cs_main['def_tpl']; } include 'templates/' . $dir . '/info.php'; $data['temp_view']['name'] = $mod_info['name']; $data['temp_view']['version'] = $mod_info['version']; $data['temp_view']['mod_released'] = cs_date('date', $mod_info['released']); $data['temp_view']['creator'] = $mod_info['creator']; $data['temp_view']['mod_team'] = $mod_info['team']; $data['temp_view']['mod_url'] = cs_html_link('http://' . $mod_info['url'], $mod_info['url']); $data['temp_view']['mod_desc'] = $mod_info['text']; echo cs_subtemplate(__FILE__, $data, 'clansphere', 'temp_view');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); require_once 'mods/categories/functions.php'; $files = cs_files(); $options = cs_sql_option(__FILE__, 'games'); $img_filetypes = array('image/gif' => 'gif'); $games_error = 0; $games_form = 1; if (empty($_POST['datum_month']) or empty($_POST['datum_day']) or empty($_POST['datum_year'])) { $games_release = cs_date('unix', cs_time(), 0, 1, 'Y-m-d'); } else { $games_release = $_POST['datum_year'] . '-' . $_POST['datum_month'] . '-' . $_POST['datum_day']; } $symbol = empty($_POST['symbol']) ? '' : $_POST['symbol']; $games_name = ''; $games_version = ''; $games_creator = ''; $games_url = ''; $categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id']; $games_usk = empty($_POST['games_usk']) ? '' : $_POST['games_usk']; $errormsg = ''; if (!empty($_POST['games_name'])) { $games_name = $_POST['games_name']; } else { $errormsg .= $cs_lang['name_error'] . cs_html_br(1); $games_error++; } $categories_id = empty($_POST['categories_name']) ? $categories_id : cs_categories_create('games', $_POST['categories_name']);
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); $timezone = $account['users_timezone'] / 3600; $zonename = $timezone >= 0 ? 'UTC +' . $timezone : 'UTC ' . $timezone; $dst = ''; if (empty($account['users_dstime']) and date('I', cs_time()) != '0' or $account['users_dstime'] == 'on') { $dst = ' [' . $cs_lang['dstime'] . ']'; } echo cs_date('unix', cs_time(), 1) . ' ' . $cs_lang['using'] . ' ' . $zonename . $dst;
} 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']; $data['threads'][$run]['last'] = cs_link($date, 'board', 'thread', 'where=' . $thread['threads_id'] . '&start=' . $goto); if (!empty($thread['users_id'])) { $data['threads'][$run]['last_user'] = cs_html_br(1); $data['threads'][$run]['last_user'] .= $cs_lang['from'] . ' '; $data['threads'][$run]['last_user'] .= cs_user($thread['users_id'], $thread['users_nick'], $thread['users_active']); } else { $data['threads'][$run]['last_user'] = ''; } } $run++; } }
$cs_sort[2] = 'quotes_headline ASC'; $cs_sort[3] = 'quotes_time DESC'; $cs_sort[4] = 'quotes_time ASC'; $sort = empty($_REQUEST['sort']) ? 3 : $_REQUEST['sort']; $order = $cs_sort[$sort]; $quotes_count = cs_sql_count(__FILE__, 'quotes', $where); $data = array(); $data['url']['form'] = cs_url('quotes', 'manage'); $data['lang']['all'] = $cs_lang['total'] . ': '; $data['head']['count'] = $quotes_count; $data['head']['pages'] = cs_pages('quotes', 'manage', $quotes_count, $start, $categories_id, $sort); $data['head']['message'] = cs_getmsg(); $quotesmod = "categories_mod = 'quotes'"; $categories_data = cs_sql_select(__FILE__, 'categories', '*', $quotesmod, 'categories_name', 0, 0); $data['head']['dropdown'] = cs_dropdown('where', 'categories_name', $categories_data, $categories_id, 'categories_id'); $from = 'quotes qts LEFT JOIN {pre}_users usr ON qts.users_id = usr.users_id'; $select = 'qts.quotes_headline AS quotes_headline, qts.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, qts.quotes_time AS quotes_time, qts.quotes_id AS quotes_id'; $cs_quotes = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $quotes_loop = count($cs_quotes); $data['sort']['quotes_headline'] = cs_sort('quotes', 'manage', $start, $categories_id, 1, $sort); $data['sort']['quotes_time'] = cs_sort('quotes', 'manage', $start, $categories_id, 3, $sort); for ($run = 0; $run < $quotes_loop; $run++) { $cs_quotes[$run]['quotes_headline'] = cs_secure($cs_quotes[$run]['quotes_headline']); $cs_quotes[$run]['url_edit'] = cs_url('quotes', 'edit', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['url_remove'] = cs_url('quotes', 'remove', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['url_user'] = cs_user($cs_quotes[$run]['users_id'], $cs_quotes[$run]['users_nick'], $cs_quotes[$run]['users_active'], $cs_quotes[$run]['users_delete']); $cs_quotes[$run]['url_quote'] = cs_url('quotes', 'view', 'id=' . $cs_quotes[$run]['quotes_id']); $cs_quotes[$run]['quotes_time'] = cs_date('unix', $cs_quotes[$run]['quotes_time'], 1); } $data['quotes'] = $cs_quotes; echo cs_subtemplate(__FILE__, $data, 'quotes', 'manage');
$count_squads = count($data['squads']); for ($run = 0; $run < $count_squads; $run++) { $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']); } $data['sort']['date'] = cs_sort('wars', 'list', $start, $squads_id, 1, $sort); $data['sort']['enemy'] = cs_sort('wars', 'list', $start, $squads_id, 3, $sort); $data['sort']['category'] = cs_sort('wars', 'list', $start, $squads_id, 5, $sort); $select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.wars_status AS status, war.clans_id AS clans_id, cln.clans_short AS clans_short, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id'; $from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id '; $from .= 'INNER JOIN {pre}_clans cln ON war.clans_id = cln.clans_id '; $cs_wars = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $data['wars'] = ''; $count_wars = count($cs_wars); for ($run = 0; $run < $count_wars; $run++) { $data['wars'][$run]['gameicon'] = cs_html_img('uploads/games/' . $cs_wars[$run]['games_id'] . '.gif'); $data['wars'][$run]['date'] = cs_date('unix', $cs_wars[$run]['wars_date']); $data['wars'][$run]['enemyurl'] = cs_url('clans', 'view', 'id=' . $cs_wars[$run]['clans_id']); $data['wars'][$run]['enemy'] = cs_secure($cs_wars[$run]['clans_short']); $data['wars'][$run]['caturl'] = cs_url('categories', 'view', 'id=' . $cs_wars[$run]['categories_id']); $data['wars'][$run]['category'] = cs_secure($cs_wars[$run]['categories_name']); $data['wars'][$run]['url'] = cs_url('wars', 'view', 'id=' . $cs_wars[$run]['wars_id']); $data['wars'][$run]['result'] = $cs_wars[$run]['wars_score1'] . ' : ' . $cs_wars[$run]['wars_score2']; $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'); }
$save = array(); $save['def_tpl'] = $activate; if (isset($templates[ucfirst($activate)]['themes'])) { $themes = cs_checkdirs('themes'); if (isset($themes[ucfirst($templates[ucfirst($activate)]['themes'])])) { $save['def_theme'] = $templates[ucfirst($activate)]['themes']; } } cs_optionsave('clansphere', $save); $msg = file_exists('themes/' . $activate) ? $cs_lang['theme_found'] . cs_link($cs_lang['change_to_this'], 'clansphere', 'themes_list', 'activate=' . $activate) : $cs_lang['success']; cs_redirect($msg, 'clansphere', 'temp_list'); } else { $data['lang']['getmsg'] = cs_getmsg(); $run = 0; foreach ($templates as $mod) { if ($mod['dir'] == 'install') { $tpl_all--; continue; } $data['temp_list'][$run]['name'] = $mod['name']; $data['temp_list'][$run]['dir'] = $mod['dir']; $data['temp_list'][$run]['version'] = $mod['version']; $data['temp_list'][$run]['date'] = cs_date('date', $mod['released']); $data['temp_list'][$run]['if']['active'] = $mod['dir'] == $cs_main['template'] ? 1 : 0; $data['temp_list'][$run]['if']['def'] = $mod['dir'] == $cs_main['def_tpl'] ? 1 : 0; $run++; } } $data['lang']['body'] = sprintf($cs_lang['body_temp_list'], $tpl_all); $data['link']['cache'] = cs_url('clansphere', 'cache'); echo cs_subtemplate(__FILE__, $data, 'clansphere', 'temp_list');
} } 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']);
$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); if (empty($nplayers)) { $wars['if']['no_players'] = TRUE; $wars['nplayers'] = array(); } else { $in_list = 0; $pl = 0; foreach ($nplayers as $player) { $wars['nplayers'][$pl]['user'] = cs_user($player['users_id'], $player['users_nick'], $player['users_active']); $wars['nplayers'][$pl]['status'] = $cs_lang[$player['players_status']]; $wars['nplayers'][$pl]['date'] = cs_date('unix', $player['players_time'], 1); if ($player['users_id'] == $account['users_id']) { $in_list = 1; } $pl++; } } if (!empty($squadmember)) { $wars['if']['status'] = TRUE; if (!isset($_POST['status'])) { $condition = 'users_id = \'' . $account['users_id'] . '\' AND wars_id = \'' . $wars_id . '\''; $select = cs_sql_select(__FILE__, 'players', 'players_id, players_status', $condition); $wars['status']['yes'] = ''; $wars['status']['maybe'] = ''; $wars['status']['no'] = ''; $sel = 'selected="selected"';
$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) { $last = strlen(substr(strrchr($cs_gbook[$run]['gbook_ip'], '.'), 1)); $ip = strlen($gbook_ip);
$error .= $cs_lang['no_headline'] . cs_html_br(1); } if (empty($cs_news['news_text'])) { $error .= $cs_lang['no_text'] . cs_html_br(1); } } if (!isset($_POST['submit']) and !isset($_POST['preview'])) { $data['head']['body'] = $cs_lang['head_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)) { $run = $_POST['run_loop']; $data['news']['news_time'] = cs_date('unix', cs_time(), 1); $data['news']['preview_news_text'] = cs_secure($cs_news['news_text'], $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]); $data['if']['readmore'] = false; if (!empty($cs_news['news_readmore'])) { $data['if']['readmore'] = true; $data['news']['preview_news_readmore'] = cs_secure($cs_news['news_readmore'], $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]) . cs_html_br(2); } $search = 'users_id = ' . $cs_news['users_id']; $cs_news_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', $search); $data['news']['users_link'] = cs_user($cs_news['users_id'], $cs_news_user['users_nick'], $cs_news_user['users_active']); $data['if']['catimg'] = false; $cat_search = "categories_id = '" . $cs_news['categories_id'] . "'"; $cs_cat = cs_sql_select(__FILE__, 'categories', 'categories_picture', $cat_search); if (!empty($cs_cat['categories_picture'])) { $data['if']['catimg'] = true; $data['news']['url_catimg'] = 'uploads/categories/' . $cs_cat['categories_picture'];