Beispiel #1
0
if (!empty($_GET['delall'])) {
    cs_sql_update(__FILE__, 'board', array('board_order'), array(0), 0, 'board_order != 0');
    cs_sql_update(__FILE__, 'categories', array('categories_order'), array(0), 0, "categories_mod = 'board'");
    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) {
Beispiel #2
0
// 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');
}
$data['signature']['text'] = cs_secure($data['signature']['text']);
echo cs_subtemplate(__FILE__, $data, 'board', 'signature');
Beispiel #3
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');
}
Beispiel #4
0
$sql_install = str_replace('{community}', $cs_lang['community'], $sql_install);
$sql_install = str_replace('{member}', $cs_lang['member'], $sql_install);
$sql_install = str_replace('{orga}', $cs_lang['orga'], $sql_install);
$sql_install = str_replace('{admin}', $cs_lang['admin'], $sql_install);
if ($cs_db['hash'] == 'md5') {
    $sec_pwd = md5('admin');
} elseif ($cs_db['hash'] == 'sha1') {
    $sec_pwd = sha1('admin');
}
$sql_install = str_replace('{pwd}', $sec_pwd, $sql_install);
$sql_install = cs_sql_replace($sql_install);
$sql_array = preg_split("=;[\n\r]+=", $sql_install);
foreach ($sql_array as $sql_query) {
    $sql_query = trim($sql_query);
    if (!empty($sql_query)) {
        if (!cs_sql_query(__FILE__, $sql_query)) {
            cs_installerror($sql_query);
        }
    }
}
if (isset($_POST['module_select'])) {
    $mods = array('articles', 'awards', 'banners', 'board', 'boardmods', 'boardranks', 'buddys', 'cash', 'clans', 'computers', 'events', 'explorer', 'faq', 'fightus', 'files', 'gallery', 'games', 'gbook', 'history', 'joinus', 'links', 'linkus', 'maps', 'members', 'messages', 'news', 'newsletter', 'partner', 'quotes', 'ranks', 'replays', 'rules', 'search', 'servers', 'shoutbox', 'squads', 'static', 'usersgallery', 'votes', 'wars', 'wizard');
    $mods_count = count($mods);
    for ($run = 0; $run < $mods_count; $run++) {
        if (!isset($_POST[$mods[$run]])) {
            cs_sql_query(__FILE__, "UPDATE {pre}_access SET access_" . $mods[$run] . " = '0'");
        }
    }
}
cs_redirect('', 'install', 'admin', 'lang=' . $account['users_lang']);
Beispiel #5
0
                    $cs_gallery_pic['gallery_name'] = $name;
                    $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');
Beispiel #6
0
    $games_version = $_POST['games_version'];
}
$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';
Beispiel #7
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');
}
Beispiel #8
0
    $errormsg = '';
    if (empty($cs_bm['categories_id'])) {
        $error++;
        $errormsg .= $cs_lang['no_cat'] . cs_html_br(1);
    }
} else {
    $boardmods_id = $_GET['id'];
    $tables = 'boardmods brd INNER JOIN {pre}_users usr ON usr.users_id = brd.users_id';
    $cells = 'brd.boardmods_id AS boardmods_id, brd.categories_id AS categories_id, brd.users_id AS users_id, usr.users_nick AS users_nick, ';
    $cells .= 'brd.boardmods_modpanel AS boardmods_modpanel, brd.boardmods_edit AS boardmods_edit, brd.boardmods_del AS boardmods_del';
    $cs_bm = cs_sql_select(__FILE__, $tables, $cells, "boardmods_id = '" . $boardmods_id . "'", 0, 0);
}
if (!isset($_POST['submit']) and empty($error)) {
    $data['head']['body'] = $cs_lang['body'];
} elseif (!empty($error)) {
    $data['head']['body'] = $errormsg;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['bm']['id'] = empty($_POST['id']) ? $_GET['id'] : $_POST['id'];
    $data['bm']['user'] = cs_secure($cs_bm['users_nick']);
    $data['bm']['cat_dropdown'] = cs_categories_dropdown('boardmods', $cs_bm['categories_id']);
    $data['bm']['boardmods_modpanel'] = $cs_bm['boardmods_modpanel'] == 1 ? 'checked="checked"' : '';
    $data['bm']['boardmods_edit'] = $cs_bm['boardmods_edit'] == 1 ? 'checked="checked"' : '';
    $data['bm']['boardmods_del'] = $cs_bm['boardmods_del'] == 1 ? 'checked="checked"' : '';
} else {
    $boardmods_cells = array_keys($cs_bm);
    $boardmods_save = array_values($cs_bm);
    cs_sql_update(__FILE__, 'boardmods', $boardmods_cells, $boardmods_save, $_POST['id']);
    cs_redirect($cs_lang['changes_done'], 'boardmods');
}
echo cs_subtemplate(__FILE__, $data, 'boardmods', 'edit');
Beispiel #9
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');
}
Beispiel #10
0
        $cs_board_id = $cs_board['board_id'];
        // $query = "UPDATE {pre}_threads SET board_id='$cs_board_id' ";
        // $query .= "WHERE board_id = '$board_id'";
        // 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);
Beispiel #11
0
        $data['link']['wizard'] = cs_link($cs_lang['show'], 'wizard', 'roots') . ' - ' . cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=temp&amp;done=1');
    }
}
if (!empty($activate) and !empty($allow)) {
    require_once 'mods/clansphere/func_options.php';
    $save = array();
    $save['def_tpl'] = $activate;
    if (isset($templates[ucfirst($activate)]['themes'])) {
        $themes = cs_checkdirs('themes');
        if (isset($themes[ucfirst($templates[ucfirst($activate)]['themes'])])) {
            $save['def_theme'] = $templates[ucfirst($activate)]['themes'];
        }
    }
    cs_optionsave('clansphere', $save);
    $msg = file_exists('themes/' . $activate) ? $cs_lang['theme_found'] . cs_link($cs_lang['change_to_this'], 'clansphere', 'themes_list', 'activate=' . $activate) : $cs_lang['success'];
    cs_redirect($msg, 'clansphere', 'temp_list');
} else {
    $data['lang']['getmsg'] = cs_getmsg();
    $run = 0;
    foreach ($templates as $mod) {
        if ($mod['dir'] == 'install') {
            $tpl_all--;
            continue;
        }
        $data['temp_list'][$run]['name'] = $mod['name'];
        $data['temp_list'][$run]['dir'] = $mod['dir'];
        $data['temp_list'][$run]['version'] = $mod['version'];
        $data['temp_list'][$run]['date'] = cs_date('date', $mod['released']);
        $data['temp_list'][$run]['if']['active'] = $mod['dir'] == $cs_main['template'] ? 1 : 0;
        $data['temp_list'][$run]['if']['def'] = $mod['dir'] == $cs_main['def_tpl'] ? 1 : 0;
        $run++;
Beispiel #12
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');
}
Beispiel #13
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('files');
$advanced = 0;
if (empty($_REQUEST['where'])) {
    cs_redirect(NULL, 'files', 'list');
}
$files_id = $_REQUEST['where'];
settype($files_id, 'integer');
$mirror_id = isset($_REQUEST['target']) ? $_REQUEST['target'] : 0;
settype($mirror_id, 'integer');
$from = 'files';
$select = 'files_count, files_name, files_mirror';
$where = "files_id = '" . $files_id . "'";
$cs_files = cs_sql_select(__FILE__, $from, $select, $where, 0, 0, 1);
$files_loop = count($cs_files);
if (!empty($files_loop)) {
    $files_count = $cs_files['files_count'];
    $files_mirror = $cs_files['files_mirror'];
    $temp_mirror1 = explode("-----", $files_mirror);
    $mirror = explode("\n", $temp_mirror1[$mirror_id]);
    $files_count = $files_count + 1;
    $files_cells = array('files_count');
    $files_save = array($files_count);
    cs_sql_update(__FILE__, 'files', $files_cells, $files_save, $files_id);
    if (empty($advanced) and isset($mirror[1])) {
        header('Location: ' . $mirror[1]);
    } elseif (!empty($advanced)) {
        $data['file']['wait'] = cs_html_img('symbols/files/wait.gif', 0, 0, 0);
Beispiel #14
0
    $thread_save = array_values($board);
    cs_sql_insert(__FILE__, 'threads', $thread_cells, $thread_save);
    $thread_now = cs_sql_select(__FILE__, 'threads', 'threads_id', 'threads_id = \'' . cs_sql_insertid(__FILE__) . '\'');
    #if thread voting -> save vote to boardvotes
    if ($votes == 1) {
        $bv['users_id'] = $board['users_id'];
        $bv['threads_id'] = $thread_now['threads_id'];
        $bv['boardvotes_time'] = $board['threads_time'];
        $bv_cells = array_keys($bv);
        $bv_save = array_values($bv);
        cs_sql_insert(__FILE__, 'boardvotes', $bv_cells, $bv_save);
    }
    for ($run = 0; $run < $run_loop_files; $run++) {
        $num = $run + 1;
        $files_cells = array('users_id', 'threads_id', 'boardfiles_time', 'boardfiles_name');
        $files_save = array($board['users_id'], $thread_now['threads_id'], $board['threads_time'], $file_name[$num]);
        cs_sql_insert(__FILE__, 'boardfiles', $files_cells, $files_save);
        $files_select_new_id = cs_sql_insertid(__FILE__);
        $ext = substr($file_name[$num], strlen($file_name[$num]) + 1 - strlen(strrchr($file_name[$num], '.')));
        $path = $cs_main['def_path'] . '/uploads/board/files/';
        $target = $path . $file_upload_name[$num];
        $target2 = $path . $files_select_new_id . '.' . $ext;
        $fileHand = fopen($target, 'r');
        fclose($fileHand);
        rename($target, $target2);
    }
    # Update board entry to get correct threads and comments count
    include_once 'mods/board/repair.php';
    cs_board_threads($board_id);
    cs_redirect($cs_lang['create_done'], 'board', 'thread', 'where=' . $thread_now['threads_id']);
}
Beispiel #15
0
        $users_id = cs_sql_select(__FILE__, 'users', 'users_id', "users_nick = '{$users_nick}'", 0, 0, 1);
        if ($users_id > 0) {
            $insertion = array('medals_id' => $medals_id, 'users_id' => $users_id['users_id'], 'medalsuser_date' => cs_time());
            cs_sql_insert(__FILE__, 'medalsuser', array_keys($insertion), array_values($insertion));
            cs_redirect($cs_lang['create_done'], 'medals', 'user', 'where=' . $medals_id);
        } else {
            cs_redirect($cs_lang['user_not_found'], 'medals', 'user', 'where=' . $medals_id);
        }
    }
} else {
    $medals_id = $_GET['where'];
}
if (isset($_GET['delete'])) {
    $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']);
Beispiel #16
0
                break;
            case 2:
                $ext = 'jpg';
                break;
            case 3:
                $ext = 'png';
                break;
        }
        $target = $cs_files_id . '-' . $file_next . '.' . $ext;
        $picture_name = 'picture-' . $target;
        $thumb_name = 'thumb-' . $target;
        if (cs_resample($files_gl['picture']['tmp_name'], 'uploads/files/' . $thumb_name, 80, 200) and cs_upload('files', $picture_name, $files_gl['picture']['tmp_name'])) {
            $cells = array('files_previews');
            $content = empty($file_string) ? array($target) : array($file_string . "\n" . $target);
            cs_sql_update(__FILE__, 'files', $cells, $content, $cs_files_id);
            cs_redirect($cs_lang['success'], 'files', 'picture', 'id=' . $cs_files_id);
        } else {
            $message .= $cs_lang['up_error'];
            $error++;
        }
    }
}
if (!empty($message)) {
    $data['head']['text'] = $message;
} elseif (empty($_GET['delete'])) {
    $data['head']['text'] = $cs_lang['body_picture'];
} else {
    $data['head']['text'] = $cs_lang['remove_done'];
}
$data['head']['message'] = cs_getmsg();
$data['file']['id'] = $cs_files_id;
Beispiel #17
0
    $save['max_navnext'] = (int) $_POST['max_navnext'];
    require_once 'mods/clansphere/func_options.php';
    cs_optionsave('wars', $save);
    $lang = cs_substr($account['users_lang'], 0, 2);
    if (!file_exists('uploads/wars/news_' . $lang . '.txt')) {
        $lang = 'de';
    }
    $text = $_POST['news_text'];
    $fp = fopen('uploads/wars/news_' . $lang . '.txt', 'w');
    # set stream encoding if possible to avoid converting issues
    if (function_exists('stream_encoding')) {
        stream_encoding($fp, $cs_main['charset']);
    }
    fwrite($fp, $text);
    fclose($fp);
    cs_redirect($cs_lang['success'], 'options', 'roots');
} else {
    $data = array();
    $data['head']['message'] = cs_getmsg();
    $data['op'] = cs_sql_option(__FILE__, 'wars');
    $pholders = array();
    $pholders['{SQUADNAME}'] = $cs_lang['op_squadname'];
    $pholders['{SQUADURL}'] = $cs_lang['op_squadurl'];
    $pholders['{OPPONENTNAME}'] = $cs_lang['op_opponentname'];
    $pholders['{OPPONENTURL}'] = $cs_lang['op_opponenturl'];
    $pholders['{SCORE_1}'] = $cs_lang['op_score1'];
    $pholders['{SCORE_2}'] = $cs_lang['op_score2'];
    $pholders['{MATCH_URL}'] = $cs_lang['op_matchurl'];
    $pholders['{CAT_NAME}'] = $cs_lang['op_catname'];
    $lang = cs_substr($account['users_lang'], 0, 2);
    if (!file_exists('uploads/wars/news_' . $lang . '.txt')) {
Beispiel #18
0
    $cs_computers['computers_memory'] = '';
    $cs_computers['computers_processors'] = '';
    $cs_computers['computers_graphics'] = '';
    $cs_computers['computers_sounds'] = '';
    $cs_computers['computers_harddisks'] = '';
    $cs_computers['computers_drives'] = '';
    $cs_computers['computers_screens'] = '';
    $cs_computers['computers_interfaces'] = '';
    $cs_computers['computers_networks'] = '';
    $cs_computers['computers_more'] = '';
}
if (!isset($_POST['submit'])) {
    $data['head']['body'] = $cs_lang['body_create'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    foreach ($cs_computers as $key => $value) {
        $data['com'][$key] = cs_secure($value);
    }
    $data['com']['referer'] = empty($_SERVER['HTTP_REFERER']) ? 'center' : $_SERVER['HTTP_REFERER'];
    echo cs_subtemplate(__FILE__, $data, 'computers', 'create');
} else {
    $cs_computers['computers_since'] = cs_time();
    $computers_cells = array_keys($cs_computers);
    $computers_save = array_values($cs_computers);
    cs_sql_insert(__FILE__, 'computers', $computers_cells, $computers_save);
    #$referrer = strpos($_POST['referer'],'manage') === false ? 'center' : 'manage';
    $referrer = $account['access_computers'] < 3 ? 'center' : 'manage';
    cs_redirect($cs_lang['create_done'], 'computers', $referrer);
}
Beispiel #19
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');
}
Beispiel #20
0
                $wars['status']['players_id'] = $select['players_id'];
                $wars['status']['wars_id'] = $wars_id;
                $wars['lang']['submit'] = empty($in_list) ? $cs_lang['confirm'] : $cs_lang['edit'];
            } else {
                $players_id = (int) $_POST['players_id'];
                $wars_id = (int) $_POST['wars_id'];
                $status = $_POST['players_status'];
                $time = cs_time();
                if (empty($in_list)) {
                    $cells = array('wars_id', 'users_id', 'players_status', 'players_time');
                    $values = array($wars_id, $account['users_id'], $status, $time);
                    cs_sql_insert(__FILE__, 'players', $cells, $values);
                } else {
                    $cells = array('players_status', 'players_time');
                    $values = array($status, $time);
                    cs_sql_update(__FILE__, 'players', $cells, $values, $players_id);
                }
                cs_redirect($cs_lang['success'], 'wars', 'view', 'id=' . $wars_id);
            }
        }
    }
}
echo cs_subtemplate(__FILE__, $wars, 'wars', 'view');
$where_com = "comments_mod = 'wars' AND comments_fid = '" . $wars_id . "'";
$count_com = cs_sql_count(__FILE__, 'comments', $where_com);
include_once 'mods/comments/functions.php';
if (!empty($count_com)) {
    echo cs_html_br(1);
    echo cs_comments_view($wars_id, 'wars', 'view', $count_com);
}
echo cs_comments_add($wars_id, 'wars', $cs_wars['wars_close']);
Beispiel #21
0
<?php

// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('gbook');
$start = empty($_GET['start']) ? 0 : $_GET['start'];
if (!empty($_GET['unhide'])) {
    cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('1'), (int) $_GET['unhide']);
    cs_redirect($cs_lang['unhide_done'], 'gbook', 'center');
}
if (!empty($_GET['hide'])) {
    cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('0'), (int) $_GET['hide']);
    cs_redirect($cs_lang['hide_done'], 'gbook', 'center');
}
$gbook_count = cs_sql_count(__FILE__, 'gbook', "gbook_users_id = '" . $account['users_id'] . "'");
$data['head']['new_entry'] = cs_link($cs_lang['submit'], 'gbook', 'entry', 'id=' . $account['users_id'] . '&amp;from=center');
$data['head']['count'] = $gbook_count;
$data['head']['pages'] = cs_pages('gbook', 'center', $gbook_count, $start);
$data['head']['getmsg'] = cs_getmsg();
$from = 'gbook gbk LEFT JOIN {pre}_users usr ON gbk.users_id = usr.users_id';
$select = 'gbk.gbook_id AS gbook_id, gbk.users_id AS users_id, gbk.gbook_time AS gbook_time, gbk.gbook_users_id AS gbook_users_id, ';
$select .= 'gbk.gbook_nick AS gbook_nick, gbk.gbook_email AS gbook_email, gbk.gbook_icq AS gbook_icq, ';
$select .= 'gbk.gbook_jabber AS gbook_jabber, gbk.gbook_skype AS gbook_skype, gbk.gbook_url AS gbook_url, ';
$select .= 'gbk.gbook_town AS gbook_town, gbk.gbook_text AS gbook_text, gbk.gbook_lock AS gbook_lock, ';
$select .= 'usr.users_nick AS users_nick, usr.users_place AS users_place, usr.users_icq AS users_icq, ';
$select .= 'usr.users_jabber AS users_jabber, usr.users_skype AS users_skype, usr.users_email AS users_email, ';
$select .= 'usr.users_url AS users_url, usr.users_hidden AS users_hidden, usr.users_active AS users_active, usr.users_delete AS users_delete';
$where = "gbook_users_id = '" . $account['users_id'] . "'";
$order = 'gbk.gbook_id DESC';
$cs_gbook = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$gbook_loop = count($cs_gbook);
Beispiel #22
0
    $cs_buddys = cs_sql_select(__FILE__, 'buddys', $cells, "buddys_id = '" . $buddys_id . "'");
}
if (isset($_POST['preview'])) {
    $data['if']['preview'] = TRUE;
    $data['if']['form'] = TRUE;
    $data['if']['done'] = FALSE;
    $data['edit']['buddys_notice'] = cs_secure($cs_buddys['buddys_notice'], 1, 1);
    $data['edit']['id'] = $buddys_id;
}
if (isset($_POST['preview']) or !isset($_POST['submit'])) {
    if (!isset($_POST['preview'])) {
        $data['if']['preview'] = FALSE;
        $data['if']['form'] = TRUE;
        $data['if']['done'] = FALSE;
    }
    $data['edit']['abcode_smileys'] = cs_abcode_smileys('buddys_notice');
    $data['edit']['abcode_features'] = cs_abcode_features('buddys_notice');
    $data['edit']['buddys_notice'] = cs_secure($cs_buddys['buddys_notice']);
    $data['edit']['id'] = $buddys_id;
} else {
    $buddys_id = $_POST['id'];
    settype($buddys_id, 'integer');
    $data['if']['preview'] = FALSE;
    $data['if']['form'] = FALSE;
    $data['if']['done'] = TRUE;
    $buddys_cells = array_keys($cs_buddys);
    $buddys_save = array_values($cs_buddys);
    cs_sql_update(__FILE__, 'buddys', $buddys_cells, $buddys_save, $buddys_id);
    cs_redirect($cs_lang['changes_done'], 'buddys', 'center');
}
echo cs_subtemplate(__FILE__, $data, 'buddys', 'edit');
Beispiel #23
0
        }
        $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);
        cs_board_threads($board_new_id);
        cs_board_comments($board_new_id);
        cs_board_last($board_id);
    }
    cs_redirect($action_lang, 'board', 'thread', 'where=' . $thread_id);
}
Beispiel #24
0
             cs_cups_addteam2match($cs_match['cups_id'], $loser, $cs_match['cupmatches_match'], $cs_match['cupmatches_round'], $cs_match['cupmatches_loserbracket'], $cs_match['cupmatches_nextmatchlb'], true);
             $msg = $cs_lang['new_match'];
         }
         /* close all defwin matches */
         cs_cups_autoclose($cs_match['cups_id']);
     }
     echo $cs_lang['changes_done'] . '. ';
     $message = $cs_lang['changes_done'] . '. ';
     if (!empty($msg)) {
         $message .= ' ' . $msg;
     }
     // clear datacache
     if (function_exists('cs_datacache_load')) {
         cs_datacache_clear('cups');
     }
     cs_redirect($message, 'cups', 'match', 'id=' . $cupmatches_id);
 } else {
     $tables = 'cupmatches cm INNER JOIN {pre}_cups cp ON cm.cups_id = cp.cups_id';
     $cells = 'cp.cups_system AS cups_system';
     $system = cs_sql_select(__FILE__, $tables, $cells, 'cm.cupmatches_id = ' . $cupmatches_id);
     $tables = 'cupmatches cm ';
     if ($system['cups_system'] == CS_CUPS_TYPE_TEAMS) {
         $tables .= 'LEFT JOIN {pre}_squads sq1 ON cm.squad1_id = sq1.squads_id ';
         $tables .= 'LEFT JOIN {pre}_squads sq2 ON cm.squad2_id = sq2.squads_id ';
         $tables .= 'LEFT JOIN {pre}_cupsquads cs1 ON cm.squad1_id = cs1.squads_id ';
         $tables .= 'LEFT JOIN {pre}_cupsquads cs2 ON cm.squad2_id = cs2.squads_id ';
         $cells = 'cm.squad1_id AS squad1_id, cm.squad2_id AS squad2_id, ';
         $cells .= 'sq1.squads_name AS squad1_name, sq2.squads_name AS squad2_name, ';
     } else {
         $tables .= 'LEFT JOIN {pre}_users usr1 ON cm.squad1_id = usr1.users_id ';
         $tables .= 'LEFT JOIN {pre}_users usr2 ON cm.squad2_id = usr2.users_id ';
Beispiel #25
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');
}
Beispiel #26
0
    if (empty($cs_main['rte_html'])) {
        $data['abcode']['features'] = cs_abcode_features('news_text', $abcode[3], 1);
        $data['abcode']['smileys'] = cs_abcode_smileys('news_text', 1);
        $data['abcode']['features_readmore'] = cs_abcode_features('news_readmore', $abcode[3], 1);
        $data['abcode']['smileys_readmore'] = cs_abcode_smileys('news_readmore', 1);
        $data['if']['rte_html'] = false;
        $data['if']['abcode'] = true;
    } else {
        $data['if']['rte_html'] = true;
        $data['if']['abcode'] = false;
        $data['rte']['html'] = cs_rte_html('news_text', $cs_news['news_text']);
        $data['rte']['html_readmore'] = cs_rte_html('news_readmore', $cs_news['news_readmore']);
    }
    $data['news']['loop'] = $run_loop;
    $data['news']['news_readmore_active'] = $cs_news['news_readmore_active'] == 1 ? 'checked="checked"' : '';
    $data['news']['news_close'] = $cs_news['news_close'] == 1 ? 'checked="checked"' : '';
    $data['news']['news_public'] = $cs_news['news_public'] == 1 ? 'checked="checked"' : '';
    $data['news']['news_attached'] = $cs_news['news_attached'] == 1 ? 'checked="checked"' : '';
    $data['news']['check_publish'] = !empty($cs_news['news_publishs_at']) ? 'checked="checked"' : '';
    $data['news']['news_publishs_at'] = cs_dateselect('date', 'unix', !empty($cs_news['news_publishs_at']) ? $cs_news['news_publishs_at'] : cs_time(), 1995);
    echo cs_subtemplate(__FILE__, $data, 'news', 'create');
} else {
    $news_cells = array_keys($cs_news);
    $news_save = array_values($cs_news);
    cs_sql_insert(__FILE__, 'news', $news_cells, $news_save);
    cs_cache_delete('news_publish');
    if (!empty($cs_news['news_public'])) {
        include_once 'mods/news/rss.php';
    }
    cs_redirect($cs_lang['news_created'], 'news');
}
Beispiel #27
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');
}
Beispiel #28
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');
}
Beispiel #29
0
    } 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);
            $values = array_values($cs_maps);
            cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id);
        } else {
            $select = cs_sql_select(__FILE__, 'maps', 'maps_picture', 'maps_id = \'' . $maps_id . '\'');
            $url = 'uploads/maps/' . $select['maps_picture'];
            cs_unlink('maps', $select['maps_picture']);
            $filename = 'picture-' . $maps_id . '.' . $extension;
            cs_upload('maps', $filename, $files_gl['picture']['tmp_name']);
            $cs_maps['maps_picture'] = $filename;
            $cells = array_keys($cs_maps);
            $values = array_values($cs_maps);
            cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id);
        }
        cs_redirect($cs_lang['changes_done'], 'maps');
    }
}
Beispiel #30
0
    $matches[2] = $cs_lang['stage_1'] . $cs_lang['stage_1_text'] . cs_html_br(1);
    $matches[2] .= $cs_lang['stage_2'] . $cs_lang['stage_2_text'] . cs_html_br(1);
    $matches[2] .= $cs_lang['stage_3'] . $cs_lang['stage_3_text'] . cs_html_br(1);
    $matches[2] .= $cs_lang['stage_4'] . $cs_lang['stage_4_text'];
    $data['squads']['secure_clip'] = cs_abcode_clip($matches);
    $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_squads['max_width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $op_squads['max_height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_squads['max_size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['squads']['picup_clip'] = cs_abcode_clip($matches);
    if (empty($cs_squads['squads_picture'])) {
        $data['squads']['current_pic'] = $cs_lang['nopic'];
    } else {
        $place = 'uploads/squads/' . $cs_squads['squads_picture'];
        $size = getimagesize($cs_main['def_path'] . '/' . $place);
        $data['squads']['current_pic'] = cs_html_img($place, $size[1], $size[0]);
        $data['if']['advanced'] = TRUE;
    }
    $data['squads']['id'] = $squads_id;
    echo cs_subtemplate(__FILE__, $data, 'squads', 'edit');
} else {
    $squads_cells = array_keys($cs_squads);
    $squads_save = array_values($cs_squads);
    cs_sql_update(__FILE__, 'squads', $squads_cells, $squads_save, $squads_id);
    cs_redirect($cs_lang['changes_done'], 'squads');
}