本文整理汇总了PHP中pwCache类的典型用法代码示例。如果您正苦于以下问题:PHP pwCache类的具体用法?PHP pwCache怎么用?PHP pwCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了pwCache类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getTopicCache
function getTopicCache()
{
//* @include pwCache::getPath(D_P.'data/bbscache/topic_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
$this->topiccatedb =& $topiccatedb;
$this->topicmodeldb =& $topicmodeldb;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:posttopic.class.php
示例2: aliasStatic
function aliasStatic($alias)
{
$file = S::escapePath(AREA_PATH . $alias . '/index.html');
$output = cookTemplate();
pwCache::writeover($file, $output);
ob_clean();
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:7,代码来源:core.php
示例3: getCardData
/**
* 组装小名片数据
*
* @param int $uid 用户ID
* @param int $winduid 当前用户id
* @param bool $username 用户名
* @return array
*/
function getCardData($uid, $winduid, $username)
{
extract(pwCache::getData(R_P . "data/bbscache/level.php", false));
if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') {
return array('username' => '游客', 'memtitle' => $ltitle[2]);
}
$userService = L::loadClass('UserService', 'user');
if ($uid) {
$userInfo = $userService->get($uid, true, true);
} elseif ($username) {
$userInfo = $userService->getByUserName($username, true, true);
}
if (!S::isArray($userInfo)) {
return array();
}
require_once R_P . 'require/showimg.php';
list($faceimage) = showfacedesign($userInfo['icon'], 1, 's');
$userInfo['groupid'] == '-1' && ($userInfo['groupid'] = $userInfo['memberid']);
!array_key_exists($userInfo['groupid'], (array) $lpic) && ($userInfo['groupid'] = 8);
$online = checkOnline($userInfo['thisvisit']);
$onlineRead = $online ? getOnlineViewing($userInfo['uid'], $userInfo['username']) : array();
$user = array('mine' => $userInfo['uid'] == $winduid || !$winduid ? 0 : 1, 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'icon' => $faceimage, 'memtitle' => $ltitle[$userInfo['groupid']], 'genderClass' => $userInfo['gender'], 'viewTid' => isset($onlineRead['tid']) && $onlineRead['tid'] ? $onlineRead['tid'] : '', 'viewFid' => isset($onlineRead['fid']) && $onlineRead['fid'] ? $onlineRead['fid'] : '', 'online' => $online ? 1 : 0);
$user['medals'] = getMedalsByUid($userInfo['uid']);
// 勋章
$memberTagsService = L::loadClass('memberTagsService', 'user');
$user['memberTags'] = $memberTagsService->makeClassTags($memberTagsService->getMemberTagsByUid($userInfo['uid']));
//标签
$attentionSerivce = L::loadClass('Attention', 'friend');
/* @var $attentionSerivce PW_Attention */
$user['attention'] = $attentionSerivce->isFollow($winduid, $userInfo['uid']) ? 1 : 0;
//关注
return $user;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:41,代码来源:smallcard.php
示例4: creatguestcache
function creatguestcache($output)
{
global $fid, $tid, $timestamp, $db_guestdir, $page;
switch (SCR) {
case 'thread':
if (!is_dir(D_P . "{$db_guestdir}/T_{$fid}")) {
@mkdir(D_P . "{$db_guestdir}/T_{$fid}");
@chmod(D_P . "{$db_guestdir}/T_{$fid}", 0777);
}
pwCache::writeover(D_P . "{$db_guestdir}/T_{$fid}/{$fid}_{$page}.html", $output);
break;
case 'read':
$tmp = 'R_' . intval($tid / 500);
if (!is_dir(D_P . "{$db_guestdir}/{$tmp}")) {
@mkdir(D_P . "{$db_guestdir}/{$tmp}");
@chmod(D_P . "{$db_guestdir}/{$tmp}", 0777);
}
pwCache::writeover(D_P . "{$db_guestdir}/{$tmp}/{$tid}_{$page}.html", $output);
break;
case 'index':
$indexpath = getguestIndexpath();
pwCache::writeover($indexpath, $output);
break;
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:25,代码来源:guestfunc.php
示例5: setActCache
function setActCache()
{
//* include pwCache::getPath(D_P.'data/bbscache/activity_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/activity_config.php', false));
$this->activitycatedb = $activity_catedb;
$this->activitymodeldb = $activity_modeldb;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:activity.class.php
示例6: getByTid
function getByTid($tid)
{
global $attachpath, $db_windpost, $foruminfo, $fid, $forumset, $pwforum, $db_hits_store;
$tid = intval($tid);
if ($tid <= 0) {
return $this->buildResponse(THREAD_INVALID_PARAMS);
}
$GLOBALS['tid'] = $tid;
$threadData = $this->_getThread($tid, true);
if (empty($threadData)) {
return $this->buildResponse(0);
}
$fid = $threadData['fid'];
$user = $this->getCurrentUser();
$user->initRight();
$this->getCustomizedCommonService()->getReadRight($user);
$GLOBALS['tpc_buy'] = $threadData['buy'];
$GLOBALS['tpc_author'] = $threadData['author'];
L::loadClass('forum', 'forum', false);
$pwforum = new PwForum($fid);
$foruminfo = $pwforum->foruminfo;
$forumset = $pwforum->forumset;
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion == '8.0') {
$threadData = $this->_isMyFavoredForEarly($tid, $threadData);
} else {
$threadData = $this->_isMyFavoredForAfter($tid, $threadData);
}
$udb = $this->_getUDb($threadData);
$bandb = $pwforum->forumBan($udb);
isset($bandb[$threadData['uid']]) && ($threadData['groupid'] = 6);
$_attachList = array();
if ($threadData['aid']) {
$query = $GLOBALS['db']->query('SELECT * FROM pw_attachs WHERE tid=' . pwEscape($tid) . ' AND pid=0');
while ($rt = $GLOBALS['db']->fetch_array($query)) {
$_attachList[] = $rt;
}
}
$imgsInContent = $this->getCustomizedCommonService()->parseImgInContent($threadData);
$threadData['content'] = $this->getCustomizedCommonService()->parsePostContent($threadData);
$threadData['content'] = $this->getCustomizedCommonService()->clearHtmlTag($threadData['content'], '<br>');
$threadData['content'] = $this->getCustomizedCommonService()->parseEmotionInContent($threadData['content']);
$threadData['attachlist'] = $this->getCustomizedCommonService()->getAttachWithThumblist($_attachList);
$threadData['attachlist'] = array_merge($imgsInContent, $threadData['attachlist']);
$this->getCustomizedCommonService()->clearAttachSign($_attachList, &$threadData['content']);
$threadData['icon'] = $this->getCustomizedCommonService()->getUserIcon($threadData['icon']);
if ($db_hits_store == 0) {
$GLOBALS['db']->update('UPDATE pw_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
} elseif ($db_hits_store == 1) {
$GLOBALS['db']->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
} elseif ($db_hits_store == 2) {
if (class_exists("pwCache") && method_exists("pwCache", "writeover")) {
pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
} else {
writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
}
}
return $this->buildResponse(0, $threadData);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:59,代码来源:ver.customized.thread.php
示例7: writeCache
/**
* @param $tag
* @param $result
* @return unknown_type
*/
function writeCache($result)
{
$cache = '';
$cache .= "<?php\r\n";
$cache .= "\$_result=" . var_export($result, TRUE) . ";\r\n";
$cache .= "?>\r\n";
pwCache::setData($this->filepath, $cache);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:13,代码来源:datanalysecache.class.php
示例8: _initFileModuleIds
function _initFileModuleIds($file, $name)
{
@chmod($file, 0777);
$fileString = pwCache::readover($file);
$moduleConfigService = L::loadClass('moduleconfigservice', 'area');
$newString = $moduleConfigService->cookModuleIds($fileString, $name);
pwCache::writeover($file, $newString);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:8,代码来源:channelservice.class.php
示例9: includefile
function includefile($file)
{
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
include_once $file;
} else {
pwCache::getData($file);
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:ver.customized.functions.php
示例10: writeLog
/**
* 记录错误信息
*/
function writeLog($method = 'rb+')
{
$logFile = D_P . 'data/error.log';
if (!$this->_logs) {
return false;
}
$temp = pw_var_export($this->_logs);
pwCache::writeover($logFile, $temp, 'rb+');
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:12,代码来源:errors.class.php
示例11: dblog
function dblog($msg)
{
$msg = str_replace(array("\n", "\r", "<"), array('', '', '<'), $msg);
if (file_exists(D_P . 'data/bbscache/dblog.php')) {
pwCache::writeover(D_P . 'data/bbscache/dblog.php', "{$msg}\n", 'ab');
} else {
pwCache::writeover(D_P . 'data/bbscache/dblog.php', "<?php die;?>\n{$msg}\n");
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:db_mysqli_error.php
示例12: getGroupsCreditset
function getGroupsCreditset($type)
{
global $o_groups_creditset;
//* include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/o_config.php', false));
$creditset = array_filter($creditset[$type], "group_filter");
$creditset = is_array($creditset) ? $creditset : array();
return $creditset;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:9,代码来源:group.class.php
示例13: _cookData
/**
*
* 获取查询结果
* @param unknown $query 查询结果
* @return array
*/
function _cookData($query)
{
//* include pwCache::getPath(D_P . 'data/bbscache/topic_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/topic_config.php', false));
while ($row = $this->_db->fetch_array($query)) {
$row['modelname'] = $topicmodeldb[$row['modelid']]['name'];
$posts[] = $row;
}
return $posts;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:16,代码来源:classifydb.class.php
示例14: loadWords
function loadWords()
{
if (!is_array($this->fbwords)) {
//* include pwCache::getPath(D_P."data/bbscache/wordsfb.php");
extract(pwCache::getData(D_P . "data/bbscache/wordsfb.php", false));
$this->fbwords = (array) $wordsfb;
$this->replace = (array) $replace;
$this->alarm = (array) $alarm;
}
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:10,代码来源:filterutil.class.php
示例15: updatecache_bg
function updatecache_bg()
{
global $db;
$query = $db->query("SELECT * FROM pw_hack WHERE hk_name LIKE 'bg_%'");
$blogdb = "<?php\r\n";
while (@extract($db->fetch_array($query))) {
$hk_name = key_cv($hk_name);
$blogdb .= "\${$hk_name}=" . pw_var_export($hk_value) . ";\r\n";
}
$blogdb .= "\n?>";
pwCache::setData(D_P . 'data/bbscache/bg_config.php', $blogdb);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:12,代码来源:admin.php
示例16: getLayoutString
/**
* 获取布局html
*
* @param string $layout 布局名
* @return string
*/
function getLayoutString($layout)
{
if (!isset($this->layoutStrings[$layout])) {
if ($layout && file_exists(S::escapePath(A_P . 'data/layout/' . $layout . '/layout.htm'))) {
//* $this->layoutStrings[$layout] = readover(S::escapePath(A_P.'data/layout/'.$layout.'/layout.htm'));
$this->layoutStrings[$layout] = pwCache::readover(S::escapePath(A_P . 'data/layout/' . $layout . '/layout.htm'));
} else {
$this->layoutStrings[$layout] = '';
}
}
return $this->layoutStrings[$layout];
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:18,代码来源:parsestopictpl.class.php
示例17: generate
function generate($rss_path)
{
/*modded for YunLiao 1.2: start*/
/* original -- start*/
/*
$all = $this->rssHeader;
$all .= $this->rssChannel;
$all .= $this->rssImage;
$all .= $this->rssItem;
$all .= "</channel></rss>";
*/
/* original -- end*/
$all = $this->getRss();
/*modded for YunLiao 1.2: end*/
pwCache::setData($rss_path, $all);
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:16,代码来源:rss.class.php
示例18: _getCreditAdd
function _getCreditAdd($type)
{
if ($type != 'credit') {
return '';
}
//* include pwCache::getPath(D_P . 'data/bbscache/o_config.php');
extract(pwCache::getData(D_P . 'data/bbscache/o_config.php', false));
$tnum = $o_groups_upgrade['tnum'] ? $o_groups_upgrade['tnum'] : 0;
$pnum = $o_groups_upgrade['pnum'] ? $o_groups_upgrade['pnum'] : 0;
$members = $o_groups_upgrade['members'] ? $o_groups_upgrade['members'] : 0;
$albumnum = $o_groups_upgrade['albumnum'] ? $o_groups_upgrade['albumnum'] : 0;
$photonum = $o_groups_upgrade['photonum'] ? $o_groups_upgrade['photonum'] : 0;
$writenum = $o_groups_upgrade['writenum'] ? $o_groups_upgrade['writenum'] : 0;
$activitynum = $o_groups_upgrade['activitynum'] ? $o_groups_upgrade['activitynum'] : 0;
return ",(tnum*{$tnum}+pnum*{$pnum}-tnum*{$pnum}+members*{$members}+albumnum*{$albumnum}+photonum*{$photonum}+writenum*{$writenum}+activitynum*{$activitynum}) AS credit";
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:16,代码来源:colonysdb.class.php
示例19: sendMessage
/**
* 以某个用户的身份给另一个用户发送短消息
* @param int $userId 发送者uid
* @param string $receiver 接受者用户名
* @param string $subject 标题
* @param string $content 内容
* return bool
*/
function sendMessage($userId, $receiver, $subject, $content)
{
global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM;
$userService = $this->_getUserService();
$winddb = $userService->get($userId, true, true);
$winduid = $winddb['uid'];
$groupid = $winddb['groupid'];
$windid = $winddb['username'];
$groupid == '-1' && ($groupid = $winddb['memberid']);
if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
} else {
extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
}
M::sendMessage($userId, array($receiver), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => S::escapeChar(stripslashes($subject)), 'content' => S::escapeChar(stripslashes($content))));
return new ApiResponse(true);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:25,代码来源:class_Msg.php
示例20: PwSpace
function PwSpace($uid)
{
global $db, $winduid, $db_phopen, $db_dopen, $db_groups_open;
$this->_db =& $db;
$this->uid = $uid;
$userService = L::loadClass('UserService', 'user');
if ($winduid && $winduid == $uid) {
$this->info = $GLOBALS['winddb'];
$this->info['isMe'] = 1;
} elseif ($userdb = $userService->get($this->uid, true, true, true)) {
//$userdb['rvrc'] /= 10;
$this->info = $userdb;
}
if ($this->info) {
if (perf::checkMemcache()) {
$_cacheService = Perf::gatherCache('pw_space');
$space = $_cacheService->getSpaceByUid($this->uid);
} else {
$space = $this->_db->get_one("SELECT * FROM pw_space WHERE uid=" . S::sqlEscape($this->uid));
}
if ($space) {
$this->info = array_merge($this->info, $space);
if ($this->info['banner']) {
list($this->info['banner_s']) = geturl($this->info['banner'], 'lf');
}
} else {
$this->default = true;
}
$spaceGroupid = $this->info['groupid'] == -1 ? $this->info['memberid'] : $this->info['groupid'];
include pwCache::getPath(D_P . "data/groupdb/group_{$spaceGroupid}.php");
$this->info['generalRight'] = $_G;
!$this->info['name'] && ($this->info['name'] = $this->info['username'] . '的个人主页');
!$this->info['skin'] && ($this->info['skin'] = 'default85');
$GLOBALS['uskin'] =& $this->info['skin'];
}
if ($db_dopen) {
$this->models[] = 'diary';
}
if ($db_phopen) {
$this->models[] = 'photos';
}
if ($db_groups_open) {
$this->models[] = 'colony';
}
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:45,代码来源:space.class.php
注:本文中的pwCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论