本文整理汇总了PHP中cs_dropdown函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_dropdown函数的具体用法?PHP cs_dropdown怎么用?PHP cs_dropdown使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_dropdown函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_categories_dropdown
function cs_categories_dropdown($mod, $categories_id)
{
global $account;
$where = "categories_mod='" . $mod . "'";
$list_data = cs_sql_select(__FILE__, 'categories', 'categories_id, categories_name', $where, 'categories_order ASC, categories_name', 0, 0);
$data = array();
$data['categories']['dropdown'] = cs_dropdown('categories_id', 'categories_name', $list_data, $categories_id);
$data['if']['cat_access'] = $account['access_categories'] >= 3 ? true : false;
return cs_subtemplate(__FILE__, $data, 'categories', 'cat_dropdown');
}
示例2: elseif
if (!isset($_POST['submit'])) {
$data['lang']['head'] = $cs_lang['body_mail'];
} elseif (!empty($error)) {
$data['lang']['head'] = cs_icon('important') . cs_html_br(1);
$data['lang']['head'] .= $errormsg;
} else {
$data['lang']['head'] = $cs_lang['success'];
}
if (!empty($error) or !isset($_POST['submit'])) {
$data['if']['form'] = TRUE;
$data['if']['done'] = FALSE;
$categories_data = cs_sql_select(__FILE__, 'categories', '*', "categories_mod = 'contact'", 'categories_order ASC, categories_name', 0, 0);
foreach ($mail as $key => $value) {
$data['mail'][$key] = cs_secure($value);
}
$data['mail']['categories_id'] = cs_dropdown('categories_id', 'categories_name', $categories_data, $mail['categories_id']);
if (!empty($captcha)) {
$data['if']['captcha'] = 1;
}
} else {
$data['if']['form'] = FALSE;
$data['if']['done'] = TRUE;
$categories_data = cs_sql_select(__FILE__, 'categories', 'categories_name', "categories_id = '" . $mail['categories_id'] . "'");
$message = sprintf($cs_lang['mailtxt'], date('d.m.Y'), date('H:i'), $ip, $mail['name'], $mail['firm'], $mail['icq'], $mail['email'], $categories_data['categories_name'], $mail['why'], $mail['text']);
settype($mail['icq'], 'integer');
$mail_cells = array('mail_name', 'mail_time', 'mail_ip', 'mail_email', 'mail_icq', 'mail_jabber', 'mail_firm', 'categories_id', 'mail_subject', 'mail_message');
$mail_save = array($mail['name'], cs_time(), $ip, $mail['email'], $mail['icq'], $mail['jabber'], $mail['firm'], $mail['categories_id'], $mail['why'], $mail['text']);
cs_sql_insert(__FILE__, 'mail', $mail_cells, $mail_save);
cs_cache_delete('count_mail_unread');
cs_mail($cs_contact['def_mail'], $mail['why'], $message, $mail['email']);
}
示例3: cs_translate
// 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'];
$save['word_cut'] = $_POST['word_cut'] > 65535 ? 65535 : (int) $_POST['word_cut'];
$save['def_abcode'] = empty($_POST['def_abcode']) ? 0 : 1;
示例4: cs_dropdown
$views[2]['name'] = $cs_lang['compatible'];
$data['setup']['view_type'] = cs_dropdown('users_view', 'name', $views, $cs_user['users_view'], 0, 1);
$mode[0]['users_invisible'] = 0;
$mode[0]['name'] = $cs_lang['off'];
$mode[1]['users_invisible'] = 1;
$mode[1]['name'] = $cs_lang['on'];
$data['setup']['users_invisible'] = cs_dropdown('users_invisible', 'name', $mode, $cs_user['users_invisible'], 0, 1);
$mode[0]['users_abomail'] = 0;
$mode[0]['name'] = $cs_lang['off'];
$mode[1]['users_abomail'] = 1;
$mode[1]['name'] = $cs_lang['on'];
$data['setup']['users_abomail'] = cs_dropdown('users_abomail', 'name', $mode, $cs_user['users_abomail'], 0, 1);
$mode[0]['users_ajax'] = 0;
$mode[0]['name'] = $cs_lang['off'];
$mode[1]['users_ajax'] = 1;
$mode[1]['name'] = $cs_lang['on'];
$data['setup']['users_ajax'] = cs_dropdown('users_ajax', 'name', $mode, $cs_user['users_ajax']);
$data['if']['ajax_allowed'] = $cs_main['ajax'] == 1 ? 1 : 0;
echo cs_subtemplate(__FILE__, $data, 'users', 'setup');
} else {
$cs_user['users_readtime'] = $cs_user['users_readtime'] * 86400;
$users_cells = array_keys($cs_user);
$users_save = array_values($cs_user);
cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']);
if (!empty($cs_main['mod_rewrite'])) {
header('Location: ../../' . $cs_main['php_self']['basename']);
} else {
$account['users_ajax'] = empty($cs_main['ajax']) ? 0 : $cs_user['users_ajax'];
cs_redirect($cs_lang['success'], 'users', 'settings', 'lang=' . $cs_user['users_lang']);
}
}
示例5: cs_board_comments
cs_board_comments($cs_board_id);
}
cs_redirect($cs_lang['del_true'], 'board');
}
if (isset($_POST['cancel'])) {
$board_form = 0;
cs_redirect($cs_lang['del_false'], 'board');
}
if (!empty($board_form)) {
$data['action']['form'] = cs_url('board', 'remove');
$data['lang']['body'] = sprintf($cs_lang['del_rly'], $board_id);
if (!empty($threads_loop)) {
$data['if']['threads_loop'] = true;
$cs_board['change_threads'] = 0;
if ($cs_board['change_threads'] == 0) {
$data['remove']['checked'] = '';
} else {
$data['remove']['checked'] = 'checked="checked"';
}
$cs_board['board_id'] = 0;
$where = "board_id != '" . $board_id . "'";
$board_data = cs_sql_select(__FILE__, 'board', '*', $where, 'board_name', 0, 0);
$data['remove']['dropdown'] = cs_dropdown('board_id', 'board_name', $board_data, $cs_board['board_id']);
} else {
$data['if']['threads_loop'] = false;
}
$data['remove']['id'] = $board_id;
$board_name = cs_sql_select(__FILE__, 'board', 'board_name', "board_id = '" . $board_id . "'");
$data['remove']['name'] = cs_secure($board_name['board_name']);
}
echo cs_subtemplate(__FILE__, $data, 'board', 'remove');
示例6: foreach
$data['head']['body'] = $error;
}
if (!empty($error) or !isset($_POST['submit'])) {
foreach ($cs_squads as $key => $value) {
$data['squads'][$key] = cs_secure($value);
}
$data['head']['mod'] = $cs_lang[$op_squads['label'] . 's'];
$data['squads']['abcode'] = cs_abcode_features('squads_text');
$data['lang']['own_label'] = $cs_lang['own_' . $op_clans['label']];
$checked = 'checked="checked"';
$data['squads']['own_check'] = empty($cs_squads['squads_own']) ? '' : $checked;
$data['squads']['joinus_check'] = empty($cs_squads['squads_joinus']) ? '' : $checked;
$data['squads']['fightus_check'] = empty($cs_squads['squads_fightus']) ? '' : $checked;
$data['lang']['clan_label'] = $cs_lang[$op_clans['label']];
$cs_clans = cs_sql_select(__FILE__, 'clans', 'clans_name,clans_id', 0, 'clans_name', 0, 0);
$data['squads']['clan_sel'] = cs_dropdown('clans_id', 'clans_name', $cs_clans, $cs_squads['clans_id']);
if ($data['if']['gamesmod'] == TRUE) {
$data['games'] = array();
$el_id = 'game_1';
$cs_games = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0);
$games_count = count($cs_games);
for ($run = 0; $run < $games_count; $run++) {
$sel = $cs_games[$run]['games_id'] == $cs_squads['games_id'] ? 1 : 0;
$data['games'][$run]['sel'] = cs_html_option($cs_games[$run]['games_name'], $cs_games[$run]['games_id'], $sel);
}
$url = 'uploads/games/' . $cs_squads['games_id'] . '.gif';
$data['squads']['games_img'] = cs_html_img($url, 0, 0, 'id="' . $el_id . '"');
}
$matches[1] = $cs_lang['secure_stages'];
$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);
示例7: elseif
}
}
}
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['data'] = $cs_links;
$data['cat']['dropdown'] = cs_categories_dropdown('links', $cs_links['categories_id']);
$linksstat[0]['links_stats'] = 'on';
$linksstat[0]['name'] = $cs_lang['online'];
$linksstat[1]['links_stats'] = 'off';
$linksstat[1]['name'] = $cs_lang['offline'];
$data['status']['dropdown'] = cs_dropdown('links_stats', 'name', $linksstat, $cs_links['links_stats']);
if (empty($cs_main['rte_html'])) {
$data['if']['abcode'] = TRUE;
$data['abcode']['smileys'] = cs_abcode_smileys('links_info', 1);
$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);
示例8: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('squads');
$cs_post = cs_post('id');
$op_squads = cs_sql_option(__FILE__, 'squads');
$label = $op_squads['label'];
if (isset($_POST['agree'])) {
$squads_id = $cs_post['id'];
$where = "squads_id = '" . $squads_id . "' AND users_id = '" . $account['users_id'] . "'";
$getme = cs_sql_select(__FILE__, 'members', 'members_id', $where);
cs_sql_delete(__FILE__, 'members', $getme['members_id']);
cs_redirect($cs_lang['sq_del_true'], 'squads', 'center');
}
if (isset($_POST['cancel'])) {
cs_redirect($cs_lang['del_false'], 'squads', 'center');
} else {
$data['head']['mod'] = $cs_lang[$label . 's'];
$data['lang']['label'] = $cs_lang[$label];
$where = "mem.users_id = '" . $account['users_id'] . "'";
$select = 'sqd.squads_name AS squads_name, sqd.squads_id AS squads_id';
$from = 'members mem INNER JOIN {pre}_squads sqd ON mem.squads_id = sqd.squads_id';
$sqd_data = cs_sql_select(__FILE__, $from, $select, $where, 'sqd.squads_name', 0, 0);
$data['squads']['squad_sel'] = cs_dropdown('id', 'squads_name', $sqd_data, 0, 'squads_id');
echo cs_subtemplate(__FILE__, $data, 'squads', 'leave');
}
示例9: cs_sql_select
$find_user = cs_sql_select(__FILE__, 'boardmods', 'users_id', $check, 0, 0);
if (!empty($find_user)) {
$error++;
$errormsg .= $cs_lang['user_exists'] . cs_html_br(1);
}
} else {
$data['bm']['boardmods_modpanel'] = 0;
$data['bm']['boardmods_edit'] = 0;
$data['bm']['boardmods_del'] = 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'])) {
$categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id'];
$data['bm']['cat_dropdown'] = cs_categories_dropdown('boardmods', $categories_id);
$users = cs_sql_select(__FILE__, 'users', 'users_nick, users_id', 'users_active = 1 AND users_delete = 0', 'users_nick ASC', 0, 0);
$data['bm']['users_dropdown'] = cs_dropdown('users_id', 'users_nick', $users, $data['bm']['users_id']);
$data['bm']['boardmods_modpanel'] = $data['bm']['boardmods_modpanel'] == 1 ? 'checked="checked"' : '';
$data['bm']['boardmods_edit'] = $data['bm']['boardmods_edit'] == 1 ? 'checked="checked"' : '';
$data['bm']['boardmods_del'] = $data['bm']['boardmods_del'] == 1 ? 'checked="checked"' : '';
$data['users']['nick'] = $users_nick;
} else {
$boardmods_cells = array_keys($data['bm']);
$boardmods_save = array_values($data['bm']);
cs_sql_insert(__FILE__, 'boardmods', $boardmods_cells, $boardmods_save);
cs_redirect($cs_lang['create_done'], 'boardmods');
}
echo cs_subtemplate(__FILE__, $data, 'boardmods', 'create');
示例10: cs_dropdownsel
$data['categories'] = cs_dropdownsel($data_categories, $cs_wars['categories_id'], 'categories_id');
$data['clans'] = cs_dropdownsel($data_clans, $cs_wars['clans_id'], 'clans_id');
$data_clans_count = count($data['clans']);
for ($run = 0; $run < $data_clans_count; $run++) {
$data['clans'][$run]['clans_name'] = cs_secure($data['clans'][$run]['clans_name']);
}
$data['squads'] = cs_dropdownsel($data_squads, $cs_wars['squads_id'], 'squads_id');
$data_squads_count = count($data['squads']);
for ($run = 0; $run < $data_squads_count; $run++) {
$data['squads'][$run]['squads_name'] = cs_secure($data['squads'][$run]['squads_name']);
}
$data['players'] = array();
for ($run = 1; $run <= $players; $run++) {
$data['players'][$run - 1]['run'] = $run;
$data['players'][$run - 1]['value'] = !empty($cs_players['player' . $run]) ? $cs_players['player' . $run] : '';
$data['players'][$run - 1]['dropdown'] = cs_dropdown('playerid' . $run, 'users_nick', $cs_members, 0, 'users_id');
}
$data['dropdown']['date'] = cs_dateselect('date', 'unix', $cs_wars['wars_date'], 1995);
$data['abcode']['smileys'] = cs_abcode_smileys('wars_report');
$data['abcode']['features'] = cs_abcode_features('wars_report');
$data['abcode']['smileys2'] = cs_abcode_smileys('wars_report2');
$data['abcode']['features2'] = cs_abcode_features('wars_report2');
$data['form']['players'] = $players;
$data['value']['opponents'] = $cs_wars['wars_opponents'];
$data['value']['players1'] = $cs_wars['wars_players1'];
$data['value']['players2'] = $cs_wars['wars_players2'];
$data['value']['score1'] = $cs_wars['wars_score1'];
$data['value']['score2'] = $cs_wars['wars_score2'];
$data['value']['url'] = $cs_wars['wars_url'];
$data['value']['report'] = cs_secure($cs_wars['wars_report']);
$data['value']['report2'] = cs_secure($cs_wars['wars_report2']);
示例11: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('wars');
$data = array();
$cs_squads = array();
$squads_id = empty($_GET['id']) ? 0 : (int) $_GET['id'];
if (!empty($_POST['squads_id'])) {
$squads_id = (int) $_POST['squads_id'];
}
$cs_squads = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id', 'squads_fightus = "0"', 'squads_name', 0, 0);
$data['head']['dropdown'] = cs_dropdown('squads_id', 'squads_name', $cs_squads, $squads_id, 'squads_id');
$squad = empty($squads_id) ? '' : "squads_id = '" . $squads_id . "'";
$squad_and = empty($squads_id) ? '' : " AND squads_id = '" . $squads_id . "'";
$squad_andwr = empty($squads_id) ? '' : "AND (wr.squads_id = '" . $squads_id . "')";
$squad_players = empty($squads_id) ? '' : "INNER JOIN {pre}_wars wr ON (wr.wars_id = ply.wars_id) WHERE (wr.squads_id = '" . $squads_id . "')";
$squad_maps = empty($squads_id) ? '' : "INNER JOIN {pre}_wars wr ON (wr.wars_id = rnd.wars_id) WHERE (wr.squads_id = '" . $squads_id . "')";
$data['wars']['all'] = cs_sql_count(__FILE__, 'wars', $squad);
$data['wars']['played'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'played\'' . $squad_and);
$data['wars']['upcoming'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'upcoming\'' . $squad_and);
$data['wars']['canceled'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'canceled\'' . $squad_and);
$data['wars']['running'] = cs_sql_count(__FILE__, 'wars', 'wars_status = \'running\'' . $squad_and);
$data['wars']['won_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 > wars_score2 AND wars_status = \'played\'' . $squad_and);
$data['wars']['won_percent'] = empty($data['wars']['won_count']) ? 0 : round($data['wars']['won_count'] / $data['wars']['played'] * 100);
$data['wars']['lost_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 < wars_score2 AND wars_status = \'played\'' . $squad_and);
$data['wars']['lost_percent'] = empty($data['wars']['lost_count']) ? 0 : round($data['wars']['lost_count'] / $data['wars']['played'] * 100);
$data['wars']['draw_count'] = cs_sql_count(__FILE__, 'wars', 'wars_score1 = wars_score2 AND wars_status = \'played\'' . $squad_and);
$data['wars']['draw_percent'] = empty($data['wars']['draw_count']) ? 0 : round($data['wars']['draw_count'] / $data['wars']['played'] * 100);
$tables = 'users usr INNER JOIN {pre}_players ply ON (ply.users_id = usr.users_id) ' . $squad_players . ' GROUP BY usr.users_id, usr.users_nick, usr.users_active, usr.users_delete';
$cells = 'usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, usr.users_delete AS users_delete, COUNT(ply.players_id) AS wars';
示例12: empty
$levels++;
}
$checked = 'checked="checked"';
$data['check']['yes'] = !empty($board['board_read']) ? $checked : '';
$data['check']['no'] = empty($board['board_read']) ? $checked : '';
$matches[1] = $cs_lang['secure_stages'];
$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['clip']['sec_level'] = cs_abcode_clip($matches);
$data['if']['pwd_remove'] = !empty($board['board_pwd']) ? TRUE : FALSE;
$op_squads = cs_sql_option(__FILE__, 'squads');
$data['squads']['lang'] = $cs_lang[$op_squads['label']];
$data_squads = cs_sql_select(__FILE__, 'squads', 'squads_name,squads_id', 'squads_own=1', 'squads_name', 0, 0);
$data['squads']['dropdown'] = cs_dropdown('squads_id', 'squads_name', $data_squads, $board['squads_id']);
$data['board']['id'] = $board_id;
echo cs_subtemplate(__FILE__, $data, 'board', 'edit');
} else {
if (!empty($new_board_pwd)) {
global $cs_db;
if ($cs_db['hash'] == 'md5') {
$board['board_pwd'] = md5($new_board_pwd);
} elseif ($cs_db['hash'] == 'sha1') {
$board['board_pwd'] = sha1($new_board_pwd);
}
$sql_del = 1;
}
if (!empty($board_pwdel)) {
$board['board_pwd'] = '';
$sql_del = 1;
示例13: cs_html_img
$data['country'][$run]['short'] = $short;
$data['country'][$run]['selection'] = $short == $data['join']['joinus_country'] ? ' selected="selected"' : '';
$data['country'][$run]['full'] = $full;
$run++;
}
$data['join']['games_url'] = cs_html_img('uploads/games/0.gif', 0, 0, 'id="game"');
$data['games'] = array();
$cs_games = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0);
for ($run = 0; $run < count($cs_games); $run++) {
$data['games'][$run]['short'] = $cs_games[$run]['games_id'];
$data['games'][$run]['selection'] = $cs_games[$run]['games_id'] == $data['join']['games_id'] ? ' selected="selected"' : '';
$data['games'][$run]['name'] = $cs_games[$run]['games_name'];
}
$cid = "squads_own = '1' AND squads_joinus = '0'";
$squads_data = cs_sql_select(__FILE__, 'squads', 'squads_name, squads_id, squads_own, squads_joinus', $cid, 'squads_name', 0, 0);
$data['squad']['list'] = cs_dropdown('squads_id', 'squads_name', $squads_data, $data['join']['squads_id']);
$data['date']['join'] = cs_dateselect('join', 'date', $data['join']['joinus_date'], 2000);
$data['abcode']['smileys'] = cs_abcode_smileys('joinus_more');
$data['abcode']['features'] = cs_abcode_features('joinus_more');
$data['rules']['link'] = cs_html_link(cs_url('rules', 'list'), $cs_lang['rules']);
$data['joinus']['rules_selected'] = !empty($data2['join']['joinus_rules']) ? 'checked="checked"' : '';
if (!empty($captcha)) {
$data['join']['captcha_img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time());
$data['if']['captcha'] = 1;
}
} elseif (!empty($data['if']['form'])) {
if (empty($account['users_id'])) {
global $cs_db;
if ($cs_db['hash'] == 'md5') {
$data['join']['users_pwd'] = md5($data['join']['users_pwd']);
} elseif ($cs_db['hash'] == 'sha1') {
示例14: foreach
if (!empty($folder_arr)) {
foreach ($folder_arr as $cond) {
$where .= "OR gal.folders_id = '" . $cond['folders_id'] . "' ";
}
}
}
if (!empty($access_id) and empty($folders_id)) {
$where = "gal.gallery_access = '" . $access_id . "' ";
}
if (!empty($access_id) and !empty($folders_id)) {
$where = "gal.folders_id = '" . $folders_id . "' AND gallery_access = '" . $access_id . "'";
}
$where = trim($where);
$access_data = array(0 => array('access_id' => '1', 'access_name' => $cs_lang['lev_1']), 1 => array('access_id' => '2', 'access_name' => $cs_lang['lev_2']), 2 => array('access_id' => '3', 'access_name' => $cs_lang['lev_3']), 3 => array('access_id' => '4', 'access_name' => $cs_lang['lev_4']), 4 => array('access_id' => '5', 'access_name' => $cs_lang['lev_5']));
$data['dropdown']['folders'] = make_folders_select('where', $folders_id, 0, 'gallery', 0);
$data['dropdown']['access'] = cs_dropdown('access', 'access_name', $access_data, $access_id, 'access_id');
$data['sort']['id'] = cs_sort('gallery', 'manage', $start, $where_x, 1, $sort);
$data['sort']['name'] = cs_sort('gallery', 'manage', $start, $where_x, 3, $sort);
$data['sort']['time'] = cs_sort('gallery', 'manage', $start, $where_x, 5, $sort);
$data['sort']['folders'] = cs_sort('gallery', 'manage', $start, $where_x, 7, $sort);
$data['sort']['status'] = cs_sort('gallery', 'manage', $start, $where_x, 9, $sort);
$from = 'gallery gal INNER JOIN {pre}_users usr ON gal.users_id = usr.users_id ';
$from .= 'LEFT JOIN {pre}_folders fol ON gal.folders_id = fol.folders_id';
$select = 'gal.gallery_id AS gallery_id, gal.gallery_status AS gallery_status, ';
$select .= 'gal.gallery_name AS gallery_name, gal.gallery_titel AS gallery_titel, ';
$select .= 'gal.users_id AS users_id, gal.gallery_time AS gallery_time, ';
$select .= 'gal.folders_id AS folders_id, fol.folders_name AS folders_name, usr.users_active AS users_active';
$data['pictures'] = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']);
$pictures_loop = count($data['pictures']);
for ($run = 0; $run < $pictures_loop; $run++) {
$id = $data['pictures'][$run]['gallery_id'];
示例15: cs_sql_select
/* select squads which are not participating */
$where = 'cs.cupsquads_id IS NULL';
$teams = cs_sql_select(__FILE__, $table, $select, $where, 'clans_tag ASC, team_name ASC', 0, 0);
$run = 0;
$teamarray = array();
foreach ($teams as $squad) {
$teamarray[$run]['team_id'] = $squad['team_id'];
$teamarray[$run]['team_name'] = cs_secure($squad['clans_tag']) . ' - ' . cs_secure($squad['team_name']);
$run++;
}
$team_name = '';
$team_id = 0;
if (isset($_POST['submit'])) {
$team_id = (int) $_POST['team_id'];
}
$data['teams']['select'] = cs_dropdown('team_id', 'team_name', $teamarray, !empty($_POST['team_id']) ? (int) $_POST['team_id'] : 0, 'team_id', 0);
/* select a specific squad */
$extra_where = ' AND sq.squads_id = %s';
}
$error = '';
$team_id = '';
if (isset($_POST['submit'])) {
if ($cs_cup['cups_system'] == CS_CUPS_TYPE_USERS) {
$team_id = $_POST['team_name'];
} else {
$team_id = (int) $_POST['team_id'];
}
$team = cs_sql_select(__FILE__, $table, $select, $where . sprintf($extra_where, cs_sql_escape($team_id)), 0, 0, 1);
if (empty($team)) {
$error = $cs_lang['join_denied'];
} else {