本文整理汇总了PHP中cs_url函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_url函数的具体用法?PHP cs_url怎么用?PHP cs_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_manage
function cs_manage($mod, $action, $def_mod, $def_action, $merge = array(), $head = array())
{
global $account, $cs_lang;
$merge = is_array($merge) ? $merge : array();
$show = $mod . '/' . $action;
if (empty($head['message'])) {
$head['message'] = '';
}
$data = array('head' => $head);
$data['content'] = array();
$options = array('info' => 0, 'size' => 48, 'theme' => '');
$options['theme'] = empty($account['users_view']) ? 'manage' : 'manage_' . $account['users_view'];
if ($account['users_view'] == 'list') {
$options['size'] = 16;
if ($show == 'clansphere/admin') {
$options['theme'] = 'manage_admin';
$options['info'] = 1;
}
}
$mod_array = cs_checkdirs('mods', $show);
$content = array_merge($merge, $mod_array);
ksort($content);
$loop = 0;
foreach ($content as $mod) {
if (!array_key_exists('dir', $mod)) {
$mod['dir'] = $def_mod;
}
if (!array_key_exists('file', $mod)) {
$mod['file'] = $def_action;
}
$acc_dir = 'access_' . $mod['dir'];
if (array_key_exists($acc_dir, $account) and $account[$acc_dir] >= $mod['show'][$show]) {
$cs_lap = cs_icon($mod['icon'], $options['size'], 0, 0);
$data['content'][$loop]['img_1'] = $cs_lap;
$data['content'][$loop]['txt_1'] = $mod['name'];
$data['content'][$loop]['link_1'] = cs_url($mod['dir'], $mod['file']);
if (!empty($options['info'])) {
if (file_exists('mods/' . $mod['dir'] . '/create.php')) {
$data['content'][$loop]['create_1'] = cs_link(cs_icon('editpaste', 16, $cs_lang['create']), $mod['dir'], 'create');
} else {
$data['content'][$loop]['create_1'] = '';
}
if (file_exists('mods/' . $mod['dir'] . '/manage.php')) {
$data['content'][$loop]['manage_1'] = cs_link(cs_icon('kfm', 16, $cs_lang['manage']), $mod['dir'], 'manage');
} else {
$data['content'][$loop]['manage_1'] = '';
}
if (file_exists('mods/' . $mod['dir'] . '/options.php')) {
$data['content'][$loop]['options_1'] = cs_link(cs_icon('package_settings', 16, $cs_lang['options']), $mod['dir'], 'options');
} else {
$data['content'][$loop]['options_1'] = '';
}
}
$loop++;
}
}
$data['head']['total'] = $loop;
return cs_subtemplate(__FILE__, $data, 'clansphere', $options['theme']);
}
示例2: cs_html_form
function cs_html_form($func, $form_id = 0, $mod = 0, $action = 0, $enctype = 0, $more = 0)
{
cs_warning(__FUNCTION__ . ' - Function is removed, please use themes instead!');
if (!empty($func)) {
$form = "<form method=\"post\" id=\"" . $form_id . "\" ";
$form .= "action=\"" . cs_url($mod, $action, $more) . "\"";
if (!empty($enctype)) {
$form .= " enctype=\"multipart/form-data\"";
}
return $form . ">\n" . cs_xsrf_protection_field(array(''));
} else {
return "</form>\n";
}
}
示例3: cs_update_rss
function cs_update_rss($mod, $action, $name, $desc, $array, $abcode = 0)
{
global $cs_main;
$cs_main['rss'] = 1;
$abcode = is_array($abcode) ? $abcode : array(0 => 1, 1 => 0, 2 => 0, 3 => 0, 4 => 0);
$target = 'uploads/rss/';
$name_sec = htmlspecialchars($name, ENT_NOQUOTES, $cs_main['charset']);
$desc_sec = htmlspecialchars($desc, ENT_NOQUOTES, $cs_main['charset']);
if (is_writeable($target)) {
include_once 'system/output/rss_20.php';
$content = cs_rss_mode(1);
$content .= cs_rss_channel(1, $mod, $name_sec, $cs_main['php_self']['website'], $desc_sec);
if (!empty($array)) {
foreach ($array as $item) {
if (!empty($item['id']) and !empty($item['title']) and !empty($item['text'])) {
$title = htmlspecialchars($item['title'], ENT_NOQUOTES, $cs_main['charset']);
$link = $cs_main['php_self']['website'] . cs_url($mod, $action, 'id=' . $item['id'], 'index');
$text = empty($item['readmore']) ? $item['text'] : $item['readmore'];
$text = cs_secure($text, $abcode[0], $abcode[1], $abcode[2], $abcode[3], $abcode[4]);
$text = '<![CDATA[ ' . $text . ' ]]>';
if (!empty($abcode[3])) {
# use full uri if needed in html content
$url_pre = $cs_main['php_self']['website'] . $cs_main['php_self']['dirname'];
$pattern = "=(background|href|src)\\=\"(?!http|\\/)(.*?)\"=i";
$text = preg_replace($pattern, "\\1=\"" . $url_pre . "\\2\"", $text);
}
$date = empty($item['time']) ? 0 : date('D, d M Y H:i:s', $item['time']) . ' +0000';
# author is presented as 'email (nick)'
$author = (empty($item['nick']) or empty($item['author'])) ? '' : $item['author'] . ' (' . cs_secure($item['nick']) . ')';
$category = empty($item['cat']) ? '' : htmlspecialchars($item['cat'], ENT_NOQUOTES, $cs_main['charset']);
$content .= cs_rss_item($title, $link, $text, $date, $author, $category);
}
}
}
$content .= cs_rss_channel(0);
$content .= cs_rss_mode(0);
$save_file = fopen($target . $mod . '.xml', 'w');
# set stream encoding if possible to avoid converting issues
if (function_exists('stream_encoding')) {
stream_encoding($save_file, $cs_main['charset']);
}
fwrite($save_file, $content);
fclose($save_file);
@chmod($target . $mod . '.xml', 0755);
} else {
cs_error($target, 'cs_update_rss - Unable to write into directory');
}
$cs_main['rss'] = 0;
}
示例4: foreach
foreach ($cs_country as $short => $full) {
$data['country'][$run]['short'] = $short;
$data['country'][$run]['selection'] = $short == $cs_user['users_country'] ? ' selected="selected"' : '';
$data['country'][$run]['full'] = $full;
$run++;
}
echo cs_subtemplate(__FILE__, $data, 'users', 'profile');
} else {
settype($cs_user['users_height'], 'integer');
settype($cs_user['users_icq'], 'integer');
$cs_user['users_hidden'] = implode(',', $hidden);
if ($cs_user['users_nick'] != $account['users_nick']) {
change_nick($account['users_id'], $account['users_nick']);
}
$users_cells = array_keys($cs_user);
$users_save = array_values($cs_user);
cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']);
cs_cache_delete('navbirth');
cs_cache_delete('nextbirth');
$data['link']['continue'] = cs_url('users', 'home');
$data['lang']['head'] = $cs_lang['profile'];
echo cs_subtemplate(__FILE__, $data, 'users', 'done');
if ($account['access_wizard'] == 5) {
$wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_prfl' AND options_value = '1'");
if (empty($wizard)) {
$data['wizard']['show'] = cs_link($cs_lang['show'], 'wizard', 'roots');
$data['wizard']['task_done'] = cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=prfl&done=1');
echo cs_subtemplate(__FILE__, $data, 'users', 'wizard');
}
}
}
示例5: empty
$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 . '&agree');
$data['url']['cancel'] = cs_url('users', 'remove', 'id=' . $users_id . '&cancel');
echo cs_subtemplate(__FILE__, $data, 'users', 'remove');
}
示例6: cs_translate
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('users');
$five_min = cs_time() - 300;
$select = 'users_id, users_nick, users_country, users_active, users_invisible, users_picture';
$invisible = $account['access_users'] > 4 ? '' : " AND users_invisible = '0'";
$upcome = "users_laston > " . $five_min . " AND users_active = '1'" . $invisible;
$order = 'users_laston DESC';
$cs_users = cs_sql_select(__FILE__, 'users', $select, $upcome, $order, 0, 8);
$data = array();
if (empty($cs_users)) {
$data['lang']['no_users'] = $cs_lang['no_data'];
echo cs_subtemplate(__FILE__, $data, 'users', 'no_users');
} else {
$count_users = count($cs_users);
for ($run = 0; $run < $count_users; $run++) {
if (!empty($cs_users[$run]['users_picture'])) {
$data['users'][$run]['picture'] = 'uploads/users/' . $cs_users[$run]['users_picture'];
} else {
$data['users'][$run]['picture'] = 'symbols/users/no_pic.png';
}
if (empty($invisible) and !empty($cs_users[$run]['users_invisible'])) {
$data['users'][$run]['nick'] = cs_html_italic(1) . $cs_users[$run]['users_nick'] . cs_html_italic(0);
} else {
$data['users'][$run]['nick'] = $cs_users[$run]['users_nick'];
}
$data['users'][$run]['url'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']);
}
echo cs_subtemplate(__FILE__, $data, 'users', 'navonline_pic');
}
示例7: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('events');
$cs_get = cs_get('catid');
$cs_option = cs_sql_option(__FILE__, 'events');
$from = 'events evs INNER JOIN {pre}_categories cat ON evs.categories_id = cat.categories_id';
$select = 'evs.events_id AS events_id, evs.events_name AS events_name, evs.events_time AS events_time';
$upcome = 'evs.events_time > ' . cs_time() . ' AND cat.categories_access <= ' . $account['access_events'];
if (!empty($cs_get['catid'])) {
$upcome .= ' AND cat.categories_id = ' . $cs_get['catid'];
}
$cs_events = cs_sql_select(__FILE__, $from, $select, $upcome, 'evs.events_time', 0, $cs_option['max_navnext']);
$events_loop = count($cs_events);
$data = array();
if (empty($cs_events)) {
echo $cs_lang['no_events'];
} else {
for ($run = 0; $run < $events_loop; $run++) {
$data['events'][$run]['date'] = cs_date('unix', $cs_events[$run]['events_time'], 1);
$data['events'][$run]['name'] = cs_secure($cs_events[$run]['events_name']);
$data['events'][$run]['link'] = cs_url('events', 'view', 'id=' . $cs_events[$run]['events_id']);
}
echo cs_subtemplate(__FILE__, $data, 'events', 'navnext');
}
示例8: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('banners');
$start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
$cs_sort[1] = 'banners_name DESC';
$cs_sort[2] = 'banners_name ASC';
$cs_sort[3] = 'banners_order DESC';
$cs_sort[4] = 'banners_order ASC';
$sort = empty($_REQUEST['sort']) ? 2 : $_REQUEST['sort'];
$order = $cs_sort[$sort];
$banners_count = cs_sql_count(__FILE__, 'banners');
$data['count']['all'] = $banners_count;
$data['pages']['list'] = cs_pages('banners', 'manage', $banners_count, $start, 0, $sort);
$data['lang']['getmsg'] = cs_getmsg();
$select = 'banners_id, banners_name, banners_order';
$cs_banners = cs_sql_select(__FILE__, 'banners', $select, 0, $order, $start, $account['users_limit']);
$banners_loop = count($cs_banners);
$data['sort']['name'] = cs_sort('banners', 'manage', $start, 0, 1, $sort);
$data['sort']['order'] = cs_sort('banners', 'manage', $start, 0, 3, $sort);
if (empty($banners_loop)) {
$data['banners'] = '';
}
for ($run = 0; $run < $banners_loop; $run++) {
$data['banners'][$run]['name'] = cs_secure($cs_banners[$run]['banners_name']);
$data['banners'][$run]['order'] = cs_secure($cs_banners[$run]['banners_order']);
$data['banners'][$run]['edit'] = cs_url('banners', 'edit', 'id=' . $cs_banners[$run]['banners_id']);
$data['banners'][$run]['remove'] = cs_url('banners', 'remove', 'id=' . $cs_banners[$run]['banners_id']);
}
echo cs_subtemplate(__FILE__, $data, 'banners', 'manage');
示例9: cs_sql_select
$tables = 'wars w INNER JOIN {pre}_squads sq ON w.squads_id = sq.squads_id ';
$tables .= 'INNER JOIN {pre}_clans c ON w.clans_id = c.clans_id ';
$tables .= 'INNER JOIN {pre}_categories cat ON w.categories_id = cat.categories_id';
$cells = 'sq.squads_name AS squads_name, c.clans_name AS clans_name, ';
$cells .= 'w.wars_score1 AS wars_score1, w.wars_score2 AS wars_score2, ';
$cells .= 'cat.categories_name AS categories_name, w.squads_id AS squads_id, ';
$cells .= 'w.wars_id AS wars_id, c.clans_id AS clans_id';
$war = cs_sql_select(__FILE__, $tables, $cells, "wars_id = '" . $wars_id . "'");
$replace = array();
$replace['{SQUADNAME}'] = $war['squads_name'];
$replace['{SQUADURL}'] = cs_url('squads', 'view', 'id=' . $war['squads_id']);
$replace['{OPPONENTNAME}'] = $war['clans_name'];
$replace['{OPPONENTURL}'] = cs_url('clans', 'view', 'id=' . $war['clans_id']);
$replace['{SCORE_1}'] = $war['wars_score1'];
$replace['{SCORE_2}'] = $war['wars_score2'];
$replace['{MATCH_URL}'] = cs_url('wars', 'view', 'id=' . $war['wars_id']);
$replace['{CAT_NAME}'] = $war['categories_name'];
$search = array_keys($replace);
$replace = array_values($replace);
$text = str_replace($search, $replace, $text);
$cs_news['news_text'] = $text;
}
$abcode = explode(",", $op_news['abcode']);
$data['op']['features'] = empty($abcode[0]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['smileys'] = empty($abcode[1]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['clip'] = empty($abcode[2]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['html'] = empty($abcode[3]) ? $cs_lang['no'] : $cs_lang['yes'];
$data['op']['php'] = empty($abcode[4]) ? $cs_lang['no'] : $cs_lang['yes'];
if (isset($_POST['submit']) or isset($_POST['preview'])) {
$cs_news['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('news', $_POST['categories_name']);
$cs_news['news_close'] = isset($_POST['news_close']) ? $_POST['news_close'] : 0;
示例10: cs_html_link
if ($cs_option['scores'] == 1) {
$matrix[$column + 1][$currow]['content'] = cs_html_link(cs_url('cups', 'match', 'id=' . $match['cupmatches_id']), $match['cupmatches_score2']);
}
if ($match['cupmatches_winner'] == $match['team2_id'] && $match['team2_id'] != $match['team1_id']) {
$matrix[$column][$currow]['class'] .= '-win';
if ($cs_option['scores'] == 1) {
$matrix[$column + 1][$currow]['class'] .= '-win';
}
} else {
$matrix[$column][$currow]['class'] .= '-loss';
if ($cs_option['scores'] == 1) {
$matrix[$column + 1][$currow]['class'] .= '-loss';
}
}
} else {
$matrix[$column + 1][$currow]['content'] = cs_html_link(cs_url('cups', 'match', 'id=' . $match['cupmatches_id']), 'x');
}
}
if ($prevrow > $maxrows) {
$maxrows = $prevrow;
}
if ($currow > $maxrows) {
$maxrows = $currow;
}
$count++;
}
}
}
// TODO
$finalmatchnr = -1;
if ($cup['cups_brackets'] == CS_CUPS_SYSTEM_LB) {
示例11: elseif
$cs_banners['banners_name'] = '';
$cs_banners['banners_url'] = '';
$cs_banners['banners_picture'] = '';
$cs_banners['banners_alt'] = '';
$cs_banners['banners_order'] = $op_banners['def_order'];
$cs_banners['categories_id'] = 0;
}
if (!isset($_POST['submit'])) {
$data['lang']['body'] = $cs_lang['body_create'];
} elseif (!empty($error)) {
$data['lang']['body'] = $message;
} else {
$data['lang']['body'] = $cs_lang['create_done'];
}
if (!empty($error) or !isset($_POST['submit'])) {
$data['action']['form'] = cs_url('banners', 'create');
$data['banners']['name'] = $cs_banners['banners_name'];
$data['banners']['category'] = cs_categories_dropdown('banners', $cs_banners['categories_id']);
$data['banners']['url'] = $cs_banners['banners_url'];
$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;
示例12: empty
for ($run = 0; $run < $showcount; $run++) {
$data['show'][$run]['run'] = $run;
$data['show'][$run]['value'] = empty($_POST['show_' . $run]) ? '' : $_POST['show_' . $run];
$data['show'][$run]['axx_value'] = empty($_POST['showaccess_' . $run]) ? '' : $_POST['showaccess_' . $run];
}
$data['value']['showcount'] = $showcount;
$data['value']['modname'] = empty($_POST['modname']) ? '' : $_POST['modname'];
$data['value']['moddir'] = empty($_POST['moddir']) ? '' : $_POST['moddir'];
$data['value']['modversion'] = empty($_POST['modversion']) ? '' : $_POST['modversion'];
$data['value']['description'] = empty($_POST['description']) ? '' : $_POST['description'];
$var = cs_datepost('release', 'date');
$data['value']['dateselect'] = empty($var) ? cs_datereal('Y-m-d') : $var;
$data['value']['creator'] = empty($_POST['creator']) ? '' : $_POST['creator'];
$data['value']['team'] = empty($_POST['team']) ? '' : $_POST['team'];
$data['value']['homepage'] = empty($_POST['homepage']) ? '' : $_POST['homepage'];
$data['value']['icon'] = empty($_POST['icon']) ? '' : $_POST['icon'];
$clip[1] = $cs_lang['help'];
$clip[2] = $cs_lang['helptext'];
$data['help']['clip'] = cs_abcode_clip($clip);
$sel = 'selected="selected"';
$data['selected']['categories_no'] = empty($_POST['categories']) ? $sel : '';
$data['selected']['categories_yes'] = empty($_POST['categories']) ? '' : $sel;
$data['selected']['protected_no'] = empty($_POST['protected']) ? $sel : '';
$data['selected']['protected_yes'] = empty($_POST['protected']) ? '' : $sel;
$data['form']['url'] = cs_url('modules', 'create');
$data['input']['dateselect'] = cs_dateselect('release', 'date', $data['value']['dateselect']);
echo cs_subtemplate(__FILE__, $data, 'modules', 'create');
} else {
cs_cache_clear();
cs_redirect($cs_lang['create_done'], 'modules', 'roots');
}
示例13: array
} else {
if ($voted_ip == $users_ip) {
$check_user_voted++;
}
}
}
if (empty($check_user_voted)) {
$votes_navlist = array();
$votes_navlist['lang']['create'] = $cs_lang['create'];
$votes_navlist['votes']['id'] = $votes_id;
$votes_navlist['votes']['type'] = empty($cs_votes['votes_several']) ? 'radio' : 'checkbox';
$votes_navlist['if']['several'] = empty($cs_votes['votes_several']) ? 0 : 1;
$votes_navlist['if']['several_name'] = empty($cs_votes['votes_several']) ? 0 : 1;
$votes_navlist['votes']['question'] = $cs_votes['votes_question'];
# $votes_navlist['votes']['action'] = '?' . $vote_action . $vote_more;
$votes_navlist['url']['action'] = cs_url('votes');
// $votes_navlist['url']['action'] = '?' . $_SERVER['argv'][0];
$temp = explode("\n", $cs_votes['votes_election']);
$answers_stop = count($temp) - 1;
for ($run = 0; $run < $answers_stop; $run++) {
$votes_navlist['answers'][$run]['value'] = $run + 1;
$votes_navlist['answers'][$run]['answer'] = $temp[$run + 1];
}
echo cs_subtemplate(__FILE__, $votes_navlist, 'votes', 'navlist_vote');
} else {
$votes_navlist = array();
$votes_navlist['votes']['question'] = $cs_votes['votes_question'];
$temp = explode("\n", $cs_votes['votes_election']);
$answers_stop = count($temp) - 1;
for ($run = 0; $run < $answers_stop; $run++) {
$answer_count = 0;
示例14: cs_sql_select
$data['value']['dir'] = $dir;
$cells = 'access_id, access_name, access_clansphere, access_' . $dir;
$data['access'] = cs_sql_select(__FILE__, 'access', $cells, 0, 'access_clansphere ASC', 0, 0);
$sel = 'selected="selected"';
$count_access = count($data['access']);
for ($run = 0; $run < $count_access; $run++) {
$data['access'][$run]['sel0'] = '';
$data['access'][$run]['sel1'] = '';
$data['access'][$run]['sel2'] = '';
$data['access'][$run]['sel3'] = '';
$data['access'][$run]['sel4'] = '';
$data['access'][$run]['sel5'] = '';
if (isset($_GET['activate'])) {
$data['access'][$run]['sel' . $data['access'][$run]['access_clansphere']] = $sel;
} else {
$data['access'][$run]['sel' . $data['access'][$run]['access_' . $dir]] = $sel;
}
}
echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_1');
} else {
$dir = $_POST['dir'];
$access = cs_sql_select(__FILE__, 'access', 'access_id', 0, 'access_clansphere ASC', 0, 0);
$cells = array('access_' . $dir);
foreach ($access as $level) {
$values = array($_POST['access_' . $level['access_id']]);
cs_sql_update(__FILE__, 'access', $cells, $values, $level['access_id']);
cs_cache_delete('access_' . $level['access_id']);
}
$data['url']['continue'] = cs_url('modules', 'roots');
echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_2');
}
示例15: settype
if (!empty($_GET['del_id'])) {
$del_id = $_GET['del_id'];
settype($del_id, 'integer');
$target = cs_sql_select(__FILE__, 'members', 'squads_id', "members_id = '" . $del_id . "'");
$squads_id = $target['squads_id'];
$is_admin = "members_admin > 0 AND squads_id ='" . $squads_id . "' AND users_id ='" . $account['users_id'] . "'";
$allow = cs_sql_count(__FILE__, 'members', $is_admin);
if (empty($allow)) {
$msg = $cs_lang['del_failed'];
} else {
cs_sql_delete(__FILE__, 'members', $del_id);
$msg = $cs_lang['del_done'];
}
}
$data['lang']['mod_name'] = $cs_lang[$op_members['label']];
$data['url']['form'] = cs_url('members', 'center');
$data['lang']['team'] = $cs_lang[$op_squads['label']];
$where = "mem.users_id = '" . $account['users_id'] . "' AND mem.members_admin > 0";
$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);
$sqd_loop = count($sqd_data);
for ($run = 0; $run < $sqd_loop; $run++) {
$data['squad'][$run]['selected'] = $sqd_data[$run]['squads_id'] == $squads_id ? ' selected="selected"' : '';
$data['squad'][$run]['id'] = $sqd_data[$run]['squads_id'];
$data['squad'][$run]['name'] = cs_secure($sqd_data[$run]['squads_name']);
}
if (empty($sqd_loop)) {
$data['squad'] = array();
}
$data['lang']['msg'] = !empty($msg) ? $msg : '';