本文整理汇总了PHP中pwCache::getData方法的典型用法代码示例。如果您正苦于以下问题:PHP pwCache::getData方法的具体用法?PHP pwCache::getData怎么用?PHP pwCache::getData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pwCache
的用法示例。
在下文中一共展示了pwCache::getData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例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;
}
示例4: includefile
function includefile($file)
{
list($windVersion) = explode(',', WIND_VERSION);
if ($windVersion && $windVersion < '8.5') {
include_once $file;
} else {
pwCache::getData($file);
}
}
示例5: 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;
}
示例6: _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;
}
示例7: 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;
}
}
示例8: _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";
}
示例9: 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);
}
示例10: PW_Appclient
function PW_Appclient()
{
global $db_siteappkey, $timestamp, $db_sitehash, $db_siteownerid, $db_siteid, $db_charset, $db_appifopen, $pwServer, $db_server_url, $db_bbsname;
$db_bbsurl = S::escapeChar("http://" . $pwServer['HTTP_HOST'] . substr($pwServer['PHP_SELF'], 0, strrpos($pwServer['PHP_SELF'], '/')));
if (!file_exists(D_P . "data/bbscache/forum_appinfo.php")) {
require_once R_P . "admin/cache.php";
updatecache_f();
}
//* @include_once pwCache::getPath(D_P . "data/bbscache/forum_appinfo.php");
extract(pwCache::getData(D_P . "data/bbscache/forum_appinfo.php", false));
$this->_db = $GLOBALS['db'];
$this->appkey = $db_siteappkey;
$this->timestamp = $timestamp;
$this->siteid = $db_siteid;
$this->siteownerid = $db_siteownerid;
$this->sitehash = $db_sitehash;
$this->bbsname = $db_bbsname;
$this->bbsurl = $db_bbsurl;
$this->charset = $db_charset;
$this->appifopen = $db_appifopen;
$this->server_url = $db_server_url;
$this->appinfo = $forum_appinfo;
}
示例11: wap_footer
function wap_footer()
{
global $wind_version, $db_obstart, $windid, $db_charset, $db_wapcharset, $chs, $timestamp, $db_online, $db, $db_wapregist, $rg_allowregister, $online_info, $db_bbsurl;
Update_ol();
$userinbbs = $guestinbbs = 0;
if (empty($db_online)) {
extract(pwCache::getData(D_P . 'data/bbscache/olcache.php', false));
} else {
if (count($online_info = explode("\t", GetCookie('online_info'))) == 3 && $timestamp - $online_info[0] < 60) {
list(, $userinbbs, $guestinbbs) = $online_info;
} else {
$onlineService = L::loadClass('OnlineService', 'user');
$userinbbs = $onlineService->countOnlineUser();
$guestinbbs = $onlineService->countOnlineGuest();
Cookie('online_info', $timestamp . "\t" . $userinbbs . "\t" . $guestinbbs);
}
}
$usertotal = $guestinbbs + $userinbbs;
$ft_time = get_date($timestamp);
require_once PrintWAP('footer');
$output = ob_get_contents();
ob_end_clean();
$db_obstart && function_exists('ob_gzhandler') ? ob_start('ob_gzhandler') : ob_start();
if ($db_charset != 'utf8') {
L::loadClass('Chinese', 'utility/lang', false);
$chs = new Chinese();
$output = $chs->Convert($output, $db_charset, $db_wapcharset ? 'UTF8' : 'UNICODE');
}
$output = str_replace(array('<!--<!---->', '<!---->-->', '<!---->', "\r\n\r\n"), '', $output);
$wap_view = S::getGP('wap_view');
if ($wap_view) {
$output = preg_replace('/<a[^>]*>([^<]+|.*?)?<\\/a>/i', "\\1", $output);
}
echo $output;
ob_flush();
exit;
}
示例12: updatecache_i_i
function updatecache_i_i($fid, $aidin = null)
{
global $db, $db_windpost, $timestamp, $forum;
require_once R_P . 'require/bbscode.php';
//* include pwCache::getPath(D_P.'data/bbscache/forum_cache.php');
extract(pwCache::getData(D_P . 'data/bbscache/forum_cache.php', false));
$sql_where = empty($aidin) ? "fid=" . S::sqlEscape($fid) : "aid IN ({$aidin})";
$F_ffid = false;
$aid = $aidcache = 0;
$aids = '';
$query = $db->query("SELECT aid,startdate,enddate,content FROM pw_announce WHERE {$sql_where} AND ifopen='1' AND (enddate=0 OR enddate>=" . S::sqlEscape($timestamp) . ") ORDER BY vieworder,startdate DESC");
while ($rt = $db->fetch_array($query)) {
if ($rt['startdate'] <= $timestamp) {
if ($F_ffid) {
continue;
} elseif (!$rt['enddate']) {
$F_ffid = true;
}
}
if (!$aid && $rt['startdate'] <= $timestamp && (!$rt['enddate'] || $rt['enddate'] >= $timestamp)) {
$aid = $rt['aid'];
if ($rt['content'] != convert($rt['content'], $db_windpost, 2)) {
//* $db->update("UPDATE pw_announce SET ifconvert='1' WHERE aid=".S::sqlEscape($aid));
pwQuery::update('pw_announce', 'aid=:aid', array($aid), array('ifconvert' => 1));
}
} else {
$aids .= ",{$rt['aid']}";
}
}
if ($aids) {
$aids = substr($aids, 1);
$aidcache = $timestamp;
}
//* $db->update("UPDATE pw_forumdata SET ".S::sqlSingle(array('aid'=>$aid,'aids'=>$aids,'aidcache'=>$aidcache))."WHERE fid=".S::sqlEscape($fid));
pwQuery::update('pw_forumdata', 'fid=:fid', array($fid), array('aid' => $aid, 'aids' => $aids, 'aidcache' => $aidcache));
}
示例13: insertHelp
/** 添加帮助信息
*
* @param int $hup 上级项目
* @param array/string $title 标题(数组时,则为批量添加),例如array('忘记密码','选择风格') 或者 '忘记密码'
* @param array/string $content 内容,如果是数组的话,必须和标题键值一一对应,例如array('忘记密码','选择风格')或者 '忘记密码'
* @param string $url 外链URL
* @param int $hid 编辑或者删除时的帮助项ID
* @param string $action 选择操作add,edit,delete
* @return int/string 例如:25 或者 25,26
*/
function insertHelp($hup = 0, $title, $content, $url = '', $hid = 0, $action = 'add')
{
//* @include_once pwCache::getPath(D_P.'data/bbscache/help_cache.php');
extract(pwCache::getData(D_P . 'data/bbscache/help_cache.php', false));
require_once R_P . 'admin/cache.php';
$hup = (int) $hup;
$hid = (int) $hid;
if ($action == 'add' || $action == 'edit') {
$url = trim($url);
if (is_array($title) && $action == 'add') {
$titledb = $title;
unset($title);
$hids = '';
foreach ($titledb as $key => $title) {
$title = trim($title);
if (empty($title)) {
return new ApiResponse('help_title_empty');
}
$desc = '';
if (is_array($content)) {
$desc = $content[$key];
} else {
$desc = $content;
}
$desc = str_replace(array("\t", "\r", ' '), array(' ', '', ' '), trim($desc));
$lv = 0;
$fathers = '';
foreach ($_HELP as $key => $value) {
if (strtolower($title) == strtolower($value['title'])) {
return new ApiResponse('help_title_exist');
}
if ($key == $hup) {
$lv = $value['lv'] + 1;
$fathers = ($value['fathers'] ? "{$value['fathers']}," : '') . $hup;
!$value['ifchild'] && $this->db->update("UPDATE pw_help SET ifchild='1' WHERE hid=" . S::sqlEscape($hup));
}
}
$this->db->update("INSERT INTO pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'lv' => $lv, 'fathers' => $fathers, 'title' => $title, 'url' => $url, 'content' => $desc, 'vieworder' => 0)));
$hid = $this->db->insert_id();
$hids .= $hids ? ',' . $hid : $hid;
}
} elseif (!is_array($title)) {
$title = trim($title);
if (empty($title)) {
return new ApiResponse('help_title_empty');
}
$content = str_replace(array("\t", "\r", ' '), array(' ', '', ' '), trim($content));
$lv = 0;
$fathers = '';
if ($action == 'add') {
foreach ($_HELP as $key => $value) {
if (strtolower($title) == strtolower($value['title'])) {
return new ApiResponse('help_title_exist');
}
if ($key == $hup) {
$lv = $value['lv'] + 1;
$fathers = ($value['fathers'] ? "{$value['fathers']}," : '') . $hup;
!$value['ifchild'] && $this->db->update("UPDATE pw_help SET ifchild='1' WHERE hid=" . S::sqlEscape($hup));
}
}
$this->db->update("INSERT INTO pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'lv' => $lv, 'fathers' => $fathers, 'title' => $title, 'url' => $url, 'content' => $content, 'vieworder' => 0)));
$hids = $this->db->insert_id();
} elseif ($action == 'edit') {
if ($hid == $hup) {
return new ApiResponse('hup_error1');
}
if ($_HELP[$hid]['hup'] != $hup && strpos(",{$_HELP[$hup][fathers]},", ",{$hid},") !== false) {
return new ApiResponse('hup_error2');
}
foreach ($_HELP as $key => $value) {
if ($key != $hid && strtolower($title) == strtolower($value['title'])) {
return new ApiResponse('help_title_exist');
}
}
$this->db->update("UPDATE pw_help" . " SET " . S::sqlSingle(array('hup' => $hup, 'title' => $title, 'url' => $url, 'content' => $content, 'vieworder' => 0)) . " WHERE hid=" . S::sqlEscape($hid));
$hids = $hid;
}
} else {
return new ApiResponse('help_title_error');
}
updatecache_help();
return new ApiResponse($hids);
} elseif ($action == 'delete' && $hid > 0) {
$this->db->update("DELETE FROM pw_help WHERE hid=" . S::sqlEscape($hid) . 'OR hup=' . S::sqlEscape($hid));
updatecache_help();
return new ApiResponse(true);
} else {
return new ApiResponse('API_OPERATE_ERROR');
}
}
示例14: array
Perf::gatherInfo('changeMembersWithUserIds', array('uid' => $_uids));
}
//* 清除pw_members缓存 end
if ($havesend < $count) {
$step++;
$j_url = "{$basename}&action={$action}&step={$step}&sendto=" . implode(',', $sendto) . "&by={$by}&count={$count}";
adminmsg("sendmsg_step", EncodeUrl($j_url), 1);
}
adminmsg('operate_success');
} elseif ($by == 2) {
$cache_file = D_P . "data/bbscache/" . substr(md5($admin_pwd), 10, 10) . ".txt";
if (!$step) {
pwCache::setData($cache_file, $atc_content);
} else {
//* $atc_content = readover($cache_file);
$atc_content = pwCache::getData($cache_file, false, true);
}
if (empty($subject) || empty($atc_content)) {
adminmsg('sendmsg_empty');
}
$subject = S::escapeChar($subject);
$sendmessage = S::escapeChar($atc_content);
$percount = 100;
empty($step) && ($step = 1);
//
$userService = L::loadClass('UserService', 'user');
/* @var $userService PW_UserService */
$db_onlinetime = $db_onlinetime > 0 ? $db_onlinetime : 1200;
$onlineuser = array();
if ($onlineusers = $userService->findOnlineUsers($timestamp - $db_onlinetime)) {
foreach ($onlineusers as $user) {
示例15: getFileCache
function getFileCache()
{
if (!$this->_cache) {
return array();
}
//* @include_once pwCache::getPath ( S::escapePath ( $this->getCacheFileName () ), true );
extract(pwCache::getData(S::escapePath($this->getCacheFileName()), false));
$jobLists = $jobLists ? $jobLists : $GLOBALS['jobLists'];
if ($jobLists) {
return $jobLists;
}
return $this->setFileCache();
}