本文整理汇总了PHP中Cloud::loadClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Cloud::loadClass方法的具体用法?PHP Cloud::loadClass怎么用?PHP Cloud::loadClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cloud
的用法示例。
在下文中一共展示了Cloud::loadClass方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例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 = '';
}
}
示例3: 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);
}
示例4: __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?';
}
示例5: 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;
}
示例6: 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');
}
示例7: _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;
}
示例8: 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;
}
示例9: 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, '', '&');
}
示例10: 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();
}
}
}
示例11: 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;
}
示例12: 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;
}
示例13: _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;
}
示例14: 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));
}
示例15: 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;
}