Example #1
0
function cs_themebar($source, $string, $mod, $action)
{
    global $cs_main, $account;
    // themebar has some side-effects, so it is forbidden in a few mod/action combinations
    $forbidden = array('abcode/sourcebox', 'errors/500', 'pictures/select', 'clansphere/debug', 'clansphere/navmeta', 'clansphere/themebar', 'clansphere/themebar_light');
    if (!in_array($mod . '/' . $action, $forbidden)) {
        // prevent from double inserting the xsrf protection key
        $xsrf = $cs_main['xsrf_protection'];
        $cs_main['xsrf_protection'] = false;
        $data = array();
        $data['data']['content'] = $string;
        $data['raw']['target'] = 'themes/' . $cs_main['def_theme'] . '/' . $mod . '/' . $action . '.tpl';
        $data['raw']['langfile'] = 'lang/' . $account['users_lang'] . '/' . $mod . '.php';
        $phpsource = str_ireplace($cs_main['def_path'], '', $source);
        $phpsource = str_replace('\\', '/', $phpsource);
        $data['raw']['phpsource'] = ltrim($phpsource, '/');
        // use lightweight version if explorer is not available
        if (empty($account['access_explorer'])) {
            $string = cs_subtemplate(__FILE__, $data, 'clansphere', 'themebar_light');
        } else {
            include_once 'mods/explorer/functions.php';
            $data['link']['target'] = cs_explorer_path($data['raw']['target'], 'escape');
            $data['link']['langfile'] = cs_explorer_path($data['raw']['langfile'], 'escape');
            $data['link']['phpsource'] = cs_explorer_path($data['raw']['phpsource'], 'escape');
            $string = cs_subtemplate(__FILE__, $data, 'clansphere', 'themebar');
        }
        // reset the xsrf protection option
        $cs_main['xsrf_protection'] = $xsrf;
    }
    return $string;
}
Example #2
0
function cs_search($mod)
{
    $cs_lang = cs_translate('search');
    $data = array();
    $data['search']['mod'] = $mod;
    echo cs_subtemplate(__FILE__, $data, 'search', 'search_function');
}
Example #3
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 #4
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 #5
0
function cs_pictures_select($mod, $fid = 0)
{
    settype($fid, 'integer');
    $cs_lang = cs_translate('pictures');
    $data = array();
    if (empty($fid)) {
        $data['if']['already'] = false;
    } else {
        $where = "pictures_mod = '" . $mod . "' AND pictures_fid = " . $fid;
        $picture = cs_sql_select(__FILE__, 'pictures', 'pictures_file', $where);
        if (empty($picture)) {
            $data['if']['already'] = false;
        } else {
            $data['if']['already'] = true;
            $data['picture']['file'] = $picture['pictures_file'];
        }
    }
    $string = cs_subtemplate(__FILE__, $data, 'pictures', 'select');
    return $string;
}
Example #6
0
function cs_categories_dropdown2($mod, $categories_id = 0, $new = 1, $name = 'categories_id')
{
    global $account;
    $data = array();
    $cells = 'categories_id, categories_name, categories_subid';
    $categories = cs_sql_select(__FILE__, 'categories', $cells, "categories_mod = '" . $mod . "' AND categories_access <= '" . $account['access_news'] . "'", 'categories_subid ASC, categories_name', 0, 0);
    $categories = cs_catsort($categories);
    $data['categories']['options'] = '';
    if (!empty($categories)) {
        foreach ($categories as $cat) {
            $blank = '';
            if (!empty($cat['layer'])) {
                for ($i = 0; $i < $cat['layer']; $i++) {
                    $blank .= '&nbsp;&nbsp;';
                }
                $blank .= '&raquo;';
            }
            $data['categories']['options'] .= cs_html_option($blank . $cat['categories_name'], $cat['categories_id'], $cat['categories_id'] == $categories_id);
        }
    }
    $data['if']['new'] = !empty($new) ? TRUE : FALSE;
    $data['dropdown']['name'] = $name;
    return cs_subtemplate(__FILE__, $data, 'categories', 'cat_dropdown2');
}
Example #7
0
     $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');
 } else {
     $cs_maps['games_id'] = (int) $_POST['games_id'];
     $cs_maps['maps_name'] = $_POST['maps_name'];
     $cs_maps['server_name'] = $_POST['server_name'];
     $cs_maps['maps_text'] = $_POST['maps_text'];
     $maps_id = (int) $_POST['maps_id'];
     if (empty($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) {
         $cells = array_keys($cs_maps);
         $values = array_values($cs_maps);
         cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id);
     } elseif (isset($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) {
         $select = cs_sql_select(__FILE__, 'maps', 'maps_picture', 'maps_id = \'' . $maps_id . '\'');
         cs_unlink('maps', $select['maps_picture']);
         $cs_maps['maps_picture'] = '';
         $cells = array_keys($cs_maps);
Example #8
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');
}
Example #9
0
    }
    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 #10
0
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
} elseif (isset($_POST['preview'])) {
    $data['head']['body'] = $cs_lang['preview'];
}
if (isset($_POST['preview']) and empty($error)) {
    $data['if']['preview'] = TRUE;
    $data['preview']['date'] = cs_date('unix', $history['history_time'], 1);
    $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
    $data['preview']['user'] = cs_user($history['users_id'], $cs_user['users_nick'], $cs_user['users_active']);
    $data['preview']['text'] = cs_secure($history['history_text'], 1, 1, 1, 1);
}
if (!empty($error) or !isset($_POST['submit']) or isset($_POST['preview'])) {
    if (empty($cs_main['rte_html'])) {
        $data['if']['no_rte_html'] = 1;
        $data['history']['abcode_smileys'] = cs_abcode_smileys('history_text', 1);
        $data['history']['abcode_features'] = cs_abcode_features('history_text', 1, 1);
        $data['history']['text'] = $history['history_text'];
        $data['if']['rte_html'] = 0;
    } else {
        $data['if']['rte_html'] = 1;
        $data['if']['no_rte_html'] = 0;
        $data['history']['rte_html'] = cs_rte_html('history_text', $history['history_text']);
    }
    echo cs_subtemplate(__FILE__, $data, 'history', 'create');
} else {
    $history_cells = array_keys($history);
    $history_save = array_values($history);
    cs_sql_insert(__FILE__, 'history', $history_cells, $history_save);
    cs_redirect($cs_lang['create_done'], 'history');
}
Example #11
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('computers');
if (isset($_POST['submit'])) {
    $save = array();
    $save['max_width'] = (int) $_POST['max_width'];
    $save['max_height'] = (int) $_POST['max_height'];
    $save['max_size'] = (int) $_POST['max_size'];
    require_once 'mods/clansphere/func_options.php';
    cs_optionsave('computers', $save);
    cs_redirect($cs_lang['changes_done'], 'options', 'roots');
} else {
    $data = array();
    $data['com'] = cs_sql_option(__FILE__, 'computers');
    echo cs_subtemplate(__FILE__, $data, 'computers', 'options');
}
Example #12
0
                    $cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0;
                    $cs_gallery_pic['gallery_access'] = isset($_POST['gallery_access']) ? $_POST['gallery_access'] : 0;
                    $cs_gallery_pic['gallery_watermark'] = $_POST['gallery_watermark'];
                    if (!empty($_POST['gallery_watermark'])) {
                        $watermark_pos = $_POST['watermark_pos'];
                        $watermark_trans = $_POST['gallery_watermark_trans'];
                        $cs_gallery_pic['gallery_watermark_pos'] = $watermark_pos . '|--@--|' . $watermark_trans;
                    }
                    $extension = strlen(strrchr($name, "."));
                    $file = strlen($name);
                    $filename = substr($name, 0, $file - $extension);
                    $cs_gallery_pic['gallery_titel'] = $filename;
                    $cs_gallery_pic['gallery_time'] = cs_time();
                    $gallery_cells = array_keys($cs_gallery_pic);
                    $gallery_save = array_values($cs_gallery_pic);
                    cs_sql_insert(__FILE__, 'gallery', $gallery_cells, $gallery_save);
                }
                $data['pics'][$run]['img'] = cs_html_img('mods/gallery/image.php?picname=' . $name);
                $data['pics'][$run]['name'] = $name;
            }
        }
    }
    cs_redirect($cs_lang['create_done'], 'gallery');
}
if (!isset($_POST['submit_1'])) {
    if (!isset($_POST['submit']) or !empty($error)) {
        $data['if']['start'] = TRUE;
    }
}
echo cs_subtemplate(__FILE__, $data, 'gallery', 'manage_advanced');
Example #13
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('count');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'count_time DESC';
$cs_sort[2] = 'count_time ASC';
$cs_sort[3] = 'count_id DESC';
$cs_sort[4] = 'count_id ASC';
$sort = empty($_REQUEST['sort']) ? 1 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$counter_count = cs_sql_count(__FILE__, 'count');
$data = array();
$data['head']['counter_count'] = $counter_count;
$data['head']['counter_pages'] = cs_pages('count', 'manage', $counter_count, $start);
$data['head']['message'] = cs_getmsg();
$data['sort']['count_time'] = cs_sort('count', 'manage', $start, 0, 1, $sort);
$data['sort']['count_id'] = cs_sort('count', 'manage', $start, 0, 3, $sort);
$cs_counter = cs_sql_select(__FILE__, 'count', '*', 0, $order, $start, $account['users_limit']);
$count_loop = count($cs_counter);
$data['count'] = array();
for ($run = 0; $run < $count_loop; $run++) {
    $data['count'][$run]['count_id'] = $cs_counter[$run]['count_id'];
    $data['count'][$run]['count_ip'] = $cs_counter[$run]['count_ip'];
    $data['count'][$run]['count_locate'] = $cs_counter[$run]['count_location'];
    $data['count'][$run]['count_time'] = cs_date('unix', $cs_counter[$run]['count_time'], 1);
}
echo cs_subtemplate(__FILE__, $data, 'count', 'manage');
Example #14
0
    $data['folders']['select'] = make_folders_select('folders_id', $edit['folders_id'], $account['users_id'], 'usersgallery');
    $data['access']['options'] = '';
    $levels = 0;
    while ($levels < 6) {
        $edit['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0);
        $data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel);
        $levels++;
    }
    $data['status']['options'] = '';
    $levels = 0;
    while ($levels < 2) {
        $edit['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0);
        $data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel);
        $levels++;
    }
    $data['abcode']['smileys'] = cs_abcode_smileys('gallery_description');
    $data['abcode']['features'] = cs_abcode_features('gallery_description');
    $checked = 'checked="checked"';
    $data['check']['newtime'] = empty($new_time) ? '' : $checked;
    $data['check']['count'] = empty($gallery_count_reset) ? '' : $checked;
    $data['hidden']['id'] = $gallery_id;
    $data['data']['usersgallery_name'] = cs_secure($data['data']['usersgallery_name']);
    $data['data']['usersgallery_titel'] = cs_secure($data['data']['usersgallery_titel']);
    $data['data']['usersgallery_description'] = cs_secure($data['data']['usersgallery_description']);
    echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'users_edit');
} else {
    $cells = array_keys($edit);
    $save = array_values($edit);
    cs_sql_update(__FILE__, 'usersgallery', $cells, $save, $gallery_id);
    cs_redirect($cs_lang['changes_done'], 'usersgallery', 'center');
}
Example #15
0
    }
    $data['clans']['country'] .= cs_html_select(0) . ' ' . cs_html_img('symbols/countries/' . $cs_clans['clans_country'] . '.png', 11, 16, 'id="' . $el_id . '"');
    $data['clans']['url'] = cs_secure($cs_clans['clans_url']);
    $data['clans']['since'] = cs_dateselect('since', 'date', $cs_clans['clans_since']);
    $data['clans']['password'] = cs_secure($cs_clans['clans_pwd']);
    $data['users']['nick'] = $users_nick;
    if (empty($cs_clans['clans_picture'])) {
        $data['clans']['pic'] = $cs_lang['nopic'];
    } else {
        $place = 'uploads/clans/' . $cs_clans['clans_picture'];
        $size = getimagesize($cs_main['def_path'] . '/' . $place);
        $data['clans']['pic'] = cs_html_img($place, $size[1], $size[0]);
    }
    $matches[1] = $cs_lang['pic_infos'];
    $return_types = '';
    foreach ($img_filetypes as $add) {
        $return_types .= empty($return_types) ? $add : ', ' . $add;
    }
    $matches[2] = $cs_lang['max_width'] . $op_clans['max_width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $op_clans['max_height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_clans['max_size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['clans']['clip'] = cs_abcode_clip($matches);
    $data['data']['id'] = $clans_id;
    echo cs_subtemplate(__FILE__, $data, 'clans', 'edit');
} else {
    $clans_cells = array_keys($cs_clans);
    $clans_save = array_values($cs_clans);
    cs_sql_update(__FILE__, 'clans', $clans_cells, $clans_save, $clans_id);
    cs_redirect($cs_lang['changes_done'], 'clans');
}
Example #16
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');
}
Example #17
0
if (!empty($cs_post['start'])) {
    $start = $cs_post['start'];
}
$sort = empty($cs_get['sort']) ? 2 : $cs_get['sort'];
if (!empty($cs_post['sort'])) {
    $sort = $cs_post['sort'];
}
$cs_sort[1] = 'linkus_name DESC';
$cs_sort[2] = 'linkus_name ASC';
$cs_sort[3] = 'linkus_banner DESC';
$cs_sort[4] = 'linkus_banner ASC';
$order = $cs_sort[$sort];
$linkus_count = cs_sql_count(__FILE__, 'linkus');
$data['head']['count'] = $linkus_count;
$data['head']['pages'] = cs_pages('linkus', 'manage', $linkus_count, $start, 0, $sort);
$data['head']['getmsg'] = cs_getmsg();
$data['sort']['name'] = cs_sort('linkus', 'manage', $start, 0, 1, $sort);
$data['sort']['banner'] = cs_sort('linkus', 'manage', $start, 0, 3, $sort);
$select = 'linkus_id, linkus_name, linkus_banner';
$data['linkus'] = cs_sql_select(__FILE__, 'linkus', $select, 0, $order, $start, $account['users_limit']);
$linkus_loop = count($data['linkus']);
for ($run = 0; $run < $linkus_loop; $run++) {
    $data['linkus'][$run]['name'] = cs_secure($data['linkus'][$run]['linkus_name']);
    $data['linkus'][$run]['banner'] = cs_secure($data['linkus'][$run]['linkus_banner']);
    $place = 'uploads/linkus/' . $data['linkus'][$run]['linkus_banner'];
    $mass = getimagesize($place);
    $data['linkus'][$run]['mass'] = cs_secure($mass[0] . ' x ' . $mass[1]);
    $data['linkus'][$run]['id'] = $data['linkus'][$run]['linkus_id'];
}
echo cs_subtemplate(__FILE__, $data, 'linkus', 'manage');
Example #18
0
        }
        $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 #19
0
    $select .= ', gam.games_name AS games_name, gam.games_id AS games_id';
    $order = 'srv.servers_order';
    $cs_servers = cs_sql_select(__FILE__, $tables, $select, 0, $order, 0, 0);
    $cs_servers_count = count($cs_servers);
    $data['servers'] = array();
    for ($serv = 0; $serv < $cs_servers_count; $serv++) {
        $data['servers'][$serv]['name'] = $cs_servers[$serv]['servers_name'];
        $data['servers'][$serv]['url'] = $cs_servers[$serv]['servers_ip'] . ':' . $cs_servers[$serv]['servers_port'];
        switch ($cs_servers[$serv]['servers_type']) {
            case 1:
                $data['servers'][$serv]['type'] = $cs_lang['clanserver'];
                break;
            case 2:
                $data['servers'][$serv]['type'] = $cs_lang['pubserver'];
                break;
            case 3:
                $data['servers'][$serv]['type'] = $cs_lang['voiceserver'];
                break;
        }
        $data['servers'][$serv]['slots'] = $cs_servers[$serv]['servers_slots'];
        $data['servers'][$serv]['img'] = 'uploads/games/' . $cs_servers[$serv]['games_id'] . '.gif';
        $data['servers'][$serv]['game'] = $cs_servers[$serv]['games_name'];
        $data['servers'][$serv]['info'] = $cs_servers[$serv]['servers_info'];
    }
    cs_cache_save($cache_name, $data, $cache_time);
}
if (empty($data['if']['noquery'])) {
    echo cs_subtemplate(__FILE__, $data, 'servers', 'list');
} else {
    echo cs_subtemplate(__FILE__, $data, 'servers', 'noquery');
}
Example #20
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('clansphere');
$data = array();
$select = 'metatags_id, metatags_name, metatags_content';
$where = 'metatags_active = 1';
$order = 'metatags_name';
$cs_metatags = cs_sql_select(__FILE__, 'metatags', $select, $where, $order, 0, 0, 'metatags');
$metatags_loop = count($cs_metatags);
for ($run = 0; $run < $metatags_loop; $run++) {
    $cs_metatags[$run]['name'] = $cs_metatags[$run]['metatags_name'];
    $cs_metatags[$run]['content'] = $cs_metatags[$run]['metatags_content'];
}
$data['metatags'] = $cs_metatags;
echo cs_subtemplate(__FILE__, $data, 'clansphere', 'navmeta');
Example #21
0
// $Id$
$cs_lang = cs_translate('board');
$count_abo = cs_sql_count(__FILE__, 'abonements', 'users_id=' . $account['users_id']);
$count_att = cs_sql_count(__FILE__, 'boardfiles', 'users_id=' . $account['users_id']);
$data = array();
$data['head']['getmsg'] = cs_getmsg();
$data['count']['abos'] = $count_abo;
$data['count']['attachments'] = $count_att;
$data['link']['abos'] = cs_url('board', 'center');
$data['link']['attachments'] = cs_url('board', 'attachments');
$data['link']['avatar'] = cs_url('board', 'avatar');
$data['action']['form'] = cs_url('board', 'signature');
$data['signature']['smileys'] = cs_abcode_smileys('signature');
$data['signature']['abcode'] = cs_abcode_features('signature');
$signature_sql = cs_sql_select($file, 'users', 'users_signature', "users_id = '" . $account['users_id'] . "'");
$signature = $signature_sql['users_signature'];
$signature = isset($_POST['signature']) ? $_POST['signature'] : $signature;
$signature = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$signature = preg_replace_callback("=\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$data['signature']['text'] = $signature;
$data['signature']['preview'] = cs_secure($signature, 1, 1);
$data['if']['preview'] = (isset($_POST['preview']) and !empty($signature)) ? 1 : 0;
if (isset($_POST['submit'])) {
    $signature_cells = array('users_signature');
    $signature_save = array($signature);
    cs_sql_update(__FILE__, 'users', $signature_cells, $signature_save, $account['users_id']);
    cs_redirect($cs_lang['create_done'], 'board', 'signature');
}
$data['signature']['text'] = cs_secure($data['signature']['text']);
echo cs_subtemplate(__FILE__, $data, 'board', 'signature');
Example #22
0
        $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 #23
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');
}
Example #24
0
        if (empty($members[$run]['users_picture'])) {
            $members[$run]['picture'] = $cs_lang['nopic'];
        } else {
            $place = 'uploads/users/' . $members[$run]['users_picture'];
            $size = getimagesize($cs_main['def_path'] . '/' . $place);
            $members[$run]['picture'] = cs_html_img($place, $size[1], $size[0]);
        }
        $url = 'symbols/countries/' . $members[$run]['users_country'] . '.png';
        $members[$run]['country'] = cs_html_img($url, 11, 16) . ' ';
        $members[$run]['nick'] = $data['squads'][$sq_run]['clans_tagpos'] == 1 ? $data['squads'][$sq_run]['clans_tag'] . ' ' : '';
        $members[$run]['nick'] .= cs_user($members[$run]['users_id'], $members[$run]['users_nick'], $members[$run]['users_active'], $members[$run]['users_delete']);
        $members[$run]['nick'] .= $data['squads'][$sq_run]['clans_tagpos'] == 2 ? ' ' . $data['squads'][$sq_run]['clans_tag'] : '';
        $users_name = !in_array('users_name', $hidden) || !empty($allow) ? $members[$run]['users_name'] : '';
        $users_surname = !in_array('users_surname', $hidden) || !empty($allow) ? $members[$run]['users_surname'] : '';
        $members[$run]['surname'] = empty($users_name) && empty($users_surname) ? ' - ' : $users_name . ' ' . $users_surname;
        $members[$run]['task'] = cs_secure($members[$run]['members_task']);
        $since = empty($members[$run]['members_since']) ? '-' : cs_date('date', $members[$run]['members_since']);
        $members[$run]['since'] = $since;
        $tr++;
        $members[$run]['if']['td'] = FALSE;
        $members[$run]['if']['end_row'] = FALSE;
        if ($tr % 2 != 0 && $tr == $members_loop) {
            $members[$run]['if']['td'] = TRUE;
        } elseif ($tr % 2 == 0 && $tr != $members_loop) {
            $members[$run]['if']['end_row'] = TRUE;
        }
        $data['squads'][$sq_run]['members'] = $members;
    }
}
echo cs_subtemplate(__FILE__, $data, 'members', 'pictured');
Example #25
0
        $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 . '"');
    }
}
$data['gbook'] = !empty($gbook) ? $gbook : '';
echo cs_subtemplate(__FILE__, $data, 'gbook', 'manage');
Example #26
0
        $board_data = cs_sql_select(__FILE__, $tables, $select, $axx_where, $sorting, 0, 0);
        $data['board']['select'] = '';
        foreach ($board_data as $board) {
            $sel = $board_id == $board['board_id'] ? 1 : 0;
            $content = $board['categories_name'] . ' -> ' . $board['board_name'];
            $data['board']['select'] .= cs_html_option($content, $board['board_id'], $sel);
        }
        $data['checked']['closed'] = empty($thread_edit['threads_close']) ? '' : 'checked="checked" ';
        $data['checked']['notclosed'] = !empty($thread_edit['threads_close']) ? '' : 'checked="checked" ';
    }
    //rename
    if (!empty($_POST['rename'])) {
        $data['if']['rename'] = TRUE;
        $data['val']['thread_headline'] = $thread_headline;
    }
    echo cs_subtemplate(__FILE__, $data, 'board', 'modpanel_q');
} else {
    cs_redirect($cs_lang['mark_all'], 'board', 'thread', 'where=' . $thread_id);
}
//Daten verarbeiten und in SQL Eintragen
if (!empty($thread_cells) and !empty($thread_save)) {
    cs_sql_update(__FILE__, 'threads', $thread_cells, $thread_save, $thread_id);
    if (!empty($update_board)) {
        include_once 'mods/board/repair.php';
        cs_board_last($board_id);
    }
    if (isset($board_new_id)) {
        //Update board entry to get correct threads and comments count
        include_once 'mods/board/repair.php';
        cs_board_threads($board_id);
        cs_board_comments($board_id);
Example #27
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 #28
0
    $data['squads'][$run]['name'] = cs_secure($data['squads'][$run]['squads_name']);
}
$data['sort']['date'] = cs_sort('wars', 'list', $start, $squads_id, 1, $sort);
$data['sort']['enemy'] = cs_sort('wars', 'list', $start, $squads_id, 3, $sort);
$data['sort']['category'] = cs_sort('wars', 'list', $start, $squads_id, 5, $sort);
$select = 'war.games_id AS games_id, war.wars_date AS wars_date, war.wars_status AS status, war.clans_id AS clans_id, cln.clans_short AS clans_short, cat.categories_name AS categories_name, war.categories_id AS categories_id, war.wars_score1 AS wars_score1, war.wars_score2 AS wars_score2, war.wars_id AS wars_id';
$from = 'wars war INNER JOIN {pre}_categories cat ON war.categories_id = cat.categories_id ';
$from .= 'INNER JOIN {pre}_clans cln ON war.clans_id = cln.clans_id ';
$cs_wars = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$data['wars'] = '';
$count_wars = count($cs_wars);
for ($run = 0; $run < $count_wars; $run++) {
    $data['wars'][$run]['gameicon'] = cs_html_img('uploads/games/' . $cs_wars[$run]['games_id'] . '.gif');
    $data['wars'][$run]['date'] = cs_date('unix', $cs_wars[$run]['wars_date']);
    $data['wars'][$run]['enemyurl'] = cs_url('clans', 'view', 'id=' . $cs_wars[$run]['clans_id']);
    $data['wars'][$run]['enemy'] = cs_secure($cs_wars[$run]['clans_short']);
    $data['wars'][$run]['caturl'] = cs_url('categories', 'view', 'id=' . $cs_wars[$run]['categories_id']);
    $data['wars'][$run]['category'] = cs_secure($cs_wars[$run]['categories_name']);
    $data['wars'][$run]['url'] = cs_url('wars', 'view', 'id=' . $cs_wars[$run]['wars_id']);
    $data['wars'][$run]['result'] = $cs_wars[$run]['wars_score1'] . ' : ' . $cs_wars[$run]['wars_score2'];
    $data['wars'][$run]['if']['upcoming'] = $cs_wars[$run]['status'] == 'upcoming' ? true : false;
    $data['wars'][$run]['if']['played'] = $cs_wars[$run]['status'] == 'played' ? true : false;
    $data['wars'][$run]['if']['running'] = $cs_wars[$run]['status'] == 'running' ? true : false;
    $data['wars'][$run]['if']['canceled'] = $cs_wars[$run]['status'] == 'canceled' ? true : false;
    $result = $cs_wars[$run]['wars_score1'] - $cs_wars[$run]['wars_score2'];
    $icon = $result >= 1 ? 'green' : 'red';
    $icon = !empty($result) ? $icon : 'grey';
    $data['wars'][$run]['resulticon'] = cs_html_img('symbols/clansphere/' . $icon . '.gif');
}
echo cs_subtemplate(__FILE__, $data, 'wars', 'list');
Example #29
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('banners');
$cs_get = cs_get('catid');
$cs_option = cs_sql_option(__FILE__, 'banners');
$data = array();
$where = empty($cs_get['catid']) ? 0 : 'categories_id = ' . $cs_get['catid'];
$data['banners'] = cs_sql_select(__FILE__, 'banners', 'banners_picture, banners_alt, banners_url', $where, 'banners_order ASC', 0, $cs_option['max_navlist']);
$banners_loop = count($data['banners']);
if (empty($data['banners'])) {
    echo $cs_lang['no_banners'];
} else {
    for ($run = 0; $run < $banners_loop; $run++) {
        $go = cs_secure($data['banners'][$run]['banners_picture']);
        $picture = cs_html_img($go, 0, 0, " style=\"margin-bottom:4px\"", cs_secure($data['banners'][$run]['banners_alt']));
        $data['banners'][$run]['image'] = cs_html_link('http://' . cs_secure($data['banners'][$run]['banners_url']), $picture) . ' ';
    }
    echo cs_subtemplate(__FILE__, $data, 'banners', 'navlist');
}
Example #30
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
# Overwrite global settings by using the following array
$cs_main = array('init_sql' => true, 'init_tpl' => false, 'init_mod' => true);
chdir('../../');
require_once 'system/core/functions.php';
cs_init($cs_main);
$term = empty($_GET['term']) ? '' : $_GET['term'];
# Mods like messages support multiple users and that must be considered
$term_array = explode(';', $term);
$current = is_array($term_array) ? end($term_array) : $term;
# Strip current search term from search_users content
$old = substr($term, 0, strlen($term) - strlen($current));
if (!empty($current)) {
    $data = array();
    $data['data']['old'] = htmlspecialchars($old);
    $data['data']['target'] = empty($_GET['target']) ? 'users_nick' : $_GET['target'];
    $where = "users_nick LIKE '%" . cs_sql_escape(trim($current)) . "%' AND users_active = 1 AND users_delete = 0";
    $data['result'] = cs_sql_select(__FILE__, 'users', 'users_nick', $where, 0, 0, 7);
    if (!empty($data['result'])) {
        $loop = count($data['result']);
        for ($run = 0; $run < $loop; $run++) {
            $data['result'][$run]['users_nick'] = cs_secure($data['result'][$run]['users_nick']);
        }
        echo cs_subtemplate(__FILE__, $data, 'ajax', 'search_users');
    }
}