本文整理汇总了PHP中save_syscache函数的典型用法代码示例。如果您正苦于以下问题:PHP save_syscache函数的具体用法?PHP save_syscache怎么用?PHP save_syscache使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了save_syscache函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: build_cache_admingroups
function build_cache_admingroups()
{
$query = DB::query("SELECT * FROM " . DB::table('common_admingroup'));
while ($data = DB::fetch($query)) {
save_syscache('admingroup_' . $data['admingid'], $data);
}
}
示例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: build_cache_globalstick
function build_cache_globalstick()
{
$data = array();
$query = DB::query("SELECT fid, type, fup FROM " . DB::table('forum_forum') . " WHERE status='1' AND type IN ('forum', 'sub') ORDER BY type");
$fuparray = $threadarray = array();
while ($forum = DB::fetch($query)) {
switch ($forum['type']) {
case 'forum':
$fuparray[$forum['fid']] = $forum['fup'];
break;
case 'sub':
$fuparray[$forum['fid']] = $fuparray[$forum['fup']];
break;
}
}
$query = DB::query("SELECT tid, fid, displayorder FROM " . DB::table('forum_thread') . " WHERE fid>'0' AND displayorder IN (2, 3)");
while ($thread = DB::fetch($query)) {
switch ($thread['displayorder']) {
case 2:
$threadarray[$fuparray[$thread['fid']]][] = $thread['tid'];
break;
case 3:
$threadarray['global'][] = $thread['tid'];
break;
}
}
foreach (array_unique($fuparray) as $gid) {
if (!empty($threadarray[$gid])) {
$data['categories'][$gid] = array('tids' => dimplode($threadarray[$gid]), 'count' => intval(@count($threadarray[$gid])));
}
}
$data['global'] = array('tids' => empty($threadarray['global']) ? '' : dimplode($threadarray['global']), 'count' => intval(@count($threadarray['global'])));
save_syscache('globalstick', $data);
}
示例4: build_cache_usergroups_single
function build_cache_usergroups_single()
{
$pluginvalue = pluginsettingvalue('groups');
$allowthreadplugin = unserialize(DB::result_first("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey='allowthreadplugin'"));
$query = DB::query("SELECT * FROM " . DB::table('common_usergroup') . " u\r\n\t\tLEFT JOIN " . DB::table('common_usergroup_field') . " uf ON u.groupid=uf.groupid\r\n\t\tLEFT JOIN " . DB::table('common_admingroup') . " a ON u.groupid=a.admingid");
while ($data = DB::fetch($query)) {
$ratearray = array();
if ($data['raterange']) {
foreach (explode("\n", $data['raterange']) as $rating) {
$rating = explode("\t", $rating);
$ratearray[$rating[0]] = array('isself' => $rating[1], 'min' => $rating[2], 'max' => $rating[3], 'mrpd' => $rating[4]);
}
}
$data['raterange'] = $ratearray;
$data['grouptitle'] = $data['color'] ? '<font color="' . $data['color'] . '">' . $data['grouptitle'] . '</font>' : $data['grouptitle'];
$data['grouptype'] = $data['type'];
$data['grouppublic'] = $data['system'] != 'private';
$data['groupcreditshigher'] = $data['creditshigher'];
$data['groupcreditslower'] = $data['creditslower'];
$data['maxspacesize'] = intval($data['maxspacesize']) * 1024 * 1024;
$data['allowthreadplugin'] = !empty($allowthreadplugin[$data['groupid']]) ? $allowthreadplugin[$data['groupid']] : array();
$data['plugin'] = $pluginvalue[$data['groupid']];
unset($data['type'], $data['system'], $data['creditshigher'], $data['creditslower'], $data['groupavatar'], $data['admingid']);
save_syscache('usergroup_' . $data['groupid'], $data);
}
}
示例5: build_cache_advs
function build_cache_advs()
{
$data = array();
$query = DB::query("SELECT * FROM " . DB::table('common_advertisement') . " WHERE available>'0' AND starttime<='" . TIMESTAMP . "' ORDER BY displayorder");
$data['code'] = $data['parameters'] = $data['evalcode'] = array();
$advlist = array();
while ($adv = DB::fetch($query)) {
foreach (explode("\t", $adv['targets']) as $target) {
$data['code'][$target][$adv['type']][$adv['advid']] = $adv['code'];
}
$advtype_class = libfile('adv/' . $adv['type'], 'class');
if (!file_exists($advtype_class)) {
continue;
}
require_once $advtype_class;
$advclass = 'adv_' . $adv['type'];
$advclass = new $advclass();
$adv['parameters'] = unserialize($adv['parameters']);
unset($adv['parameters']['style'], $adv['parameters']['html'], $adv['parameters']['displayorder']);
$data['parameters'][$adv['type']][$adv['advid']] = $adv['parameters'];
if ($adv['parameters']['extra']) {
$data['parameters'][$adv['type']][$adv['advid']] = array_merge($data['parameters'][$adv['type']][$adv['advid']], $adv['parameters']['extra']);
unset($data['parameters'][$adv['type']][$adv['advid']]['extra']);
}
$advlist[] = $adv;
$data['evalcode'][$adv['type']] = $advclass->evalcode($adv);
}
updateadvtype();
save_syscache('advs', $data);
}
示例6: build_cache_stamps
function build_cache_stamps()
{
$data = array();
$query = DB::query("SELECT id, url, displayorder FROM " . DB::table('common_smiley') . " WHERE type IN ('stamp','stamplist') ORDER BY displayorder");
$fillarray = range(0, 99);
$count = 0;
$repeats = $stampicon = array();
while ($stamp = DB::fetch($query)) {
if (isset($fillarray[$stamp['displayorder']])) {
unset($fillarray[$stamp['displayorder']]);
} else {
$repeats[] = $stamp['id'];
}
$count++;
}
foreach ($repeats as $id) {
reset($fillarray);
$displayorder = current($fillarray);
unset($fillarray[$displayorder]);
DB::query("UPDATE " . DB::table('common_smiley') . " SET displayorder='{$displayorder}' WHERE id='{$id}'");
}
$query = DB::query("SELECT typeid, displayorder FROM " . DB::table('common_smiley') . " WHERE type='stamplist' AND typeid>'0' ORDER BY displayorder");
while ($stamp = DB::fetch($query)) {
$stamporder = DB::result_first("SELECT displayorder FROM " . DB::table('common_smiley') . " WHERE id='{$stamp['typeid']}' AND type='stamp'");
$stampicon[$stamporder] = $stamp['displayorder'];
}
$query = DB::query("SELECT * FROM " . DB::table('common_smiley') . " WHERE type IN ('stamp','stamplist') ORDER BY displayorder");
while ($stamp = DB::fetch($query)) {
$icon = $stamp['type'] == 'stamp' ? isset($stampicon[$stamp['displayorder']]) ? $stampicon[$stamp['displayorder']] : 0 : ($stamp['type'] == 'stamplist' && !in_array($stamp['displayorder'], $stampicon) ? 1 : 0);
$data[$stamp['displayorder']] = array('url' => $stamp['url'], 'text' => $stamp['code'], 'type' => $stamp['type'], 'icon' => $icon);
}
save_syscache('stamps', $data);
}
示例7: build_cache_heats
function build_cache_heats()
{
global $_G;
$data = array();
if ($_G['setting']['indexhot']['status']) {
require_once libfile('function/post');
$_G['setting']['indexhot'] = array('status' => 1, 'limit' => intval($_G['setting']['indexhot']['limit'] ? $_G['setting']['indexhot']['limit'] : 10), 'days' => intval($_G['setting']['indexhot']['days'] ? $_G['setting']['indexhot']['days'] : 7), 'expiration' => intval($_G['setting']['indexhot']['expiration'] ? $_G['setting']['indexhot']['expiration'] : 900), 'messagecut' => intval($_G['setting']['indexhot']['messagecut'] ? $_G['setting']['indexhot']['messagecut'] : 200));
$heatdateline = TIMESTAMP - 86400 * $_G['setting']['indexhot']['days'];
$query = DB::query("SELECT t.tid,t.posttableid,t.views,t.dateline,t.replies,t.author,t.authorid,t.subject,t.price\r\n\t\t\tFROM " . DB::table('forum_thread') . " t\r\n\t\t\tWHERE t.dateline>'{$heatdateline}' AND t.heats>'0' AND t.displayorder>='0' ORDER BY t.heats DESC LIMIT " . $_G['setting']['indexhot']['limit'] * 2);
$messageitems = 2;
$limit = $_G['setting']['indexhot']['limit'];
while ($heat = DB::fetch($query)) {
$posttable = $heat['posttableid'] ? "forum_post_{$heat['posttableid']}" : 'forum_post';
$post = DB::fetch_first("SELECT p.pid, p.message FROM " . DB::table($posttable) . " p WHERE p.tid='{$heat['tid']}' AND p.first='1'");
$heat = array_merge($heat, (array) $post);
if ($limit == 0) {
break;
}
if ($messageitems > 0) {
$heat['message'] = !$heat['price'] ? messagecutstr($heat['message'], $_G['setting']['indexhot']['messagecut']) : '';
$data['message'][$heat['tid']] = $heat;
} else {
unset($heat['message']);
$data['subject'][$heat['tid']] = $heat;
}
$messageitems--;
$limit--;
}
$data['expiration'] = TIMESTAMP + $_G['setting']['indexhot']['expiration'];
}
save_syscache('heats', $data);
}
示例8: build_cache_fields_connect_register
function build_cache_fields_connect_register()
{
global $_G;
$data = array();
$fields = array();
if ($_G['setting']['connect']['register_gender']) {
$fields[] = 'gender';
}
if ($_G['setting']['connect']['register_birthday']) {
$fields[] = 'birthyear';
$fields[] = 'birthmonth';
$fields[] = 'birthday';
}
if ($fields) {
$query = DB::query("SELECT * FROM " . DB::table('common_member_profile_setting') . " WHERE fieldid IN (" . dimplode($fields) . ")");
while ($field = DB::fetch($query)) {
$choices = array();
if ($field['selective']) {
foreach (explode("\n", $field['choices']) as $item) {
list($index, $choice) = explode('=', $item);
$choices[trim($index)] = trim($choice);
}
$field['choices'] = $choices;
} else {
unset($field['choices']);
}
$field['showinregister'] = 1;
$field['available'] = 1;
$data['field_' . $field['fieldid']] = $field;
}
}
save_syscache('fields_connect_register', $data);
}
示例9: poll_getcachearray
function poll_getcachearray($cachename, $script = '')
{
global $_G;
$cols = '*';
$conditions = '';
$timestamp = TIMESTAMP;
switch ($cachename) {
case 'poll_setting':
$table = 'poll_setting';
$conditions = '';
break;
}
$data = array();
if ($cols && $table) {
$query = DB::query("SELECT {$cols} FROM " . DB::table($table) . " {$conditions}");
}
switch ($cachename) {
case 'poll_setting':
while ($datarow = DB::fetch($query)) {
$data[$datarow['skey']] = $datarow['svalue'];
}
default:
while ($datarow = DB::fetch($query)) {
$data[] = $datarow;
}
}
save_syscache($cachename, $data);
return true;
}
示例10: pdnovelcache
function pdnovelcache($cachename, $identifier = "")
{
global $_G;
$cachearray = array("pdnovelcategory", "pdnovelcreditrule");
$cachename = in_array($cachename, $cachearray) ? $cachename : "";
if ($cachename == "pdnovelcategory") {
$data = array();
$query = DB::query("SELECT * FROM " . DB::table("pdnovel_category") . " ORDER BY displayorder,catid");
while ($value = DB::fetch($query)) {
$value['catname'] = dhtmlspecialchars($value['catname']);
$data[$value['catid']] = $value;
}
foreach ($data as $k => $v) {
if (!$v['catid']) {
continue;
} elseif ($v['upid'] > 0) {
$data[$k]['level'] = 1;
continue;
}
foreach ($data as $ks => $vs) {
if ($vs['upid'] == $v['catid']) {
$data[$k]['children'][] = $vs['catid'];
$data[$k]['level'] = 0;
}
}
}
save_syscache("pdnovelcategory", $data);
}
}
示例11: build_cache_forumrecommend
function build_cache_forumrecommend()
{
$data = array();
$query = DB::query("SELECT fid FROM " . DB::table('forum_forum') . " WHERE type<>'group' AND status<>3");
while ($row = DB::fetch($query)) {
require_once libfile('function/group');
$squery = DB::query("SELECT f.fid, f.name, f.threads, f.lastpost, ff.icon, ff.membernum, ff.description FROM " . DB::table('forum_forum') . " f LEFT JOIN " . DB::table('forum_forumfield') . " ff ON ff.fid=f.fid WHERE recommend='{$row['fid']}'");
while ($group = DB::fetch($squery)) {
$group['icon'] = get_groupimg($group['icon'], 'icon');
$lastpost = array(0, 0, '', '');
$group['lastpost'] = is_string($group['lastpost']) ? explode("\t", $group['lastpost']) : $group['lastpost'];
$group['lastpost'] = count($group['lastpost']) != 4 ? $lastpost : $group['lastpost'];
list($lastpost['tid'], $lastpost['subject'], $lastpost['dateline'], $lastpost['author']) = $group['lastpost'];
if ($lastpost['tid']) {
$lastpost['dateline'] = dgmdate($lastpost['dateline'], 'Y-m-d H:i:s');
if ($lastpost['author']) {
$lastpost['encode_author'] = rawurlencode($lastpost['author']);
}
$group['lastpost'] = $lastpost;
} else {
$group['lastpost'] = '';
}
$data[$row['fid']][] = $group;
}
}
save_syscache('forumrecommend', $data);
}
示例12: build_cache_forumlinks
function build_cache_forumlinks()
{
global $_G;
$data = array();
$query = DB::query("SELECT * FROM " . DB::table('common_friendlink') . " ORDER BY displayorder");
if ($_G['setting']['forumlinkstatus']) {
$tightlink_content = $tightlink_text = $tightlink_logo = $comma = '';
while ($flink = DB::fetch($query)) {
if ($flink['description']) {
if ($flink['logo']) {
$tightlink_content .= '<li class="lk_logo mbm bbda cl"><img src="' . $flink['logo'] . '" border="0" alt="' . $flink['name'] . '" /><div class="lk_content z"><h5><a href="' . $flink['url'] . '" target="_blank">' . $flink['name'] . '</a></h5><p>' . $flink['description'] . '</p></div>';
} else {
$tightlink_content .= '<li class="mbm bbda"><div class="lk_content"><h5><a href="' . $flink['url'] . '" target="_blank">' . $flink['name'] . '</a></h5><p>' . $flink['description'] . '</p></div>';
}
} else {
if ($flink['logo']) {
$tightlink_logo .= '<a href="' . $flink['url'] . '" target="_blank"><img src="' . $flink['logo'] . '" border="0" alt="' . $flink['name'] . '" /></a> ';
} else {
$tightlink_text .= '<li><a href="' . $flink['url'] . '" target="_blank" title="' . $flink['name'] . '">' . $flink['name'] . '</a></li>';
}
}
}
$data = array($tightlink_content, $tightlink_logo, $tightlink_text);
}
save_syscache('forumlinks', $data);
}
示例13: build_cache_groupreadaccess
function build_cache_groupreadaccess()
{
$data = array();
$query = DB::query("SELECT g.groupid, g.grouptitle, gf.readaccess FROM " . DB::table('common_usergroup') . " g\r\n\t\tLEFT JOIN " . DB::table('common_usergroup_field') . " gf ON gf.groupid=g.groupid WHERE gf.readaccess>'0' ORDER BY gf.readaccess");
while ($datarow = DB::fetch($query)) {
$data[] = $datarow;
}
save_syscache('groupreadaccess', $data);
}
示例14: build_cache_modreasons
function build_cache_modreasons()
{
$data = array();
$query = DB::query("SELECT svalue FROM " . DB::table('common_setting') . " WHERE skey='modreasons'");
$modreasons = DB::result($query, 0);
$modreasons = str_replace(array("\r\n", "\r"), array("\n", "\n"), $modreasons);
$data = explode("\n", trim($modreasons));
save_syscache('modreasons', $data);
}
示例15: build_cache_typetree
function build_cache_typetree()
{
global $root;
global $data_array;
$data = array();
$data['root'] = $root;
$data['data_array'] = $data_array;
save_syscache('typetree', $data);
}