本文整理汇总了PHP中getcachevars函数的典型用法代码示例。如果您正苦于以下问题:PHP getcachevars函数的具体用法?PHP getcachevars怎么用?PHP getcachevars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getcachevars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updatecache
function updatecache($cachename = '')
{
global $db, $bbname, $tablepre, $maxbdays;
static $cachescript = array('settings' => array('settings'), 'usergroups' => array('usergroups'), 'ipbanned' => array('ipbanned'));
if ($maxbdays) {
$cachescript['birthdays'] = array('birthdays');
$cachescript['index'][] = 'birthdays_index';
}
$updatelist = empty($cachename) ? array_values($cachescript) : (is_array($cachename) ? array('0' => $cachename) : array(array('0' => $cachename)));
$updated = array();
foreach ($updatelist as $value) {
foreach ($value as $cname) {
if (empty($updated) || !in_array($cname, $updated)) {
$updated[] = $cname;
getcachearray($cname);
}
}
}
foreach ($cachescript as $script => $cachenames) {
if (empty($cachename) || !is_array($cachename) && in_array($cachename, $cachenames) || is_array($cachename) && array_intersect($cachename, $cachenames)) {
$cachedata = '';
$query = $db->query("SELECT data FROM {$tablepre}caches WHERE cachename in(" . implodeids($cachenames) . ")");
while ($data = $db->fetch_array($query)) {
$cachedata .= $data['data'];
}
writetocache($script, $cachenames, $cachedata);
}
}
if (!$cachename || $cachename == 'admingroups') {
$query = $db->query("SELECT * FROM {$tablepre}admingroups");
while ($data = $db->fetch_array($query)) {
writetocache($data['admingid'], '', getcachevars($data), 'admingroup_');
}
}
}
示例2: build_cache_plugin
function build_cache_plugin()
{
$data = array();
$query = DB::query("SELECT * FROM " . DB::table('common_plugin') . " WHERE available='1'");
$pluginsetting = array();
while ($plugin = DB::fetch($query)) {
$queryvars = DB::query("SELECT * FROM " . DB::table('common_pluginvar') . " WHERE pluginid='{$plugin['pluginid']}'");
while ($var = DB::fetch($queryvars)) {
$data[$plugin['identifier']][$var['variable']] = $var['value'];
if (in_array(substr($var['type'], 0, 6), array('group_', 'forum_'))) {
$stype = substr($var['type'], 0, 5) . 's';
$type = substr($var['type'], 6);
if ($type == 'select') {
foreach (explode("\n", $var['extra']) as $key => $option) {
$option = trim($option);
if (strpos($option, '=') === FALSE) {
$key = $option;
} else {
$item = explode('=', $option);
$key = trim($item[0]);
$option = trim($item[1]);
}
$var['select'][] = array($key, $option);
}
}
$pluginsetting[$stype][$plugin['identifier']]['name'] = $plugin['name'];
$pluginsetting[$stype][$plugin['identifier']]['setting'][$var['pluginvarid']] = array('title' => $var['title'], 'description' => $var['description'], 'type' => $type, 'select' => $var['select']);
}
}
}
writetocache('pluginsetting', getcachevars(array('pluginsetting' => $pluginsetting)));
save_syscache('plugin', $data);
}
示例3: shy9000_famehall_updateCache
function shy9000_famehall_updateCache()
{
$query = DB::query("SELECT g.groupname, g.grouppic, m.uid, m.gid, m.value FROM " . DB::table('mingrentang') . " m, " . DB::table('mingrentanggroup') . " g WHERE m.gid=g.id ORDER BY m.uid");
while ($famehall = DB::fetch($query)) {
$return[$famehall['uid']][] = $famehall['groupname'];
$return2[$famehall['uid']][] = $famehall['gid'];
$return3[$famehall['uid']][] = cutstr($famehall['value'], 40);
$return4[$famehall['uid']][] = $famehall['grouppic'] ? $famehall['grouppic'] : 'def.gif';
}
require_once libfile('function/cache');
writetocache('famehall_cache', getcachevars(array('_FHCACHE' => array('gname' => $return, 'gid' => $return2, 'js' => $return3, 'pic' => $return4))));
return $return;
}
示例4: build_cache_plugin
function build_cache_plugin()
{
global $importtxt;
$data = array();
$query = DB::query("SELECT * FROM " . DB::table('common_plugin') . " WHERE available='1'");
$pluginsetting = array();
while ($plugin = DB::fetch($query)) {
$dir = substr($plugin['directory'], 0, -1);
$plugin['modules'] = unserialize($plugin['modules']);
if ($plugin['modules']['extra']['langexists']) {
require_once libfile('function/plugin');
require_once libfile('function/admincp');
$file = DISCUZ_ROOT . './source/plugin/' . $dir . '/discuz_plugin_' . $dir . ($plugin['modules']['extra']['installtype'] ? '_' . $plugin['modules']['extra']['installtype'] : '') . '.xml';
$importtxt = @implode('', file($file));
$pluginarray = getimportdata('Discuz! Plugin', 1, 1);
if ($pluginarray) {
updatepluginlanguage($pluginarray);
}
}
$queryvars = DB::query("SELECT * FROM " . DB::table('common_pluginvar') . " WHERE pluginid='{$plugin['pluginid']}'");
while ($var = DB::fetch($queryvars)) {
$data[$plugin['identifier']][$var['variable']] = $var['value'];
if (in_array(substr($var['type'], 0, 6), array('group_', 'forum_'))) {
$stype = substr($var['type'], 0, 5) . 's';
$type = substr($var['type'], 6);
if ($type == 'select') {
foreach (explode("\n", $var['extra']) as $key => $option) {
$option = trim($option);
if (strpos($option, '=') === FALSE) {
$key = $option;
} else {
$item = explode('=', $option);
$key = trim($item[0]);
$option = trim($item[1]);
}
$var['select'][] = array($key, $option);
}
}
$pluginsetting[$stype][$plugin['identifier']]['name'] = $plugin['name'];
$pluginsetting[$stype][$plugin['identifier']]['setting'][$var['pluginvarid']] = array('title' => $var['title'], 'description' => $var['description'], 'type' => $type, 'select' => $var['select']);
}
}
}
writetocache('pluginsetting', getcachevars(array('pluginsetting' => $pluginsetting)));
save_syscache('plugin', $data);
}
示例5: build_cache_plugin_mobile
function build_cache_plugin_mobile() {
if(!defined('DISCUZ_VERSION')) {
require './source/discuz_version.php';
}
global $_G;
$setting = array();
$settings = array('closeforumorderby');
foreach($settings as $v) {
$setting[$v] = $_G['setting'][$v];
}
if(in_array('mobile', $_G['setting']['plugins']['available'])) {
$extendsetting = C::t('#mobile#mobile_setting')->fetch_all(array(
'extend_used',
'extend_lastupdate'
));
$array = array(
'discuzversion' => DISCUZ_VERSION,
'charset' => CHARSET,
'version' => MOBILE_PLUGIN_VERSION,
'pluginversion' => $_G['setting']['plugins']['version']['mobile'],
'oemversion' => in_array('mobileoem', $_G['setting']['plugins']['available']) ? $_G['setting']['plugins']['version']['mobileoem'] : '0',
'regname' => $_G['setting']['regname'],
'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0',
'sitename' => $_G['setting']['bbname'],
'mysiteid' => $_G['setting']['my_siteid'],
'ucenterurl' => $_G['setting']['ucenterurl'],
'setting' => $setting,
'extends' => array('used' => $extendsetting['extend_used'], 'lastupdate' => $extendsetting['extend_lastupdate']),
);
} else {
$array = array();
}
require_once './source/plugin/mobile/mobile.class.php';
$data = array('mobilecheck' => mobile_core::json($array));
writetocache('mobile', getcachevars($data));
}
示例6: rewrite_list
$pageinfo .= '<a href="' . rewrite_list($_GET['type'], $page + 1) . '" class="nextpage">' . lang('plugin/dzapp_haodai', 'page_3') . '</a><a href="' . rewrite_list($_GET['type'], $maxpage) . '" class="nextpage">' . lang('plugin/dzapp_haodai', 'page_4') . '</a>';
}
}
if (empty($result['items'])) {
showmessage('dzapp_haodai:param_wrong');
}
$articles = $result['items'];
include template('dzapp_haodai:list');
} elseif ($action == 'calc') {
$type = $_GET['type'];
if (!in_array($type, array('chedai', 'debj', 'debx', 'esjys', 'fd', 'gjj', 'secondhand', 'zhdk'))) {
showmessage('dzapp_haodai:param_wrong');
}
if (!@(include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkgl_' . $city . '.php' || TIMESTAMP - filemtime(DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkgl_' . $city . '.php') > $var['refreshtime'])) {
$dkgl_article = get_article_dkgl_list();
writetocache('dzapp_haodai_dkgl_' . $city, getcachevars(array('dkgl_article' => $dkgl_article)));
}
$seodata = array('bbname' => $_G['setting']['bbname'], 'calc_type' => lang('plugin/dzapp_haodai', 'calc_' . $type));
list($navtitle, $metadescription, $metakeywords) = get_seosetting('', $seodata, $dzapp_haodai_seo['calc']);
if (defined('IN_MOBILE') && $type == 'fd') {
$script_more = '
var $btnss = $(\'.btn-b\');
var $tables = $btnss.siblings(\'.int_table\');
$btnss.click(
function() {
if ($tables.hasClass(\'hide-table\')) {
$tables.removeClass(\'hide-table\');
$(this).html(\'' . lang('plugin/dzapp_haodai', 'hide-table') . '\');
} else
{
$tables.addClass(\'hide-table\');
示例7: getcachevars
This is NOT a freeware, use is subject to license terms
$Id: admin.inc.php 21306 2009-11-26 00:56:50Z monkey $
*/
if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
$palang = $GLOBALS['scriptlang']['dps_postawards'];
@include_once DISCUZ_ROOT.'./forumdata/cache/cache_usergroups.php';
if(submitcheck('submit')){
require_once DISCUZ_ROOT.'./include/cache.func.php';
writetocache('postawards_setting', '', getcachevars(array('PACACHE' => array('userright' => $userright))));
$cache = serialize($userright);
$cachedata = "\$PACACHE['userright'] = ".arrayeval($userright).";\n\n";
$db->query("REPLACE INTO {$tablepre}caches (cachename, type, dateline, data) VALUES ('postawards', '1', '$timestamp', '".addslashes($cachedata)."')");
}
@include_once DISCUZ_ROOT.'./forumdata/cache/cache_postawards_setting.php';
if(is_array($PACACHE)) {
foreach($PACACHE['userright'] as $key => $item) {
$postawards_checked[$key] = $item['postawards'] ? ' checked' : '';
$systemcredit_checked[$key] = $item['systemcredit'] ? ' checked' : '';
$ratemode_checked[$key] = $item['ratemode'] ? ' checked' : '';
$ratelowlimit[$key] = $item['ratelowlimit'];
$ratehighlimit[$key] = $item['ratehighlimit'];
$ratealllimit[$key] = $item['ratealllimit'];
示例8: smart_cache
function smart_cache()
{
global $_G;
$smart = $_G['cache']['plugin']['smart_video'];
$hot = C::t("#smart_video#video")->fetch_all_by_where('smart_video_thread', 'visiable=1', 'play desc,dateline desc', 0, 10);
$boke = C::t("#smart_video#video")->fetch_all_by_where('smart_video_user', 'threads<>0', 'threads desc', 0, 8);
if (empty($smart['recom'])) {
$new = C::t("#smart_video#video")->fetch_all_by_where('smart_video_thread', 'visiable=1', 'dateline desc', 0, 6);
} else {
$n_tids = explode("|", $smart['recom']);
$new = C::t("#smart_video#video")->fetch_all_by_array('smart_video_thread', 'tid', $n_tids);
}
$fclass = C::t("#smart_video#video")->fetch_all("type=1");
$enew = array();
foreach ($fclass as $k => $v) {
$enew[] = C::t("#smart_video#video")->fetch_all_by_where('smart_video_thread', 'fcid=' . intval($fclass[$k]['cid']) . " and visiable=1", 'dateline desc', 0, 9);
if ($k == 8) {
break;
}
}
$smart_video = array('new' => $new, 'hot' => $hot, 'fclass' => $fclass, 'enew' => $enew, 'boke' => $boke, 'time' => time());
require_once libfile("function/cache");
writetocache('smart_video', getcachevars(array('smart_video' => $smart_video)));
return $smart_video;
}
示例9: exit
<?php
if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
exit('Access Denied');
}
if (submitcheck('submit')) {
require_once libfile('function/cache');
writetocache('paulissue_setting', getcachevars(array('PACACHE' => array('issuetypeid' => $_G['gp_issuetypeid']))));
$cache = serialize($_G['gp_issuetypeid']);
$cachedata = "\$PACACHE['issuetypeid'] = " . arrayeval($_G['gp_issuetypeid']) . ";\n\n";
DB::query("REPLACE INTO " . DB::table('common_cache') . " (cachekey, cachevalue, dateline) VALUES ('paulissue_setting', '" . addslashes($cachedata) . "', '{$_G['timestamp']}')");
cpmsg(lang('plugin/dsu_paulissue', 'ht_1'), '', 'succeed');
}
@(include_once DISCUZ_ROOT . './data/cache/cache_paulissue_setting.php');
if (is_array($PACACHE)) {
foreach ($PACACHE['issuetypeid'] as $key => $item) {
$dt[$key] = $item['dt'];
$ot[$key] = $item['ot'];
}
}
showformheader("plugins&operation=config&do=13&identifier=dsu_paulissue&pmod=admin");
showtableheader('dsu_paulissue');
showsubtitle(array(lang('plugin/dsu_paulissue', 'ht_2'), lang('plugin/dsu_paulissue', 'ht_3'), lang('plugin/dsu_paulissue', 'ht_4')));
loadcache('plugin');
$ofids = dimplode(unserialize($_G['cache']['plugin']['dsu_paulissue']['ofid']));
$query = DB::query("SELECT name,fid FROM " . DB::table('forum_forum') . " WHERE fid IN ({$ofids}) ORDER BY fid");
while ($forum = DB::fetch($query)) {
$list = showtablerow('', array('class="td35"', 'class="td35"', 'class="td35"', 'class="td35"', 'class="td35"', 'class="td35"', 'class="td35"', 'class="td35"'), array($forum['name'], '<input type="text" name="issuetypeid[' . $forum['fid'] . '][dt]" id="dt" value="' . $dt[$forum['fid']] . '">', '<input type="text" name="issuetypeid[' . $forum['fid'] . '][ot]" id="ot" value="' . $ot[$forum['fid']] . '">'), TRUE);
echo $list;
}
showsubmit('submit', 'submit', '', '');
示例10: array
$data = array();
$query = $db->query("SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM {$tablepre}attachments attach LEFT JOIN {$tablepre}threads t ON t.displayorder>=0 AND t.tid=attach.tid WHERE attach.readperm='0' AND displayorder>='0' AND filetype='image/pjpeg' {$fids} GROUP BY attach.tid ORDER BY {$orderby} DESC LIMIT {$searchnums}");
while ($pic = $db->fetch_array($query)) {
$data['pic'][$pic[aid]]['showpicpics'] = $attachurl . '/' . $pic['attachment'];
$data['pic'][$pic[aid]]['showpiclinks'] = "viewthread.php?tid={$pic['tid']}";
$data['pic'][$pic[aid]]['showpictexts'] = str_replace('\'', ' ', $pic['subject']);
}
$data['expiration'] = $cachelife + time();
$data['cacheshownums'] = $shownums;
$data['cachesearchnums'] = $searchnums;
$data['cachecachelife'] = $cachelife;
$data['cacheorderby'] = $orderby;
$data['cachecachename'] = $cachename;
$data['cachesearchfid'] = $searchfid;
require_once DISCUZ_ROOT . './include/cache.func.php';
writetocache($cachename, '', getcachevars($data));
include DISCUZ_ROOT . './forumdata/cache/cache_' . $cachename . '.php';
//}
shuffle($pic);
$i = 0;
$j = 0;
while ($j < $shownums && isset($pic[$i])) {
if (is_readable($pic[$i]['showpicpics'])) {
$showpicpics .= $comma . $pic[$i]['showpicpics'];
$showpiclinks .= $comma . $pic[$i]['showpiclinks'];
$showpictexts .= $comma . $pic[$i]['showpictexts'];
$comma = '|';
$j++;
}
$i++;
}
示例11: build_cache_setting
//.........这里部分代码省略.........
$data['sitemessage']['time'] = !empty($data['sitemessage']['time']) ? $data['sitemessage']['time'] * 1000 : 0;
foreach (array('register', 'login', 'newthread', 'reply') as $type) {
$data['sitemessage'][$type] = !empty($data['sitemessage'][$type]) ? explode("\n", $data['sitemessage'][$type]) : array();
}
$data['cachethreadon'] = DB::result_first("SELECT COUNT(*) FROM " . DB::table('forum_forum') . " WHERE status='1' AND threadcaches>0") ? 1 : 0;
$data['disallowfloat'] = is_array($data['disallowfloat']) ? implode('|', $data['disallowfloat']) : '';
if (!$data['imagelib']) {
unset($data['imageimpath']);
}
if (is_array($data['relatedtag']['order'])) {
asort($data['relatedtag']['order']);
$relatedtag = array();
foreach ($data['relatedtag']['order'] as $k => $v) {
$relatedtag['status'][$k] = $data['relatedtag']['status'][$k];
$relatedtag['name'][$k] = $data['relatedtag']['name'][$k];
$relatedtag['limit'][$k] = $data['relatedtag']['limit'][$k];
$relatedtag['template'][$k] = $data['relatedtag']['template'][$k];
}
$data['relatedtag'] = $relatedtag;
foreach ((array) $data['relatedtag']['status'] as $appid => $status) {
if (!$status) {
unset($data['relatedtag']['limit'][$appid]);
}
}
unset($data['relatedtag']['status'], $data['relatedtag']['order'], $relatedtag);
}
$data['domain']['defaultindex'] = isset($data['defaultindex']) && $data['defaultindex'] != '#' ? $data['defaultindex'] : '';
$data['domain']['holddomain'] = isset($data['holddomain']) ? $data['holddomain'] : '';
$data['domain']['list'] = array();
$query = DB::query("SELECT * FROM " . DB::table('common_domain') . " WHERE idtype IN('subarea', 'forum', 'topic', 'channel')");
while ($value = DB::fetch($query)) {
$data['domain']['list'][$value['domain'] . '.' . $value['domainroot']] = array('id' => $value['id'], 'idtype' => $value['idtype']);
}
writetocache('domain', getcachevars(array('domain' => $data['domain'])));
$data['seccodedata'] = is_array($data['seccodedata']) ? $data['seccodedata'] : array();
if ($data['seccodedata']['type'] == 2) {
if (extension_loaded('ming')) {
unset($data['seccodedata']['background'], $data['seccodedata']['adulterate'], $data['seccodedata']['ttf'], $data['seccodedata']['angle'], $data['seccodedata']['color'], $data['seccodedata']['size'], $data['seccodedata']['animator']);
} else {
$data['seccodedata']['animator'] = 0;
}
} elseif ($data['seccodedata']['type'] == 99) {
$data['seccodedata']['width'] = 32;
$data['seccodedata']['height'] = 24;
}
$data['watermarktype'] = !empty($data['watermarktype']) ? unserialize($data['watermarktype']) : array();
$data['watermarktext'] = !empty($data['watermarktext']) ? unserialize($data['watermarktext']) : array();
foreach ($data['watermarktype'] as $k => $v) {
if ($data['watermarktype'][$k] == 'text' && $data['watermarktext']['text'][$k]) {
if ($data['watermarktext']['text'][$k] && strtoupper(CHARSET) != 'UTF-8') {
$data['watermarktext']['text'][$k] = diconv($data['watermarktext']['text'][$k], CHARSET, 'UTF-8', true);
}
$data['watermarktext']['text'][$k] = bin2hex($data['watermarktext']['text'][$k]);
if (file_exists('static/image/seccode/font/en/' . $data['watermarktext']['fontpath'][$k])) {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/en/' . $data['watermarktext']['fontpath'][$k];
} elseif (file_exists('static/image/seccode/font/ch/' . $data['watermarktext']['fontpath'][$k])) {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/ch/' . $data['watermarktext']['fontpath'][$k];
} else {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/' . $data['watermarktext']['fontpath'][$k];
}
$data['watermarktext']['color'][$k] = preg_replace('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/e', "hexdec('\\1').','.hexdec('\\2').','.hexdec('\\3')", $data['watermarktext']['color'][$k]);
$data['watermarktext']['shadowcolor'][$k] = preg_replace('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/e', "hexdec('\\1').','.hexdec('\\2').','.hexdec('\\3')", $data['watermarktext']['shadowcolor'][$k]);
} else {
$data['watermarktext']['text'][$k] = '';
$data['watermarktext']['fontpath'][$k] = '';
$data['watermarktext']['color'][$k] = '';
示例12: diconv
$value['zone_name'] = diconv($value['zone_name'], 'UTF-8', CHARSET);
$value['Province'] = diconv($value['Province'], 'UTF-8', CHARSET);
$value['area'] = diconv($value['area'], 'UTF-8', CHARSET);
$zones[$value['s_EN']] = $value['zone_name'];
$zonesort['provinces'][$value['Province']][$value['s_EN']] = $value['zone_name'];
$zonesort['letter_raw'][$value['letter']][$value['s_EN']] = $value['zone_name'];
$zonesort['area'][$value['area']][$value['s_EN']] = $value['zone_name'];
}
foreach (range('A', 'Z') as $letter) {
if (!empty($zonesort['letter_raw'][$letter])) {
$zonesort['letter'][$letter] = $zonesort['letter_raw'][$letter];
}
}
require_once libfile('function/cache');
writetocache('dzapp_haodai_city', getcachevars(array('zones' => $zones)));
writetocache('dzapp_haodai_city_sort', getcachevars(array('zonesort' => $zonesort)));
} else {
showmessage('dzapp_haodai:callback_error_admin');
}
} else {
@(include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_city_sort.php');
}
if (!$_GET['city']) {
include template('dzapp_haodai:city');
} else {
if (!$_GET['city'] || $_GET['formhash'] != FORMHASH || !$zones[$_GET['city']]) {
showmessage('dzapp_haodai:city_choose_wrong');
}
dsetcookie('HD_CITY', $_GET['city']);
showmessage('dzapp_haodai:city_choose_ok', 'plugin.php?id=dzapp_haodai');
}
示例13: exit
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: check.php 32817 2013-03-13 11:29:12Z monkey $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
if (!defined('DISCUZ_VERSION')) {
require './source/discuz_version.php';
}
global $_G;
$setting = array();
$settings = array('closeforumorderby');
foreach ($settings as $v) {
$setting[$v] = $_G['setting'][$v];
}
if (in_array('mobile', $_G['setting']['plugins']['available'])) {
$extendsetting = C::t('#mobile#mobile_setting')->fetch_all(array('extend_used', 'extend_lastupdate'));
$array = array('discuzversion' => DISCUZ_VERSION, 'charset' => CHARSET, 'version' => MOBILE_PLUGIN_VERSION, 'pluginversion' => $_G['setting']['plugins']['version']['mobile'], 'regname' => $_G['setting']['regname'], 'qqconnect' => in_array('qqconnect', $_G['setting']['plugins']['available']) ? '1' : '0', 'sitename' => $_G['setting']['bbname'], 'mysiteid' => $_G['setting']['my_siteid'], 'ucenterurl' => $_G['setting']['ucenterurl'], 'setting' => $setting, 'extends' => array('used' => $extendsetting['extend_used'], 'lastupdate' => $extendsetting['extend_lastupdate']));
} else {
$array = array();
}
require_once './source/plugin/mobile/mobile.class.php';
$data = array('mobilecheck' => mobile_core::json($array));
writetocache('mobile', getcachevars($data));
示例14: updatespacesettings
function updatespacesettings()
{
global $db, $tablepre, $initcredits;
$initcreditarray = explode(',', $initcredits);
$tmp = array();
for ($i = 1; $i <= 8; $i++) {
$tmp['extcredits' . $i] = $initcreditarray[$i];
}
$lowercredits = intval($initcredits);
$groupinfo = $db->fetch_first("SELECT groupid, readaccess FROM {$tablepre}usergroups WHERE creditshigher<={$lowercredits} AND creditslower>{$lowercredits} ORDER BY creditshigher LIMIT 1");
$fids = 0;
$query = $db->query("SELECT ff.fid, ff.viewperm, ff.formulaperm FROM {$tablepre}forumfields ff,{$tablepre}forums f WHERE f.fid=ff.fid AND f.status>'0' AND ff.password=''");
while ($forum = $db->fetch_array($query)) {
if (empty($forum['viewperm']) || in_array($groupinfo['groupid'], explode("\t", $forum['viewperm']))) {
$fids .= ',' . $forum['fid'];
}
}
$spacesettings = array('parms' => array('infids' => $fids, 'groupid' => $groupinfo['groupid'], 'readaccess' => $groupinfo['readaccess']));
writetocache('spacesettings', '', getcachevars($spacesettings));
}
示例15: build_cache_setting
//.........这里部分代码省略.........
$data['sitemessage'][$type] = !empty($data['sitemessage'][$type]) ? explode("\n", $data['sitemessage'][$type]) : array();
}
$data['cachethreadon'] = C::t('forum_forum')->fetch_threadcacheon_num() ? 1 : 0;
$data['disallowfloat'] = is_array($data['disallowfloat']) ? implode('|', $data['disallowfloat']) : '';
if(!$data['imagelib']) unset($data['imageimpath']);
if(is_array($data['relatedtag']['order'])) {
asort($data['relatedtag']['order']);
$relatedtag = array();
foreach($data['relatedtag']['order'] AS $k => $v) {
$relatedtag['status'][$k] = $data['relatedtag']['status'][$k];
$relatedtag['name'][$k] = $data['relatedtag']['name'][$k];
$relatedtag['limit'][$k] = $data['relatedtag']['limit'][$k];
$relatedtag['template'][$k] = $data['relatedtag']['template'][$k];
}
$data['relatedtag'] = $relatedtag;
foreach((array)$data['relatedtag']['status'] AS $appid => $status) {
if(!$status) {
unset($data['relatedtag']['limit'][$appid]);
}
}
unset($data['relatedtag']['status'], $data['relatedtag']['order'], $relatedtag);
}
$data['domain']['defaultindex'] = isset($data['defaultindex']) && $data['defaultindex'] != '#' ? $data['defaultindex'] : '';
$data['domain']['holddomain'] = isset($data['holddomain']) ? $data['holddomain'] : '';
$data['domain']['list'] = array();
foreach(C::t('common_domain')->fetch_all_by_idtype(array('subarea', 'forum', 'topic', 'channel')) as $value) {
$data['domain']['list'][$value['domain'].'.'.$value['domainroot']] = array('id' => $value['id'], 'idtype' => $value['idtype']);
}
writetocache('domain', getcachevars(array('domain' => $data['domain'])));
$data['seccodedata'] = is_array($data['seccodedata']) ? $data['seccodedata'] : array();
if($data['seccodedata']['type'] == 2) {
if(extension_loaded('ming')) {
unset($data['seccodedata']['background'], $data['seccodedata']['adulterate'],
$data['seccodedata']['ttf'], $data['seccodedata']['angle'],
$data['seccodedata']['color'], $data['seccodedata']['size'],
$data['seccodedata']['animator']);
} else {
$data['seccodedata']['animator'] = 0;
}
} elseif($data['seccodedata']['type'] == 99) {
$data['seccodedata']['width'] = 32;
$data['seccodedata']['height'] = 24;
}
$data['watermarktype'] = !empty($data['watermarktype']) ? dunserialize($data['watermarktype']) : array();
$data['watermarktext'] = !empty($data['watermarktext']) ? dunserialize($data['watermarktext']) : array();
foreach($data['watermarktype'] as $k => $v) {
if($data['watermarktype'][$k] == 'text' && $data['watermarktext']['text'][$k]) {
if($data['watermarktext']['text'][$k] && strtoupper(CHARSET) != 'UTF-8') {
$data['watermarktext']['text'][$k] = diconv($data['watermarktext']['text'][$k], CHARSET, 'UTF-8', true);
}
$data['watermarktext']['text'][$k] = bin2hex($data['watermarktext']['text'][$k]);
if(file_exists('static/image/seccode/font/en/'.$data['watermarktext']['fontpath'][$k])) {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/en/'.$data['watermarktext']['fontpath'][$k];
} elseif(file_exists('static/image/seccode/font/ch/'.$data['watermarktext']['fontpath'][$k])) {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/ch/'.$data['watermarktext']['fontpath'][$k];
} else {
$data['watermarktext']['fontpath'][$k] = 'static/image/seccode/font/'.$data['watermarktext']['fontpath'][$k];
}
$data['watermarktext']['color'][$k] = preg_replace('/#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/e', "hexdec('\\1').','.hexdec('\\2').','.hexdec('\\3')", $data['watermarktext']['color'][$k]);