本文整理汇总了PHP中WebUtils::initWebApiArray_oldVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::initWebApiArray_oldVersion方法的具体用法?PHP WebUtils::initWebApiArray_oldVersion怎么用?PHP WebUtils::initWebApiArray_oldVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebUtils
的用法示例。
在下文中一共展示了WebUtils::initWebApiArray_oldVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run($keyword, $page = 1, $pageSize = 10, $searchid = 0)
{
$keyword = rawurldecode($keyword);
$res = WebUtils::initWebApiArray_oldVersion();
$res = $this->_getForumData($res, $keyword, $page, $pageSize, $searchid);
echo WebUtils::outputWebApi($res, '', false);
}
示例2: run
public function run($type = 'follow', $page = 1, $pageSize = 10, $orderBy = 'dateline', $longitude = '', $latitude = '', $radius = 100000)
{
$res = WebUtils::initWebApiArray_oldVersion();
switch ($orderBy) {
case 'register':
$sortType = 'regdate';
break;
case 'login':
$sortType = 'lastvisit';
break;
case 'followed':
$sortType = 'follower';
break;
case 'distance':
$sortType = 'range';
break;
case 'dateline':
$sortType = 'default';
break;
case 'at':
$sortType = 'at';
break;
default:
break;
}
global $_G;
$uid = $_G['uid'];
$viewUid = isset($_GET['uid']) ? $_GET['uid'] : $uid;
$res = $this->_getUserInfoList($res, $type, $uid, $viewUid, $page, $pageSize, $sortType, $longitude, $latitude, $radius);
echo WebUtils::outputWebApi($res, '', false);
}
示例3: run
public function run($tid, $act = 'apply')
{
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $this->getController()->uid;
// $_REQUEST['json'] = "{'payment':1,'payvalue':100, 'realname': '请求参数11', 'qq': '8', 'message': '请求参数'}";
$json = isset($_REQUEST['json']) ? $_REQUEST['json'] : '';
$json = rawurldecode($json);
$data = WebUtils::jsonDecode($json);
if (!empty($data)) {
foreach ($data as $key => $value) {
if (is_string($value)) {
$data[$key] = WebUtils::t($value);
}
}
switch ($act) {
case 'apply':
$res = $this->_applyActivityTopic($res, $tid, $uid, $data);
break;
case 'cancel':
$res = $this->_cancelActivityTopic($res, $tid, $uid, $data);
break;
default:
$res = $this->_makeErrorInfo($res, 'activity_apply_params_error');
break;
}
} else {
$res = $this->_makeErrorInfo($res, 'activity_apply_params_error');
}
echo WebUtils::outputWebApi($res, '', false);
}
示例4: endAppWithErrorInfo
public static function endAppWithErrorInfo($res, $message, $params = array())
{
$tmpRes = WebUtils::initWebApiArray_oldVersion();
$tmpRes = WebUtils::makeErrorInfo_oldVersion($tmpRes, $message, $params);
$tmpRes = array_merge($tmpRes, $res);
WebUtils::outputWebApi($tmpRes);
}
示例5: run
public function run($uid, $albumId, $page = 1, $pageSize = 10)
{
$res = WebUtils::initWebApiArray_oldVersion();
$landUid = $this->getController()->uid;
$res = $this->_getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId);
echo WebUtils::outputWebApi($res, '', false);
}
示例6: run
public function run($attachment)
{
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $this->getController()->uid;
// $attachment ="{'head': {'errCode': 0, 'errInfo': ''}, 'body': {'attachment': {'name': 'test', 'isPost': 1, 'data': 'ss', 'type': 'image', 'module':'forum'}, 'externInfo': {}}}";
$attachment = rawurldecode($attachment);
$attachment = WebUtils::jsonDecode($attachment);
$attachment = isset($attachment['body']['attachment']) ? $attachment['body']['attachment'] : array();
!isset($attachment['module']) && ($attachment['module'] = 'forum');
$resAttachment = false;
if (!empty($attachment)) {
if ($attachment['isPost'] == 1) {
if (($data = file_get_contents('php://input')) === false) {
$attachment['data'] = $GLOBALS['HTTP_RAW_POST_DATA'];
} else {
$attachment['data'] = $data;
}
}
// $attachment['data'] = WebUtils::httpRequest('http://bbs.appbyme.com/static/image/common/logo.png');// test
$resAttachment = $this->_saveAttachment($uid, $attachment);
}
if ($resAttachment === false) {
$attachmentTypes = array('audio' => WebUtils::t('语音'), 'image' => WebUtils::t('图片'));
$res = WebUtils::makeErrorInfo_oldVersion($res, 'UPLOAD_ATTACHMENT_ERROR', array('{attachment}' => $attachmentTypes[$attachment['type']]));
} else {
$res['body']['attachment'] = $resAttachment;
}
echo WebUtils::outputWebApi($res, '', false);
}
示例7: run
public function run()
{
$res = WebUtils::initWebApiArray_oldVersion();
global $_G;
$uid = $_G['uid'];
$puid = isset($_GET['userId']) ? $_GET['userId'] : $uid;
$res = $this->_getUserInfo($res, $uid, $puid);
$res['info'] = array();
echo WebUtils::outputWebApi($res, '', false);
}
示例8: run
public function run($page = 1, $pageSize = 10)
{
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $this->getController()->uid;
$params = array('type' => 'friend', 'orderBy' => 'at', 'page' => 0, 'uid' => $uid);
$friend = $this->_getForWardInfo($params);
$params = array('type' => 'follow', 'orderBy' => 'dateline', 'page ' => 0, 'uid' => $uid);
$follow = $this->_getForWardInfo($params);
$res = $this->_getUserPostFriendPagingListInfo($res, $friend, $follow, $page, $pageSize);
echo WebUtils::outputWebApi($res, '', false);
}
示例9: run
public function run()
{
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $_GET['uid'];
$page = $_GET['page'] ? $_GET['page'] : 1;
$pageSize = $_GET['pageSize'] ? $_GET['pageSize'] : 10;
$type = $_GET['type'];
$idType = $_GET['idType'] ? $_GET['idType'] : 'tid';
$res = $this->_getTopicList($res, $type, $idType, $uid, $page, $pageSize, $idtype);
echo WebUtils::outputWebApi($res, '', false);
}
示例10: run
public function run($json)
{
$res = WebUtils::initWebApiArray_oldVersion();
// $json = "{'id': 1, 'idType': 'aid', 'page': 1, 'pageSize': 10, }";
$json = rawurldecode($json);
$json = WebUtils::jsonDecode($json);
$res = $this->_checkComment($res, $json);
if (!WebUtils::checkError($res)) {
$comments = $this->getCommentList($json);
$res['body']['list'] = $comments['list'];
$res = array_merge($res, WebUtils::getWebApiArrayWithPage($res, $json['page'], $json['pageSize'], $comments['count']));
}
echo WebUtils::outputWebApi($res, '', false);
}
示例11: run
public function run($json)
{
$res = WebUtils::initWebApiArray_oldVersion();
// $json = "{'action': 'reply', 'idType': 'aid', 'id': 1, 'content': [{'type': 0, 'infor': '呵呵\r\nhaha%25E5%2591%25B5%25E5%2591%25B5%25E2%2580%259C%25E2%2580%259D%2522%2522',}], 'quoteCommentId': 12, }";
$json = rawurldecode($json);
$json = WebUtils::jsonDecode($json);
!isset($json['action']) && ($json['action'] = 'reply');
!isset($json['idType']) && ($json['idType'] = 'aid');
switch ($json['action']) {
case 'reply':
$res = $this->_commentReply($res, $json);
break;
default:
$res = WebUtils::makeErrorInfo_oldVersion($res, 'mobcent_error_params');
break;
}
echo WebUtils::outputWebApi($res, '', false);
}
示例12: run
public function run()
{
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $this->getController()->uid;
// get reply info
$res['body']['replyInfo'] = $this->_getNotifyInfo($uid, 'post');
// get @me info
$res['body']['atMeInfo'] = $this->_getNotifyInfo($uid, 'at');
// 获取好友通知
$res['body']['friendInfo'] = $this->_getNotifyInfo($uid, 'friend');
// get private message that client unreceived
$res['body']['pmInfos'] = $this->_getPmInfos($uid);
if (($heartPeriod = WebUtils::getDzPluginAppbymeAppConfig('message_period')) <= 0) {
$heartPeriod = MINUTE_SECONDS * 2;
}
if (($pmPeriod = WebUtils::getDzPluginAppbymeAppConfig('message_pm_period')) <= 0) {
$pmPeriod = 20;
}
$res['body']['externInfo']['heartPeriod'] = $heartPeriod . '000';
$res['body']['externInfo']['pmPeriod'] = $pmPeriod . '000';
echo WebUtils::outputWebApi($res, '', false);
}
示例13: run
public function run($type = 'post', $page = 1, $pageSize = 20)
{
require_once libfile('function/friend');
$res = WebUtils::initWebApiArray_oldVersion();
$uid = $this->getController()->uid;
$notifyInfo = $this->_getNotifyInfo($uid, $type, $page, $pageSize);
$list = $notifyInfo['list'];
$count = $notifyInfo['count'];
$res = array_merge($res, WebUtils::getWebApiArrayWithPage_oldVersion($page, $pageSize, $count));
$res['list'] = $list;
$res['body']['data'] = $notifyInfo['data'];
// $transaction = Yii::app()->dbDz->beginTransaction();
// try {
echo WebUtils::outputWebApi($res, '', false);
$this->_updateReadStatus($uid, $type);
// $transaction->commit();
// } catch(Exception $e) {
// var_dump($e);
// $transaction->rollback();
// }
Yii::app()->end();
}
示例14: run
public function run()
{
$res = WebUtils::initWebApiArray_oldVersion();
$res = $this->_startSign($res);
echo WebUtils::outputWebApi($res, '', false);
}
示例15: run
public function run()
{
$res = WebUtils::initWebApiArray_oldVersion();
$res['list'] = $this->_getModuleList();
echo WebUtils::outputWebApi($res, '', false);
}