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); }
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 = ''; } }
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); }
public function __construct() { global $_G; $this->_util = Cloud::loadClass('Service_Util'); $this->_client = Cloud::loadClass('Service_Client_Disk'); $this->_baseUrl = $_G['siteurl'] . 'apptest.php?'; }
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; }
public function plugin_qqgroup() { global $_G; self::$siteId = $_G['setting']['my_siteid']; self::$siteKey = $_G['setting']['my_sitekey']; self::$util = Cloud::loadClass('Service_Util'); }
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; }
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; }
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, '', '&'); }
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(); } } }
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; }
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; }
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; }
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)); }
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; }
function _viewthread_fastpost_btn_extra_output() { if (!$this->allow) { return; } global $_G; $allowconnectt = $this->_allowconnectt(); if ($GLOBALS['fastpost'] && $allowconnectt) { $connectService = Cloud::loadClass('Service_Connect'); $connectService->connectMergeMember(); if ($_G['member']['is_feed']) { return lang('plugin/qqconnect', 'connect_post_sync_method') . tpl_sync_method(false, $allowconnectt) . ' | '; } } }
function connectunbind($member) { global $_G; if (!$member['conopenid']) { return; } $_G['member'] = array_merge($_G['member'], $member); $connectService = Cloud::loadClass('Service_Connect'); $connectService->connectUserUnbind(); C::t('#qqconnect#connect_memberbindlog')->insert(array('uid' => $member['uid'], 'uin' => $member['conopenid'], 'type' => '2', 'dateline' => $_G['timestamp'])); C::t('common_member')->update($member['uid'], array('conisbind' => 0)); C::t('#qqconnect#common_member_connect')->delete($member['uid']); }
function tpl_cloudsearch_global_footer_mini() { global $_G; $utilService = Cloud::loadClass('Service_Util'); $params = array( 's_site_gid' => $_G['groupid'], 'response_type' => 'JSONP', ); $params = $utilService->generateSiteSignUrl($params, false, true); $signUrlParams = json_encode($params); $discuz_mini_js_url = 'http://discuz.gtimg.cn/search/scripts/discuz_mini.js'; $referer = htmlspecialchars($_SERVER['HTTP_REFERER']);?><?php $return = <<<EOF EOF; if(empty($_GET['inajax'])) { $return .= <<<EOF <script src="{$discuz_mini_js_url}" type="text/javascript"></script> <script type="text/javascript" charset="utf-8"> if (typeof DiscuzMini != 'undefined' && typeof DiscuzMini == 'object') { DiscuzMini.showMini('{$referer}', {$signUrlParams}); } </script> EOF; } $return .= <<<EOF EOF; ?><?php return $return;?><?php }
cpmsg("{$lang['counter_thread']}: " . cplang('counter_processing', array('current' => $current, 'next' => $next)), $nextlink, 'loading'); } else { cpmsg('counter_thread_succeed', 'action=counter', 'succeed'); } } elseif (submitcheck('movedthreadsubmit', 1)) { $nextlink = "action=counter¤t={$next}&pertask={$pertask}&movedthreadsubmit=yes"; $processed = 0; $tids = array(); $updateclosed = array(); foreach (C::t('forum_thread')->fetch_all_movedthread($current, $pertask) as $thread) { $processed = 1; if ($thread['isgroup'] && $thread['status'] == 3) { $updateclosed[] = $thread['tid']; } elseif ($thread['threadexists']) { $tids[] = $thread['tid']; $log_handler = Cloud::loadClass('Cloud_Service_SearchHelper'); $log_handler->myThreadLog('delete', array('tid' => $thread['tid'])); } } if ($tids) { C::t('forum_thread')->delete_by_tid($tids, true); } if ($updateclosed) { C::t('forum_thread')->update($updateclosed, array('closed' => '')); } if ($processed) { cpmsg(cplang('counter_moved_thread') . ': ' . cplang('counter_processing', array('current' => $current, 'next' => $next)), $nextlink, 'loading'); } else { cpmsg('counter_moved_thread_succeed', 'action=counter', 'succeed'); } } elseif (submitcheck('specialarrange', 1)) {
public function makeSearchSignUrl() { global $_G; $url = ''; $params = array(); $mySearchData = $_G['setting']['my_search_data']; $mySiteId = $_G['setting']['my_siteid']; $mySiteKey = $_G['setting']['my_sitekey']; $cloudAppService = Cloud::loadClass('Service_App'); if ($mySearchData['status'] && $cloudAppService->getCloudAppStatus('search') && $mySiteId) { $myExtGroupIds = array(); $_extGroupIds = explode("\t", $_G['member']['extgroupids']); foreach ($_extGroupIds as $v) { if ($v) { $myExtGroupIds[] = $v; } } $myExtGroupIdsStr = implode(',', $myExtGroupIds); $params = array('sId' => $mySiteId, 'ts' => time(), 'cuId' => $_G['uid'], 'cuName' => $_G['username'], 'gId' => intval($_G['groupid']), 'agId' => intval($_G['adminid']), 'egIds' => $myExtGroupIdsStr, 'fmSign' => ''); $groupIds = array($params['gId']); if ($params['agId']) { $groupIds[] = $params['agId']; } if ($myExtGroupIds) { $groupIds = array_merge($groupIds, $myExtGroupIds); } $groupIds = array_unique($groupIds); foreach ($groupIds as $v) { $key = 'ugSign' . $v; $params[$key] = ''; } $extraParams = array(); if (isset($_G['setting']['verify']['enabled']) && $_G['setting']['verify']['enabled']) { $verifyGroups = C::t('common_member_verify')->fetch($_G['uid']); $extraParams['ext_vgIds'] = 0; foreach ($verifyGroups as $k => $v) { if ($k != 'uid') { $position = dintval(substr($k, strlen('verify'))); $extraParams['ext_vgIds'] = setstatus($position, dintval($v), $extraParams['ext_vgIds']); } } } if ($_G['cookie']['ffids' . $_G['uid']]) { $ext_ffids = str_replace('D', ',', authcode($_G['cookie']['ffids' . $_G['uid']], 'DECODE')); $extraParams['ext_ffids'] = $ext_ffids; } if (!empty($extraParams)) { ksort($extraParams); $params = array_merge($params, $extraParams); } $params['sign'] = md5(implode('|', $params) . '|' . $mySiteKey); if ($cloudAppService->getCloudAppStatus('connect') && $_G['member']['conopenid']) { $connectService = Cloud::loadClass('Service_Connect'); $connectService->connectMergeMember(); $params['openid'] = $_G['member']['conopenid']; } $params['charset'] = $_G['charset']; if ($mySearchData['domain']) { $domain = $mySearchData['domain']; } else { $domain = 'search.discuz.qq.com'; } $url = 'http://' . $domain . '/f/discuz'; } return !empty($url) ? array('url' => $url, 'params' => $params) : array(); }
private function step_bindQQBack() { $stepurl = $_G['siteurl'] . ADMINSCRIPT . '?action=plugins&operation=enable&pluginid=' . $this->pluginid . '&formhash=' . FORMHASH . '&step=' . $this->_step('appOpenWithRegister'); if ($_GET['extra']) { $utilService = Cloud::loadClass('Service_Util'); $stepurl .= '&' . $utilService->httpBuildQuery(array('extra' => $_GET['extra']), '', '&'); } echo '<script type="text/javascript">if(window.opener) {window.opener.location.href=\'' . $stepurl . '\';};window.close();</script>'; exit; }
function banlog($username, $origgroupid, $newgroupid, $expiration, $reason, $status = 0) { global $_G, $_POST; $cloud_apps = dunserialize($_G['setting']['cloud_apps']); if (isset($_POST['bannew']) && $_POST['formhash'] && $cloud_apps['security']['status'] == 'normal') { $securityService = Cloud::loadClass('Service_Security'); if ($_POST['bannew']) { $securityService->logBannedMember($username, $reason); } else { $securityService->updateMemberRecover($username); } } writelog('banlog', dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['groupid']}\t{$_G['clientip']}\t{$username}\t{$origgroupid}\t{$newgroupid}\t{$expiration}\t{$reason}\t{$status}")); }
/** * 帖子列表页展示热门话题 */ public function forumdisplay_middle_output() { if (!$this->allow || !$this->allow_forum_recommend) { return; } global $_G, $searchparams; $result = ''; if ($_G['fid']) { $searchHelper = Cloud::loadClass('Service_SearchHelper'); //note 获取关键词,使用字符串索引 $recwords = $searchHelper->getRecWords(14, 'assoc', $_G['fid']); $srchotquery = ''; if (!empty($searchparams['params'])) { foreach ($searchparams['params'] as $key => $value) { $srchotquery .= '&' . $key . '=' . rawurlencode($value); } } $result = tpl_cloudsearch_index_top($recwords, $searchparams, $srchotquery, 'hotopic_fm'); } return $result; }
} if ($myExtGroupIds) { $groupIds = array_merge($groupIds, $myExtGroupIds); } $groupIds = array_unique($groupIds); $userGroups = $searchHelper->getUserGroupPermissions($groupIds); foreach ($groupIds as $k => $v) { $value = substr($userGroups[$v]['sign'], -4); if ($value) { $params['ugSign' . $v] = $value; } } $params['charset'] = $_G['charset']; if ($_G['member']['conopenid']) { $params['openid'] = $_G['member']['conopenid']; } $extra = array('q', 'fId', 'author', 'scope', 'source', 'module', 'isAdv'); foreach ($extra as $v) { if ($_GET[$v]) { $params[$v] = $_GET[$v]; } } $mySearchData = $_G['setting']['my_search_data']; if ($mySearchData['domain']) { $domain = $mySearchData['domain']; } else { $domain = 'search.discuz.qq.com'; } $utilService = Cloud::loadClass('Cloud_Service_Util'); $url = 'http://' . $domain . '/f/discuz?' . $utilService->generateSiteSignUrl($params, true, true); dheader('Location: ' . $url);
function cloud_referer_related() { global $_G; $my_search_data = $_G['setting']['my_search_data']; if (viewthread_is_search_referer() && $my_search_data['status']) { $appService = Cloud::loadClass('Service_App'); if ($appService->getCloudAppStatus('search')) { $_params = array('s_site_gid' => $_G['groupid'], 'response_type' => 'js', 'referer' => $_SERVER['HTTP_REFERER']); $utilService = Cloud::loadClass('Service_Util'); $signUrl = $utilService->generateSiteSignUrl($_params); $my_search_se_url = 'http://search.discuz.qq.com/api/site/se?' . $signUrl . ""; } } return $my_search_se_url; }
public function __construct() { self::$cloudAppService = Cloud::loadClass('Service_App'); self::$securityStatus = self::$cloudAppService->getCloudAppStatus('security'); self::$securityService = Cloud::loadClass('Service_Security'); }
} $html_content = $connectService->connectParseBbcode($post['message'], $post['fid'], $post['pid'], $post['htmlon'], $attach_images); $html_content = strip_tags(preg_replace('/( )+/', ' ', $html_content)); $url = $_G['siteurl'] . 'forum.php?mod=redirect&goto=findpost&ptid=' . $tid . '&pid=' . $pid; $_t_content = lang('plugin/qqconnect', 'connect_feed_iam'); $_t_content .= '#' . cutstr($_G['setting']['bbname'], 20, '') . '#'; $_t_content .= lang('plugin/qqconnect', 'connect_feed_published_post', array('subject' => cutstr($thread['subject'], 120))); $_t_content .= cutstr($html_content, 80); $_t_content .= ' ' . $url; $t_params = array('content' => $_t_content); if ($attach_images && is_array($attach_images)) { $attach_image = array_shift($attach_images); $t_params['pic'] = $attach_image['path']; $t_params['remote'] = $attach_image['remote']; } $connectOAuthClient = Cloud::loadClass('Service_Client_ConnectOAuth'); $weibo_succ = false; try { if ($t_params['pic']) { $method = 'connectAddPicT'; } else { $method = 'connectAddT'; } $response = $connectOAuthClient->{$method}($_G['member']['conopenid'], $_G['member']['conuin'], $_G['member']['conuinsecret'], $t_params); if ($response['ret'] == 0) { $weibo_succ = true; } } catch (Exception $e) { if ($e->getCode()) { $weiboErrorCode = $e->getCode(); }
public static function notification_add($username, $touid, $type, $note, $uid, $notevars = array(), $system = 0) { global $_G; if (!($tospace = getuserbyuid($touid))) { return false; } space_merge($tospace, 'field_home'); $filter = empty($tospace['privacy']['filter_note']) ? array() : array_keys($tospace['privacy']['filter_note']); if ($filter && (in_array($type . '|0', $filter) || in_array($type . '|' . $_G['uid'], $filter))) { return false; } $notevars['actor'] = "<a href=\"home.php?mod=space&uid={$_G['uid']}\">" . $username . "</a>"; if (!is_numeric($type)) { $vars = explode(':', $note); if (count($vars) == 2) { $notestring = lang('plugin/' . $vars[0], $vars[1], $notevars); } else { $notestring = lang('notification', $note, $notevars); } $frommyapp = false; } else { $frommyapp = true; $notestring = $note; } $oldnote = array(); if ($notevars['from_id'] && $notevars['from_idtype']) { $oldnote = C::t('home_notification')->fetch_by_fromid_uid($notevars['from_id'], $notevars['from_idtype'], $touid); } if (empty($oldnote['from_num'])) { $oldnote['from_num'] = 0; } $notevars['from_num'] = $notevars['from_num'] ? $notevars['from_num'] : 1; $setarr = array('uid' => $touid, 'type' => $type, 'new' => 1, 'authorid' => $uid, 'author' => $username, 'note' => $notestring, 'dateline' => $_G['timestamp'], 'from_id' => $notevars['from_id'], 'from_idtype' => $notevars['from_idtype'], 'from_num' => $oldnote['from_num'] + $notevars['from_num']); if ($system) { $setarr['authorid'] = 0; $setarr['author'] = ''; } $pkId = 0; if ($oldnote['id']) { C::t('home_notification')->update($oldnote['id'], $setarr); $pkId = $oldnote['id']; } else { $oldnote['new'] = 0; $pkId = C::t('home_notification')->insert($setarr, true); } $banType = array('task'); if ($_G['setting']['cloud_status'] && !in_array($type, $banType)) { $noticeService = Cloud::loadClass('Service_Client_Notification'); if ($oldnote['id']) { $noticeService->update($touid, $pkId, $setarr['from_num'], $setarr['dateline']); } else { $extra = $type == 'post' ? array('pId' => $notevars['pid']) : array(); $noticeService->add($touid, $pkId, $type, $setarr['authorid'], $setarr['author'], $setarr['from_id'], $setarr['from_idtype'], $setarr['note'], $setarr['from_num'], $setarr['dateline'], $extra); } } if (empty($oldnote['new'])) { C::t('common_member')->increase($touid, array('newprompt' => 1)); require_once libfile('function/mail'); $mail_subject = lang('notification', 'mail_to_user'); sendmail_touser($touid, $mail_subject, $notestring, $frommyapp ? 'myapp' : $type); } if (!$system && $_G['uid'] && $touid != $_G['uid']) { C::t('home_friend')->update_num_by_uid_fuid(1, $_G['uid'], $touid); } }
require_once libfile('function/delete'); $threadsdel = deletethread($threadlist); } cpmsg('recyclebin_succeed', 'action=recyclebin', 'succeed', array('threadsdel' => $threadsdel, 'threadsundel' => $threadsundel)); } } elseif ($operation == 'search') { if (!submitcheck('rbsubmit')) { $inforum = $_GET['inforum']; $authors = $_GET['authors']; $keywords = $_GET['keywords']; $admins = $_GET['admins']; $pstarttime = $_GET['pstarttime']; $pendtime = $_GET['pendtime']; $mstarttime = $_GET['mstarttime']; $mendtime = $_GET['mendtime']; $appService = Cloud::loadClass('Service_App'); $secStatus = $appService->getCloudAppStatus('security'); if ($secStatus) { $security = $_GET['security']; } $searchsubmit = $_GET['searchsubmit']; require_once libfile('function/forumlist'); $forumselect = '<select name="inforum"><option value=""> > ' . $lang['select'] . '</option>' . '<option value=""> </option><option value="groupthread">' . $lang['group_thread'] . '</option>' . forumselect(FALSE, 0, 0, TRUE) . '</select>'; if ($inforum) { $forumselect = preg_replace("/(\\<option value=\"{$inforum}\")(\\>)/", "\\1 selected=\"selected\" \\2", $forumselect); } shownav('topic', 'nav_recyclebin'); showsubmenu('nav_recyclebin', array(array('recyclebin_list', 'recyclebin', 0), array('search', 'recyclebin&operation=search', 1), array('clean', 'recyclebin&operation=clean', 0))); echo <<<EOT <script type="text/javascript" src="static/js/calendar.js"></script> <script type="text/JavaScript">
showtips('cloud_doctor_setidkey_tips'); showformheader('cloud'); showhiddenfields(array('operation' => $operation)); showhiddenfields(array('op' => $op)); showtableheader(); showsetting('cloud_site_id', 'my_siteid', $_G['setting']['my_siteid'], 'text'); showsetting('cloud_site_key', 'my_sitekey', preg_replace('/(\\w{2})\\w*(\\w{2})/', '\\1****\\2', $_G['setting']['my_sitekey']), 'text'); showsetting('cloud_site_status', array('cloud_status', array(array('0', $lang['cloud_doctor_status_0']), array('1', $lang['cloud_doctor_status_1']), array('2', $lang['cloud_doctor_status_2']))), $_G['setting']['cloud_status'], 'select'); showsubmit('setidkeysubmit'); showtablefooter(); showformfooter(); echo '</div>'; ajaxshowfooter(); } else { $appService = Cloud::loadClass('Service_App'); $doctorService = Cloud::loadClass('Service_Doctor'); require_once DISCUZ_ROOT . './source/discuz_version.php'; shownav('navcloud', 'menu_cloud_doctor'); showsubmenu('menu_cloud_doctor'); showtips('cloud_doctor_tips'); echo '<script type="text/javascript">var disallowfloat = "";</script>'; showtableheader(); showtagheader('tbody', '', true); showtitle('cloud_doctor_title_status'); showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_url') . '</strong>', $_G['siteurl'])); showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_id') . '</strong>', $_G['setting']['my_siteid'])); showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_key') . '</strong>', preg_replace('/(\\w{2})\\w*(\\w{2})/', '\\1****\\2', $_G['setting']['my_sitekey']) . ' ' . $lang['cloud_site_key_safetips'])); showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_status') . '</strong>', isfounder() ? $doctorService->showCloudStatus($_G['setting']['cloud_status']) . ' <a href="javascript:;" onClick="showWindow(\'cloudApiIpWin\', \'' . ADMINSCRIPT . '?action=cloud&operation=doctor&op=setidkey\'); return false;">' . $lang['cloud_doctor_modify_siteidkey'] . '</a>' : $doctorService->showCloudStatus($_G['setting']['cloud_status']))); showtablerow('', array('class="td24"'), array('<strong>' . cplang('setting_basic_bbclosed') . '</strong>', $_G['setting']['bbclosed'] ? $lang['cloud_doctor_close_yes'] : $lang['no'])); showtablerow('', array('class="td24"'), array('<strong>' . cplang('cloud_site_version') . '</strong>', DISCUZ_VERSION . ' ' . DISCUZ_RELEASE)); showtagfooter('tbody');