本文整理汇总了PHP中uc_app_ls函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_app_ls函数的具体用法?PHP uc_app_ls怎么用?PHP uc_app_ls使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_app_ls函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkConnect
public function checkConnect()
{
$this->initDiscuzApi();
try {
uc_app_ls();
return true;
} catch (\Exception $e) {
return false;
}
}
示例2: updatesettingcache
function updatesettingcache()
{
global $_G, $_SGLOBAL, $_SSCONFIG, $lang;
$_SSCONFIG = array();
$query = DB::query('SELECT * FROM ' . tname('settings'));
while ($set = DB::fetch($query)) {
$_G['setting'][$set['variable']] = $set['value'];
}
// 附件設置
$_G['setting']['attach'] = unserialize($_G['setting']['attach']);
$_G['setting']['attachmenturlarr'] = explode("\r\n", trim($_G['setting']['attachmenturls']));
//縮略圖設置
if (empty($_G['setting']['thumbarray'])) {
$_G['setting']['thumbarray'] = array('news' => array('400', '300'));
} else {
$_G['setting']['thumbarray'] = unserialize($_G['setting']['thumbarray']);
}
//讀取UC中論壇地址
require_once B_ROOT . './uc_client/client.php';
$ucapparray = uc_app_ls();
if (count($ucapparray) > 0) {
foreach ($ucapparray as $apparray) {
if ($apparray['type'] == 'DISCUZ') {
$_G['setting']['discuz_url'] = $apparray['url'];
break;
}
}
}
// 讀取導航
$query = DB::query('SELECT name,flag,url,target,highlight FROM ' . tname('nav') . ' WHERE (type=\'sys\' or type=\'site\') and shopid=0 and available=1 order by displayorder limit 7');
while ($value = DB::fetch($query)) {
$value['ext'] = ($value['target'] == 1 ? ' target=\'_blank\'' : '') . ' style=\'' . pktitlestyle($value['highlight']) . '\'';
$_G['setting']['site_nav'][$value['flag']] = $value;
}
// 會員卡商家導航
if (empty($_G['setting']['enablecard'])) {
unset($_G['setting']['site_nav']['card']);
}
// make cache
$cachefile = B_ROOT . './data/system/config.cache.php';
$cachetext = '$_G[\'setting\'] = ' . arrayeval($_G['setting']);
writefile($cachefile, $cachetext, 'php');
}
示例3: build_cache_setting
//.........这里部分代码省略.........
$data['exchangestatus'] = $allowexchangein && $allowexchangeout;
$data['transferstatus'] = isset($data['extcredits'][$data['creditstrans']]);
list($data['zoomstatus'], $data['imagemaxwidth']) = explode("\t", $data['zoomstatus']);
$data['imagemaxwidth'] = intval($data['imagemaxwidth']);
require_once DISCUZ_ROOT . './config/config_ucenter.php';
$data['ucenterurl'] = UC_API;
$query = DB::query("SELECT identifier, name FROM " . DB::table('common_magic') . " WHERE available='1'");
while ($magic = DB::fetch($query)) {
$data['magics'][$magic['identifier']] = $magic['name'];
}
$data['tradeopen'] = DB::result_first("SELECT count(*) FROM " . DB::table('common_usergroup_field') . " WHERE allowposttrade='1'") ? 1 : 0;
$data['medalstatus'] = intval(DB::result_first("SELECT count(*) FROM " . DB::table('forum_medal') . " WHERE available='1'"));
$focus = array();
if ($data['focus']['data']) {
foreach ($data['focus']['data'] as $k => $v) {
if ($v['available'] && $v['position']) {
foreach ($v['position'] as $position) {
$focus[$position][$k] = $k;
}
}
}
}
$data['focus'] = $focus;
list($data['plugins'], $data['pluginlinks'], $data['hookscript'], $data['hookscriptmobile'], $data['threadplugins'], $data['specialicon']) = get_cachedata_setting_plugin();
if (empty($data['defaultindex'])) {
$data['defaultindex'] = array();
}
list($data['navs'], $data['subnavs'], $data['menunavs'], $data['navmns'], $data['navmn'], $data['navdms'], $data['navlogos']) = get_cachedata_mainnav();
$data['footernavs'] = get_cachedata_footernav();
$data['spacenavs'] = get_cachedata_spacenavs();
$data['mynavs'] = get_cachedata_mynavs();
$data['topnavs'] = get_cachedata_topnav();
require_once DISCUZ_ROOT . './uc_client/client.php';
$ucapparray = uc_app_ls();
$data['allowsynlogin'] = isset($ucapparray[UC_APPID]['synlogin']) ? $ucapparray[UC_APPID]['synlogin'] : 1;
$appnamearray = array('UCHOME', 'XSPACE', 'DISCUZ', 'SUPESITE', 'SUPEV', 'ECSHOP', 'ECMALL', 'OTHER');
$data['ucapp'] = $data['ucappopen'] = array();
$data['uchomeurl'] = '';
$data['discuzurl'] = $_G['siteurl'];
$appsynlogins = 0;
foreach ($ucapparray as $apparray) {
if ($apparray['appid'] != UC_APPID) {
if (!empty($apparray['synlogin'])) {
$appsynlogins = 1;
}
if ($data['uc']['navlist'][$apparray['appid']] && $data['uc']['navopen']) {
$data['ucapp'][$apparray['appid']]['name'] = $apparray['name'];
$data['ucapp'][$apparray['appid']]['url'] = $apparray['url'];
}
} else {
$data['discuzurl'] = $apparray['url'];
}
if (!empty($apparray['viewprourl'])) {
$data['ucapp'][$apparray['appid']]['viewprourl'] = $apparray['url'] . $apparray['viewprourl'];
}
foreach ($appnamearray as $name) {
if ($apparray['type'] == $name && $apparray['appid'] != UC_APPID) {
$data['ucappopen'][$name] = 1;
if ($name == 'UCHOME') {
$data['uchomeurl'] = $apparray['url'];
} elseif ($name == 'XSPACE') {
$data['xspaceurl'] = $apparray['url'];
}
}
}
}
示例4: uc_app_ls
$sub['url'] != '#' ? "<input name=\"defaultindex\" class=\"radio\" type=\"radio\" value=\"$sub[url]\"".($_G['setting']['defaultindex'] == $sub['url'] ? ' checked="checked"' : '')." />" : '',
"<input class=\"checkbox\" type=\"checkbox\" name=\"availablenew[$sub[id]]\" value=\"1\" ".($sub['available'] ? 'checked' : '').">",
"<a href=\"".ADMINSCRIPT."?action=nav&operation=headernav&do=edit&id=$sub[id]\" class=\"act\">$lang[edit]</a>"
));
}
showtagfooter('tbody');
}
}
showtagfooter('tbody');
/*vot*/ echo '<tr><td colspan="2"></td><td colspan="8"><div><a href="###" onclick="addrow(this, 0, 0)" class="addtr">'.$lang['misc_customnav_add_menu'].'</a></div></td></tr>';
showsubmit('submit', 'submit', 'del');
showtablefooter();
showformfooter();
loaducenter();
$ucapparray = uc_app_ls();
$applist = '';
if(count($ucapparray) > 1) {
/*vot*/ $applist = "<br/>".$lang['misc_customnav_add_ucenter'].'<select name="applist" onchange="app(this)"><option value=""></option>';
foreach($ucapparray as $app) {
if($app['appid'] != UC_APPID) {
$applist .= "<option value=\"$app[url]\">$app[name]</option>";
}
}
$applist .= '</select>';
}
$applist = str_replace("'", "\'", $applist);
echo <<<EOT
<script type="text/JavaScript">
示例5: error_reporting
*/
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$mtime = explode(' ', microtime());
$cyask_starttime = $mtime[1] + $mtime[0];
error_reporting(7);
define('IN_CYASK', TRUE);
define('CYASK_ROOT', substr(dirname(__FILE__), 0, -7));
require_once CYASK_ROOT . './config.inc.php';
require_once CYASK_ROOT . './include/global.func.php';
require_once CYASK_ROOT . './include/db_' . $database . '.php';
require_once CYASK_ROOT . './uc_client/client.php';
file_exists(CYASK_ROOT . './uc_client/data/cache/apps.php') && (include_once CYASK_ROOT . './uc_client/data/cache/apps.php');
if (isset($_CACHE['apps'])) {
rsort($_CACHE['apps']);
} else {
$_CACHE['apps'] = rsort(uc_app_ls());
}
if (!defined('CURSCRIPT')) {
exit('CURSCRIPT ERROR');
}
$magic_quotes_gpc = get_magic_quotes_gpc();
if (!$magic_quotes_gpc) {
$_POST = daddslashes($_POST);
$_GET = daddslashes($_GET);
$_FILES = daddslashes($_FILES);
}
$cyask_version = '3.0 for UCenter';
$timestamp = time();
$PHP_SELF = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_NAME'];
$QUERY_STRING = empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'];
$onlineip = $_SERVER['REMOTE_ADDR'] ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';
示例6: cpmessage
}
//权限
if (!checkperm('manageapp')) {
cpmessage('no_authority_management_operation');
}
if (submitcheck('appsubmit')) {
include_once S_ROOT . './source/function_cache.php';
data_set('relatedtag', $_POST['relatedtag']);
tagtpl_cache();
app_cache();
//应用列表缓存
cpmessage('do_success', 'admincp.php?ac=app');
}
if (empty($_GET['op'])) {
include_once S_ROOT . './uc_client/client.php';
$applist = uc_app_ls();
$relatedtag = data_get('relatedtag');
$relatedtag = unserialize($relatedtag);
if (empty($relatedtag)) {
$relatedtag = array();
}
}
//更新tag模板文件
function tagtpl_cache()
{
$relatedtag = unserialize(data_get('relatedtag'));
if (empty($relatedtag)) {
$relatedtag = array();
}
foreach ($relatedtag['data'] as $appid => $data) {
$relatedtag['limit'][$appid] = empty($relatedtag['limit'][$appid]) ? 0 : intval($relatedtag['limit'][$appid]);
示例7: build_cache_setting
//.........这里部分代码省略.........
foreach(C::t('common_magic')->fetch_all_data(1) as $magic) {
$magic['identifier'] = str_replace(':', '_', $magic['identifier']);
$data['magics'][$magic['identifier']] = $magic['name'];
}
$data['tradeopen'] = C::t('common_usergroup_field')->count_by_field('allowposttrade', 1) ? 1 : 0;
$data['medalstatus'] = intval(C::t('forum_medal')->count_by_available());
$focus = array();
if($data['focus']['data']) {
foreach($data['focus']['data'] as $k => $v) {
if($v['available'] && $v['position']) {
foreach($v['position'] as $position) {
$focus[$position][$k] = $k;
}
}
}
}
$data['focus'] = $focus;
list($data['plugins'], $data['pluginlinks'], $data['hookscript'], $data['hookscriptmobile'], $data['threadplugins'], $data['specialicon']) = get_cachedata_setting_plugin();
if(empty($data['defaultindex'])) $data['defaultindex'] = array();
list($data['navs'], $data['subnavs'], $data['menunavs'], $data['navmns'], $data['navmn'], $data['navdms'], $data['navlogos']) = get_cachedata_mainnav();
$data['footernavs'] = get_cachedata_footernav();
$data['spacenavs'] = get_cachedata_spacenavs();
$data['mynavs'] = get_cachedata_mynavs();
$data['topnavs'] = get_cachedata_topnav();
$data['profilenode'] = get_cachedata_threadprofile();
require_once DISCUZ_ROOT.'./uc_client/client.php';
$ucapparray = uc_app_ls();
$data['allowsynlogin'] = isset($ucapparray[UC_APPID]['synlogin']) ? $ucapparray[UC_APPID]['synlogin'] : 1;
$appnamearray = array('UCHOME','XSPACE','DISCUZ','SUPESITE','SUPEV','ECSHOP','ECMALL','OTHER');
$data['ucapp'] = $data['ucappopen'] = array();
$data['uchomeurl'] = '';
$data['discuzurl'] = $_G['siteurl'];
$appsynlogins = 0;
foreach($ucapparray as $apparray) {
if($apparray['appid'] != UC_APPID) {
if(!empty($apparray['synlogin'])) {
$appsynlogins = 1;
}
if($data['uc']['navlist'][$apparray['appid']] && $data['uc']['navopen']) {
$data['ucapp'][$apparray['appid']]['name'] = $apparray['name'];
$data['ucapp'][$apparray['appid']]['url'] = $apparray['url'];
}
} else {
$data['discuzurl'] = $apparray['url'];
}
if(!empty($apparray['viewprourl'])) {
$data['ucapp'][$apparray['appid']]['viewprourl'] = $apparray['url'].$apparray['viewprourl'];
}
foreach($appnamearray as $name) {
if($apparray['type'] == $name && $apparray['appid'] != UC_APPID) {
$data['ucappopen'][$name] = 1;
if($name == 'UCHOME') {
$data['uchomeurl'] = $apparray['url'];
} elseif($name == 'XSPACE') {
$data['xspaceurl'] = $apparray['url'];
}
}
}
}
示例8: uc_show
function uc_show()
{
$this->dtp->Assign('uc_config_file', $this->config);
if (!defined('UC_APPID')) {
$this->dtp->LoadTemplate(DEDEADMIN . '/templets/api_ucenter_install.htm');
} else {
$uc_api_open = false;
$ucapparray = uc_app_ls();
foreach ($ucapparray as $apparray) {
if ($apparray['appid'] == UC_APPID) {
$uc_api_open = true;
break;
}
}
if (!$uc_api_open) {
ShowMsg("DedeCMS没找到正确的uc配置!", -1);
exit;
}
list($dbname, $dbtablepre) = explode('.', str_replace('`', '', UC_DBTABLEPRE));
$uc_setings = array('appid' => UC_APPID, 'ucapi' => UC_API, 'connect' => UC_CONNECT, 'dbhost' => UC_DBHOST, 'dbuser' => UC_DBUSER, 'dbpass' => UC_DBPW, 'dbname' => $dbname, 'dbtablepre' => $dbtablepre, 'ucip' => UC_IP, 'authkey' => UC_KEY);
$this->dtp->Assign('uc_setings', $uc_setings);
$this->dtp->LoadTemplate(DEDEADMIN . '/templets/api_ucenter_edit.htm');
}
$this->dtp->Display();
exit;
}
示例9: submenu_credit_exchange
function submenu_credit_exchange()
{
echo '<div class=wrap>';
echo '<h2>' . __('Credit Exchange', 'ucenter') . '</h2>';
global $current_user;
wp_get_current_user();
list($uid, $_, $_) = uc_get_user($current_user->user_login);
$credit = intval(get_usermeta($current_user->ID, 'ucenter_credit'));
if (empty($credit)) {
$credit = 0;
}
echo __('Current Credits : ', 'ucenter') . $credit . ' ' . $this->integration_settings['ucenter_credit_unit'] . '<br />';
echo '<br />';
$apps = uc_app_ls();
$ratio_array = array();
foreach ($this->integration_settings['ucenter_credit_exchange_setting'] as $appid => $appsettings) {
if ($appid == UC_APPID) {
foreach ($appsettings as $appsetting) {
foreach ($apps as $app) {
if ($app['appid'] == $appsetting['appiddesc']) {
echo '<form action="" method="post">';
printf(__('Exchange %s <input type="text" name="amount" size=5 value="0"> %s to %s %s with ratio %s', 'ucenter'), $this->integration_settings['ucenter_credit_name'], $this->integration_settings['ucenter_credit_unit'], $app['name'], $appsetting['title'], $appsetting['ratio']);
echo "<input type='hidden' name='to' value='{$appsetting['creditdesc']}'>";
echo "<input type='hidden' name='toappid' value='{$appsetting['appiddesc']}'>";
echo '<input type="submit"><br />';
echo '</form>';
$ratio_array[implode(',', array($appsetting['creditdesc'], $appsetting['appiddesc']))] = $appsetting['ratio'];
}
}
}
}
}
if (!empty($_POST['to']) && !empty($_POST['toappid'])) {
if (intval($_POST['amount']) >= 0 && intval($_POST['amount']) <= $credit) {
$ratio = $ratio_array[implode(',', array($_POST['to'], $_POST['toappid']))];
if (uc_credit_exchange_request($uid, 0, $_POST['to'], $_POST['toappid'], $_POST['amount'] / $ratio)) {
$credit -= $_POST['amount'];
update_usermeta($current_user->ID, 'ucenter_credit', $credit);
_e('Exchange Success!', 'ucenter');
}
} else {
_e('Invalid Credit Amount!', 'ucenter');
}
}
echo '</div>';
}
示例10: getcachearray
//.........这里部分代码省略.........
$subnavs = "<ul class=\"popupmenu_popup headermenu_popup\" id=\"" . $id . "_menu\" style=\"display: none\">";
while ($subnav = $db->fetch_array($subquery)) {
$subnavs .= "<li><a href=\"{$subnav['url']}\" hidefocus=\"true\" " . ($subnav['title'] ? "title=\"{$subnav['title']}\" " : '') . ($subnav['target'] == 1 ? "target=\"_blank\" " : '') . parsehighlight($subnav['highlight']) . ">{$subnav['name']}</a></li>";
}
$subnavs .= '</ul>';
$data['subnavs'][] = $subnavs;
$data['navs'][$nav['id']]['nav'] = "<li class=\"menu_" . $nav['id'] . "\" id=\"{$id}\" onmouseover=\"showMenu(this.id)\"><a href=\"{$nav['url']}\" hidefocus=\"true\" " . ($nav['title'] ? "title=\"{$nav['title']}\" " : '') . ($nav['target'] == 1 ? "target=\"_blank\" " : '') . " class=\"dropmenu\"{$nav['style']}>{$nav['name']}</a></li>";
} else {
if ($nav['id'] == '3') {
$data['navs'][$nav['id']]['nav'] = !empty($data['plugins']['jsmenu']) ? "<li class=\"menu_3\" id=\"plugin\" onmouseover=\"showMenu(this.id)\"><a href=\"javascript:;\" hidefocus=\"true\" " . ($nav['title'] ? "title=\"{$nav['title']}\" " : '') . ($nav['target'] == 1 ? "target=\"_blank\" " : '') . "class=\"dropmenu\"{$nav['style']}>{$nav['name']}</a></li>" : '';
} elseif ($nav['id'] == '5') {
$data['navs'][$nav['id']]['nav'] = "<li class=\"menu_5\"><a href=\"misc.php?action=nav\" hidefocus=\"true\" " . ($nav['title'] ? "title=\"{$nav['title']}\" " : '') . "onclick=\"floatwin('open_nav', this.href, 600, 410);return false;\"{$nav['style']}>{$nav['name']}</a></li>";
} else {
if ($nav['id'] == '1') {
$nav['url'] = $GLOBALS['indexname'];
}
list($mnid) = explode('.', basename($nav['url']));
$purl = parse_url($nav['url']);
$getvars = array();
if ($purl['query']) {
parse_str($purl['query'], $getvars);
$mnidnew = $mnid . '_' . $mngsid;
$data['navmngs'][$mnid][] = array($getvars, $mnidnew);
$mnid = $mnidnew;
$mngsid++;
}
$data['navmns'][] = $mnid;
$data['navs'][$nav['id']]['nav'] = "<li class=\"menu_" . $nav['id'] . "\"><a href=\"{$nav['url']}\" hidefocus=\"true\" " . ($nav['title'] ? "title=\"{$nav['title']}\" " : '') . ($nav['target'] == 1 ? "target=\"_blank\" " : '') . "id=\"mn_{$mnid}\"{$nav['style']}>{$nav['name']}</a></li>";
}
}
$data['navs'][$nav['id']]['level'] = $nav['level'];
}
require_once DISCUZ_ROOT . './uc_client/client.php';
$ucapparray = uc_app_ls();
$data['allowsynlogin'] = isset($ucapparray[UC_APPID]['synlogin']) ? $ucapparray[UC_APPID]['synlogin'] : 1;
$appnamearray = array('UCHOME', 'XSPACE', 'DISCUZ', 'SUPESITE', 'SUPEV', 'ECSHOP', 'ECMALL');
$data['ucapp'] = $data['ucappopen'] = array();
$data['uchomeurl'] = '';
$appsynlogins = 0;
foreach ($ucapparray as $apparray) {
if ($apparray['appid'] != UC_APPID) {
if (!empty($apparray['synlogin'])) {
$appsynlogins = 1;
}
if ($data['uc']['navlist'][$apparray['appid']] && $data['uc']['navopen']) {
$data['ucapp'][$apparray['appid']]['name'] = $apparray['name'];
$data['ucapp'][$apparray['appid']]['url'] = $apparray['url'];
}
}
$data['ucapp'][$apparray['appid']]['viewprourl'] = $apparray['url'] . $apparray['viewprourl'];
foreach ($appnamearray as $name) {
if ($apparray['type'] == $name && $apparray['appid'] != UC_APPID) {
$data['ucappopen'][$name] = 1;
if ($name == 'UCHOME') {
$data['uchomeurl'] = $apparray['url'];
} elseif ($name == 'XSPACE') {
$data['xspaceurl'] = $apparray['url'];
}
}
}
}
$data['allowsynlogin'] = $data['allowsynlogin'] && $appsynlogins ? 1 : 0;
$data['homeshow'] = $data['uchomeurl'] && $data['uchome']['homeshow'] ? $data['uchome']['homeshow'] : '0';
/*
if($data['uchomeurl']) {
$data['homeshow']['avatar'] = $data['uc']['homeshow'] & 1 ? 1 : 0;
示例11: app_cache
function app_cache()
{
global $_SGLOBAL;
$relatedtag = unserialize(data_get('relatedtag'));
$default_open = 0;
if (empty($relatedtag)) {
//UCȡӦ
$relatedtag = array();
include_once S_ROOT . './uc_client/client.php';
$relatedtag['data'] = uc_app_ls();
$default_open = 1;
}
$_SGLOBAL['app'] = array();
foreach ($relatedtag['data'] as $appid => $data) {
if ($default_open) {
$data['open'] = 1;
}
if ($appid == UC_APPID) {
//ǰӦ
$data['open'] = 0;
}
$_SGLOBAL['app'][$appid] = array('name' => $data['name'], 'url' => $data['url'], 'type' => $data['type'], 'open' => $data['open'], 'icon' => $data['type'] == 'OTHER' ? 'default' : strtolower($data['type']));
}
cache_write('app', "_SGLOBAL['app']", $_SGLOBAL['app']);
}
示例12: initUcenter
protected function initUcenter()
{
// 获取UCenter的应用列表
$filename = SITE_PATH . '/api/uc_client/uc_sync.php';
if (file_exists($filename)) {
require_once $filename;
if (UC_SYNC) {
unset($_ENV['app']);
global $ts;
$ts['ucenter']['app'] = uc_app_ls();
$ts['ucenter']['current_appid'] = UC_APPID;
}
}
}
示例13: define
<?php
define('IN_MYOP', TRUE);
error_reporting(0);
// 初始化session
session_start();
//系统配置
$_SITE_CONFIG = array();
//获取UCenter的应用列表
$filename = SITE_PATH . '/api/uc_client/uc_sync.php';
if (file_exists($filename)) {
require_once $filename;
if (UC_SYNC) {
$_SITE_CONFIG['ucenter']['app'] = uc_app_ls();
$_SITE_CONFIG['ucenter']['current_appid'] = UC_APPID;
}
}
require_once './api/define.php';
require_once './api/function.php';
require_once './function.php';
//所有URL的后面都不带“/”
define('SITE_PATH', SITE_ROOT);
define('MYOP_URL', getmyopurl());
define('UC_URL', MYOP_URL);
define('SITE_URL', substr(MYOP_URL, 0, -(strlen(APPS_DIR_NAME) + strlen(MYOP_DIR_NAME) + 2)));
define('PUBLIC_URL', SITE_URL . '/public');
//系统配置
refreshConfig();
//公共模版
define('THEME_URL', PUBLIC_URL . '/themes/' . $_SITE_CONFIG['site_theme']);
//MYOP模版
示例14: getcachearray
function getcachearray($cachename, $script = '')
{
global $db, $timestamp, $tablepre, $timeoffset, $maxbdays, $charset;
$cols = '*';
$conditions = '';
switch ($cachename) {
case 'settings':
$table = 'set';
$conditions = "";
break;
case 'ipbanned':
$db->query("DELETE FROM {$tablepre}banned WHERE expiration<'{$timestamp}'");
$table = 'banned';
$cols = 'ip1, ip2, ip3, ip4, expiration';
break;
}
$data = array();
if (empty($table) || empty($cols)) {
return '';
}
$query = $db->query("SELECT {$cols} FROM {$tablepre}{$table} {$conditions}");
switch ($cachename) {
case 'settings':
while ($setting = $db->fetch_array($query)) {
if ($setting['type'] == 'number') {
$setting['value'] = $setting['value'];
} elseif ($setting['type'] == 'array') {
$setting['value'] = unserialize($setting['value']);
} else {
$setting['value'] = $setting['value'];
}
$GLOBALS[$setting['variable']] = $data[$setting['variable']] = $setting['value'];
}
$outextcreditsrcs = $outextcredits = array();
foreach ((array) $data['outextcredits'] as $value) {
$outextcreditsrcs[$value['creditsrc']] = $value['creditsrc'];
$key = $value['appiddesc'] . '|' . $value['creditdesc'];
if (!isset($outextcredits[$key])) {
$outextcredits[$key] = array('title' => $value['title'], 'unit' => $value['unit']);
}
$outextcredits[$key]['ratiosrc'][$value['creditsrc']] = $value['ratiosrc'];
$outextcredits[$key]['ratiodesc'][$value['creditsrc']] = $value['ratiodesc'];
$outextcredits[$key]['creditsrc'][$value['creditsrc']] = $value['ratio'];
}
$data['outextcredits'] = $outextcredits;
$exchcredits = array();
$allowexchangein = $allowexchangeout = FALSE;
foreach ((array) $data['extcredits'] as $id => $credit) {
$data['extcredits'][$id]['img'] = $credit['img'] ? '<img style="vertical-align:middle" src="' . $credit['img'] . '" />' : '';
if (!empty($credit['ratio'])) {
$exchcredits[$id] = $credit;
$credit['allowexchangein'] && ($allowexchangein = TRUE);
$credit['allowexchangeout'] && ($allowexchangeout = TRUE);
}
$data['creditnotice'] && ($data['creditnames'][] = str_replace("'", "\\'", htmlspecialchars($id . '|' . $credit['title'] . '|' . $credit['unit'])));
}
$data['creditnames'] = $data['creditnotice'] ? implode(',', $data['creditnames']) : '';
$creditstranssi = explode(',', $data['creditstrans']);
$data['creditstrans'] = $creditstranssi[0];
unset($creditstranssi[0]);
$data['creditstransextra'] = $creditstranssi;
for ($i = 1; $i < 5; $i++) {
$data['creditstransextra'][$i] = !$data['creditstransextra'][$i] ? $data['creditstrans'] : $data['creditstransextra'][$i];
}
$data['exchangestatus'] = $allowexchangein && $allowexchangeout;
$data['transferstatus'] = isset($data['extcredits'][$data['creditstrans']]);
require_once CYASK_ROOT . './uc_client/client.php';
$ucapparray = uc_app_ls();
$data['allowsynlogin'] = isset($ucapparray[UC_APPID]['synlogin']) ? $ucapparray[UC_APPID]['synlogin'] : 1;
$appnamearray = array('UCHOME', 'XSPACE', 'DISCUZ', 'SUPESITE', 'SUPEV', 'ECSHOP', 'ECMALL', 'CYASK');
$data['ucapp'] = $data['ucappopen'] = array();
$data['uchomeurl'] = '';
$appsynlogins = 0;
foreach ($ucapparray as $apparray) {
if ($apparray['appid'] != UC_APPID) {
if (!empty($apparray['synlogin'])) {
$appsynlogins = 1;
}
if ($data['uc']['navlist'][$apparray['appid']] && $data['uc']['navopen']) {
$data['ucapp'][$apparray['appid']]['name'] = $apparray['name'];
$data['ucapp'][$apparray['appid']]['url'] = $apparray['url'];
}
}
$data['ucapp'][$apparray['appid']]['viewprourl'] = $apparray['url'] . $apparray['viewprourl'];
foreach ($appnamearray as $name) {
if ($apparray['type'] == $name && $apparray['appid'] != UC_APPID) {
$data['ucappopen'][$name] = 1;
if ($name == 'UCHOME') {
$data['uchomeurl'] = $apparray['url'];
} elseif ($name == 'XSPACE') {
$data['xspaceurl'] = $apparray['url'];
}
}
}
}
include language('runtime');
$dlang['date'] = explode(',', $dlang['date']);
$data['dlang'] = $dlang;
break;
case 'ipbanned':
//.........这里部分代码省略.........
示例15: checkapps
function checkapps()
{
@(include FANWE_ROOT . 'uc_client/data/cache/apps.php');
if (count($_CACHE['apps']) == 0) {
$appls = uc_app_ls();
$cachefile = FANWE_ROOT . 'uc_client/data/cache/apps.php';
$fp = fopen($cachefile, 'w');
$s = "<?php\r\n";
$s .= '$_CACHE[\'apps\'] = ' . var_export($appls, TRUE) . ";\r\n";
fwrite($fp, $s);
fclose($fp);
}
}