本文整理汇总了PHP中cs_optionsave函数的典型用法代码示例。如果您正苦于以下问题:PHP cs_optionsave函数的具体用法?PHP cs_optionsave怎么用?PHP cs_optionsave使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cs_optionsave函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cs_optionsave
cs_optionsave('counter', $save);
}
if ($op_counter['last_archiv'] != $month) {
$year = cs_datereal('Y');
$timer = mktime(0, 0, 0, $month, 1, $year);
$timer2 = $timer - 86400;
$cond = "count_time < '" . $timer . "'";
$last_day = cs_sql_count(__FILE__, 'count', $cond . " AND count_time > '" . $timer2 . "'");
$count_month = cs_sql_count(__FILE__, 'count', $cond);
$month_archieve = cs_sql_select(__FILE__, 'count_archiv', 'SUM(count_num) AS count', 'count_mode = 1', 0, 0, 0);
$count_month += $month_archieve[0]['count'];
if (!empty($count_month)) {
cs_sql_query(__FILE__, 'DELETE FROM {pre}_count WHERE ' . $cond);
cs_sql_query(__FILE__, "DELETE FROM {pre}_count_archiv WHERE count_mode = '1'");
if ($month == 1) {
$old_year = $year - 1;
$old_month = 12;
} else {
$old_year = $year;
$old_month = $month - 1;
}
$counter_cells1 = array('count_month', 'count_num');
$counter_content1 = array($old_month . '-' . $old_year, $count_month);
cs_sql_insert(__FILE__, 'count_archiv', $counter_cells1, $counter_content1);
}
//Save the newest month
$save = array('last_archiv' => $month, 'last_archiv_day' => 1, 'count_lastday' => $last_day);
require_once 'mods/clansphere/func_options.php';
cs_optionsave('counter', $save);
}
}
示例2: cs_link
if (empty($wizard)) {
$data['if']['done'] = true;
$data['link']['wizard'] = cs_link($cs_lang['show'], 'wizard', 'roots') . ' - ' . cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=temp&done=1');
}
}
if (!empty($activate) and !empty($allow)) {
require_once 'mods/clansphere/func_options.php';
$save = array();
$save['def_tpl'] = $activate;
if (isset($templates[ucfirst($activate)]['themes'])) {
$themes = cs_checkdirs('themes');
if (isset($themes[ucfirst($templates[ucfirst($activate)]['themes'])])) {
$save['def_theme'] = $templates[ucfirst($activate)]['themes'];
}
}
cs_optionsave('clansphere', $save);
$msg = file_exists('themes/' . $activate) ? $cs_lang['theme_found'] . cs_link($cs_lang['change_to_this'], 'clansphere', 'themes_list', 'activate=' . $activate) : $cs_lang['success'];
cs_redirect($msg, 'clansphere', 'temp_list');
} else {
$data['lang']['getmsg'] = cs_getmsg();
$run = 0;
foreach ($templates as $mod) {
if ($mod['dir'] == 'install') {
$tpl_all--;
continue;
}
$data['temp_list'][$run]['name'] = $mod['name'];
$data['temp_list'][$run]['dir'] = $mod['dir'];
$data['temp_list'][$run]['version'] = $mod['version'];
$data['temp_list'][$run]['date'] = cs_date('date', $mod['released']);
$data['temp_list'][$run]['if']['active'] = $mod['dir'] == $cs_main['template'] ? 1 : 0;
示例3: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('wars');
if (isset($_POST['submit'])) {
$save = array();
$save['max_width'] = (int) $_POST['max_width'];
$save['max_height'] = (int) $_POST['max_height'];
$save['max_size'] = (int) $_POST['max_size'];
$save['max_navlist'] = (int) $_POST['max_navlist'];
$save['max_navlist2'] = (int) $_POST['max_navlist2'];
$save['max_navnext'] = (int) $_POST['max_navnext'];
require_once 'mods/clansphere/func_options.php';
cs_optionsave('wars', $save);
$lang = cs_substr($account['users_lang'], 0, 2);
if (!file_exists('uploads/wars/news_' . $lang . '.txt')) {
$lang = 'de';
}
$text = $_POST['news_text'];
$fp = fopen('uploads/wars/news_' . $lang . '.txt', 'w');
# set stream encoding if possible to avoid converting issues
if (function_exists('stream_encoding')) {
stream_encoding($fp, $cs_main['charset']);
}
fwrite($fp, $text);
fclose($fp);
cs_redirect($cs_lang['success'], 'options', 'roots');
} else {
$data = array();
$data['head']['message'] = cs_getmsg();
示例4: empty
$save['max_text'] = $_POST['max_text'] < 65000 ? (int) $_POST['max_text'] : 65000;
$save['max_signatur'] = $_POST['max_signatur'];
$save['avatar_width'] = $_POST['avatar_width'];
$save['avatar_height'] = $_POST['avatar_height'];
$save['avatar_size'] = $_POST['avatar_size'] * 1024;
$save['file_size'] = $_POST['file_size'] * 1024;
$save['file_types'] = $_POST['file_types'];
$save['sort'] = $_POST['sort'];
$save['doubleposts'] = empty($_POST['doublep_allowed']) ? -1 : (int) (86400 * str_replace(',', '.', $_POST['doubleposts']));
$save['list_subforums'] = empty($_POST['list_subforums']) ? 0 : 1;
$save['max_navlist'] = $_POST['max_navlist'];
$save['max_headline'] = $_POST['max_headline'];
$save['max_navtop'] = $_POST['max_navtop'];
$save['max_navtop2'] = $_POST['max_navtop2'];
require_once 'mods/clansphere/func_options.php';
cs_optionsave('board', $save);
cs_redirect($cs_lang['success'], 'options', 'roots');
}
if (!empty($board_form)) {
$data['action']['form'] = cs_url('board', 'options');
$size = $cs_board['avatar_size'] / 1024;
$size2 = $cs_board['file_size'] / 1024;
$data['options']['max_text'] = $cs_board['max_text'];
$data['options']['max_signatur'] = $cs_board['max_signatur'];
$data['options']['max_high'] = $cs_board['avatar_height'];
$data['options']['max_avatar_width'] = $cs_board['avatar_width'];
$data['options']['max_avatar_size'] = $size;
$data['options']['max_filesize'] = $size2;
$data['options']['filetypes'] = $cs_board['file_types'];
$data['options']['max_navlist'] = $cs_board['max_navlist'];
$data['options']['max_headline'] = $cs_board['max_headline'];
示例5: array
// $Id$
require_once 'mods/clansphere/func_options.php';
$data = array();
$i = 0;
$modules = cs_checkdirs('mods');
if (isset($_POST['submit'])) {
foreach ($modules as $mod) {
if (isset($mod['navlist'])) {
if (isset($_POST[$mod['tables'][0]])) {
foreach ($mod['navlist'] as $navlist) {
$save = array();
$save[$navlist] = $_POST[$mod['tables'][0]][$navlist];
if (empty($save[$navlist])) {
$save[$navlist] = 0;
}
cs_optionsave($mod['tables'][0], $save);
}
}
}
}
global $cs_lang;
cs_redirect($cs_lang['success'], 'options', 'roots');
} else {
foreach ($modules as $mod) {
if (isset($mod['navlist'])) {
$cs_lang = cs_translate($mod['dir']);
$cs_option = cs_sql_option(__FILE__, $mod['tables'][0]);
$data['mods'][$i]['mod'] = $mod['name'];
$a = 0;
foreach ($mod['navlist'] as $navlist) {
$data['mods'][$i]['navlist'][$a]['type'] = $cs_lang[$navlist];
示例6: array
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$data = array();
$op_banners = cs_sql_option(__FILE__, 'banners');
$where = "banners_id != '" . $op_banners['last_id'] . "'";
$cat_where = '';
if (!empty($_GET['cat_id'])) {
$cat_id = (int) $_GET['cat_id'];
$cat_where = "categories_id = '" . $cat_id . "'";
$where .= ' AND ' . $cat_where;
}
$cs_count = cs_sql_count(__FILE__, 'banners', $where);
if ($cs_count == 0) {
$where = $cat_where;
}
$columns = 'banners_id, banners_picture, banners_alt, banners_url, categories_id';
$cs_banners = cs_sql_select(__FILE__, 'banners', $columns, $where, '{random}', 0, 1);
if (empty($cs_banners)) {
echo '----';
} else {
$data['banner']['pic'] = cs_secure($cs_banners['banners_picture']);
$data['banner']['alt'] = cs_secure($cs_banners['banners_alt']);
$data['banner']['url'] = cs_secure($cs_banners['banners_url']);
echo cs_subtemplate(__FILE__, $data, 'banners', 'rotation');
require_once 'mods/clansphere/func_options.php';
$save = array('last_id' => $cs_banners['banners_id']);
cs_optionsave('banners', $save);
}
示例7: cs_optionsave
$save['quality'] = (int) $_POST['quality'];
$save['width'] = (int) $_POST['width'];
$save['height'] = (int) $_POST['height'];
$save['size'] = (int) $_POST['size'] * 1024;
$save['max_width'] = (int) $_POST['max_width'];
$save['top_5_votes'] = (int) $_POST['top_5_votes'];
$save['top_5_views'] = (int) $_POST['top_5_views'];
$save['newest_5'] = (int) $_POST['newest_5'];
$save['list_sort'] = (int) $_POST['list_sort'];
$save['size2'] = (int) $_POST['size2'] * 1024;
$save['max_files'] = (int) $_POST['max_files'];
$save['max_folders'] = (int) $_POST['max_folders'];
$save['lightbox'] = (int) $_POST['lightbox'];
$save['max_navlist'] = (int) $_POST['max_navlist'];
require_once 'mods/clansphere/func_options.php';
cs_optionsave('gallery', $save);
cs_redirect($cs_lang['changes_done'], 'options', 'roots');
} else {
$data = array();
$data['op'] = cs_sql_option(__FILE__, 'gallery');
$data['op']['size'] = $data['op']['size'] / 1024;
$data['op']['size2'] = $data['op']['size2'] / 1024;
$checked = 'checked="checked"';
$data['check']['top_5_votes_0'] = empty($data['op']['top_5_votes']) ? $checked : '';
$data['check']['top_5_votes_1'] = !empty($data['op']['top_5_votes']) ? $checked : '';
$data['check']['top_5_views_0'] = empty($data['op']['top_5_views']) ? $checked : '';
$data['check']['top_5_views_1'] = !empty($data['op']['top_5_views']) ? $checked : '';
$data['check']['newest_5_0'] = empty($data['op']['newest_5']) ? $checked : '';
$data['check']['newest_5_1'] = !empty($data['op']['newest_5']) ? $checked : '';
$levels = 0;
$var2 = '';
示例8: cs_translate
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$
$cs_lang = cs_translate('wizard');
$cs_options = cs_sql_option(__FILE__, 'wizard');
$task_array = array(0 => array('icon' => 'locale', 'handler' => 'lang', 'mod' => 'clansphere', 'action' => 'lang_list'), 1 => array('icon' => 'style', 'handler' => 'temp', 'mod' => 'clansphere', 'action' => 'temp_list'), 2 => array('icon' => 'package_system', 'handler' => 'opts', 'mod' => 'clansphere', 'action' => 'options'), 3 => array('icon' => 'knetconfig', 'handler' => 'meta', 'mod' => 'clansphere', 'action' => 'metatags'), 4 => array('icon' => 'looknfeel', 'handler' => 'setp', 'mod' => 'users', 'action' => 'setup'), 5 => array('icon' => 'personal', 'handler' => 'prfl', 'mod' => 'users', 'action' => 'profile'), 6 => array('icon' => 'kdmconfig', 'handler' => 'clan', 'mod' => 'clans', 'action' => 'create'), 7 => array('icon' => 'kontact', 'handler' => 'cont', 'mod' => 'contact', 'action' => 'imp_edit'), 8 => array('icon' => 'kcmdf', 'handler' => 'mods', 'mod' => 'modules', 'action' => 'roots'), 9 => array('icon' => 'log', 'handler' => 'logs', 'mod' => 'logs', 'action' => 'roots'));
$handler = isset($_GET['handler']) ? $_GET['handler'] : 0;
if (!empty($handler)) {
foreach ($task_array as $step) {
if ($step['handler'] == $handler) {
require_once 'mods/clansphere/func_options.php';
$save = array();
$save['done_' . $handler] = isset($_GET['done']) ? $_GET['done'] : 0;
cs_optionsave('wizard', $save);
$cs_options['done_' . $handler . ''] = $save['done_' . $handler];
break;
}
}
}
$run = 0;
$done = 0;
$next = 0;
$next_task = '-';
$data = array('head' => array(), 'wizard' => array());
foreach ($task_array as $step) {
$data['wizard'][$run]['icon'] = cs_icon($step['icon'], 48);
$data['wizard'][$run]['link'] = cs_link($cs_lang['' . $step['handler'] . '_name'], $step['mod'], $step['action']);
$data['wizard'][$run]['text'] = $cs_lang['' . $step['handler'] . '_text'];
if (empty($cs_options['done_' . $step['handler'] . ''])) {
$next_task = empty($next) ? cs_link($cs_lang['' . $step['handler'] . '_name'], $step['mod'], $step['action']) : $next_task;