Ejemplo n.º 1
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']);
}
Ejemplo n.º 2
0
function cs_html_form($func, $form_id = 0, $mod = 0, $action = 0, $enctype = 0, $more = 0)
{
    cs_warning(__FUNCTION__ . ' - Function is removed, please use themes instead!');
    if (!empty($func)) {
        $form = "<form method=\"post\" id=\"" . $form_id . "\" ";
        $form .= "action=\"" . cs_url($mod, $action, $more) . "\"";
        if (!empty($enctype)) {
            $form .= " enctype=\"multipart/form-data\"";
        }
        return $form . ">\n" . cs_xsrf_protection_field(array(''));
    } else {
        return "</form>\n";
    }
}
Ejemplo n.º 3
0
function cs_update_rss($mod, $action, $name, $desc, $array, $abcode = 0)
{
    global $cs_main;
    $cs_main['rss'] = 1;
    $abcode = is_array($abcode) ? $abcode : array(0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 0);
    $target = 'uploads/rss/';
    $name_sec = htmlspecialchars($name, ENT_NOQUOTES, $cs_main['charset']);
    $desc_sec = htmlspecialchars($desc, ENT_NOQUOTES, $cs_main['charset']);
    if (is_writeable($target)) {
        include_once 'system/output/rss_20.php';
        $content = cs_rss_mode(1);
        $content .= cs_rss_channel(1, $mod, $name_sec, $cs_main['php_self']['website'], $desc_sec);
        if (!empty($array)) {
            foreach ($array as $item) {
                if (!empty($item['id']) and !empty($item['title']) and !empty($item['text'])) {
                    $title = htmlspecialchars($item['title'], ENT_NOQUOTES, $cs_main['charset']);
                    $link = $cs_main['php_self']['website'] . cs_url($mod, $action, 'id=' . $item['id'], 'index');
                    $text = empty($item['readmore']) ? $item['text'] : $item['readmore'];
                    $text = cs_secure($text, $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]);
                    $text = '<![CDATA[ ' . $text . ' ]]>';
                    if (!empty($abcode[3])) {
                        # use full uri if needed in html content
                        $url_pre = $cs_main['php_self']['website'] . $cs_main['php_self']['dirname'];
                        $pattern = "=(background|href|src)\\=\"(?!http|\\/)(.*?)\"=i";
                        $text = preg_replace($pattern, "\\1=\"" . $url_pre . "\\2\"", $text);
                    }
                    $date = empty($item['time']) ? 0 : date('D, d M Y H:i:s', $item['time']) . ' +0000';
                    # author is presented as 'email (nick)'
                    $author = (empty($item['nick']) or empty($item['author'])) ? '' : $item['author'] . ' (' . cs_secure($item['nick']) . ')';
                    $category = empty($item['cat']) ? '' : htmlspecialchars($item['cat'], ENT_NOQUOTES, $cs_main['charset']);
                    $content .= cs_rss_item($title, $link, $text, $date, $author, $category);
                }
            }
        }
        $content .= cs_rss_channel(0);
        $content .= cs_rss_mode(0);
        $save_file = fopen($target . $mod . '.xml', 'w');
        # set stream encoding if possible to avoid converting issues
        if (function_exists('stream_encoding')) {
            stream_encoding($save_file, $cs_main['charset']);
        }
        fwrite($save_file, $content);
        fclose($save_file);
        @chmod($target . $mod . '.xml', 0755);
    } else {
        cs_error($target, 'cs_update_rss - Unable to write into directory');
    }
    $cs_main['rss'] = 0;
}
Ejemplo n.º 4
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');
        }
    }
}
Ejemplo n.º 5
0
$users_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
$nick_temp = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $users_id);
if (isset($_GET['agree'])) {
    $nick = $nick_temp['users_nick'];
    $chars = 'abcdefghijklmnopqrstuvwxyz0123456789';
    $chars_count = strlen($chars) - 1;
    $mail = '';
    $given = 1;
    while (!empty($given)) {
        for ($i = 0; $i < 40; $i++) {
            $rand = rand(0, $chars_count);
            $mail .= $chars[$rand];
        }
        $given = cs_sql_count(__FILE__, 'users', "users_email = '" . $mail . "'");
    }
    $array_data = array('access_id' => 0, 'users_nick' => $nick, 'users_pwd' => '', 'users_name' => '', 'users_surname' => '', 'users_sex' => '', 'users_age' => '', 'users_height' => 0, 'users_lang' => '', 'users_country' => "fam", 'users_postalcode' => '', 'users_place' => '', 'users_adress' => '', 'users_icq' => 0, 'users_jabber' => '', 'users_skype' => '', 'users_email' => $mail, 'users_url' => '', 'users_phone' => '', 'users_mobile' => '', 'users_laston' => 0, 'users_picture' => '', 'users_avatar' => '', 'users_signature' => '', 'users_info' => '', 'users_regkey' => '', 'users_register' => 0, 'users_delete' => 1);
    $array_keys = array_keys($array_data);
    $array_values = array_values($array_data);
    cs_sql_update(__FILE__, 'users', $array_keys, $array_values, $users_id);
    cs_sql_delete(__FILE__, 'members', $users_id, 'users_id');
    cs_cache_clear();
    cs_redirect($cs_lang['del_true'], 'users');
}
if (isset($_GET['cancel'])) {
    cs_redirect($cs_lang['del_false'], 'users');
} else {
    $data['head']['body'] = sprintf($cs_lang['rly_rmv_user'], $nick_temp['users_nick']);
    $data['url']['agree'] = cs_url('users', 'remove', 'id=' . $users_id . '&amp;agree');
    $data['url']['cancel'] = cs_url('users', 'remove', 'id=' . $users_id . '&amp;cancel');
    echo cs_subtemplate(__FILE__, $data, 'users', 'remove');
}
Ejemplo n.º 6
0
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('users');
$five_min = cs_time() - 300;
$select = 'users_id, users_nick, users_country, users_active, users_invisible, users_picture';
$invisible = $account['access_users'] > 4 ? '' : " AND users_invisible = '0'";
$upcome = "users_laston > " . $five_min . " AND users_active = '1'" . $invisible;
$order = 'users_laston DESC';
$cs_users = cs_sql_select(__FILE__, 'users', $select, $upcome, $order, 0, 8);
$data = array();
if (empty($cs_users)) {
    $data['lang']['no_users'] = $cs_lang['no_data'];
    echo cs_subtemplate(__FILE__, $data, 'users', 'no_users');
} else {
    $count_users = count($cs_users);
    for ($run = 0; $run < $count_users; $run++) {
        if (!empty($cs_users[$run]['users_picture'])) {
            $data['users'][$run]['picture'] = 'uploads/users/' . $cs_users[$run]['users_picture'];
        } else {
            $data['users'][$run]['picture'] = 'symbols/users/no_pic.png';
        }
        if (empty($invisible) and !empty($cs_users[$run]['users_invisible'])) {
            $data['users'][$run]['nick'] = cs_html_italic(1) . $cs_users[$run]['users_nick'] . cs_html_italic(0);
        } else {
            $data['users'][$run]['nick'] = $cs_users[$run]['users_nick'];
        }
        $data['users'][$run]['url'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']);
    }
    echo cs_subtemplate(__FILE__, $data, 'users', 'navonline_pic');
}
Ejemplo n.º 7
0
<?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');
}
Ejemplo n.º 8
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('banners');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'banners_name DESC';
$cs_sort[2] = 'banners_name ASC';
$cs_sort[3] = 'banners_order DESC';
$cs_sort[4] = 'banners_order ASC';
$sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$banners_count = cs_sql_count(__FILE__, 'banners');
$data['count']['all'] = $banners_count;
$data['pages']['list'] = cs_pages('banners', 'manage', $banners_count, $start, 0, $sort);
$data['lang']['getmsg'] = cs_getmsg();
$select = 'banners_id, banners_name, banners_order';
$cs_banners = cs_sql_select(__FILE__, 'banners', $select, 0, $order, $start, $account['users_limit']);
$banners_loop = count($cs_banners);
$data['sort']['name'] = cs_sort('banners', 'manage', $start, 0, 1, $sort);
$data['sort']['order'] = cs_sort('banners', 'manage', $start, 0, 3, $sort);
if (empty($banners_loop)) {
    $data['banners'] = '';
}
for ($run = 0; $run < $banners_loop; $run++) {
    $data['banners'][$run]['name'] = cs_secure($cs_banners[$run]['banners_name']);
    $data['banners'][$run]['order'] = cs_secure($cs_banners[$run]['banners_order']);
    $data['banners'][$run]['edit'] = cs_url('banners', 'edit', 'id=' . $cs_banners[$run]['banners_id']);
    $data['banners'][$run]['remove'] = cs_url('banners', 'remove', 'id=' . $cs_banners[$run]['banners_id']);
}
echo cs_subtemplate(__FILE__, $data, 'banners', 'manage');
Ejemplo n.º 9
0
    $tables = 'wars w INNER JOIN {pre}_squads sq ON w.squads_id = sq.squads_id ';
    $tables .= 'INNER JOIN {pre}_clans c ON w.clans_id = c.clans_id ';
    $tables .= 'INNER JOIN {pre}_categories cat ON w.categories_id = cat.categories_id';
    $cells = 'sq.squads_name AS squads_name, c.clans_name AS clans_name, ';
    $cells .= 'w.wars_score1 AS wars_score1, w.wars_score2 AS wars_score2, ';
    $cells .= 'cat.categories_name AS categories_name, w.squads_id AS squads_id, ';
    $cells .= 'w.wars_id AS wars_id, c.clans_id AS clans_id';
    $war = cs_sql_select(__FILE__, $tables, $cells, "wars_id = '" . $wars_id . "'");
    $replace = array();
    $replace['{SQUADNAME}'] = $war['squads_name'];
    $replace['{SQUADURL}'] = cs_url('squads', 'view', 'id=' . $war['squads_id']);
    $replace['{OPPONENTNAME}'] = $war['clans_name'];
    $replace['{OPPONENTURL}'] = cs_url('clans', 'view', 'id=' . $war['clans_id']);
    $replace['{SCORE_1}'] = $war['wars_score1'];
    $replace['{SCORE_2}'] = $war['wars_score2'];
    $replace['{MATCH_URL}'] = cs_url('wars', 'view', 'id=' . $war['wars_id']);
    $replace['{CAT_NAME}'] = $war['categories_name'];
    $search = array_keys($replace);
    $replace = array_values($replace);
    $text = str_replace($search, $replace, $text);
    $cs_news['news_text'] = $text;
}
$abcode = explode(",", $op_news['abcode']);
$data['op']['features'] = empty($abcode[0]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['smileys'] = empty($abcode[1]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['clip'] = empty($abcode[2]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['html'] = empty($abcode[3]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['php'] = empty($abcode[4]) ? $cs_lang['no'] : $cs_lang['yes'];
if (isset($_POST['submit']) or isset($_POST['preview'])) {
    $cs_news['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('news', $_POST['categories_name']);
    $cs_news['news_close'] = isset($_POST['news_close']) ? $_POST['news_close'] : 0;
Ejemplo n.º 10
0
                    if ($cs_option['scores'] == 1) {
                        $matrix[$column + 1][$currow]['content'] = cs_html_link(cs_url('cups', 'match', 'id=' . $match['cupmatches_id']), $match['cupmatches_score2']);
                    }
                    if ($match['cupmatches_winner'] == $match['team2_id'] && $match['team2_id'] != $match['team1_id']) {
                        $matrix[$column][$currow]['class'] .= '-win';
                        if ($cs_option['scores'] == 1) {
                            $matrix[$column + 1][$currow]['class'] .= '-win';
                        }
                    } else {
                        $matrix[$column][$currow]['class'] .= '-loss';
                        if ($cs_option['scores'] == 1) {
                            $matrix[$column + 1][$currow]['class'] .= '-loss';
                        }
                    }
                } else {
                    $matrix[$column + 1][$currow]['content'] = cs_html_link(cs_url('cups', 'match', 'id=' . $match['cupmatches_id']), 'x');
                }
            }
            if ($prevrow > $maxrows) {
                $maxrows = $prevrow;
            }
            if ($currow > $maxrows) {
                $maxrows = $currow;
            }
            $count++;
        }
    }
}
// TODO
$finalmatchnr = -1;
if ($cup['cups_brackets'] == CS_CUPS_SYSTEM_LB) {
Ejemplo n.º 11
0
    $cs_banners['banners_name'] = '';
    $cs_banners['banners_url'] = '';
    $cs_banners['banners_picture'] = '';
    $cs_banners['banners_alt'] = '';
    $cs_banners['banners_order'] = $op_banners['def_order'];
    $cs_banners['categories_id'] = 0;
}
if (!isset($_POST['submit'])) {
    $data['lang']['body'] = $cs_lang['body_create'];
} elseif (!empty($error)) {
    $data['lang']['body'] = $message;
} else {
    $data['lang']['body'] = $cs_lang['create_done'];
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['action']['form'] = cs_url('banners', 'create');
    $data['banners']['name'] = $cs_banners['banners_name'];
    $data['banners']['category'] = cs_categories_dropdown('banners', $cs_banners['categories_id']);
    $data['banners']['url'] = $cs_banners['banners_url'];
    $data['banners']['or_img_url'] = $cs_banners['banners_picture'];
    $data['banners']['alt'] = $cs_banners['banners_alt'];
    $data['banners']['order'] = $cs_banners['banners_order'];
    $matches[1] = $cs_lang['pic_infos'];
    $return_types = '';
    foreach ($img_filetypes as $add) {
        $return_types .= empty($return_types) ? $add : ', ' . $add;
    }
    $matches[2] = $cs_lang['max_width'] . $op_banners['max_width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $op_banners['max_height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_banners['max_size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
Ejemplo n.º 12
0
    for ($run = 0; $run < $showcount; $run++) {
        $data['show'][$run]['run'] = $run;
        $data['show'][$run]['value'] = empty($_POST['show_' . $run]) ? '' : $_POST['show_' . $run];
        $data['show'][$run]['axx_value'] = empty($_POST['showaccess_' . $run]) ? '' : $_POST['showaccess_' . $run];
    }
    $data['value']['showcount'] = $showcount;
    $data['value']['modname'] = empty($_POST['modname']) ? '' : $_POST['modname'];
    $data['value']['moddir'] = empty($_POST['moddir']) ? '' : $_POST['moddir'];
    $data['value']['modversion'] = empty($_POST['modversion']) ? '' : $_POST['modversion'];
    $data['value']['description'] = empty($_POST['description']) ? '' : $_POST['description'];
    $var = cs_datepost('release', 'date');
    $data['value']['dateselect'] = empty($var) ? cs_datereal('Y-m-d') : $var;
    $data['value']['creator'] = empty($_POST['creator']) ? '' : $_POST['creator'];
    $data['value']['team'] = empty($_POST['team']) ? '' : $_POST['team'];
    $data['value']['homepage'] = empty($_POST['homepage']) ? '' : $_POST['homepage'];
    $data['value']['icon'] = empty($_POST['icon']) ? '' : $_POST['icon'];
    $clip[1] = $cs_lang['help'];
    $clip[2] = $cs_lang['helptext'];
    $data['help']['clip'] = cs_abcode_clip($clip);
    $sel = 'selected="selected"';
    $data['selected']['categories_no'] = empty($_POST['categories']) ? $sel : '';
    $data['selected']['categories_yes'] = empty($_POST['categories']) ? '' : $sel;
    $data['selected']['protected_no'] = empty($_POST['protected']) ? $sel : '';
    $data['selected']['protected_yes'] = empty($_POST['protected']) ? '' : $sel;
    $data['form']['url'] = cs_url('modules', 'create');
    $data['input']['dateselect'] = cs_dateselect('release', 'date', $data['value']['dateselect']);
    echo cs_subtemplate(__FILE__, $data, 'modules', 'create');
} else {
    cs_cache_clear();
    cs_redirect($cs_lang['create_done'], 'modules', 'roots');
}
Ejemplo n.º 13
0
     } else {
         if ($voted_ip == $users_ip) {
             $check_user_voted++;
         }
     }
 }
 if (empty($check_user_voted)) {
     $votes_navlist = array();
     $votes_navlist['lang']['create'] = $cs_lang['create'];
     $votes_navlist['votes']['id'] = $votes_id;
     $votes_navlist['votes']['type'] = empty($cs_votes['votes_several']) ? 'radio' : 'checkbox';
     $votes_navlist['if']['several'] = empty($cs_votes['votes_several']) ? 0 : 1;
     $votes_navlist['if']['several_name'] = empty($cs_votes['votes_several']) ? 0 : 1;
     $votes_navlist['votes']['question'] = $cs_votes['votes_question'];
     #   $votes_navlist['votes']['action']   = '?' . $vote_action . $vote_more;
     $votes_navlist['url']['action'] = cs_url('votes');
     //  $votes_navlist['url']['action'] = '?' . $_SERVER['argv'][0];
     $temp = explode("\n", $cs_votes['votes_election']);
     $answers_stop = count($temp) - 1;
     for ($run = 0; $run < $answers_stop; $run++) {
         $votes_navlist['answers'][$run]['value'] = $run + 1;
         $votes_navlist['answers'][$run]['answer'] = $temp[$run + 1];
     }
     echo cs_subtemplate(__FILE__, $votes_navlist, 'votes', 'navlist_vote');
 } else {
     $votes_navlist = array();
     $votes_navlist['votes']['question'] = $cs_votes['votes_question'];
     $temp = explode("\n", $cs_votes['votes_election']);
     $answers_stop = count($temp) - 1;
     for ($run = 0; $run < $answers_stop; $run++) {
         $answer_count = 0;
Ejemplo n.º 14
0
    $data['value']['dir'] = $dir;
    $cells = 'access_id, access_name, access_clansphere, access_' . $dir;
    $data['access'] = cs_sql_select(__FILE__, 'access', $cells, 0, 'access_clansphere ASC', 0, 0);
    $sel = 'selected="selected"';
    $count_access = count($data['access']);
    for ($run = 0; $run < $count_access; $run++) {
        $data['access'][$run]['sel0'] = '';
        $data['access'][$run]['sel1'] = '';
        $data['access'][$run]['sel2'] = '';
        $data['access'][$run]['sel3'] = '';
        $data['access'][$run]['sel4'] = '';
        $data['access'][$run]['sel5'] = '';
        if (isset($_GET['activate'])) {
            $data['access'][$run]['sel' . $data['access'][$run]['access_clansphere']] = $sel;
        } else {
            $data['access'][$run]['sel' . $data['access'][$run]['access_' . $dir]] = $sel;
        }
    }
    echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_1');
} else {
    $dir = $_POST['dir'];
    $access = cs_sql_select(__FILE__, 'access', 'access_id', 0, 'access_clansphere ASC', 0, 0);
    $cells = array('access_' . $dir);
    foreach ($access as $level) {
        $values = array($_POST['access_' . $level['access_id']]);
        cs_sql_update(__FILE__, 'access', $cells, $values, $level['access_id']);
        cs_cache_delete('access_' . $level['access_id']);
    }
    $data['url']['continue'] = cs_url('modules', 'roots');
    echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_2');
}
Ejemplo n.º 15
0
if (!empty($_GET['del_id'])) {
    $del_id = $_GET['del_id'];
    settype($del_id, 'integer');
    $target = cs_sql_select(__FILE__, 'members', 'squads_id', "members_id = '" . $del_id . "'");
    $squads_id = $target['squads_id'];
    $is_admin = "members_admin > 0 AND squads_id ='" . $squads_id . "' AND users_id ='" . $account['users_id'] . "'";
    $allow = cs_sql_count(__FILE__, 'members', $is_admin);
    if (empty($allow)) {
        $msg = $cs_lang['del_failed'];
    } else {
        cs_sql_delete(__FILE__, 'members', $del_id);
        $msg = $cs_lang['del_done'];
    }
}
$data['lang']['mod_name'] = $cs_lang[$op_members['label']];
$data['url']['form'] = cs_url('members', 'center');
$data['lang']['team'] = $cs_lang[$op_squads['label']];
$where = "mem.users_id = '" . $account['users_id'] . "' AND mem.members_admin > 0";
$select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id';
$from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id';
$sqd_data = cs_sql_select(__FILE__, $from, $select, $where, 'sqd.squads_name', 0, 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 : '';
Ejemplo n.º 16
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('medals');
$cs_get = cs_get('id,confirm,');
if (isset($_GET['confirm'])) {
    cs_sql_delete(__FILE__, 'medalsuser', $cs_get['id'], 'medals_id');
    cs_sql_delete(__FILE__, 'medals', $cs_get['id']);
    cs_redirect($cs_lang['del_true'], 'medals', 'manage');
}
$medal = cs_sql_select(__FILE__, 'medals', 'medals_name', "medals_id = '" . $cs_get['id'] . "'");
if (!empty($medal)) {
    $data = array();
    $medals_name = cs_secure($medal['medals_name']);
    $data['medals']['message'] = sprintf($cs_lang['rly_remove'], $medals_name);
    $data['medals']['url_confirm'] = cs_url('medals', 'remove', 'id=' . $cs_get['id'] . '&amp;confirm');
    echo cs_subtemplate(__FILE__, $data, 'medals', 'remove');
} else {
    cs_redirect('', 'medals');
}
Ejemplo n.º 17
0
    $wars_pics = explode("\n", $cs_wars['wars_pictures']);
    foreach ($wars_pics as $pic) {
        $link = cs_html_img('uploads/wars/thumb-' . $pic);
        $path = $cs_main['php_self']['dirname'];
        $wars['pictures']['show'] .= cs_html_link($path . 'uploads/wars/picture-' . $pic, $link) . ' ';
    }
}
$wars['war']['report'] = empty($cs_wars['wars_report']) ? '-' : cs_secure($cs_wars['wars_report'], 1, 1);
$wars['war']['report2'] = empty($cs_wars['wars_report2']) ? '-' : cs_secure($cs_wars['wars_report2'], 1, 1);
$tables2 = 'rounds rnd INNER JOIN {pre}_maps mps ON rnd.maps_id = mps.maps_id';
$cells2 = 'rnd.rounds_score1 AS rounds_score1, rnd.rounds_score2 AS rounds_score2, ' . 'rnd.rounds_description AS rounds_description, mps.maps_name AS maps_name, ' . 'rnd.maps_id AS maps_id';
$wars['rounds'] = cs_sql_select(__FILE__, $tables2, $cells2, 'rnd.wars_id = \'' . $wars_id . '\'', 'rnd.rounds_order ASC', 0, 0);
if (!empty($wars['rounds'])) {
    $count_rounds = count($wars['rounds']);
    for ($run = 0; $run < $count_rounds; $run++) {
        $wars['rounds'][$run]['mapurl'] = cs_url('maps', 'view', 'id=' . $wars['rounds'][$run]['maps_id']);
        $wars['rounds'][$run]['maps_name'] = cs_secure($wars['rounds'][$run]['maps_name']);
        $result2 = $wars['rounds'][$run]['rounds_score1'] - $wars['rounds'][$run]['rounds_score2'];
        $icon2 = $result2 >= 1 ? 'green' : 'red';
        $icon2 = !empty($result2) ? $icon2 : 'grey';
        $wars['rounds'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon2 . '.gif');
        $wars['rounds'][$run]['rounds_description'] = cs_secure($wars['rounds'][$run]['rounds_description'], 1, 1);
    }
} else {
    $wars['rounds'] = array();
}
if ($wars_status == 'upcoming') {
    $condition = 'users_id = \'' . $account['users_id'] . '\' AND squads_id = \'' . $cs_squad['squads_id'] . '\'';
    $squadmember = cs_sql_count(__FILE__, 'members', $condition);
    $wars_access = empty($account['access_wars']) ? 0 : $account['access_wars'];
    if (!empty($squadmember) or $wars_access >= 3) {
Ejemplo n.º 18
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
require_once 'mods/board/functions.php';
$data = array();
$data['stats']['topics'] = cs_sql_count(__FILE__, 'threads');
$data['stats']['posts'] = cs_sql_count(__FILE__, 'comments', 'comments_mod = \'board\'');
$data['stats']['users'] = cs_sql_count(__FILE__, 'users', 'users_active = 1 AND users_delete = 0');
$data['stats']['categories'] = cs_sql_count(__FILE__, 'categories', 'categories_mod = \'board\'');
$data['stats']['boards'] = cs_sql_count(__FILE__, 'board');
$data['stats']['users_active'] = cs_sql_count(__FILE__, 'comments', 'comments_mod = \'board\'', 'users_id');
$user = toplist_comments(0, 3);
$data['stats']['toplist'] = '';
if (!empty($user)) {
    foreach ($user as $users_data) {
        $data['stats']['toplist'] .= empty($users_data['users_nick']) ? '- (' . $users_data['num_comments'] . ' ' . $cs_lang['posts'] . '), ' : cs_user($users_data['users_id'], $users_data['users_nick'], $users_data['users_active'], $users_data['users_delete']) . ' (' . $users_data['num_comments'] . ' ' . $cs_lang['posts'] . '), ';
    }
    $data['stats']['toplist'] = substr($data['stats']['toplist'], 0, -2);
}
$tables = 'threads t INNER JOIN {pre}_board b ON t.board_id = b.board_id ' . 'AND b.board_access <= \'' . $account['access_board'] . '\' AND b.board_pwd = \'\' ' . 'INNER JOIN {pre}_comments cms ON cms.comments_mod = \'board\' ' . 'AND cms.comments_fid = t.threads_id GROUP BY t.threads_id, t.threads_comments, t.threads_headline';
$cells = 't.threads_id AS threads_id, t.threads_comments AS threads_comments, ';
$cells .= 't.threads_headline AS threads_headline, COUNT(cms.comments_id) AS comments';
$select = cs_sql_select(__FILE__, $tables, $cells, 0, 'comments DESC');
$data['stats']['longest_thread'] = $select['threads_headline'];
$data['stats']['longest_thread_posts'] = $select['comments'];
$data['link']['longest_thread'] = cs_url('board', 'thread', 'where=' . $select['threads_id']);
$data['stats']['average_posts'] = !empty($data['stats']['topics']) ? round($data['stats']['posts'] / $data['stats']['topics'], 2) : 0;
echo cs_subtemplate(__FILE__, $data, 'board', 'stats');
Ejemplo n.º 19
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('wars');
$cs_get = cs_get('id');
$data = array();
$rounds_id = empty($cs_get['id']) ? 0 : $cs_get['id'];
$cs_rounds = cs_sql_select(__FILE__, 'rounds', 'wars_id', "rounds_id = '" . $rounds_id . "'");
if (isset($_GET['agree'])) {
    cs_sql_delete(__FILE__, 'rounds', $rounds_id);
    cs_redirect($cs_lang['del_true'], 'wars', 'rounds', 'id=' . $cs_rounds['wars_id']);
}
if (isset($_GET['cancel'])) {
    cs_redirect($cs_lang['del_false'], 'wars', 'rounds', 'id=' . $cs_rounds['wars_id']);
} else {
    $data['head']['body'] = sprintf($cs_lang['really_delete'], $rounds_id);
    $data['url']['agree'] = cs_url('wars', 'roundsremove', 'id=' . $rounds_id . '&amp;agree');
    $data['url']['cancel'] = cs_url('wars', 'roundsremove', 'id=' . $rounds_id . '&amp;cancel');
    echo cs_subtemplate(__FILE__, $data, 'wars', 'remove');
}
Ejemplo n.º 20
0
    cs_redirect(NULL, 'board', 'sort');
}
if (!empty($_GET['board'])) {
    $board_cells = array('board_order');
    $board_save = empty($_GET['order']) ? array(0) : array(cs_sql_escape($_GET['order']));
    cs_sql_update(__FILE__, 'board', $board_cells, $board_save, cs_sql_escape($_GET['board']));
    cs_redirect(NULL, 'board', 'sort');
}
if (!empty($_GET['cat'])) {
    $board_cells = array('categories_order');
    $board_save = empty($_GET['order']) ? array(0) : array(cs_sql_escape($_GET['order']));
    cs_sql_update(__FILE__, 'categories', $board_cells, $board_save, cs_sql_escape($_GET['cat']));
    cs_redirect(NULL, 'board', 'sort');
}
$data['link']['back'] = cs_url('board', 'manage');
$data['link']['delall'] = cs_url('board', 'sort', 'delall=1');
$where = "categories_mod = 'board'";
$select = 'categories_name, categories_id, categories_order';
$cs_categories = cs_sql_select(__FILE__, 'categories', $select, $where, 'categories_order ASC, categories_name ASC', 0, 0);
$loop_categories = count($cs_categories);
if (!empty($cs_categories)) {
    for ($run = 0; $run < $loop_categories; $run++) {
        $data['cat'][$run]['categories_name'] = cs_secure($cs_categories[$run]['categories_name']);
        $data['cat'][$run]['categories_order'] = cs_secure($cs_categories[$run]['categories_order']);
        if ($run > 0 and $cs_categories[$run]['categories_order'] - 1 >= $cs_categories[$run - 1]['categories_order']) {
            $data['cat'][$run]['categories_up'] = cs_html_img('symbols/clansphere/up_arrow_active.png') . ' ' . cs_link($cs_lang['up'], 'board', 'sort', 'cat=' . $cs_categories[$run]['categories_id'] . '&order=' . $cs_categories[$run - 1]['categories_order']);
        } else {
            if ($run > 0 and $cs_categories[$run]['categories_order'] > 0) {
                $cat_new = $cs_categories[$run - 1]['categories_order'] - 1 > 0 ? $cs_categories[$run - 1]['categories_order'] - 1 : 0;
                $data['cat'][$run]['categories_up'] = cs_html_img('symbols/clansphere/up_arrow_active.png') . ' ' . cs_link($cs_lang['up'], 'board', 'sort', 'cat=' . $cs_categories[$run]['categories_id'] . '&order=' . $cat_new);
            } else {
Ejemplo n.º 21
0
    $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');
Ejemplo n.º 22
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('fightus');
$cs_get = cs_get('id,agree,cancel');
if (isset($cs_get['agree'])) {
    cs_sql_delete(__FILE__, 'fightus', $cs_get['id']);
    cs_cache_delete('count_fightus');
    cs_redirect($cs_lang['fight_del_true'], 'fightus');
}
if (isset($cs_get['cancel'])) {
    cs_redirect($cs_lang['del_false'], 'fightus');
}
$fightus = cs_sql_select(__FILE__, 'fightus', 'fightus_nick', 'fightus_id = ' . $cs_get['id'], 0, 0, 1);
if (!empty($fightus)) {
    $data = array();
    $data['head']['body'] = sprintf($cs_lang['remove_entry'], $cs_lang['mod_name'], $fightus['fightus_nick']);
    $data['url']['agree'] = cs_url('fightus', 'remove', 'id=' . $cs_get['id'] . '&amp;agree');
    $data['url']['cancel'] = cs_url('fightus', 'remove', 'id=' . $cs_get['id'] . '&amp;cancel');
    echo cs_subtemplate(__FILE__, $data, 'fightus', 'remove');
} else {
    cs_redirect('', 'fightus');
}
Ejemplo n.º 23
0
$data['lang']['body'] = !isset($_POST['submit']) ? $cs_lang['body_create'] : $errormsg;
if (isset($_POST['submit']) && empty($games_error) && empty($symbol_error)) {
    $games_cells = array('games_name', 'games_version', 'games_released', 'games_creator', 'categories_id', 'games_url', 'games_usk');
    $games_save = array($games_name, $games_version, $games_release, $games_creator, $categories_id, $games_url, $games_usk);
    cs_sql_insert(__FILE__, 'games', $games_cells, $games_save);
    $where = "games_name = '" . cs_sql_escape($games_name) . "'";
    $getid = cs_sql_select(__FILE__, 'games', 'games_id', $where);
    if (!empty($files['symbol']['tmp_name']) and $symbol_error == 0) {
        $filename = $getid['games_id'] . '.' . $extension;
        cs_upload('games', $filename, $files['symbol']['tmp_name']);
    } else {
        copy('uploads/games/0.gif', 'uploads/games/' . (int) $getid['games_id'] . '.gif');
    }
    cs_redirect($cs_lang['create_done'], 'games');
}
$data['url']['form'] = cs_url('games', 'create');
$data['games']['name'] = $games_name;
$data['games']['version'] = $games_version;
$data['games']['genre'] = cs_categories_dropdown('games', $categories_id);
$data['games']['release'] = cs_dateselect('datum', 'date', $games_release);
$data['games']['creator'] = $games_creator;
$data['games']['homepage'] = $games_url;
$usknum[0]['games_usk'] = '00';
$usknum[0]['name'] = $cs_lang['usk_00'];
$usknum[1]['games_usk'] = '06';
$usknum[1]['name'] = $cs_lang['usk_06'];
$usknum[2]['games_usk'] = '12';
$usknum[2]['name'] = $cs_lang['usk_12'];
$usknum[3]['games_usk'] = '16';
$usknum[3]['name'] = $cs_lang['usk_16'];
$usknum[4]['games_usk'] = '18';
Ejemplo n.º 24
0
$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');
Ejemplo n.º 25
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
$count_abo = cs_sql_count(__FILE__, 'abonements', 'users_id=' . $account['users_id']);
$count_att = cs_sql_count(__FILE__, 'boardfiles', 'users_id=' . $account['users_id']);
$data = array();
$data['head']['getmsg'] = cs_getmsg();
$data['count']['abos'] = $count_abo;
$data['count']['attachments'] = $count_att;
$data['link']['abos'] = cs_url('board', 'center');
$data['link']['attachments'] = cs_url('board', 'attachments');
$data['link']['avatar'] = cs_url('board', 'avatar');
$data['action']['form'] = cs_url('board', 'signature');
$data['signature']['smileys'] = cs_abcode_smileys('signature');
$data['signature']['abcode'] = cs_abcode_features('signature');
$signature_sql = cs_sql_select($file, 'users', 'users_signature', "users_id = '" . $account['users_id'] . "'");
$signature = $signature_sql['users_signature'];
$signature = isset($_POST['signature']) ? $_POST['signature'] : $signature;
$signature = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$signature = preg_replace_callback("=\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$data['signature']['text'] = $signature;
$data['signature']['preview'] = cs_secure($signature, 1, 1);
$data['if']['preview'] = (isset($_POST['preview']) and !empty($signature)) ? 1 : 0;
if (isset($_POST['submit'])) {
    $signature_cells = array('users_signature');
    $signature_save = array($signature);
    cs_sql_update(__FILE__, 'users', $signature_cells, $signature_save, $account['users_id']);
    cs_redirect($cs_lang['create_done'], 'board', 'signature');
}
Ejemplo n.º 26
0
        // cs_sql_query(__FILE__,$query);
        cs_sql_update(__FILE__, 'threads', array('board_id'), array($cs_board_id), 0, 'board_id = ' . $board_id);
        # Update board entry to get correct threads and comments count
        include_once 'mods/board/repair.php';
        cs_board_threads($cs_board_id);
        cs_board_last($cs_board_id);
        cs_board_comments($cs_board_id);
    }
    cs_redirect($cs_lang['del_true'], 'board');
}
if (isset($_POST['cancel'])) {
    $board_form = 0;
    cs_redirect($cs_lang['del_false'], 'board');
}
if (!empty($board_form)) {
    $data['action']['form'] = cs_url('board', 'remove');
    $data['lang']['body'] = sprintf($cs_lang['del_rly'], $board_id);
    if (!empty($threads_loop)) {
        $data['if']['threads_loop'] = true;
        $cs_board['change_threads'] = 0;
        if ($cs_board['change_threads'] == 0) {
            $data['remove']['checked'] = '';
        } else {
            $data['remove']['checked'] = 'checked="checked"';
        }
        $cs_board['board_id'] = 0;
        $where = "board_id != '" . $board_id . "'";
        $board_data = cs_sql_select(__FILE__, 'board', '*', $where, 'board_name', 0, 0);
        $data['remove']['dropdown'] = cs_dropdown('board_id', 'board_name', $board_data, $cs_board['board_id']);
    } else {
        $data['if']['threads_loop'] = false;
Ejemplo n.º 27
0
// ClanSphere 2010 - www.clansphere.net
// $Id$
$thisday = cs_datereal('m-d');
$output = array();
$data = array();
$data = cs_cache_load('navbirth');
$cs_lang = cs_translate('users');
$options = cs_sql_option(__FILE__, 'users');
if ($data['day'] != $thisday) {
    $data['day'] = $thisday;
    $select = 'users_id, users_nick, users_age';
    $where = "users_age LIKE '%-" . $data['day'] . "' AND users_hidden NOT LIKE '%users_age%' AND users_active = 1";
    $order = 'users_nick ASC';
    $data['users'] = cs_sql_select(__FILE__, 'users', $select, $where, $order, 0, 0);
    cs_cache_save('navbirth', $data);
}
if (empty($data['users'])) {
    echo $cs_lang['no_data'];
} else {
    $count = empty($options['navbirth_max_users']) ? count($data['users']) : min(count($data['users']), $options['navbirth_max_users']);
    for ($run = 0; $run < $count; $run++) {
        $birth = explode('-', $data['users'][$run]['users_age']);
        $output['users'][$run]['age'] = cs_datereal('Y') - $birth[0];
        $output['users'][$run]['day'] = $birth[2];
        $output['users'][$run]['month'] = $birth[1];
        $output['users'][$run]['year'] = $birth[0];
        $output['users'][$run]['user'] = cs_user($data['users'][$run]['users_id'], $data['users'][$run]['users_nick']);
        $output['users'][$run]['messageurl'] = cs_url('messages', 'create', 'to_id=' . $data['users'][$run]['users_id']);
    }
    echo cs_subtemplate(__FILE__, $output, 'users', 'navbirth');
}
Ejemplo n.º 28
0
    $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');
Ejemplo n.º 29
0
         if ($files_gl['picture']['size'] > $options['max_size']) {
             $error .= cs_html_br(1) . '- ' . $cs_lang['too_big'];
         }
     }
 }
 if (empty($_POST['submit']) || !empty($error)) {
     $maps_id = empty($_POST['submit']) ? (int) $_GET['id'] : $_POST['maps_id'];
     $cells = 'games_id, maps_name, maps_text, maps_picture, server_name';
     $data['maps'] = cs_sql_select(__FILE__, 'maps', $cells, 'maps_id = \'' . $maps_id . '\'');
     $data['maps']['maps_id'] = empty($error) ? (int) $_GET['id'] : (int) $_POST['maps_id'];
     $data['maps']['message'] = empty($error) ? $cs_lang['fill_in'] : $cs_lang['error_occured'] . $error;
     $data['maps']['maps_name'] = empty($_POST['maps_name']) ? $data['maps']['maps_name'] : $_POST['maps_name'];
     $data['maps']['maps_text'] = empty($_POST['maps_text']) ? $data['maps']['maps_text'] : $_POST['maps_text'];
     $data['abcode']['smileys'] = cs_abcode_smileys('maps_text');
     $data['abcode']['features'] = cs_abcode_features('maps_text');
     $data['maps']['action'] = cs_url('maps', 'edit');
     $data['games'] = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0);
     $data['games'] = cs_dropdownsel($data['games'], $data['maps']['games_id'], 'games_id');
     $data['maps']['picture'] = empty($data['maps']['maps_picture']) ? '-' : cs_html_img('uploads/maps/' . $data['maps']['maps_picture']);
     $matches[1] = $cs_lang['pic_infos'];
     $return_types = '';
     foreach ($img_filetypes as $add) {
         $return_types .= empty($return_types) ? $add : ', ' . $add;
     }
     $matches[2] = $cs_lang['max_width'] . $options['max_width'] . ' px' . cs_html_br(1);
     $matches[2] .= $cs_lang['max_height'] . $options['max_height'] . ' px' . cs_html_br(1);
     $matches[2] .= $cs_lang['max_size'] . cs_filesize($options['max_size']) . cs_html_br(1);
     $matches[2] .= $cs_lang['filetypes'] . $return_types;
     $data['maps']['matches'] = cs_abcode_clip($matches);
     $data['if']['picture_remove'] = !empty($data['maps']['maps_picture']) ? TRUE : FALSE;
     echo cs_subtemplate(__FILE__, $data, 'maps', 'edit');
Ejemplo n.º 30
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('install');
$data = array();
$languages = cs_checkdirs('lang');
$i = 0;
foreach ($languages as $lang) {
    $data['languages'][$i]['name'] = $lang['name'];
    $data['languages'][$i]['symbol'] = $lang['symbol'];
    $data['languages'][$i]['link'] = cs_url('install', 'compatible', 'lang=' . $lang['name']);
    $i++;
}
echo cs_subtemplate(__FILE__, $data, 'install');