예제 #1
0
function cs_pictures_upload($file, $mod, $fid, $ajaxclean = 1)
{
    if (!empty($_POST['del_picture'])) {
        cs_pictures_delete($_POST['del_picture']);
    }
    if (empty($file['tmp_name'])) {
        return true;
    }
    settype($fid, 'integer');
    $types_allowed = array('image/jpeg', 'image/png', 'image/pjpeg', 'image/x-png');
    if (!in_array($file['type'], $types_allowed)) {
        return false;
    }
    $exts = array('image/jpeg' => 'jpg', 'image/png' => 'png', 'image/pjpeg' => 'jpg', 'image/x-png' => 'png');
    $ext = $exts[$file['type']];
    $where = "pictures_fid = '" . $fid . "' AND pictures_mod = '" . $mod . "'";
    $already = cs_sql_select(__FILE__, 'pictures', 'pictures_id', $where);
    $pictures_id = $already['pictures_id'];
    if (empty($already)) {
        $vars = array();
        $vars['pictures_mod'] = $mod;
        $vars['pictures_fid'] = $fid;
        cs_sql_insert(__FILE__, 'pictures', array_keys($vars), array_values($vars));
        $pictures_id = cs_sql_insertid(__FILE__);
    }
    if (!cs_upload('pictures', 'picture-' . $pictures_id . '.' . $ext, $file['tmp_name'], $ajaxclean)) {
        cs_sql_delete(__FILE__, 'pictures', $pictures_id);
        return false;
    }
    $cells = array('pictures_file');
    $content = array('picture-' . $pictures_id . '.' . $ext);
    cs_sql_update(__FILE__, 'pictures', $cells, $content, $pictures_id);
    return true;
}
예제 #2
0
function cs_categories_create($mod, $categories_name)
{
    $return = 0;
    if (empty($categories_name)) {
        return 0;
    }
    $get = "categories_mod='" . $mod . "' AND categories_name = '" . cs_sql_escape($categories_name) . "'";
    $get_data = cs_sql_select(__FILE__, 'categories', 'categories_id', $get, 'categories_name');
    if (empty($get_data['categories_id'])) {
        $columns = array('categories_mod', 'categories_name');
        $values = array($mod, $categories_name);
        cs_sql_insert(__FILE__, 'categories', $columns, $values);
        $find = "categories_mod='" . $mod . "' AND categories_name = '" . cs_sql_escape($categories_name) . "'";
        $find_data = cs_sql_select(__FILE__, 'categories', 'categories_id', $find, 'categories_name');
        $return = $find_data['categories_id'];
    } else {
        $return = $get_data['categories_id'];
    }
    return $return;
}
예제 #3
0
    }
    $result = array_values(array_diff($all_smileys, $act_smileys));
    if (!empty($result)) {
        $counter = 0;
        for ($run = 0; $run < count($result); $run++) {
            $data['file'][$run]['name'] = $result[$run];
            $data['file'][$run]['preview'] = cs_html_img('uploads/abcode/' . $result[$run]);
            $data['file'][$run]['run'] = empty($data['file'][$run]['run']) ? '' : $data['file'][$run]['run'];
            $data['file'][$run]['order'] = empty($_POST['order_' . $counter]) ? '' : (int) $_POST['order_' . $counter];
            $data['file'][$run]['counter'] = $counter;
            $counter++;
        }
    }
} else {
    for ($run = 0; $run < count($data['file']); $run++) {
        $sql_cells = array('abcode_func', 'abcode_pattern', 'abcode_file', 'abcode_order');
        $sql_saves = array('img', $data['file'][$run]['run'], $data['file'][$run]['name'], $data['file'][$run]['order']);
        cs_sql_insert(__FILE__, 'abcode', $sql_cells, $sql_saves);
    }
    cs_cache_delete('abcode_smileys');
    cs_cache_delete('abcode_content');
    cs_redirect($cs_lang['changes_done'], 'abcode', 'manage');
}
if (empty($data['file'])) {
    $data['if']['no_smileys'] = true;
    $data['if']['smileys'] = false;
} else {
    $data['if']['no_smileys'] = false;
    $data['if']['smileys'] = true;
}
echo cs_subtemplate(__FILE__, $data, 'abcode', 'import');
예제 #4
0
    $data['users']['nick'] = $users_nick;
    $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);
    echo cs_subtemplate(__FILE__, $data, 'clans', 'create');
} else {
    $clans_cells = array_keys($cs_clans);
    $clans_save = array_values($cs_clans);
    cs_sql_insert(__FILE__, 'clans', $clans_cells, $clans_save);
    if (!empty($files['picture']['tmp_name'])) {
        $where = "clans_name = '" . cs_sql_escape($cs_clans['clans_name']) . "'";
        $getid = cs_sql_select(__FILE__, 'clans', 'clans_id', $where);
        $filename = 'picture-' . $getid['clans_id'] . '.' . $extension;
        cs_upload('clans', $filename, $files['picture']['tmp_name']);
        $cs_clans2['clans_picture'] = $filename;
        $clans2_cells = array_keys($cs_clans2);
        $clans2_save = array_values($cs_clans2);
        cs_sql_update(__FILE__, 'clans', $clans2_cells, $clans2_save, $getid['clans_id']);
    }
    if ($account['access_wizard'] == 5) {
        cs_redirect($cs_lang['create_done'], 'clans', 'manage');
    } else {
        cs_redirect($cs_lang['create_done'], 'clans');
    }
예제 #5
0
        $error++;
        $errormsg .= $cs_lang['no_text'] . cs_html_br(1);
    }
    $exists = cs_sql_count(__FILE__, 'boardreport', "threads_id = " . (int) $tid . " AND comments_id = " . (int) $cid);
    if (!empty($exists)) {
        $error++;
        $errormsg .= $cs_lang['report_exists'] . cs_html_br(1);
    }
}
if (!empty($error)) {
    $data['lang']['body'] = $errormsg;
} elseif (!isset($_POST['submit'])) {
    $data['lang']['body'] = $cs_lang['fill_out_all_fields'];
} else {
    $data['lang']['body'] = $cs_lang['report_success'];
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['action']['form'] = cs_url('board', 'report');
    $data['report']['tid'] = $tid;
    $data['report']['cid'] = $cid;
} else {
    $report_cells = array('threads_id', 'comments_id', 'users_id', 'boardreport_time', 'boardreport_text');
    $report_save = array($tid, $cid, $account['users_id'], cs_time(), $report);
    cs_sql_insert(__FILE__, 'boardreport', $report_cells, $report_save);
    cs_cache_delete('count_boardreport');
    require_once 'mods/notifymods/functions.php';
    $users_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $account['users_id']);
    notifymods_mail('board', $account['users_id'], array($users_nick['users_nick'], $cs_thread['threads_headline'], $report));
    cs_redirect($cs_lang['report_success'], 'board', 'thread', 'where=' . $tid);
}
echo cs_subtemplate(__FILE__, $data, 'board', 'report');
예제 #6
0
    }
}
if (!empty($_POST['games_creator'])) {
    $games_creator = $_POST['games_creator'];
}
if (!empty($_POST['games_url'])) {
    $games_url = $_POST['games_url'];
}
if (!empty($_POST['games_version'])) {
    $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);
예제 #7
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');
예제 #8
0
        $error .= cs_html_br(1) . '- ' . $cs_lang['double'];
    }
    if (empty($account['users_id']) || $cs_shout['shoutbox_name'] != $account['users_nick']) {
        $nick_valid = cs_sql_count(__FILE__, 'users', 'users_nick = \'' . cs_sql_escape($cs_shout['shoutbox_name']) . '\'');
        if (!empty($nick_valid)) {
            $error .= cs_html_br(1) . '- ' . $cs_lang['user_exists'];
        }
    }
    if (!empty($error)) {
        $data['lang']['body'] = $cs_lang['errors'] . ' ' . $error;
        $data['form']['url'] = cs_url('shoutbox', 'create');
        $data['form']['name'] = cs_secure($cs_shout['shoutbox_name']);
        $data['form']['message'] = cs_secure($cs_shout['shoutbox_text']);
        if (!empty($captcha) && empty($account['users_id'])) {
            $data['form']['captcha'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time() . '&mini');
            $data['form']['show'] = cs_subtemplate(__FILE__, $data, 'shoutbox', 'captcha');
        } else {
            $data['form']['show'] = '';
        }
        echo cs_subtemplate(__FILE__, $data, 'shoutbox', 'create');
    } else {
        $cells = array_keys($cs_shout);
        $values = array_values($cs_shout);
        cs_sql_insert(__FILE__, 'shoutbox', $cells, $values);
        $data['shoutbox']['done'] = cs_html_link($uri, $cs_lang['continue'], 0);
        echo cs_subtemplate(__FILE__, $data, 'shoutbox', 'submit');
    }
} else {
    $data['shoutbox']['no_submit'] = $cs_lang['no_submit'];
    echo cs_subtemplate(__FILE__, $data, 'shoutbox', 'no_submit');
}
예제 #9
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');
}
예제 #10
0
        $levels++;
    }
    $data['cat']['abcode_smileys'] = cs_abcode_smileys('categories_text');
    $data['cat']['abcode_features'] = cs_abcode_features('categories_text');
    $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_categories['max_width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $op_categories['max_height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_categories['max_size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['cat']['picup_clip'] = cs_abcode_clip($matches);
    echo cs_subtemplate(__FILE__, $data, 'categories', 'create');
} else {
    $categories_cells = array_keys($cs_categories);
    $categories_save = array_values($cs_categories);
    cs_sql_insert(__FILE__, 'categories', $categories_cells, $categories_save);
    if (!empty($files_gl['picture']['tmp_name'])) {
        $where = "categories_name = '" . cs_sql_escape($cs_categories['categories_name']) . "'";
        $getid = cs_sql_select(__FILE__, 'categories', 'categories_id', $where);
        $filename = 'picture-' . $getid['categories_id'] . '.' . $extension;
        cs_upload('categories', $filename, $files_gl['picture']['tmp_name']);
        $cs_categories2['categories_picture'] = $filename;
        $categories2_cells = array_keys($cs_categories2);
        $categories2_save = array_values($cs_categories2);
        cs_sql_update(__FILE__, 'categories', $categories2_cells, $categories2_save, $getid['categories_id']);
    }
    cs_redirect($cs_lang['create_done'], 'categories', 'manage', 'where=' . $cs_categories['categories_mod']);
}
예제 #11
0
        $run = 0;
        $run2 = 0;
        foreach ($cs_rounds as $round) {
            $run2++;
            $data['maps'][$run]['name'] = $round['maps_name'];
            $data['maps'][$run]['result'] = $round['rounds_score1'] . ' : ' . $round['rounds_score2'];
            $data['maps'][$run]['rounds_id'] = $round['rounds_id'];
            $up = $run2 != 1 ? cs_link($img_up, 'wars', 'rounds', 'id=' . $wars_id . '&amp;up=' . $round['rounds_id']) : '-';
            $down = $run2 != $count ? cs_link($img_down, 'wars', 'rounds', 'id=' . $wars_id . '&amp;down=' . $round['rounds_id']) : '-';
            $data['maps'][$run]['up_down'] = $up . ' ' . $down;
            $run++;
        }
    } else {
        $data['if']['rounds'] = false;
    }
    echo cs_subtemplate(__FILE__, $data, 'wars', 'rounds');
} else {
    if (!empty($new_map)) {
        $get_game_id = cs_sql_select(__FILE__, 'wars', 'games_id', 'wars_id = \'' . $cs_rounds['wars_id'] . '\'');
        $cells1 = array('maps_name', 'games_id');
        $values1 = array($_POST['new_map'], $get_game_id['games_id']);
        cs_sql_insert(__FILE__, 'maps', $cells1, $values1);
        $cs_rounds['maps_id'] = cs_sql_insertid(__FILE__);
    } else {
        $cs_rounds['maps_id'] = (int) $_POST['maps_id'];
    }
    $cells2 = array_keys($cs_rounds);
    $values2 = array_values($cs_rounds);
    cs_sql_insert(__FILE__, 'rounds', $cells2, $values2);
    cs_redirect($cs_lang['create_done'], 'wars', 'rounds', 'id=' . $cs_rounds['wars_id']);
}
예제 #12
0
        $data['abcode']['features'] = cs_abcode_features('links_info', 1, 1);
    } else {
        $data['if']['rte_html'] = TRUE;
        $data['rte']['html'] = cs_rte_html('links_info', $cs_links['links_info']);
    }
    $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'] . $img_max['width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $img_max['height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($img_max['size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['picup']['clip'] = cs_abcode_clip($matches);
    $data['check']['sponsor'] = empty($cs_links['links_sponsor']) ? '' : 'checked="checked"';
    echo cs_subtemplate(__FILE__, $data, 'links', 'create');
} else {
    $cells = array_keys($cs_links);
    $save = array_values($cs_links);
    cs_sql_insert(__FILE__, 'links', $cells, $save);
    if (!empty($files_gl['symbol']['tmp_name'])) {
        $id = cs_sql_insertid(__FILE__);
        $filename = $id . '.' . $ext;
        cs_upload('links', $filename, $files_gl['symbol']['tmp_name']);
        $file_cell = array('links_banner');
        $file_save = array($filename);
        cs_sql_update(__FILE__, 'links', $file_cell, $file_save, $id);
    }
    cs_redirect($cs_lang['create_done'], 'links');
}
예제 #13
0
    $data['check']['multi_yes'] = $_POST['events_multi'] == 'yes' ? $selected : '';
    $data['data']['events_multix'] = $_POST['events_multix'];
    $checked = 'checked="checked"';
    $data['check']['close'] = empty($cs_events['events_close']) ? '' : $checked;
    $data['check']['cancel'] = empty($cs_events['events_cancel']) ? '' : $checked;
    echo cs_subtemplate(__FILE__, $data, 'events', 'create');
} else {
    settype($cs_events['events_guestsmin'], 'integer');
    settype($cs_events['events_guestsmax'], 'integer');
    settype($cs_events['events_needage'], 'integer');
    $events_cells = array_keys($cs_events);
    $events_save = array_values($cs_events);
    cs_sql_insert(__FILE__, 'events', $events_cells, $events_save);
    if ($_POST['events_multi'] == 'yes') {
        $mode = date('I', $cs_events['events_time']);
        for ($run = 0; $run < $_POST['events_multix']; $run++) {
            $cs_events['events_time'] = strtotime("+1 week", $cs_events['events_time']);
            if (date('I', $cs_events['events_time']) > $mode) {
                $cs_events['events_time'] = $cs_events['events_time'] - 3600;
                $mode = 1;
            } elseif (date('I', $cs_events['events_time']) < $mode) {
                $cs_events['events_time'] = $cs_events['events_time'] + 3600;
                $mode = 0;
            }
            $events_cells = array_keys($cs_events);
            $events_save = array_values($cs_events);
            cs_sql_insert(__FILE__, 'events', $events_cells, $events_save);
        }
    }
    cs_redirect($cs_lang['create_done'], 'events');
}
예제 #14
0
    } else {
        $error = $cs_lang['error_id'];
    }
}
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'])) {
    $data['buddys']['nick'] = $buddys_nick;
    if (empty($users_add_id)) {
        $more = 'onkeyup="Clansphere.ajax.user_autocomplete(\'buddys_nick\', \'output\', \'' . $cs_main['php_self']['dirname'] . '\')" id="buddys_nick"';
        $data['if']['empty_users_id'] = TRUE;
        $data['if']['users_id'] = FALSE;
        $data['input']['more'] = $more;
    } else {
        $data['if']['empty_users_id'] = FALSE;
        $data['if']['users_id'] = TRUE;
        $data['buddys']['nick_sec'] = cs_secure($buddys_nick);
    }
    $data['abcode']['smileys'] = cs_abcode_smileys('buddys_notice');
    $data['abcode']['features'] = cs_abcode_features('buddys_notice');
    $data['create']['buddys_notice'] = $buddys_notice;
    echo cs_subtemplate(__FILE__, $data, 'buddys', 'create');
} else {
    $buddys_cells = array('users_id', 'buddys_user', 'buddys_time', 'buddys_notice');
    $buddys_save = array($users_id, $buddys_id, $time, $buddys_notice);
    cs_sql_insert(__FILE__, 'buddys', $buddys_cells, $buddys_save);
    cs_redirect($cs_lang['create_done'], 'buddys', 'center');
}
예제 #15
0
        foreach ($matches as $matchnr => $match) {
            $cs_cups = array();
            $cs_cups['cups_id'] = $id;
            $cs_cups['squad1_id'] = isset($match['squad_id1']) ? $match['squad_id1'] : 0;
            $cs_cups['squad2_id'] = isset($match['squad_id2']) ? $match['squad_id2'] : 0;
            $cs_cups['cupmatches_loserbracket'] = $match['loserbracket'];
            $cs_cups['cupmatches_round'] = $match['round'];
            $cs_cups['cupmatches_tree_order'] = $match['tree_order'];
            $cs_cups['cupmatches_match'] = $matchnr;
            $cs_cups['cupmatches_nextmatch'] = $match['nextmatch'];
            $cs_cups['cupmatches_nextmatchlb'] = $match['nextmatchlb'];
            $cs_cups['cupmatches_seed1'] = $match['seed1'];
            $cs_cups['cupmatches_seed2'] = $match['seed2'];
            $cells = array_keys($cs_cups);
            $values = array_values($cs_cups);
            cs_sql_insert(__FILE__, 'cupmatches', $cells, $values);
        }
        /* autoclose the matches */
        cs_cups_autoclose($id);
    }
    cs_redirect($cs_lang['started_successfully'], 'cups', 'manage');
} else {
    $id = (int) $_GET['id'];
    $cupsel = cs_sql_select(__FILE__, 'cups', 'cups_teams, cups_system', 'cups_id = ' . $id);
    if ($cupsel['cups_system'] == CS_CUPS_TYPE_TEAMS) {
        // remove squads automatically which doesn't exist anymore in the database
        $del = cs_sql_select(__FILE__, 'cupsquads cq LEFT JOIN {pre}_squads sq ON cq.squads_id = sq.squads_id', 'cq.squads_id', 'sq.squads_id IS NULL AND cups_id = ' . $id, 0, 0, 0);
        if (!empty($del)) {
            foreach ($del as $del_id) {
                cs_sql_delete(__FILE__, 'cupsquads', $del_id['squads_id'], 'squads_id');
            }
예제 #16
0
$cs_lang = cs_translate('boardranks');
$data = array();
if (isset($_POST['submit'])) {
    $boardranks_min = $_POST['boardranks_min'];
    $boardranks_name = $_POST['boardranks_name'];
    $error = '';
    if ($boardranks_min == '') {
        $error .= $cs_lang['no_min'] . cs_html_br(1);
    }
    if (empty($boardranks_name)) {
        $error .= $cs_lang['no_name'] . cs_html_br(1);
    }
} else {
    $boardranks_min = '';
    $boardranks_name = '';
}
if (!isset($_POST['submit']) or empty($error)) {
    $data['head']['body'] = $cs_lang['body'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['boardranks']['min'] = $boardranks_min;
    $data['boardranks']['name'] = $boardranks_name;
    echo cs_subtemplate(__FILE__, $data, 'boardranks', 'create');
} else {
    $cells = array('boardranks_min', 'boardranks_name');
    $content = array($boardranks_min, $boardranks_name);
    cs_sql_insert(__FILE__, 'boardranks', $cells, $content);
    cs_redirect($cs_lang['create_done'], 'boardranks');
}
예제 #17
0
                die('Multivote triggered an error with answers -> Execution halted.');
            }
            for ($run = 0; $run < $count_voted; $run++) {
                $votes_cells = array('voted_fid', 'users_id', 'voted_time', 'voted_answer', 'voted_ip', 'voted_mod');
                $votes_save = array($votes_id, $users_id, $time, $voted_answer[$run], $users_ip, $mod);
                if (!empty($voted_answer[$run])) {
                    cs_sql_insert(__FILE__, 'voted', $votes_cells, $votes_save);
                } else {
                    cs_error(__FILE__, 'Empty answer for multivote with ID ' . $cs_votes_id);
                }
            }
        } else {
            $votes_cells = array('voted_fid', 'users_id', 'voted_time', 'voted_answer', 'voted_ip', 'voted_mod');
            $votes_save = array($votes_id, $users_id, $time, $voted_answer, $users_ip, $mod);
            if (!empty($voted_answer)) {
                cs_sql_insert(__FILE__, 'voted', $votes_cells, $votes_save);
            } else {
                cs_error(__FILE__, 'Empty answer for singlevote with ID ' . $cs_votes_id);
            }
        }
        cs_redirect($cs_lang['create_done'], 'votes', 'list');
    } else {
        $votes_form = 0;
        cs_redirect($cs_lang['error_occurred'], 'votes', 'list');
    }
}
if (!empty($cs_votes) and !empty($votes_form)) {
    $from = 'voted';
    $select = 'voted_id, users_id, voted_ip, voted_answer';
    $where = "voted_fid = \"" . $votes_id . "\" AND voted_mod = 'votes'";
    $cs_voted = cs_sql_select(__FILE__, $from, $select, $where, '', '0', '0');
예제 #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);
}
예제 #19
0
    $data['banners']['or_img_url'] = $cs_banners['banners_picture'];
    $data['banners']['alt'] = $cs_banners['banners_alt'];
    $data['banners']['order'] = $cs_banners['banners_order'];
    $matches[1] = $cs_lang['pic_infos'];
    $return_types = '';
    foreach ($img_filetypes as $add) {
        $return_types .= empty($return_types) ? $add : ', ' . $add;
    }
    $matches[2] = $cs_lang['max_width'] . $op_banners['max_width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $op_banners['max_height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_banners['max_size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['banners']['clip'] = cs_abcode_clip($matches);
    echo cs_subtemplate(__FILE__, $data, 'banners', 'create');
} else {
    settype($cs_banners['banners_order'], 'integer');
    $banners_cells = array_keys($cs_banners);
    $banners_save = array_values($cs_banners);
    cs_sql_insert(__FILE__, 'banners', $banners_cells, $banners_save);
    if (!empty($files['picture']['tmp_name'])) {
        $where = "banners_name = '" . cs_sql_escape($cs_banners['banners_name']) . "'";
        $getid = cs_sql_select(__FILE__, 'banners', 'banners_id', $where);
        $filename = 'picture-' . $getid['banners_id'] . '.' . $extension;
        cs_upload('banners', $filename, $files['picture']['tmp_name']);
        $cs_banners2['banners_picture'] = 'uploads/banners/' . $filename;
        $banners2_cells = array_keys($cs_banners2);
        $banners2_save = array_values($cs_banners2);
        cs_sql_update(__FILE__, 'banners', $banners2_cells, $banners2_save, $getid['banners_id']);
    }
    cs_redirect($cs_lang['create_done'], 'banners');
}
예제 #20
0
    $cs_cash['users_id'] = $account['users_id'];
    $cs_cash['cash_time'] = cs_date('unix', cs_time(), 0, 1, 'Y-m-d');
}
if (!isset($_POST['submit']) and empty($error)) {
    $data['head']['body'] = $cs_lang['body_info'];
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['cash'] = $cs_cash;
    $data['cash']['cash_money'] = cs_secure($data['cash']['cash_money'], 0, 0, 0);
    $data['cash']['cash_text'] = cs_secure($data['cash']['cash_text'], 0, 0, 0);
    $data['cash']['cash_info'] = cs_secure($data['cash']['cash_info'], 0, 0, 0);
    $cs_users = cs_sql_select(__FILE__, 'users', 'users_nick,users_id', 'users_delete = "0"', 'users_nick', 0, 0);
    $data['cash']['users_sel'] = cs_dropdown('users_id', 'users_nick', $cs_users, $cs_cash['users_id']);
    $inoutlist[0]['cash_inout'] = 'in';
    $inoutlist[0]['name'] = $cs_lang['drop_in'];
    $inoutlist[1]['cash_inout'] = 'out';
    $inoutlist[1]['name'] = $cs_lang['drop_out'];
    $data['cash']['inout_sel'] = cs_dropdown('cash_inout', 'name', $inoutlist, $cs_cash['cash_inout']);
    $data['cash']['date_sel'] = cs_dateselect('datum', 'date', $cs_cash['cash_time'], 2000);
    $data['cash']['abcode_smileys'] = cs_abcode_smileys('cash_info');
    $data['cash']['abcode_features'] = cs_abcode_features('cash_info');
    $data['users']['nick'] = cs_secure($users_nick, 0, 0, 0);
    echo cs_subtemplate(__FILE__, $data, 'cash', 'create');
} else {
    $cash_cells = array_keys($cs_cash);
    $cash_save = array_values($cs_cash);
    cs_sql_insert(__FILE__, 'cash', $cash_cells, $cash_save);
    cs_redirect($cs_lang['create_done'], 'cash');
}
예제 #21
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']);
}
예제 #22
0
} elseif (!empty($error)) {
    $data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
    $data['linkus'] = $cs_linkus;
    $matches[1] = $cs_lang['pic_infos'];
    $return_types = '';
    foreach ($img_filetypes as $add => $value) {
        $return_types .= empty($return_types) ? $add : ', ' . $add;
    }
    $matches[2] = $cs_lang['max_width'] . $img_max['width'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_height'] . $img_max['height'] . ' px' . cs_html_br(1);
    $matches[2] .= $cs_lang['max_size'] . cs_filesize($img_max['size']) . cs_html_br(1);
    $matches[2] .= $cs_lang['filetypes'] . $return_types;
    $data['linkus']['picup_clip'] = cs_abcode_clip($matches);
    echo cs_subtemplate(__FILE__, $data, 'linkus', 'create');
} else {
    $linkus_cells = array_keys($cs_linkus);
    $linkus_save = array_values($cs_linkus);
    cs_sql_insert(__FILE__, 'linkus', $linkus_cells, $linkus_save);
    if (!empty($files_gl['symbol']['tmp_name'])) {
        $where = "linkus_name = '" . cs_sql_escape($cs_linkus['linkus_name']) . "'";
        $getid = cs_sql_select(__FILE__, 'linkus', 'linkus_id', $where);
        $filename = $getid['linkus_id'] . '.' . $extension;
        cs_upload('linkus', $filename, $files_gl['symbol']['tmp_name']);
    }
    $linkus_cells = array('linkus_banner');
    $linkus_save = array($filename);
    cs_sql_update(__FILE__, 'linkus', $linkus_cells, $linkus_save, $getid['linkus_id']);
    cs_redirect($cs_lang['create_done'], 'linkus');
}
예제 #23
0
파일: view.php 프로젝트: aberrios/WEBTHESGO
                }
                if ($select['players_status'] == 'no') {
                    $wars['status']['no'] = $sel;
                }
                $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)) {
예제 #24
0
                break;
            case 3:
                $extension = 'png';
                break;
        }
        if (empty($extension)) {
            $error .= cs_html_br(1) . $cs_lang['wrong_ext'];
        } else {
            $save['medals_extension'] = $extension;
        }
    }
}
if (!empty($_POST['submit']) && empty($error)) {
    $cells = array_keys($save);
    $values = array_values($save);
    cs_sql_insert(__FILE__, 'medals', $cells, $values);
    if (!empty($files_gl['medals_picture']['tmp_name'])) {
        $id = cs_sql_insertid(__FILE__);
        $filename = 'medal-' . $id . '.' . $extension;
        cs_upload('medals', $filename, $files_gl['medals_picture']['tmp_name']);
    }
    cs_redirect($cs_lang['create_done'], 'medals');
}
if (empty($_POST['submit'])) {
    $data['medals']['medals_name'] = '';
    $data['medals']['medals_text'] = '';
} else {
    $data['medals']['medals_name'] = $save['medals_name'];
    $data['medals']['medals_text'] = $save['medals_text'];
}
$data['medals']['message'] = empty($error) ? $cs_lang['errors_here'] : $cs_lang['error_occured'] . $error;
예제 #25
0
파일: user.php 프로젝트: aberrios/WEBTHESGO
<?php

$cs_lang = cs_translate('medals');
$data = array();
if (isset($_POST['submit'])) {
    $medals_id = $_POST['medals_id'];
    if (!empty($_POST['users_nick'])) {
        $users_nick = cs_sql_escape($_POST['users_nick']);
        $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'];
예제 #26
0
파일: new.php 프로젝트: aberrios/WEBTHESGO
    $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);
    echo cs_subtemplate(__FILE__, $data, 'squads', 'new');
} else {
    $squads_cells = array_keys($cs_squads);
    $squads_save = array_values($cs_squads);
    cs_sql_insert(__FILE__, 'squads', $squads_cells, $squads_save);
    $where = "squads_name = '" . cs_sql_escape($cs_squads['squads_name']) . "'";
    $getid = cs_sql_select(__FILE__, 'squads', 'squads_id', $where);
    $members_cells = array('users_id', 'squads_id', 'members_task', 'members_order', 'members_admin');
    $members_save = array($account['users_id'], $getid['squads_id'], $cs_lang['leader'], 1, 1);
    cs_sql_insert(__FILE__, 'members', $members_cells, $members_save);
    if (!empty($files['picture']['tmp_name'])) {
        $filename = 'picture-' . $getid['squads_id'] . '.' . $extension;
        cs_upload('squads', $filename, $files['picture']['tmp_name']);
        $cs_squads2['squads_picture'] = $filename;
        $squads2_cells = array_keys($cs_squads2);
        $squads2_save = array_values($cs_squads2);
        cs_sql_update(__FILE__, 'squads', $squads2_cells, $squads2_save, $getid['squads_id']);
    }
    cs_redirect($cs_lang['create_done'], 'squads', 'center');
}
예제 #27
0
    if (empty($_POST['board_id']) or $_POST['board_id'] == $board_id) {
        return cs_redirect(NULL, 'board', 'thread', 'where=' . $thread_id);
    }
    if ($_POST['ghost'] == '1') {
        $ghost['board_id'] = $thread_edit['board_id'];
        $ghost['threads_headline'] = $cs_lang['movedto'] . ' (' . $thread_edit['threads_headline'] . ')';
        $ghost['threads_close'] = $account['users_id'];
        $ghost['users_id'] = $thread_edit['users_id'];
        $ghost['threads_time'] = $thread_edit['threads_time'];
        $ghost['threads_last_time'] = $thread_edit['threads_last_time'];
        $ghost['threads_ghost'] = 1;
        $ghost['threads_ghost_board'] = $_POST['board_id'];
        $ghost['threads_ghost_thread'] = $thread_edit['threads_id'];
        $ghost_cells = array_keys($ghost);
        $ghost_save = array_values($ghost);
        $ghost_insert = cs_sql_insert(__FILE__, 'threads', $ghost_cells, $ghost_save);
    }
    $board_new_id = $_POST['board_id'];
    $thread_closed = !empty($_POST['thread_closed']) ? $account['users_id'] : 0;
    //  echo $thread_closed;
    settype($board_new_id, 'integer');
    settype($thread_closed, 'integer');
    $thread_cells = array('board_id', 'threads_close');
    $thread_save = array($board_new_id, $thread_closed);
    $action_lang = $cs_lang['action_move'];
} elseif (!empty($_POST['submit_rename'])) {
    if (empty($_POST['thread_headline'])) {
        return cs_redirect($cs_lang['mark_all'], 'board', 'thread', 'where=' . $thread_id);
    }
    $thread_headline = $_POST['thread_headline'];
    $thread_cells = array('threads_headline');
예제 #28
0
 }
 for ($run = 0; $run < $cs_messages_loop; $run++) {
     $users_id_to = $cs_messages[$run]['users_id'];
     $messages_cells = array('users_id', 'messages_time', 'messages_subject', 'messages_text', 'users_id_to', 'messages_show_receiver', 'messages_show_sender');
     $messages_save = array($users_id, $time, $messages_subject, $messages_text, $users_id_to, $messages_show_receiver, $messages_show_sender);
     cs_sql_insert(__FILE__, 'messages', $messages_cells, $messages_save);
     $where = "users_id = '" . $users_id_to . "'";
     $select = 'users_id,autoresponder_subject,autoresponder_text,autoresponder_close,autoresponder_mail';
     $autoresponder = cs_sql_select(__FILE__, 'autoresponder', $select, $where);
     $auto_subject = $autoresponder['autoresponder_subject'];
     $auto_text = $autoresponder['autoresponder_text'];
     $auto_mail = $autoresponder['autoresponder_mail'];
     if (!empty($autoresponder['autoresponder_close'])) {
         $messages_cells = array('users_id', 'messages_time', 'messages_subject', 'messages_text', 'users_id_to', 'messages_show_receiver');
         $messages_save = array($users_id_to, $time, $auto_subject, $auto_text, $users_id, '1');
         cs_sql_insert(__FILE__, 'messages', $messages_cells, $messages_save);
     }
     if (!empty($autoresponder['autoresponder_mail']) && !empty($cs_messages[$run]['users_email'])) {
         $lang = cs_sql_select(__FILE__, 'users', 'users_lang', 'users_id = "' . $users_id_to . '"');
         if ($lang['users_lang'] != $account['users_lang']) {
             $lang_save = $account['users_lang'];
             $account['users_lang'] = $lang['users_lang'];
             $cs_lang_save = $cs_lang;
             $cs_lang = cs_translate('messages');
         }
         $cs_contact = cs_sql_option(__FILE__, 'contact');
         $email = $cs_messages[$run]['users_email'];
         $title = $cs_lang['mail_titel'];
         $message = $cs_lang['mail_text'] . $cs_messages[$run]['users_nick'];
         $message .= $cs_lang['mail_text_2'] . $cs_main['def_title'] . $cs_lang['mail_text_3'];
         $message .= $cs_contact['def_org'] . $cs_lang['mail_text_4'];
예제 #29
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');
}
예제 #30
0
        $error++;
        $errormsg .= $cs_lang['no_event_url'] . cs_html_br(1);
    }
    if (empty($cs_awards['games_id']) and empty($cs_games['games_name'])) {
        $error++;
        $errormsg .= $cs_lang['no_game'] . cs_html_br(1);
    }
    if (empty($cs_awards['awards_rank'])) {
        $error++;
        $errormsg .= $cs_lang['no_rank'] . cs_html_br(1);
    }
}
if (!isset($_POST['submit']) or isset($_POST['submit']) and !empty($error)) {
    $data = array();
    $data['head']['body_create'] = !isset($_POST['submit']) ? $cs_lang['body_create'] : $errormsg;
    $data['awards']['awards_event_url'] = $cs_awards['awards_event_url'];
    $data['awards']['awards_event'] = $cs_awards['awards_event'];
    $data['awards']['awards_rank'] = $cs_awards['awards_rank'];
    $games = cs_sql_select(__FILE__, 'games', 'games_name, games_id', 0, 1, 1, 0);
    $data['select']['game'] = cs_dropdown('games_id', 'games_name', $games, $cs_awards['games_id']);
    $data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 0, 'squads_name', 0, 0);
    $data['squads'] = cs_dropdownsel($data_squads, $cs_awards['squads_id'], 'squads_id');
    $data['select']['date'] = cs_dateselect('datum', 'date', $cs_awards['awards_time']);
    echo cs_subtemplate(__FILE__, $data, 'awards', 'create');
}
if (isset($_POST['submit']) and empty($error)) {
    $awards_cells = array_keys($cs_awards);
    $awards_save = array_values($cs_awards);
    cs_sql_insert(__FILE__, 'awards', $awards_cells, $awards_save);
    cs_redirect($cs_lang['create_done'], 'awards');
}