本文整理汇总了PHP中cs_sql_update函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_sql_update函数的具体用法?PHP cs_sql_update怎么用?PHP cs_sql_update使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_sql_update函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_cache_clear
function cs_cache_clear()
{
apc_clear_cache('user');
$unicode = extension_loaded('unicode') ? 1 : 0;
$where = "options_mod = 'clansphere' AND options_name = 'cache_unicode'";
cs_sql_update(__FILE__, 'options', array('options_value'), array($unicode), 0, $where);
}
示例2: cs_pictures_upload
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;
}
示例3: cs_login_cookies
function cs_login_cookies($userid = 0, $use_old_hash = 0)
{
global $account, $cs_main;
$lifetime = empty($userid) ? 1 : $cs_main['cookie']['lifetime'];
$thistime = empty($userid) ? '' : cs_time();
$thishash = empty($use_old_hash) ? '' : $use_old_hash;
if (!empty($userid) and empty($use_old_hash)) {
$pattern = '1234567890abcdefghijklmnpqrstuvwxyz';
for ($i = 0; $i < 34; $i++) {
$thishash .= $pattern[rand(0, 34)];
}
$cells = array('users_cookietime', 'users_cookiehash');
$content = array($thistime, $thishash);
cs_sql_update(__FILE__, 'users', $cells, $content, $userid, 0, 0);
} elseif (!empty($userid) and $use_old_hash == true) {
$thistime = $account['users_cookietime'];
$thishash = $account['users_cookiehash'];
if (empty($thistime) or empty($thishash)) {
cs_login_cookies($userid);
return true;
}
}
setcookie('cs_userid', $userid, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
setcookie('cs_cookietime', $thistime, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
setcookie('cs_cookiehash', $thishash, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']);
}
示例4: cs_articles_views
function cs_articles_views($id, $views)
{
settype($id, 'integer');
settype($views, 'integer');
$_SESSION['articles'] = isset($_SESSION['articles']) ? $_SESSION['articles'] : array();
if (empty($_SESSION['articles'][$id])) {
$_SESSION['articles'][$id] = true;
cs_sql_update(__FILE__, 'articles', array('articles_views'), array(1 + $views), $id, 0, 0);
}
}
示例5: cs_optionsave
function cs_optionsave($mod, $save)
{
$condition = "options_mod = '" . $mod . "' AND options_name = ";
$cells = array('options_value');
foreach ($save as $options_name => $options_value) {
$values = array($options_value);
cs_sql_update(__FILE__, 'options', $cells, $values, 0, $condition . "'" . $options_name . "'");
}
cs_cache_delete('op_' . $mod);
}
示例6: cs_cache_clear
function cs_cache_clear()
{
$cache_count = xcache_count(XC_TYPE_VAR);
for ($i = 0; $i < $cache_count; $i++) {
xcache_clear_cache(XC_TYPE_VAR, $i);
}
$unicode = extension_loaded('unicode') ? 1 : 0;
$where = "options_mod = 'clansphere' AND options_name = 'cache_unicode'";
cs_sql_update(__FILE__, 'options', array('options_value'), array($unicode), 0, $where);
}
示例7: cs_threads_comments
function cs_threads_comments($threads_id)
{
settype($threads_id, 'integer');
$condition = "comments_mod = 'board' AND comments_fid = '" . $threads_id . "'";
$comments = cs_sql_count(__FILE__, 'comments', $condition);
$cells = array('threads_comments');
$content = array($comments);
cs_sql_update(__FILE__, 'threads', $cells, $content, $threads_id, 0, 0);
return $comments;
}
示例8: cs_cache_clear
function cs_cache_clear()
{
$content = cs_paths('uploads/cache');
unset($content['index.html'], $content['.htaccess'], $content['web.config']);
foreach ($content as $file => $name) {
unlink('uploads/cache/' . $file);
}
$unicode = extension_loaded('unicode') ? 1 : 0;
$where = "options_mod = 'clansphere' AND options_name = 'cache_unicode'";
cs_sql_update(__FILE__, 'options', array('options_value'), array($unicode), 0, $where);
}
示例9: array
$ext = 'gif';
break;
case 2:
$ext = 'jpg';
break;
case 3:
$ext = 'png';
break;
}
$target = $cs_files_id . '-' . $file_next . '.' . $ext;
$picture_name = 'picture-' . $target;
$thumb_name = 'thumb-' . $target;
if (cs_resample($files_gl['picture']['tmp_name'], 'uploads/files/' . $thumb_name, 80, 200) and cs_upload('files', $picture_name, $files_gl['picture']['tmp_name'])) {
$cells = array('files_previews');
$content = empty($file_string) ? array($target) : array($file_string . "\n" . $target);
cs_sql_update(__FILE__, 'files', $cells, $content, $cs_files_id);
cs_redirect($cs_lang['success'], 'files', 'picture', 'id=' . $cs_files_id);
} else {
$message .= $cs_lang['up_error'];
$error++;
}
}
}
if (!empty($message)) {
$data['head']['text'] = $message;
} elseif (empty($_GET['delete'])) {
$data['head']['text'] = $cs_lang['body_picture'];
} else {
$data['head']['text'] = $cs_lang['remove_done'];
}
$data['head']['message'] = cs_getmsg();
示例10: cs_html_br
$error .= $cs_lang['too_wide'] . cs_html_br(1);
}
if ($img_size[1] > $op_users['max_height']) {
$error .= $cs_lang['too_high'] . cs_html_br(1);
}
if ($files['picture']['size'] > $op_users['max_size']) {
$error .= $cs_lang['too_big'] . cs_html_br(1);
}
if (empty($error) and cs_upload('users', $filename, $files['picture']['tmp_name']) or !empty($error) and extension_loaded('gd') and cs_resample($files['picture']['tmp_name'], 'uploads/users/' . $filename, $op_users['max_width'], $op_users['max_height'])) {
$error = '';
if ($userpic != $filename and !empty($userpic)) {
cs_unlink('users', $userpic);
}
$cells = array('users_picture');
$content = array($filename);
cs_sql_update(__FILE__, 'users', $cells, $content, $users_id);
cs_redirect('', 'users', 'manage');
} else {
$error .= $cs_lang['up_error'];
}
}
}
if (empty($error)) {
$data['head']['body'] = $cs_lang['picture_manage'];
} else {
$data['head']['body'] = $error;
}
if (!empty($error) or empty($files['picture']['tmp_name']) and empty($del)) {
if (empty($userpic)) {
$data['users']['current_pic'] = $cs_lang['nopic'];
} else {
示例11: cs_html_br
$errormsg = '';
if (empty($cs_bm['categories_id'])) {
$error++;
$errormsg .= $cs_lang['no_cat'] . cs_html_br(1);
}
} else {
$boardmods_id = $_GET['id'];
$tables = 'boardmods brd INNER JOIN {pre}_users usr ON usr.users_id = brd.users_id';
$cells = 'brd.boardmods_id AS boardmods_id, brd.categories_id AS categories_id, brd.users_id AS users_id, usr.users_nick AS users_nick, ';
$cells .= 'brd.boardmods_modpanel AS boardmods_modpanel, brd.boardmods_edit AS boardmods_edit, brd.boardmods_del AS boardmods_del';
$cs_bm = cs_sql_select(__FILE__, $tables, $cells, "boardmods_id = '" . $boardmods_id . "'", 0, 0);
}
if (!isset($_POST['submit']) and empty($error)) {
$data['head']['body'] = $cs_lang['body'];
} elseif (!empty($error)) {
$data['head']['body'] = $errormsg;
}
if (!empty($error) or !isset($_POST['submit'])) {
$data['bm']['id'] = empty($_POST['id']) ? $_GET['id'] : $_POST['id'];
$data['bm']['user'] = cs_secure($cs_bm['users_nick']);
$data['bm']['cat_dropdown'] = cs_categories_dropdown('boardmods', $cs_bm['categories_id']);
$data['bm']['boardmods_modpanel'] = $cs_bm['boardmods_modpanel'] == 1 ? 'checked="checked"' : '';
$data['bm']['boardmods_edit'] = $cs_bm['boardmods_edit'] == 1 ? 'checked="checked"' : '';
$data['bm']['boardmods_del'] = $cs_bm['boardmods_del'] == 1 ? 'checked="checked"' : '';
} else {
$boardmods_cells = array_keys($cs_bm);
$boardmods_save = array_values($cs_bm);
cs_sql_update(__FILE__, 'boardmods', $boardmods_cells, $boardmods_save, $_POST['id']);
cs_redirect($cs_lang['changes_done'], 'boardmods');
}
echo cs_subtemplate(__FILE__, $data, 'boardmods', 'edit');
示例12: 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');
}
示例13: 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');
}
}
}
示例14: cs_translate
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('board');
$count_abo = cs_sql_count(__FILE__, 'abonements', 'users_id=' . $account['users_id']);
$count_att = cs_sql_count(__FILE__, 'boardfiles', 'users_id=' . $account['users_id']);
$data = array();
$data['head']['getmsg'] = cs_getmsg();
$data['count']['abos'] = $count_abo;
$data['count']['attachments'] = $count_att;
$data['link']['abos'] = cs_url('board', 'center');
$data['link']['attachments'] = cs_url('board', 'attachments');
$data['link']['avatar'] = cs_url('board', 'avatar');
$data['action']['form'] = cs_url('board', 'signature');
$data['signature']['smileys'] = cs_abcode_smileys('signature');
$data['signature']['abcode'] = cs_abcode_features('signature');
$signature_sql = cs_sql_select($file, 'users', 'users_signature', "users_id = '" . $account['users_id'] . "'");
$signature = $signature_sql['users_signature'];
$signature = isset($_POST['signature']) ? $_POST['signature'] : $signature;
$signature = preg_replace_callback("=\\[img\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$signature = preg_replace_callback("=\\[img width\\=(.*?) height\\=(.*?)\\](.*?)\\[/img\\]=si", "cs_abcode_resize", $signature);
$data['signature']['text'] = $signature;
$data['signature']['preview'] = cs_secure($signature, 1, 1);
$data['if']['preview'] = (isset($_POST['preview']) and !empty($signature)) ? 1 : 0;
if (isset($_POST['submit'])) {
$signature_cells = array('users_signature');
$signature_save = array($signature);
cs_sql_update(__FILE__, 'users', $signature_cells, $signature_save, $account['users_id']);
cs_redirect($cs_lang['create_done'], 'board', 'signature');
}
$data['signature']['text'] = cs_secure($data['signature']['text']);
echo cs_subtemplate(__FILE__, $data, 'board', 'signature');
示例15: make_folders_select
$data['folders']['select'] = make_folders_select('folders_id', $edit['folders_id'], $account['users_id'], 'usersgallery');
$data['access']['options'] = '';
$levels = 0;
while ($levels < 6) {
$edit['usersgallery_access'] == $levels ? $sel = 1 : ($sel = 0);
$data['access']['options'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel);
$levels++;
}
$data['status']['options'] = '';
$levels = 0;
while ($levels < 2) {
$edit['usersgallery_status'] == $levels ? $sel = 1 : ($sel = 0);
$data['status']['options'] .= cs_html_option($cs_lang['show_' . $levels], $levels, $sel);
$levels++;
}
$data['abcode']['smileys'] = cs_abcode_smileys('gallery_description');
$data['abcode']['features'] = cs_abcode_features('gallery_description');
$checked = 'checked="checked"';
$data['check']['newtime'] = empty($new_time) ? '' : $checked;
$data['check']['count'] = empty($gallery_count_reset) ? '' : $checked;
$data['hidden']['id'] = $gallery_id;
$data['data']['usersgallery_name'] = cs_secure($data['data']['usersgallery_name']);
$data['data']['usersgallery_titel'] = cs_secure($data['data']['usersgallery_titel']);
$data['data']['usersgallery_description'] = cs_secure($data['data']['usersgallery_description']);
echo cs_subtemplate(__FILE__, $data, 'usersgallery', 'users_edit');
} else {
$cells = array_keys($edit);
$save = array_values($edit);
cs_sql_update(__FILE__, 'usersgallery', $cells, $save, $gallery_id);
cs_redirect($cs_lang['changes_done'], 'usersgallery', 'center');
}