当前位置: 首页>>代码示例>>PHP>>正文


PHP cache_build_modules函数代码示例

本文整理汇总了PHP中cache_build_modules函数的典型用法代码示例。如果您正苦于以下问题:PHP cache_build_modules函数的具体用法?PHP cache_build_modules怎么用?PHP cache_build_modules使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cache_build_modules函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: cache_build_account

/**
 * 更新用户下的公众号缓存
 * @param int $uid
 */
function cache_build_account($uid = 0) {
	global $_W;
	isetcookie('wechatloaded', '0');
	$uid = empty($uid) ? $_W['uid'] : $uid;
	cache_build_modules();
	cache_load('modules');
	$modules = $_W['modules'];

	$wechats = pdo_fetchall("SELECT * FROM " . tablename('wechats') . " WHERE uid = '{$uid}' ORDER BY `weid` DESC", array(), 'weid');
	$sysmodules = pdo_fetchall("SELECT mid, name FROM ".tablename('modules')." WHERE issystem = '1'", array(), 'mid');
	foreach ($sysmodules as $mid => &$module) {
		$module['issystem'] = 1;
		$module['displayorder'] = -1;
		$module['enabled'] = 1;
	}
	if(!empty($wechats)) {
		$founder = explode(',', $_W['config']['setting']['founder']);
		foreach ($wechats as $index => $row) {
			if (in_array($uid, $founder)) {
				$membermodules = pdo_fetchall("SELECT mid, name FROM ".tablename('modules') . " ORDER BY issystem DESC, mid ASC", array(), 'mid');
				$modulelist  = array();
			} else {
				$membermodules = pdo_fetchall("SELECT b.mid, b.name FROM ".tablename('members_modules')." AS a LEFT JOIN ".tablename('modules')." AS b ON a.mid = b.mid WHERE a.uid = :uid AND b.name <> '' ORDER BY issystem DESC, mid ASC", array(':uid' => $uid), 'mid');
				$modulelist = $sysmodules;
			}
			$mymodules = pdo_fetchall("SELECT mid, enabled, displayorder FROM ".tablename('wechats_modules')." WHERE weid = '{$row['weid']}' AND mid IN (".implode(",", array_keys($membermodules)).") ORDER BY enabled DESC, displayorder ASC, mid ASC", array(), 'mid');
			//拼接模块
			if (!empty($mymodules)) {
				foreach ($mymodules as $mid => $row){
					if (empty($row['enabled'])) {
						unset($membermodules[$mid]);
						continue;
					}
					if (!empty($membermodules[$mid])) {
						$modulelist[$mid] = $membermodules[$mid];
						$modulelist[$mid]['enabled'] = $row['enabled'];
						$modulelist[$mid]['displayorder'] = $row['displayorder'];
						unset($membermodules[$mid]);
					}
				}
			}
			
			if (!empty($membermodules)) {
				$modulelist = array_merge($modulelist, $membermodules);
			} elseif (in_array($uid, $founder)) {
				$modulelist  = $membermodules;
			}
			unset($row);
			foreach ($modulelist as $mid => &$row) {
				if (!isset($row['enabled'])) {
					$row['enabled'] = 1;
					$row['displayorder'] = 127;
				}
			}
			unset($row);
			$wechats[$index]['modules'] = $modulelist;
		}
	}
	cache_write('account:'.$uid, $wechats);
}
开发者ID:royalwang,项目名称:saivi,代码行数:64,代码来源:cache.mod.php

示例2: cloud_download

    $ret = cloud_download($post['path'], $post['type']);
    if (!is_error($ret)) {
        exit('success');
    }
    exit;
}
if ($step == 'scripts' && $_W['ispost']) {
    $post = $_GPC['__input'];
    $fname = $post['fname'];
    $entry = IA_ROOT . '/data/update/' . $fname;
    if (is_file($entry) && preg_match('/^update\\(\\d{12}\\-\\d{12}\\)\\.php$/', $fname)) {
        $evalret = (include $entry);
        if (!empty($evalret)) {
            cache_build_users_struct();
            cache_build_setting();
            cache_build_modules();
            @unlink($entry);
            exit('success');
        }
    }
    exit('failed');
}
if (!empty($_GPC['m'])) {
    $m = $_GPC['m'];
    $type = 'module';
    $is_upgrade = intval($_GPC['is_upgrade']);
    $packet = cloud_m_build($_GPC['m']);
} elseif (!empty($_GPC['t'])) {
    $m = $_GPC['t'];
    $type = 'theme';
    $is_upgrade = intval($_GPC['is_upgrade']);
开发者ID:eduNeusoft,项目名称:weixin,代码行数:31,代码来源:process.ctrl.php


注:本文中的cache_build_modules函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。