Example #1
0
function getUserIcons($cs_lang, $users_id, $nick, $hidden = 0, $email = 0, $icq = 0, $jabber = 0, $url = 0, $skype = 0)
{
    global $account;
    $allow = $users_id == $account['users_id'] or $account['access_users'] > 4 ? 1 : 0;
    $hidden = explode(',', $hidden);
    if (in_array('users_email', $hidden) && empty($allow)) {
        $email = '';
    }
    if (in_array('users_icq', $hidden) && empty($allow)) {
        $icq = '';
    }
    if (in_array('users_jabber', $hidden) && empty($allow)) {
        $jabber = '';
    }
    if (in_array('users_skype', $hidden) && empty($allow)) {
        $skype = '';
    }
    if (in_array('users_url', $hidden) && empty($allow)) {
        $url = '';
    }
    $icons = '';
    $icons .= !empty($email) ? cs_html_mail($email, cs_icon('mail_generic')) : '';
    $icons .= $account['access_users'] >= 2 ? cs_link(cs_icon('mail_send'), 'messages', 'create', 'to_id=' . $users_id, 0, $cs_lang['send_message']) : '';
    $icons .= !empty($icq) ? cs_html_link('http://www.icq.com/people/' . $icq, cs_icon('licq'), 1, 0, $cs_lang['icq']) : '';
    $icons .= !empty($jabber) ? cs_html_jabbermail($jabber, cs_icon('jabber_protocol')) : '';
    $icons .= !empty($skype) ? cs_html_link('skype:' . $skype . '?userinfo', cs_html_img('http://mystatus.skype.com/smallicon/' . $skype, '16', '16', '0', 'Skype'), 0, 0, $cs_lang['skype']) : '';
    $icons .= !empty($url) ? cs_html_link('http://' . $url, cs_icon('gohome'), 1, 0, $cs_lang['homepage']) : '';
    return $icons;
}
Example #2
0
function cs_manage($mod, $action, $def_mod, $def_action, $merge = array(), $head = array())
{
    global $account, $cs_lang;
    $merge = is_array($merge) ? $merge : array();
    $show = $mod . '/' . $action;
    if (empty($head['message'])) {
        $head['message'] = '';
    }
    $data = array('head' => $head);
    $data['content'] = array();
    $options = array('info' => 0, 'size' => 48, 'theme' => '');
    $options['theme'] = empty($account['users_view']) ? 'manage' : 'manage_' . $account['users_view'];
    if ($account['users_view'] == 'list') {
        $options['size'] = 16;
        if ($show == 'clansphere/admin') {
            $options['theme'] = 'manage_admin';
            $options['info'] = 1;
        }
    }
    $mod_array = cs_checkdirs('mods', $show);
    $content = array_merge($merge, $mod_array);
    ksort($content);
    $loop = 0;
    foreach ($content as $mod) {
        if (!array_key_exists('dir', $mod)) {
            $mod['dir'] = $def_mod;
        }
        if (!array_key_exists('file', $mod)) {
            $mod['file'] = $def_action;
        }
        $acc_dir = 'access_' . $mod['dir'];
        if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show'][$show]) {
            $cs_lap = cs_icon($mod['icon'], $options['size'], 0, 0);
            $data['content'][$loop]['img_1'] = $cs_lap;
            $data['content'][$loop]['txt_1'] = $mod['name'];
            $data['content'][$loop]['link_1'] = cs_url($mod['dir'], $mod['file']);
            if (!empty($options['info'])) {
                if (file_exists('mods/' . $mod['dir'] . '/create.php')) {
                    $data['content'][$loop]['create_1'] = cs_link(cs_icon('editpaste', 16, $cs_lang['create']), $mod['dir'], 'create');
                } else {
                    $data['content'][$loop]['create_1'] = '';
                }
                if (file_exists('mods/' . $mod['dir'] . '/manage.php')) {
                    $data['content'][$loop]['manage_1'] = cs_link(cs_icon('kfm', 16, $cs_lang['manage']), $mod['dir'], 'manage');
                } else {
                    $data['content'][$loop]['manage_1'] = '';
                }
                if (file_exists('mods/' . $mod['dir'] . '/options.php')) {
                    $data['content'][$loop]['options_1'] = cs_link(cs_icon('package_settings', 16, $cs_lang['options']), $mod['dir'], 'options');
                } else {
                    $data['content'][$loop]['options_1'] = '';
                }
            }
            $loop++;
        }
    }
    $data['head']['total'] = $loop;
    return cs_subtemplate(__FILE__, $data, 'clansphere', $options['theme']);
}
Example #3
0
function cs_installerror($old_query = '')
{
    global $cs_db, $cs_lang, $account;
    $cs_lang = cs_translate('install');
    $error = empty($cs_db['last_error']) ? 'Unknown' : $cs_db['last_error'];
    $msg = 'Error: ' . $error . cs_html_br(2) . 'Query: ' . $old_query . cs_html_br(4);
    $msg .= cs_link($cs_lang['remove_and_again'], 'install', 'sql', 'lang=' . $account['users_lang'] . '&uninstall=1');
    die(cs_error_internal('sql', $msg));
}
Example #4
0
function cs_abcode_pb_url($matches)
{
    $cs_get = cs_get('id,where');
    if (!empty($cs_get['id'])) {
        $matches[3] = empty($cs_get['id']) ? 0 : $cs_get['id'];
    }
    if (!empty($cs_get['where'])) {
        $matches[3] = empty($cs_get['where']) ? 0 : $cs_get['where'];
    }
    if (empty($matches[2])) {
        $matches[2] = $matches[1];
    }
    return cs_link($matches[2], 'articles', 'view', 'id=' . $matches[3] . '&page=' . $matches[1]);
}
Example #5
0
function cs_admin_menu()
{
    global $cs_main, $account;
    $cs_lang = cs_translate('clansphere');
    $data = array();
    $recent_mod = $cs_main['mod'];
    $recent_action = $cs_main['action'];
    $link_count = 0;
    if (file_exists('mods/' . $recent_mod . '/manage.php') && $account['access_' . $recent_mod] >= 3) {
        include $cs_main['def_path'] . '/mods/' . $recent_mod . '/info.php';
        # look for sql table named like mod, else use first sql table given
        $mod_tables = is_array($mod_info['tables']) ? $mod_info['tables'] : array();
        if (in_array($recent_mod, $mod_tables)) {
            $sql_table = $recent_mod;
        } elseif (isset($mod_tables[0])) {
            $sql_table = $mod_tables[0];
        } else {
            $sql_table = false;
        }
        $sql_count = empty($sql_table) ? '' : ' (' . cs_sql_count(__FILE__, $sql_table) . ')';
        $link_count++;
        $data['menu']['manage'] = $recent_action == 'manage' ? $cs_lang['manage'] : cs_link($cs_lang['manage'], $recent_mod, 'manage') . $sql_count;
        $data['if']['manage'] = true;
    } else {
        $data['menu']['manage'] = '';
        $data['if']['manage'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/create.php') && $account['access_' . $recent_mod] >= 3 && $recent_mod != 'shoutbox') {
        $link_count++;
        $data['menu']['create'] = $recent_action == 'create' ? $cs_lang['create'] : cs_link($cs_lang['create'], $recent_mod, 'create');
        $data['if']['create'] = true;
    } else {
        $data['menu']['create'] = '';
        $data['if']['create'] = false;
    }
    if (file_exists('mods/' . $recent_mod . '/options.php') && $account['access_' . $recent_mod] >= 5) {
        $link_count++;
        $data['menu']['options'] = $recent_action == 'options' ? $cs_lang['options'] : cs_link($cs_lang['options'], $recent_mod, 'options');
        $data['if']['options'] = true;
    } else {
        $data['menu']['options'] = '';
        $data['if']['options'] = false;
    }
    if ($link_count > 1) {
        $data['links']['count'] = $link_count;
        return cs_subtemplate(__FILE__, $data, 'clansphere', 'admin_menu');
    }
}
Example #6
0
function cs_datacontrol($data_id, $div = 0, $style = '', $more = '')
{
    global $cs_main, $cs_lang, $account;
    $content = '';
    $mod = $cs_main['mod'];
    $get_axx = 'mods/' . $mod . '/access.php';
    $axx_file = array();
    include $get_axx;
    if (!empty($div)) {
        $content .= '<div style="' . $style . '" ' . $more . '>';
    }
    if ($account['access_' . $mod] >= $axx_file['edit']) {
        $img_edit = cs_icon('edit', 16, $cs_lang['edit']);
        $content .= cs_link($img_edit, $mod, 'edit', 'id=' . $data_id, 0, $cs_lang['edit']);
    }
    if ($account['access_' . $mod] >= $axx_file['remove']) {
        $img_del = cs_icon('editdelete', 16, $cs_lang['remove']);
        $content .= cs_link($img_del, $mod, 'remove', 'id=' . $data_id, 0, $cs_lang['remove']);
    }
    if (!empty($div)) {
        $content .= '</div>';
    }
    return $content;
}
Example #7
0
$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'] . '&amp;user_gb=' . $user_gb, 0, $cs_lang['active']);
        $deactive = cs_link(cs_icon('submit'), 'gbook', 'manage', 'deactive=' . $cs_gbook[$run]['gbook_id'] . '&amp;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);
            $ip = substr($gbook_ip, 0, $ip - $last);
            $ip = $ip . '*';
        }
        $ip_show = empty($ip) ? '-' : $ip;
        $gbook[$run]['ip'] = cs_html_img('symbols/' . $cs_main['img_path'] . '/16/important.' . $cs_main['img_ext'], 16, 16, 'title="' . $ip_show . '"');
    }
Example #8
0
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;
}
Example #9
0
            $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'] . '&amp;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++;
    }
}
echo cs_subtemplate(__FILE__, $data, 'board', 'active');
Example #10
0
$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']);
    // . '&amp;start=' . $goto);
    $data['boardreport'][$run]['threads_headline'] = $link . ' #' . $cs_report[$run]['comments_id'];
}
echo cs_subtemplate(__FILE__, $data, 'board', 'reportlist');
Example #11
0
        $data['if']['done'] = true;
        $data['link']['wizard'] = cs_link($cs_lang['show'], 'wizard', 'roots') . ' - ' . cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=temp&amp;done=1');
    }
}
if (!empty($activate) and !empty($allow)) {
    require_once 'mods/clansphere/func_options.php';
    $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;
Example #12
0
}
$from = 'news nws INNER JOIN {pre}_users usr ON nws.users_id = usr.users_id INNER JOIN {pre}_categories cat ON nws.categories_id = cat.categories_id';
$select = 'nws.news_id AS news_id, nws.news_headline AS news_headline, nws.news_time AS news_time, nws.news_text AS news_text, nws.news_close AS news_close, nws.news_public AS news_public, nws.news_pictures as news_pictures, nws.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, nws.categories_id AS categories_id, cat.categories_access AS categories_access, cat.categories_picture AS categories_picture, nws.news_mirror AS news_mirror, nws.news_mirror_name AS news_mirror_name, nws.news_readmore AS news_readmore, nws.news_readmore_active AS news_readmore_active';
$cs_news = cs_sql_select(__FILE__, $from, $select, "news_id = '" . $cs_news_id . "'");
$head['head']['mod'] = $cs_lang['mod_name'];
$head['head']['action'] = $cs_lang['details'];
$topline = empty($cs_news['news_public']) ? 'not_public' : 'news_info';
$head['head']['topline'] = $cs_lang[$topline];
echo cs_subtemplate(__FILE__, $head, 'news', 'head');
$pub = $cs_news['categories_access'] > $account['access_news'] ? 0 : $cs_news['news_public'];
if (!empty($pub)) {
    $com_where = "comments_mod = 'news' AND comments_fid = '" . $cs_news['news_id'] . "'";
    $data['news']['comments_count'] = cs_sql_count(__FILE__, 'comments', $com_where);
    $start = floor($data['news']['comments_count'] / ($account['users_limit'] + 1)) * $account['users_limit'];
    $cs_news_com_count = $data['news']['comments_count'] - $start;
    $data['news']['comments_link'] = cs_link($cs_lang['comments'], 'news', 'view', 'id=' . $cs_news['news_id'] . '&amp;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'])) {
Example #13
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('rules');
$data = array();
$data['rules'] = array();
$rules_count = cs_sql_count(__FILE__, 'rules');
$where = "categories_mod = 'rules' AND categories_access <= '" . $account['access_rules'] . "'";
$categories_data = cs_sql_select(__FILE__, 'categories', '*', $where, 'categories_name', 0, 0);
$categories_loop = count($categories_data);
$data['count']['rules'] = sprintf($cs_lang['all'], $rules_count);
for ($run = 0; $run < $categories_loop; $run++) {
    $data['rules'][$run]['cat'] = cs_link(cs_secure($categories_data[$run]['categories_name']), 'rules', 'listcat', 'id=' . $categories_data[$run]['categories_id']);
    $content = cs_sql_count(__FILE__, 'rules', 'categories_id = ' . $categories_data[$run]['categories_id']);
    $data['rules'][$run]['count_cat'] = $content;
    $data['rules'][$run]['cat_text'] = cs_secure($categories_data[$run]['categories_text'], 1, 1);
}
echo cs_subtemplate(__FILE__, $data, 'rules', 'list');
Example #14
0
$sqd_loop = count($sqd_data);
for ($run = 0; $run < $sqd_loop; $run++) {
    $data['squad'][$run]['selected'] = $sqd_data[$run]['squads_id'] == $squads_id ? ' selected="selected"' : '';
    $data['squad'][$run]['id'] = $sqd_data[$run]['squads_id'];
    $data['squad'][$run]['name'] = cs_secure($sqd_data[$run]['squads_name']);
}
if (empty($sqd_loop)) {
    $data['squad'] = array();
}
$data['lang']['msg'] = !empty($msg) ? $msg : '';
$select = 'mem.members_admin AS members_admin, mem.members_order AS members_order, mem.users_id AS users_id, usr.users_nick AS users_nick, usr.users_delete AS users_delete, usr.users_active AS users_active, mem.members_task, mem.members_id AS members_id';
$from = 'members mem INNER JOIN {pre}_users usr ON mem.users_id = usr.users_id';
$where = "mem.squads_id = '" . $squads_id . "'";
$cs_members = cs_sql_select(__FILE__, $from, $select, $where, $order, 0, 0);
$members_loop = count($cs_members);
$data['sort']['user'] = cs_sort('members', 'center', 0, $squads_id, 1, $sort);
$data['sort']['task'] = cs_sort('members', 'center', 0, $squads_id, 3, $sort);
$img_edit = cs_icon('edit', 16, $cs_lang['edit']);
$img_del = cs_icon('editdelete', 16, $cs_lang['remove']);
if (empty($members_loop)) {
    $data['members'] = '';
}
for ($run = 0; $run < $members_loop; $run++) {
    $users_nick = cs_user($cs_members[$run]['users_id'], $cs_members[$run]['users_nick'], $cs_members[$run]['users_active'], $cs_members[$run]['users_delete']);
    $data['members'][$run]['user'] = empty($cs_members[$run]['members_admin']) ? $users_nick : cs_html_big(1) . $users_nick . cs_html_big(0);
    $data['members'][$run]['task'] = cs_secure($cs_members[$run]['members_task']);
    $data['members'][$run]['order'] = $cs_members[$run]['members_order'];
    $data['members'][$run]['edit'] = cs_link($img_edit, 'members', 'change', 'id=' . $cs_members[$run]['members_id'], 0, $cs_lang['edit']);
    $data['members'][$run]['remove'] = cs_link($img_del, 'members', 'center', 'del_id=' . $cs_members[$run]['members_id'], 0, $cs_lang['remove']);
}
echo cs_subtemplate(__FILE__, $data, 'members', 'center');
Example #15
0
    $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');
Example #16
0
if ($account['access_board'] < $cs_thread['board_access'] or empty($check_pw)) {
    $errorpage = empty($check_sq) ? 1 : 0;
}
if (!empty($errorpage)) {
    return errorPage('thread_add', $cs_lang);
}
//Sicherheitsabfrage Ende
#check mod
$acc_mod = 0;
$check_mod = cs_sql_select(__FILE__, 'boardmods', 'boardmods_modpanel', 'users_id = ' . (int) $account['users_id'], 0, 0, 1);
if (!empty($check['boardmods_modpanel']) or $account['access_board'] == 5) {
    $acc_mod = 1;
}
$head = cs_link($cs_lang['board'], 'board', 'list', 'normalb') . ' -> ';
$head .= cs_link($cs_thread['categories_name'], 'board', 'list', 'where=' . $cs_thread['categories_id'], 'normalb') . ' -> ';
$head .= cs_link($cs_thread['board_name'], 'board', 'listcat', 'where=' . $cs_thread['board_id'], 'normalb');
$data['head']['boardlinks'] = $head;
$bv['boardvotes_question'] = '';
$cs_board_opt = cs_sql_option(__FILE__, 'board');
$max_size = $cs_board_opt['file_size'];
$filetypes = explode(',', $cs_board_opt['file_types']);
$board['board_id'] = $board_id;
$board['users_id'] = $account['users_id'];
$board['threads_last_user'] = $account['users_id'];
$board['threads_time'] = cs_time();
$board['threads_last_time'] = cs_time();
$board['threads_headline'] = '';
$board['threads_text'] = '';
$board['threads_important'] = 0;
$board['threads_close'] = 0;
$votes = 0;
Example #17
0
        $data['cal'][$run]['week'] = date('W', mktime(0, 0, 0, $month, $count, $year));
        $row = 2;
    }
    if (array_key_exists($count, $events)) {
        $css = 'calevent';
        $unix = mktime(0, 0, 0, $month, $count, $year);
        $out = cs_link($count, 'events', 'timer', 'unix=' . $unix);
    } else {
        $css = 'calday';
        $out = $count;
    }
    $current = $count . '-' . $zero . '-' . $year;
    $css2 = $current == cs_datereal('j-m-Y') ? 'caltoday' : $css;
    $data['cal'][$run]['css'] = $css2;
    $data['cal'][$run]['out'] = $out;
    $count++;
    $row++;
}
$data['if']['colspan2'] = FALSE;
if ($row < 9) {
    $colspan2 = 9 - $row;
    $data['if']['colspan2'] = TRUE;
    $data['cal1']['colspan2'] = $colspan2;
}
$nom = date('F', mktime(0, 0, 0, $month, 1, $year));
$next = $month == 12 ? 'year=' . ($year + 1) . '&amp;month=1' : 'year=' . $year . '&amp;month=' . ($month + 1);
$last = $month == 1 ? 'year=' . ($year - 1) . '&amp;month=12' : 'year=' . $year . '&amp;month=' . ($month - 1);
$data['cal1']['bef_month'] = ($year < 1970 or $year == 1970 and $month == 1) ? '&lt;' : cs_link('&lt;', 'events', 'calendar', $last);
$data['cal1']['now_month'] = $cs_lang[$nom] . ' ' . $year;
$data['cal1']['nxt_month'] = ($year > 2037 or $year == 2037 and $month == 12) ? '&gt;' : cs_link('&gt;', 'events', 'calendar', $next);
echo cs_subtemplate(__FILE__, $data, 'events', 'calendar');
Example #18
0
    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']) ? '&nbsp;' : 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']) ? '&nbsp;' : 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']) ? '&nbsp;' : 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');
Example #19
0
if (!empty($cs_squad['clans_country'])) {
    $wars['squad']['country'] = cs_html_img('symbols/countries/' . $cs_squad['clans_country'] . '.png', 11, 16);
} else {
    $wars['squad']['country'] = '-';
}
$cells = 'pl.users_id AS users_id, usr.users_nick AS users_nick';
$tables = 'players pl INNER JOIN {pre}_users usr ON pl.users_id = usr.users_id';
$cond = 'pl.wars_id = \'' . $wars_id . '\' AND pl.players_played = \'1\'';
$players = cs_sql_select(__FILE__, $tables, $cells, $cond, 'usr.users_nick', 0, 0);
if (!empty($players)) {
    $first = 0;
    $wars['wars']['players'] = '';
    foreach ($players as $player) {
        $wars['wars']['players'] .= empty($first) ? '' : ' - ';
        $first++;
        $wars['wars']['players'] .= cs_link(cs_secure($player['users_nick']), 'users', 'view', 'id=' . $player['users_id']);
    }
} else {
    $wars['wars']['players'] = '-';
}
if (empty($cs_wars['wars_players1']) && empty($cs_wars['wars_players2'])) {
    $wars['lang']['on'] = '';
    $wars['wars']['players1'] = '-';
    $wars['wars']['players2'] = '';
} else {
    $wars['wars']['players1'] = $cs_wars['wars_players1'];
    $wars['wars']['players2'] = $cs_wars['wars_players2'];
}
$wars['date']['show'] = cs_date('unix', $cs_wars['wars_date'], 1);
$wars_status = empty($cs_wars['wars_status']) ? 'upcoming' : $cs_wars['wars_status'];
$wars['war']['status'] = $cs_lang[$wars_status];
Example #20
0
    $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');
Example #21
0
<?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');
Example #22
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('replays');
$cs_get = cs_get('id');
if (isset($cs_get['agree'])) {
    $replays = cs_sql_select(__FILE__, 'replays', 'replays_mirror_urls', "replays_id = '" . $cs_get['id'] . "'");
    $replays_string = $replays['replays_mirror_urls'];
    $replays_pics = empty($replays_string) ? array() : explode("\n", $replays_string);
    foreach ($replays_pics as $pics) {
        cs_unlink('replays', $pics);
    }
    cs_sql_delete(__FILE__, 'replays', $cs_get['id']);
    cs_redirect($cs_lang['del_true'], 'replays');
}
if (isset($cs_get['cancel'])) {
    cs_redirect($cs_lang['del_false'], 'replays');
}
$replay = cs_sql_select(__FILE__, 'replays', 'replays_id', 'replays_id = ' . $cs_get['id'], 0, 0, 1);
if (!empty($replay)) {
    $data = array();
    $data['head']['topline'] = sprintf($cs_lang['del_rly'], $cs_get['id']);
    $data['replays']['content'] = cs_link($cs_lang['confirm'], 'replays', 'remove', 'id=' . $cs_get['id'] . '&amp;agree');
    $data['replays']['content'] .= ' - ';
    $data['replays']['content'] .= cs_link($cs_lang['cancel'], 'replays', 'remove', 'id=' . $cs_get['id'] . '&amp;cancel');
    echo cs_subtemplate(__FILE__, $data, 'replays', 'remove');
} else {
    cs_redirect('', 'replays');
}
Example #23
0
        $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');
Example #24
0
        }
        $where = "clans_id = '" . $clans_id . "'";
        $cs_squads = cs_sql_select(__FILE__, 'squads', 'squads_id', $where, 0, 0, 0);
        if (is_array($cs_squads)) {
            foreach ($cs_squads as $key => $squads_id) {
                cs_sql_delete(__FILE__, 'members', $squads_id, 'squads_id');
            }
        }
        cs_sql_delete(__FILE__, 'squads', $clans_id, 'clans_id');
        cs_sql_delete(__FILE__, 'clans', $clans_id);
        $msg = sprintf($cs_lang['del_true_clan'], $cs_lang[$op_clans['label']]);
    }
    cs_redirect($msg, 'clans', $center);
}
if (isset($_GET['cancel']) or $clans_id == 1) {
    $clans_form = 0;
    cs_redirect($cs_lang['del_false'], 'clans', $center);
}
if (!empty($clans_form)) {
    $clan = cs_sql_select(__FILE__, 'clans', 'clans_name', 'clans_id = ' . $clans_id, 0, 0, 1);
    if (!empty($clan)) {
        $data['lang']['mod_name'] = $cs_lang[$op_clans['label']];
        $data['lang']['body'] = sprintf($cs_lang['remove_entry'], $data['lang']['mod_name'], $clan['clans_name']);
        $data['lang']['content'] = cs_link($cs_lang['confirm'], 'clans', 'remove', 'id=' . $clans_id . '&amp;agree');
        $data['lang']['content'] .= ' - ';
        $data['lang']['content'] .= cs_link($cs_lang['cancel'], 'clans', 'remove', 'id=' . $clans_id . '&amp;cancel');
        echo cs_subtemplate(__FILE__, $data, 'clans', 'remove');
    } else {
        cs_redirect('', 'clans');
    }
}
Example #25
0
    $action_lang = $cs_lang['action_move'];
} elseif (!empty($_POST['submit_rename'])) {
    if (empty($_POST['thread_headline'])) {
        return cs_redirect($cs_lang['mark_all'], 'board', 'thread', 'where=' . $thread_id);
    }
    $thread_headline = $_POST['thread_headline'];
    $thread_cells = array('threads_headline');
    $thread_save = array($thread_headline);
    $update_board = 1;
    $action_lang = $cs_lang['action_rename'];
} elseif (!empty($_POST['move']) or !empty($_POST['rename'])) {
    $data['threads']['id'] = $thread_edit['threads_id'];
    $head = cs_link($cs_lang['board'], 'board', 'list', 'normalb') . ' -> ';
    $head .= cs_link($thread_edit['categories_name'], 'board', 'list', 'where=' . $thread_edit['categories_id'], 'normalb') . ' -> ';
    $head .= cs_link($thread_edit['board_name'], 'board', 'listcat', 'where=' . $board_id, 'normalb') . ' -> ';
    $head .= cs_link($thread_edit['threads_headline'], 'board', 'thread', 'where=' . $thread_edit['threads_id'], 'normalb');
    $data['head']['links'] = $head;
    $data['if']['move'] = FALSE;
    $data['if']['rename'] = FALSE;
    //move
    if (!empty($_POST['move'])) {
        $data['if']['move'] = TRUE;
        $tables = "board boa INNER JOIN {pre}_categories cat ON boa.categories_id = cat.categories_id";
        $select = "boa.board_id AS board_id, boa.board_name AS board_name, cat.categories_name AS categories_name";
        $axx_where = "boa.board_access <= '" . $account['access_board'] . "'";
        $sorting = 'cat.categories_name ASC, boa.board_name ASC';
        $board_data = cs_sql_select(__FILE__, $tables, $select, $axx_where, $sorting, 0, 0);
        $data['board']['select'] = '';
        foreach ($board_data as $board) {
            $sel = $board_id == $board['board_id'] ? 1 : 0;
            $content = $board['categories_name'] . ' -> ' . $board['board_name'];
Example #26
0
                $data['matches'][$i]['team1'] = (empty($data['matches'][$i]['squad1_name']) and !empty($data['matches'][$i]['squad1_id'])) ? '? ID:' . $data['matches'][$i]['squad1_id'] : cs_link(cs_secure($data['matches'][$i]['squad1_name']), 'squads', 'view', 'id=' . $data['matches'][$i]['squad1_id']);
            } else {
                $data['matches'][$i]['team1'] = cs_user($data['matches'][$i]['squad1_id'], $data['matches'][$i]['user1_nick'], $data['matches'][$i]['user1_active'], $data['matches'][$i]['user1_delete']);
            }
            if ($data['matches'][$i]['autoseed1'] == 0) {
                $data['matches'][$i]['team1'] .= ' (#' . $data['matches'][$i]['seed1'] . ')';
            }
            break;
    }
    switch ($data['matches'][$i]['squad2_id']) {
        case CS_CUPS_TEAM_UNKNOWN:
            // not determined yet
            $data['matches'][$i]['team2'] = $cs_lang['unknown'];
            break;
        case CS_CUPS_TEAM_BYE:
            // free win
            $data['matches'][$i]['team2'] = $cs_lang['bye'];
            break;
        default:
            if ($system['cups_system'] == CS_CUPS_TYPE_TEAMS) {
                $data['matches'][$i]['team2'] = (empty($data['matches'][$i]['squad2_name']) and !empty($data['matches'][$i]['squad2_id'])) ? '? ID:' . $data['matches'][$i]['squad2_id'] : cs_link(cs_secure($data['matches'][$i]['squad2_name']), 'squads', 'view', 'id=' . $data['matches'][$i]['squad2_id']);
            } else {
                $data['matches'][$i]['team2'] = cs_user($data['matches'][$i]['squad2_id'], $data['matches'][$i]['user2_nick'], $data['matches'][$i]['user2_active'], $data['matches'][$i]['user2_delete']);
            }
            if ($data['matches'][$i]['autoseed2'] == 0) {
                $data['matches'][$i]['team2'] .= ' (#' . $data['matches'][$i]['seed2'] . ')';
            }
            break;
    }
}
echo cs_subtemplate(__FILE__, $data, 'cups', 'matchlist');
Example #27
0
        $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');
Example #28
0
    $sort = 'rnd.rounds_order ASC, rnd.rounds_id ASC';
    $cs_rounds = cs_sql_select(__FILE__, $tables, $cells, 'rnd.wars_id = \'' . $wars_id . '\'', $sort, 0, 0);
    $count = count($cs_rounds);
    if (!empty($cs_rounds)) {
        $data['if']['rounds'] = true;
        $img_up = cs_html_img('symbols/clansphere/up_arrow.png');
        $img_down = cs_html_img('symbols/clansphere/down_arrow.png');
        $run = 0;
        $run2 = 0;
        foreach ($cs_rounds as $round) {
            $run2++;
            $data['maps'][$run]['name'] = $round['maps_name'];
            $data['maps'][$run]['result'] = $round['rounds_score1'] . ' : ' . $round['rounds_score2'];
            $data['maps'][$run]['rounds_id'] = $round['rounds_id'];
            $up = $run2 != 1 ? cs_link($img_up, 'wars', 'rounds', 'id=' . $wars_id . '&amp;up=' . $round['rounds_id']) : '-';
            $down = $run2 != $count ? cs_link($img_down, 'wars', 'rounds', 'id=' . $wars_id . '&amp;down=' . $round['rounds_id']) : '-';
            $data['maps'][$run]['up_down'] = $up . ' ' . $down;
            $run++;
        }
    } else {
        $data['if']['rounds'] = false;
    }
    echo cs_subtemplate(__FILE__, $data, 'wars', 'rounds');
} else {
    if (!empty($new_map)) {
        $get_game_id = cs_sql_select(__FILE__, 'wars', 'games_id', 'wars_id = \'' . $cs_rounds['wars_id'] . '\'');
        $cells1 = array('maps_name', 'games_id');
        $values1 = array($_POST['new_map'], $get_game_id['games_id']);
        cs_sql_insert(__FILE__, 'maps', $cells1, $values1);
        $cs_rounds['maps_id'] = cs_sql_insertid(__FILE__);
    } else {
Example #29
0
    foreach ($cs_country as $short => $full) {
        $data['country'][$run]['short'] = $short;
        $data['country'][$run]['selection'] = $short == $cs_user['users_country'] ? ' selected="selected"' : '';
        $data['country'][$run]['full'] = $full;
        $run++;
    }
    echo cs_subtemplate(__FILE__, $data, 'users', 'profile');
} else {
    settype($cs_user['users_height'], 'integer');
    settype($cs_user['users_icq'], 'integer');
    $cs_user['users_hidden'] = implode(',', $hidden);
    if ($cs_user['users_nick'] != $account['users_nick']) {
        change_nick($account['users_id'], $account['users_nick']);
    }
    $users_cells = array_keys($cs_user);
    $users_save = array_values($cs_user);
    cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']);
    cs_cache_delete('navbirth');
    cs_cache_delete('nextbirth');
    $data['link']['continue'] = cs_url('users', 'home');
    $data['lang']['head'] = $cs_lang['profile'];
    echo cs_subtemplate(__FILE__, $data, 'users', 'done');
    if ($account['access_wizard'] == 5) {
        $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_prfl' AND options_value = '1'");
        if (empty($wizard)) {
            $data['wizard']['show'] = cs_link($cs_lang['show'], 'wizard', 'roots');
            $data['wizard']['task_done'] = cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=prfl&amp;done=1');
            echo cs_subtemplate(__FILE__, $data, 'users', 'wizard');
        }
    }
}
Example #30
0
                $data['cat'][$run]['board'][$board_run]['board_name'] = cs_secure($cs_board[$board_run]['board_name']);
                $data['cat'][$run]['board'][$board_run]['board_order'] = cs_secure($cs_board[$board_run]['board_order']);
                if ($board_run > 0 and $cs_board[$board_run]['board_order'] - 1 >= $cs_board[$board_run - 1]['board_order']) {
                    $data['cat'][$run]['board'][$board_run]['board_up'] = cs_html_img('symbols/clansphere/up_arrow.png') . ' ' . cs_link($cs_lang['up'], 'board', 'sort', 'board=' . $cs_board[$board_run]['board_id'] . '&order=' . $cs_board[$board_run - 1]['board_order']);
                } else {
                    if ($board_run > 0 and $cs_board[$board_run]['board_order'] > 0) {
                        $board_new = $cs_board[$board_run - 1]['board_order'] - 1 > 0 ? $cs_board[$board_run - 1]['board_order'] - 1 : 0;
                        $data['cat'][$run]['board'][$board_run]['board_up'] = cs_html_img('symbols/clansphere/up_arrow.png') . ' ' . cs_link($cs_lang['up'], 'board', 'sort', 'board=' . $cs_board[$board_run]['board_id'] . '&order=' . $board_new);
                    } else {
                        $data['cat'][$run]['board'][$board_run]['board_up'] = '';
                    }
                }
                if ($board_run < $loop_board - 1 and $cs_board[$board_run]['board_order'] + 1 <= $cs_board[$board_run + 1]['board_order']) {
                    $data['cat'][$run]['board'][$board_run]['board_down'] = cs_html_img('symbols/clansphere/down_arrow.png') . ' ' . cs_link($cs_lang['down'], 'board', 'sort', 'board=' . $cs_board[$board_run]['board_id'] . '&order=' . $cs_board[$board_run + 1]['board_order']);
                } else {
                    if ($board_run < $loop_board - 1 and $cs_board[$board_run]['board_order'] < 9999) {
                        $board_new = $cs_board[$board_run + 1]['board_order'] + 1 < 9999 ? $cs_board[$board_run + 1]['board_order'] + 1 : 9999;
                        $data['cat'][$run]['board'][$board_run]['board_down'] = cs_html_img('symbols/clansphere/down_arrow.png') . ' ' . cs_link($cs_lang['down'], 'board', 'sort', 'board=' . $cs_board[$board_run]['board_id'] . '&order=' . $board_new);
                    } else {
                        $data['cat'][$run]['board'][$board_run]['board_down'] = '';
                    }
                }
            }
        } else {
            $data['cat'][$run]['board'] = array();
        }
    }
} else {
    $data['cat'] = '';
}
echo cs_subtemplate(__FILE__, $data, 'board', 'sort');