示例#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']);
}
示例#2
0
function cs_addons($modul, $action, $id, $modul_now)
{
    global $account, $cs_main;
    $show = $modul . '/' . $action;
    $addons = cs_checkdirs('mods', $show);
    $count = count($addons);
    $var = '';
    if (!empty($count)) {
        foreach ($addons as $mod) {
            $acc_dir = 'access_' . $mod['dir'];
            if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show'][$show]) {
                $mod['action'] = $modul == $mod['dir'] ? $action : $modul;
                $out = $modul_now == $mod['dir'] ? $mod['name'] : cs_link($mod['name'], $mod['dir'], $mod['action'], 'id=' . $id);
                if ($mod['dir'] == $modul) {
                    if ($modul == 'users') {
                        $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active, users_delete', 'users_id = ' . $id);
                        $user = cs_user($id, $cs_user['users_nick'], $cs_user['users_active'], $cs_user['users_delete']);
                        $var = $mod['name'] . ' - ' . $user . cs_html_hr('100%') . $var;
                    } else {
                        $cs_refer = cs_sql_select(__FILE__, $modul, $modul . '_name', $modul . '_id = ' . $id);
                        $name = cs_secure($cs_refer[$modul . '_name']);
                        $var = $mod['name'] . ' - ' . cs_link($name, $modul, $action, 'id=' . $id) . cs_html_hr('100%') . $var;
                    }
                } else {
                    if (!empty($mod['references'][$modul])) {
                        /*
                         * @TODO ACCESS rights (usersgallery) for count columns
                         */
                        $column = empty($mod['references'][$modul . '_column']) ? $modul . '_id' : $mod['references'][$modul . '_column'];
                        $more = empty($mod['references'][$modul . '_where']) ? '' : ' AND (' . $mod['references'][$modul . '_where'] . ')';
                        $count = cs_sql_count(__FILE__, $mod['references'][$modul], $column . ' = ' . $id . $more);
                        $var .= $out . " (" . $count . ")\r\n - ";
                    } else {
                        $var .= $out . "\r\n - ";
                    }
                }
            }
        }
    }
    $var = substr($var, 0, -3);
    return $var;
}
示例#3
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');
示例#4
0
    }
}
$data['if']['done'] = false;
if ($account['access_wizard'] == 5) {
    $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_temp' AND options_value = '1'");
    if (empty($wizard)) {
        $data['if']['done'] = true;
        $data['link']['wizard'] = cs_link($cs_lang['show'], 'wizard', 'roots') . ' - ' . cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=temp&amp;done=1');
    }
}
if (!empty($activate) and !empty($allow)) {
    require_once 'mods/clansphere/func_options.php';
    $save = array();
    $save['def_tpl'] = $activate;
    if (isset($templates[ucfirst($activate)]['themes'])) {
        $themes = cs_checkdirs('themes');
        if (isset($themes[ucfirst($templates[ucfirst($activate)]['themes'])])) {
            $save['def_theme'] = $templates[ucfirst($activate)]['themes'];
        }
    }
    cs_optionsave('clansphere', $save);
    $msg = file_exists('themes/' . $activate) ? $cs_lang['theme_found'] . cs_link($cs_lang['change_to_this'], 'clansphere', 'themes_list', 'activate=' . $activate) : $cs_lang['success'];
    cs_redirect($msg, 'clansphere', 'temp_list');
} else {
    $data['lang']['getmsg'] = cs_getmsg();
    $run = 0;
    foreach ($templates as $mod) {
        if ($mod['dir'] == 'install') {
            $tpl_all--;
            continue;
        }
示例#5
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('access');
$cs_access = cs_sql_select(__FILE__, 'access', '*', "access_id = '" . $account['access_id'] . "'");
unset($cs_access['access_id']);
$data = array();
$run = 0;
$data['lang']['name'] = cs_secure($cs_access['access_name']);
$data['lang']['clansphere'] = $account['access_clansphere'] . ' - ' . $cs_lang['clansphere_' . $account['access_clansphere'] . ''];
$modules = cs_checkdirs('mods');
foreach ($modules as $mod) {
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $cs_access) and $mod['dir'] != 'clansphere' and !empty($account[$acc_dir])) {
        if (!empty($mod['icon'])) {
            $data['access'][$run]['icon'] = cs_icon($mod['icon']);
        } else {
            $data['access'][$run]['icon'] = '';
        }
        $data['access'][$run]['name'] = $mod['name'];
        $mod_acc = $cs_access[$acc_dir];
        $data['access'][$run]['access'] = $mod_acc . ' - ' . $cs_lang['lev_' . $mod_acc];
        $run++;
    }
}
echo cs_subtemplate(__FILE__, $data, 'access', 'view');
示例#6
0
function cs_content_lang()
{
    global $account, $com_lang, $cs_main;
    $lang = empty($account['users_id']) ? $cs_main['def_lang'] : $account['users_lang'];
    if (empty($account['users_id']) and !empty($_COOKIE['cs_lang'])) {
        $lang_new = $_COOKIE['cs_lang'];
    }
    if (!empty($_REQUEST['lang'])) {
        $lang_new = $_REQUEST['lang'];
    }
    if (!empty($lang_new)) {
        $allow = 0;
        $languages = cs_checkdirs('lang');
        foreach ($languages as $mod) {
            if ($mod['dir'] == $lang_new) {
                $allow++;
            }
        }
        $lang = empty($allow) ? $cs_main['def_lang'] : $lang_new;
        # update language changes
        if (empty($account['users_id'])) {
            setcookie('cs_lang', $lang, $cs_main['cookie']['lifetime'], $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
        } elseif ($account['users_lang'] != $lang) {
            $users_cells = array('users_lang');
            $users_save = array($lang);
            cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id'], 0, 0);
        }
    }
    require_once 'lang/' . $lang . '/system/comlang.php';
    return $lang;
}
示例#7
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$admin = cs_checkdirs('mods', 'clansphere/admin');
foreach ($admin as $mod) {
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show']['clansphere/admin']) {
        echo cs_icon($mod['icon']);
        echo cs_link($mod['name'], $mod['dir'], 'manage');
        echo cs_html_br(1);
    }
}
示例#8
0
    if (!preg_match($pattern, $create['users_email'])) {
        $error++;
        $errormsg .= $cs_lang['email_false'] . cs_html_br(1);
    }
} else {
    $create['users_lang'] = $account['users_lang'];
    $create['users_nick'] = '';
    $create_['password'] = '';
    $create['users_email'] = '';
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data = array();
    if (isset($_POST['submit'])) {
        $data['lang']['create_admin'] = $errormsg;
    }
    $langs = cs_checkdirs('lang');
    $i = 0;
    $data['langs'] = array();
    foreach ($langs as $lang) {
        $data['langs'][$i]['name'] = $lang['name'];
        $data['langs'][$i]['selected'] = $lang['name'] == $create['users_lang'] ? ' selected="selected"' : '';
        $i++;
    }
    $data['value']['users_nick'] = $create['users_nick'];
    $data['value']['users_email'] = $create['users_email'];
    $data['value']['users_password'] = $create_['password'];
    echo cs_subtemplate(__FILE__, $data, 'install', 'admin');
} else {
    $dstime = date('I');
    $create['users_timezone'] = empty($dstime) ? date('Z') : date('Z') - 3600;
    $create['users_dstime'] = 0;
示例#9
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('abcode');
$data = array();
$data['lang']['getmsg'] = cs_getmsg();
if (!isset($_POST['submit'])) {
    $data['options'] = cs_sql_option(__FILE__, 'abcode');
    $rte_html_array = cs_checkdirs('mods', 'abcode/rte_html');
    $rte_more_array = cs_checkdirs('mods', 'abcode/rte_more');
    $data['dropdown']['rte_html'] = cs_dropdown('rte_html', 'name', $rte_html_array, $data['options']['rte_html'], 'dir');
    $data['dropdown']['rte_more'] = cs_dropdown('rte_more', 'name', $rte_more_array, $data['options']['rte_more'], 'dir');
    $abc[0]['def_func'] = 'img';
    $abc[0]['name'] = $cs_lang['img'];
    $abc[1]['def_func'] = 'str';
    $abc[1]['name'] = $cs_lang['str'];
    $data['dropdown']['def_func'] = cs_dropdown('def_func', 'name', $abc, $data['options']['def_func']);
    $data['checked']['def_abcode'] = empty($data['options']['def_abcode']) ? '' : ' checked="checked"';
    echo cs_subtemplate(__FILE__, $data, 'abcode', 'options');
} else {
    require_once 'mods/clansphere/func_options.php';
    $save = array();
    $save['rte_html'] = $_POST['rte_html'];
    $save['rte_more'] = $_POST['rte_more'];
    $save['max_width'] = (int) $_POST['max_width'];
    $save['max_height'] = (int) $_POST['max_height'];
    $save['max_size'] = (int) $_POST['max_size'];
    $save['def_func'] = $_POST['def_func'];
    $save['image_width'] = $_POST['image_width'];
    $save['image_height'] = $_POST['image_height'];
示例#10
0
$dir = empty($_GET['dir']) ? '' : $_GET['dir'];
if (empty($dir) or !preg_match("=^[_a-z0-9-]+\$=i", $dir)) {
    $dir = $cs_main['def_lang'];
}
$lang_diff = $dir == 'German' ? 'English' : 'German';
include 'lang/' . $dir . '/info.php';
$data['lang_view']['name'] = $mod_info['name'];
$data['lang_view']['version'] = $mod_info['version'];
$data['lang_view']['mod_released'] = cs_date('date', $mod_info['released']);
$data['lang_view']['creator'] = $mod_info['creator'];
$data['lang_view']['mod_team'] = $mod_info['team'];
$data['lang_view']['mod_url'] = cs_html_link('http://' . $mod_info['url'], $mod_info['url']);
$data['lang_view']['mod_desc'] = $mod_info['text'];
$php_ok = version_compare(phpversion(), '5.1.0', '>=');
# note: translation of countries is not checked
$lang_mods = cs_checkdirs('mods');
$lang_more = array('system/main' => array('dir' => 'system/main'), 'system/abcodes' => array('dir' => 'system/abcodes'));
$lang_mods = array_merge($lang_mods, $lang_more);
$data['diff'] = array();
if (empty($lang_mods)) {
    $data['diff'][0] = array('file' => '', 'diff' => '');
}
$run = 0;
$files = 0;
$count = 0;
$diff_count = 0;
$missing_file = $cs_lang['missing_file'];
$total_diff = $cs_lang['total_diff'];
$lang_stats = $cs_lang['lang_stats'];
foreach ($lang_mods as $mods) {
    $file_origine = 'lang/' . $lang_diff . '/' . $mods['dir'] . '.php';
示例#11
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('users');
$opt_array = array($cs_lang['profile'] => array('file' => 'profile', 'icon' => 'personal', 'name' => $cs_lang['profile'], 'show' => array('users/settings' => 1)), $cs_lang['picture'] => array('file' => 'picture', 'icon' => 'camera_unmount', 'name' => $cs_lang['picture'], 'show' => array('users/settings' => 1)), $cs_lang['password'] => array('file' => 'password', 'icon' => 'password', 'name' => $cs_lang['password'], 'show' => array('users/settings' => 1)), $cs_lang['setup'] => array('file' => 'setup', 'icon' => 'looknfeel', 'name' => $cs_lang['setup'], 'show' => array('users/settings' => 1)), $cs_lang['close'] => array('file' => 'close', 'icon' => 'gpg', 'name' => $cs_lang['close'], 'show' => array('users/settings' => 1)), $cs_lang['avatar'] => array('dir' => 'board', 'file' => 'avatar', 'icon' => 'babelfish', 'name' => $cs_lang['avatar'], 'show' => array('users/settings' => 1)), $cs_lang['signature'] => array('dir' => 'board', 'file' => 'signature', 'icon' => 'colors', 'name' => $cs_lang['signature'], 'show' => array('users/settings' => 1)));
$mod_array = cs_checkdirs('mods', 'users/settings');
$settings = array_merge($opt_array, $mod_array);
ksort($settings);
foreach ($settings as $mod) {
    if (!array_key_exists('dir', $mod)) {
        $mod['dir'] = 'users';
    }
    if (!array_key_exists('file', $mod)) {
        $mod['file'] = 'center';
    }
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show']['users/settings']) {
        echo cs_icon($mod['icon']);
        echo cs_link($mod['name'], $mod['dir'], $mod['file']);
        echo cs_html_br(1);
    }
}
示例#12
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$admin = cs_checkdirs('mods', 'options/roots');
foreach ($admin as $mod) {
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show']['options/roots']) {
        echo cs_icon($mod['icon']);
        echo cs_link($mod['name'], $mod['dir'], 'options');
        echo cs_html_br(1);
    }
}
示例#13
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('clansphere');
$sys_array = array($cs_lang['software'] => array('file' => 'software', 'icon' => 'kpackage', 'name' => $cs_lang['software'], 'show' => array('clansphere/system' => 5)), $cs_lang['languages'] => array('file' => 'lang_list', 'icon' => 'locale', 'name' => $cs_lang['languages'], 'show' => array('clansphere/system' => 4)), $cs_lang['cache'] => array('file' => 'cache', 'icon' => 'ark', 'name' => $cs_lang['cache'], 'show' => array('clansphere/system' => 4)), $cs_lang['templates'] => array('file' => 'temp_list', 'icon' => 'style', 'name' => $cs_lang['templates'], 'show' => array('clansphere/system' => 4)), $cs_lang['themes'] => array('file' => 'themes_list', 'icon' => 'kllckety', 'name' => $cs_lang['themes'], 'show' => array('clansphere/system' => 5)), $cs_lang['storage'] => array('file' => 'storage', 'icon' => 'hdd_unmount', 'name' => $cs_lang['storage'], 'show' => array('clansphere/system' => 5)), $cs_lang['variables'] => array('file' => 'variables', 'icon' => 'kdvi', 'name' => $cs_lang['variables'], 'show' => array('clansphere/system' => 5)), $cs_lang['metatags'] => array('file' => 'metatags', 'icon' => 'knetconfig', 'name' => $cs_lang['metatags'], 'show' => array('clansphere/system' => 5)), $cs_lang['support'] => array('file' => 'support', 'icon' => 'krdc', 'name' => $cs_lang['support'], 'show' => array('clansphere/system' => 4)));
$mod_array = cs_checkdirs('mods', 'clansphere/system');
$system = array_merge($sys_array, $mod_array);
ksort($system);
foreach ($system as $mod) {
    array_key_exists('file', $mod) ? $mod['dir'] = 'clansphere' : ($mod['file'] = 'roots');
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show']['clansphere/system']) {
        echo cs_icon($mod['icon']);
        echo cs_link($mod['name'], $mod['dir'], $mod['file']);
        echo cs_html_br(1);
    }
}
示例#14
0
$cs_lang = cs_translate('users');
$select = 'users_email, users_register, users_laston, users_hidden, users_active, users_invisible';
$cs_user = cs_sql_select(__FILE__, 'users', $select, "users_id = '" . $account['users_id'] . "'");
$hidden = explode(',', $cs_user['users_hidden']);
$data['head']['mod'] = $cs_lang['mod_name'];
$data['head']['action'] = $cs_lang['home'];
$data['head']['body_text'] = $cs_lang['home_info'];
echo cs_subtemplate(__FILE__, $data, 'users', 'head');
if ($cs_user['users_invisible'] == 1) {
    $if_invis = ' (' . $cs_lang['invisible'] . ')';
} else {
    $if_invis = '';
}
$data['users']['link'] = cs_user($account['users_id'], $account['users_nick'], $cs_user['users_active']) . $if_invis;
$data['lang']['getmsg'] = cs_getmsg();
if (in_array('users_email', $hidden)) {
    $cs_user['users_email'] = cs_html_italic(1) . $cs_user['users_email'] . cs_html_italic(0);
}
$data['users']['email'] = empty($cs_user['users_email']) ? '--' : $cs_user['users_email'];
$data['users']['register'] = cs_date('unix', $cs_user['users_register'], 1);
$data['users']['laston'] = cs_date('unix', $cs_user['users_laston'], 1);
$data['users']['access_name'] = cs_secure($account['access_name']);
echo cs_subtemplate(__FILE__, $data, 'users', 'home');
$plugins = cs_checkdirs('mods', 'users/home');
ksort($plugins);
foreach ($plugins as $mod) {
    $acc_dir = 'access_' . $mod['dir'];
    if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show']['users/home']) {
        include_once 'mods/' . $mod['dir'] . '/users_home.php';
    }
}