本文整理汇总了PHP中Cloud类的典型用法代码示例。如果您正苦于以下问题:PHP Cloud类的具体用法?PHP Cloud怎么用?PHP Cloud使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Cloud类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getGlobalPostString
private function getGlobalPostString($action)
{
global $_G;
$setting = $_G['setting'];
$mySiteId = empty($_G['setting']['my_siteid']) ? '' : $_G['setting']['my_siteid'];
$siteName = $_G['setting']['bbname'];
$siteUrl = $_G['siteurl'];
$ucUrl = rtrim($_G['setting']['ucenterurl'], '/') . '/';
$siteCharset = $_G['charset'];
$siteTimeZone = $_G['setting']['timeoffset'];
$mySiteKey = empty($_G['setting']['my_sitekey']) ? '' : $_G['setting']['my_sitekey'];
$siteKey = C::t('common_setting')->fetch('siteuniqueid');
$siteLanguage = $_G['config']['output']['language'];
$siteVersion = $_G['setting']['version'];
$utilService = Cloud::loadClass('Service_Util');
$myVersion = $utilService->getApiVersion();
$productType = 'DISCUZX';
$siteRealNameEnable = '';
$siteRealAvatarEnable = '';
$siteEnableApp = intval($setting['my_app_status']);
$key = $mySiteId . $siteName . $siteUrl . $ucUrl . $siteCharset . $siteTimeZone . $siteRealNameEnable . $mySiteKey . $siteKey;
$key = md5($key);
$siteTimeZone = urlencode($siteTimeZone);
$siteName = urlencode($siteName);
$register = false;
return sprintf('action=%s&productType=%s&key=%s&mySiteId=%d&siteName=%s&siteUrl=%s&ucUrl=%s&siteCharset=%s&siteTimeZone=%s&siteEnableRealName=%s&siteEnableRealAvatar=%s&siteKey=%s&siteLanguage=%s&siteVersion=%s&myVersion=%s&siteEnableApp=%s&from=cloud', $action, $productType, $key, $mySiteId, $siteName, $siteUrl, $ucUrl, $siteCharset, $siteTimeZone, $siteRealNameEnable, $siteRealAvatarEnable, $siteKey, $siteLanguage, $siteVersion, $myVersion, $siteEnableApp);
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:Manyou.php
示例2: checkCloud
function checkCloud() {
global $_G;
loadcache('mobileoem_data');
if(!$_G['cache']['mobileoem_data'] || (TIMESTAMP - $_G['cache']['mobileoem_data']['timestamp']) > 86400) {
try {
$cloud = Cloud::loadClass('Service_Client_OEM');
$clouddata = $cloud->checkApp();
} catch (Exception $e) {
$clouddata = array('errCode' => 1);
}
if(!$clouddata['errCode']) {
if(!$clouddata['isDone']) {
$_G['cache']['mobileoem_data'] = array();
} else {
$_G['cache']['mobileoem_data'] = $clouddata;
}
}
$_G['cache']['mobileoem_data']['timestamp'] = TIMESTAMP;
savecache('mobileoem_data', $_G['cache']['mobileoem_data']);
}
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($useragent, 'iphone') !== false || strpos($useragent, 'ios') !== false) {
$this->platform = '&platform=ios';
} elseif(strpos($useragent, 'android') !== false) {
$this->platform = '&platform=android';
} elseif(strpos($useragent, 'windows phone') !== false) {
$this->platform = '&platform=windowsphone';
} else {
$this->platform = '';
}
}
开发者ID:hutao1004,项目名称:yintt,代码行数:33,代码来源:mobileoem.class.php
示例3: show
public function show()
{
global $_G;
if ($_G['inajax']) {
return '';
}
$clientVersion = '2';
$util = Cloud::loadclass('Service_Util');
include_once DISCUZ_ROOT . '/source/discuz_version.php';
$release = DISCUZ_RELEASE;
$fix = DISCUZ_FIXBUG;
$cloudApi = $util->getApiVersion();
$isfounder = $util->isfounder($_G['member']);
$sId = $_G['setting']['my_siteid'];
$version = $_G['setting']['version'];
$ts = TIMESTAMP;
$sig = '';
$adminId = $_G['adminid'];
$openId = $_G['member']['conopenid'];
$uid = $_G['uid'];
$groupId = $_G['groupid'];
if ($sId) {
$params = array('s_id' => $sId, 'product_version' => $version, 'product_release' => '', 'fix_bug' => '', 'is_founder' => $isfounder, 's_url' => $_G['siteurl'], 'admin_id' => $adminId, 'open_id' => $openId, 'uid' => $uid, 'group_id' => $groupId, 'last_send_time' => $_COOKIE['dctips']);
ksort($params);
$str = $util->httpBuildQuery($params, '', '&');
$sig = md5(sprintf('%s|%s|%s', $str, $_G['setting']['my_sitekey'], $ts));
}
$jsCode = <<<EOF
\t\t\t<div id="discuz_tips" style="display:none;"></div>
EOF;
echo $jsCode;
}
开发者ID:JX3PVE-Team,项目名称:JX3PVE2015,代码行数:32,代码来源:DiscuzTips.php
示例4: onCommonGetNavs
public function onCommonGetNavs($type = '')
{
Cloud::loadFile('Service_SearchHelper');
$navtype = null;
switch ($type) {
case 'footer':
$navtype = 1;
break;
case 'space':
$navtype = 2;
break;
case 'my':
$navtype = 3;
break;
case 'header':
$navtype = 0;
break;
}
$navs = $subNavs = array();
foreach (C::t('common_nav')->fetch_all_by_navtype($navtype) as $nav) {
if (!$nav['parentid']) {
$navs[$nav['id']] = Cloud_Service_SearchHelper::convertNav($nav);
} else {
$subNavs[$nav['id']] = $nav;
}
}
foreach ($subNavs as $k => $v) {
$navs[$v['parentid']]['navs'][$v['id']] = Cloud_Service_SearchHelper::convertNav($v);
}
return $navs;
}
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:Common.php
示例5: plugin_qqgroup
public function plugin_qqgroup()
{
global $_G;
self::$siteId = $_G['setting']['my_siteid'];
self::$siteKey = $_G['setting']['my_sitekey'];
self::$util = Cloud::loadClass('Service_Util');
}
开发者ID:tianyunchong,项目名称:php,代码行数:7,代码来源:qqgroup.class.php
示例6: generateSiteSignUrl
public function generateSiteSignUrl($params = array())
{
global $_G;
$utilService = Cloud::loadClass('Service_Util');
@(include_once DISCUZ_ROOT . './source/discuz_version.php');
if (!isset($_G['member']['conopenid'])) {
$member_connect = $_G['uid'] ? C::t('#qqconnect#common_member_connect')->fetch($_G['uid']) : array();
$_G['member'] = array_merge($_G['member'], $member_connect);
}
$ts = TIMESTAMP;
$sKey = $_G['setting']['my_sitekey'];
$params['clientIp'] = $_G['clientip'];
$params['uid'] = $_G['uid'];
$params['openId'] = getuserprofile('conopenid');
$params['sId'] = $_G['setting']['siteuniqueid'];
$params['appId'] = $_G['setting']['connectappid'];
$params['ver'] = CLOUDCAPTCHA_VER;
$params['dzVersion'] = DISCUZ_VERSION;
$params['sId'] = $_G['setting']['my_siteid'];
ksort($params);
$str = $utilService->httpBuildQuery($params, '', '&');
$sig = md5(sprintf('%s|%s|%s', $str, $sKey, $ts));
$params['ts'] = $ts;
$params['sig'] = $sig;
$params = $utilService->httpBuildQuery($params, '', '&');
return $params;
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:27,代码来源:class_captcha.php
示例7: getCloudRelateThreads
function getCloudRelateThreads($api = 'tao', $keyword, $page, $tpp = 20, $excludeForumIds = '', $cache = false)
{
global $_G;
$threadlist = array();
$searchHelper = Cloud::loadClass('Service_SearchHelper');
if ($api != 'tao') {
$cloudData = $searchHelper->getRelatedThreads($excludeForumIds);
} else {
$cloudData = $searchHelper->getRelatedThreadsTao($keyword, $page, $tpp, $disAd, $of, $ot, $cache, $excludeForumIds);
}
if ($cloudData['result']['data']) {
foreach ($cloudData['result']['ad']['content'] as $sAdv) {
$threadlist[] = array('icon' => (string) $cloudData['result']['ad']['icon']) + $sAdv;
}
foreach ($cloudData['result']['data'] as $sPost) {
$threadlist[] = $sPost;
}
} else {
return null;
}
loadcache('forums');
foreach ($threadlist as $curtid => &$curvalue) {
$curvalue['pForumName'] = $_G['cache']['forums'][$curvalue['pForumId']]['name'];
$curvalue['istoday'] = strtotime($curvalue['pPosted']) > $todaytime ? 1 : 0;
$curvalue['dateline'] = $curvalue['pPosted'];
}
return array($threadlist, $cloudData);
}
开发者ID:softhui,项目名称:discuz,代码行数:28,代码来源:forumdisplay.inc.php
示例8: __construct
public function __construct()
{
global $_G;
$this->_util = Cloud::loadClass('Service_Util');
$this->_client = Cloud::loadClass('Service_Client_Disk');
$this->_baseUrl = $_G['siteurl'] . 'apptest.php?';
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:7,代码来源:Disk.php
示例9: update
static function update()
{
if (file_exists('data.txt')) {
self::$instance = unserialize(file_get_contents("data.txt"));
} else {
self::$instance = new Cloud();
}
return self::$instance;
}
开发者ID:kingsj,项目名称:core,代码行数:9,代码来源:Cloud.php
示例10: _output
public function _output($aid, $sha, $filename)
{
include_once libfile('function/attachment');
$storageService = Cloud::loadClass('Service_Storage');
$qqdlUrl = $storageService->makeQQdlUrl($sha, $filename);
$aidencode = packaids(array('aid' => $aid));
include template('xf_storage:link');
return $return;
}
开发者ID:lemonstory,项目名称:bbs,代码行数:9,代码来源:xf_storage.class.php
示例11: onCloudOpenCloud
public function onCloudOpenCloud()
{
$appService = Cloud::loadClass('Service_App');
$utilService = Cloud::loadClass('Service_Util');
$this->_openCloud();
$res = array();
$res['status'] = true;
$res['siteInfo'] = $this->_getBaseInfo();
return $res;
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:10,代码来源:Cloud.php
示例12: bindQQ
public function bindQQ($appIdentifier, $fromUrl, $extra = array())
{
$this->reloadId();
$utilService = Cloud::loadClass('Service_Util');
$fromUrl .= $extra ? '&' . $utilService->httpBuildQuery(array('extra' => $extra), '', '&') : '';
$params = array('s_id' => $this->_sId, 'app_identifier' => $appIdentifier, 's_site_uid' => $this->siteUid, 'from_url' => $fromUrl, 'ADTAG' => 'CP.CLOUD.BIND.INDEX');
ksort($params);
$str = $utilService->httpBuildQuery($params, '', '&');
$params['sig'] = md5(sprintf('%s|%s|%s', $str, $this->_sKey, $this->_ts));
$params['ts'] = $this->_ts;
return 'http://cp.discuz.qq.com/addon_bind/index?' . $utilService->httpBuildQuery($params, '', '&');
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:12,代码来源:Cloud.php
示例13: mobileplugin_cloudsearch
public function mobileplugin_cloudsearch()
{
global $_G, $searchparams;
$cloudAppService = Cloud::loadClass('Service_App');
$this->allow = $cloudAppService->getCloudAppStatus('search');
if ($this->allow) {
include_once template('cloudsearch:module');
if (!$searchparams) {
$searchHelper = Cloud::loadClass('Cloud_Service_SearchHelper');
$searchparams = $searchHelper->makeSearchSignUrl();
}
}
}
开发者ID:softhui,项目名称:discuz,代码行数:13,代码来源:search_wap.class.php
示例14: __construct
public function __construct()
{
$this->model = model('Base')->model;
$this->cloud = Cloud::getInstance();
// 定义当前请求的系统常量
define('NOW_TIME', $_SERVER['REQUEST_TIME']);
define('REQUEST_METHOD', $_SERVER['REQUEST_METHOD']);
define('IS_GET', REQUEST_METHOD == 'GET' ? true : false);
define('IS_POST', REQUEST_METHOD == 'POST' ? true : false);
define('IS_PUT', REQUEST_METHOD == 'PUT' ? true : false);
define('IS_DELETE', REQUEST_METHOD == 'DELETE' ? true : false);
define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
}
开发者ID:m7720647,项目名称:demo,代码行数:13,代码来源:Controller.class.php
示例15: getInstance
public static function getInstance()
{
global $_G;
if (!self::$_instance instanceof self) {
self::$_instance = new self();
$cloudAppService = Cloud::loadClass('Service_App');
self::$_appStatus = $cloudAppService->getCloudAppStatus('storage');
self::$_siteId = $_G['setting']['my_siteid'];
self::$_encKey = $_G['setting']['xf_storage_enc_key'];
self::$_util = Cloud::loadClass('Service_Util');
}
return self::$_instance;
}
开发者ID:softhui,项目名称:discuz,代码行数:13,代码来源:Storage.php
示例16: sendpm
public static function sendpm($toid, $subject, $message, $fromid = '', $replypmid = 0, $isusername = 0, $type = 0)
{
global $_G;
if ($fromid === '') {
$fromid = $_G['uid'];
}
$author = '';
if ($fromid) {
if ($fromid == $_G['uid']) {
$sendpmmaxnum = $_G['group']['allowsendpmmaxnum'];
$author = $_G['username'];
} else {
$user = getuserbyuid($fromid);
$author = $user['username'];
loadcache('usergroup_' . $user['groupid']);
$sendpmmaxnum = $_G['cache']['usergroup_' . $user['groupid']]['allowsendpmmaxnum'];
}
$currentnum = C::t('common_member_action_log')->count_day_hours(getuseraction('pmid'), $fromid);
if ($sendpmmaxnum && $currentnum >= $sendpmmaxnum) {
return -16;
}
}
loaducenter();
$return = uc_pm_send($fromid, $toid, addslashes($subject), addslashes($message), 1, $replypmid, $isusername, $type);
if ($return > 0 && $fromid) {
if ($_G['setting']['cloud_status']) {
$msgService = Cloud::loadClass('Cloud_Service_Client_Message');
if (is_numeric($toid)) {
$tospace = getuserbyuid($toid);
if ($tospace['conisbind']) {
$msgService->add($toid, $fromid, $author, $_G['timestamp']);
}
} else {
$senduids = array();
foreach (C::t('common_member')->fetch_all_by_username(explode(',', $toid)) as $touser) {
if ($touser['conisbind']) {
$senduids[$touser['uid']] = $touser['uid'];
}
}
if ($senduids) {
$msgService->add($senduids, $fromid, $author, $_G['timestamp']);
}
}
}
foreach (explode(',', $fromid) as $v) {
useractionlog($fromid, 'pmid');
}
}
return $return;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:50,代码来源:helper_pm.php
示例17: _getPMList
private function _getPMList($page, $pageSize)
{
$pmList = array('list' => array(), 'count' => 0);
global $_G;
// 在DISCUZ_ROOT/source/include/space/space_pm.php基础上二次开发
loaducenter();
$filter = 'privatepm';
$perpage = $pageSize;
$count = 0;
$list = array();
if ($filter == 'privatepm' || $filter == 'newpm') {
$result = uc_pm_list($_G['uid'], $page, $perpage, 'inbox', $filter, 200);
$count = $result['count'];
$list = $result['data'];
}
if ($_G['member']['newpm']) {
if ($newpm && $_G['setting']['cloud_status']) {
$msgService = Cloud::loadClass('Cloud_Service_Client_Message');
$msgService->setMsgFlag($_G['uid'], $_G['timestamp']);
}
C::t('common_member')->update($_G['uid'], array('newpm' => 0));
uc_pm_ignore($_G['uid']);
}
$tempPMList = array();
foreach ($list as $pm) {
// 目前只要两人对话的列表
if ($pm['members'] > 2 || $pm['pmtype'] != 1) {
$count--;
continue;
}
$tempPm = array();
$tempPm['plid'] = (int) $pm['plid'];
$tempPm['pmid'] = (int) $pm['pmid'];
$tempPm['lastUserId'] = (int) $pm['lastauthorid'];
$tempPm['lastUserName'] = (string) $pm['lastauthor'];
$tempPm['lastSummary'] = (string) $pm['lastsummary'];
$tempPm['lastDateline'] = $pm['lastdateline'] . '000';
$tempPm['toUserId'] = (int) $pm['touid'];
$tempPm['toUserAvatar'] = UserUtils::getUserAvatar($pm['touid']);
$tempPm['toUserName'] = (string) $pm['tousername'];
$tempPm['toUserIsBlack'] = UserUtils::isBlacklist($_G['uid'], $pm['touid']) ? 1 : 0;
$tempPm['isNew'] = $pm['new'] ? 1 : 0;
$tempPMList[] = $tempPm;
}
$pmList['list'] = $tempPMList;
$pmList['count'] = $count;
return $pmList;
}
开发者ID:caidongyun,项目名称:CS,代码行数:48,代码来源:PMSessionListAction.php
示例18: show
public function show()
{
global $_G;
$clientVersion = '2';
$util = Cloud::loadclass('Service_Util');
include_once DISCUZ_ROOT . '/source/discuz_version.php';
$release = DISCUZ_RELEASE;
$fix = DISCUZ_FIXBUG;
$cloudApi = $util->getApiVersion();
$isfounder = $util->isfounder($_G['member']);
$sId = $_G['setting']['my_siteid'];
$version = $_G['setting']['version'];
$ts = TIMESTAMP;
$sig = '';
$adminId = $_G['adminid'];
$openId = $_G['member']['conopenid'];
$uid = $_G['uid'];
$groupId = $_G['groupid'];
if ($sId) {
$params = array('s_id' => $sId, 'product_version' => $version, 'product_release' => $release, 'fix_bug' => $fix, 'is_founder' => $isfounder, 's_url' => $_G['siteurl'], 'admin_id' => $adminId, 'open_id' => $openId, 'uid' => $uid, 'group_id' => $groupId, 'last_send_time' => $_COOKIE['dctips']);
ksort($params);
$str = $util->httpBuildQuery($params, '', '&');
$sig = md5(sprintf('%s|%s|%s', $str, $_G['setting']['my_sitekey'], $ts));
}
$jsCode = <<<EOF
\t\t\t<div id="discuz_tips" style="display:none;"></div>
\t\t\t<script type="text/javascript">
\t\t\t\tvar discuzSId = '{$sId}';
\t\t\t\tvar discuzVersion = '{$version}';
\t\t\t\tvar discuzRelease = '{$release}';
\t\t\t\tvar discuzApi = '{$cloudApi}';
\t\t\t\tvar discuzIsFounder = '{$isfounder}';
\t\t\t\tvar discuzFixbug = '{$fix}';
\t\t\t\tvar discuzAdminId = '{$adminId}';
\t\t\t\tvar discuzOpenId = '{$openId}';
\t\t\t\tvar discuzUid = '{$uid}';
\t\t\t\tvar discuzGroupId = '{$groupId}';
\t\t\t\tvar ts = '{$ts}';
\t\t\t\tvar sig = '{$sig}';
\t\t\t\tvar discuzTipsCVersion = '{$clientVersion}';
\t\t\t</script>
\t\t\t<script src="http://discuz.gtimg.cn/cloud/scripts/discuz_tips.js?v=1" type="text/javascript" charset="UTF-8"></script>
EOF;
echo $jsCode;
}
开发者ID:softhui,项目名称:discuz,代码行数:45,代码来源:DiscuzTips.php
示例19: getDownloadUrl
public function getDownloadUrl()
{
if (!$this->_sId) {
return '';
}
global $_G;
loadcache('mobileoem_data');
if (!$_G['cache']['mobileoem_data']['downloadPath']) {
return '';
}
if ($_G['uid']) {
$connectUser = C::t('#qqconnect#common_member_connect')->fetch($_G['uid']);
$openid = $connectUser['conopenid'];
} else {
$openid = '';
}
$utilService = Cloud::loadClass('Service_Util');
return $_G['cache']['mobileoem_data']['downloadPath'] . '?' . $utilService->generateSiteSignUrl(array('sId' => $this->_sId, 'uId' => $_G['uid'], 'openId' => $openid));
}
开发者ID:lemonstory,项目名称:bbs,代码行数:19,代码来源:OEM.php
示例20: sync
public function sync()
{
global $_G;
$setting = $_G['setting'];
$my_url = 'http://api.manyou.com/uchome.php';
$mySiteId = empty($_G['setting']['my_siteid']) ? '' : $_G['setting']['my_siteid'];
$siteName = $_G['setting']['bbname'];
$siteUrl = $_G['siteurl'];
$ucUrl = rtrim($_G['setting']['ucenterurl'], '/') . '/';
$siteCharset = $_G['charset'];
$siteTimeZone = $_G['setting']['timeoffset'];
$mySiteKey = empty($_G['setting']['my_sitekey']) ? '' : $_G['setting']['my_sitekey'];
$siteKey = C::t('common_setting')->fetch('siteuniqueid');
$siteLanguage = $_G['config']['output']['language'];
$siteVersion = $_G['setting']['version'];
$utilService = Cloud::loadClass('Service_Util');
$myVersion = $utilService->getApiVersion();
$productType = 'DISCUZX';
$siteRealNameEnable = '';
$siteRealAvatarEnable = '';
$siteEnableApp = intval($setting['my_app_status']);
$key = $mySiteId . $siteName . $siteUrl . $ucUrl . $siteCharset . $siteTimeZone . $siteRealNameEnable . $mySiteKey . $siteKey;
$key = md5($key);
$siteTimeZone = urlencode($siteTimeZone);
$siteName = urlencode($siteName);
$register = false;
$postString = sprintf('action=%s&productType=%s&key=%s&mySiteId=%d&siteName=%s&siteUrl=%s&ucUrl=%s&siteCharset=%s&siteTimeZone=%s&siteEnableRealName=%s&siteEnableRealAvatar=%s&siteKey=%s&siteLanguage=%s&siteVersion=%s&myVersion=%s&siteEnableApp=%s&from=cloud', 'siteRefresh', $productType, $key, $mySiteId, $siteName, $siteUrl, $ucUrl, $siteCharset, $siteTimeZone, $siteRealNameEnable, $siteRealAvatarEnable, $siteKey, $siteLanguage, $siteVersion, $myVersion, $siteEnableApp);
$response = @dfsockopen($my_url, 0, $postString, '', false, $setting['my_ip']);
$res = unserialize($response);
if (!$response) {
throw new Cloud_Service_Client_RestfulException('Empty Response', 111);
} elseif (!$res) {
throw new Cloud_Service_Client_RestfulException('Error Response: ' . $response, 110);
}
if ($res['errCode']) {
throw new Cloud_Service_Client_RestfulException($res['errMessage'], $res['errCode']);
}
return true;
}
开发者ID:dalinhuang,项目名称:healthshop,代码行数:39,代码来源:Manyou.php
注:本文中的Cloud类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论