当前位置: 首页>>代码示例>>PHP>>正文


PHP WebUtils::makeErrorInfo_oldVersion方法代码示例

本文整理汇总了PHP中WebUtils::makeErrorInfo_oldVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::makeErrorInfo_oldVersion方法的具体用法?PHP WebUtils::makeErrorInfo_oldVersion怎么用?PHP WebUtils::makeErrorInfo_oldVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebUtils的用法示例。


在下文中一共展示了WebUtils::makeErrorInfo_oldVersion方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
 }
开发者ID:caidongyun,项目名称:CS,代码行数:7,代码来源:WebUtils.php

示例2: _getImageInfoList

 private function _getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId)
 {
     $list = array();
     $imageList = UserPhotoInfo::getImageListByAlbumId($albumId, $uid, $page, $pageSize);
     foreach ($imageList as $image) {
         $tempimageInfo = PhotoUtils::getPhotoInfo($image);
         // $imageInfo['board_id'] = (Int)$albumId;
         $imageInfo['pic_id'] = (int) $image;
         $imageInfo['title'] = $tempimageInfo['title'] == "" ? $tempimageInfo['filename'] : $tempimageInfo['title'];
         $imageInfo['title'] = WebUtils::emptyHtml($imageInfo['title']);
         $imageInfo['user_id'] = (int) $uid;
         $imageInfo['release_date'] = $tempimageInfo['dateline'] . "000";
         $lastReplyDate = PhotoUtils::getReplyDate($image);
         $imageInfo['last_update_date'] = $lastReplyDate['last_reply_date'] . "000";
         $imageInfo['user_nick_name'] = $tempimageInfo['username'];
         $imageInfo['hot'] = (int) $tempimageInfo['hot'];
         $imageInfo['replies'] = (int) PhotoUtils::getReplyCount($image);
         $imageInfo['thumb_pic'] = PhotoUtils::getImageCover($image);
         $imageInfo['origin_pic'] = PhotoUtils::getPhotosoRiginCover($tempimageInfo);
         $list[] = $imageInfo;
     }
     global $_G;
     if ($_G['adminid'] != 1) {
         $albumInfo = UserPhotoInfo::getAlbumInfo($uid, $albumId);
         switch ($albumInfo['friend']) {
             case 0:
                 $list;
                 break;
             case 1:
                 UserUtils::isFriend($uid, $landUid) || $landUid == $uid ? $list : ($list = 1);
                 break;
             case 2:
                 $list = PhotoUtils::judgeDesignatedFriends($albumInfo, $landUid, $uid, $list);
                 break;
             case 3:
                 $uid == $landUid ? $list : ($list = 3);
                 break;
             case 4:
                 $landUid == $uid ? $list : ($list = 4);
                 break;
         }
     }
     $res['list'] = $list;
     if ($albumId == 0) {
         $count = UserPhotoInfo::getImageListCountByAlbumId($uid);
     } else {
         $count = UserPhotoInfo::getImageListCount($albumId, $uid);
     }
     $res = WebUtils::getWebApiArrayWithPage_oldVersion($page, $pageSize, $count, $res);
     if (empty($res['list'])) {
         if ($albumId == 0) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_defaultAlbum_does_not_exist');
         }
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_does_not_exist');
     } elseif ($res['list'] == 1 || $res['list'] == 2 || $res['list'] == 3 || $res['list'] == 4) {
         $res['list'] = array();
         return WebUtils::makeErrorInfo_oldVersion($res, 'to_view_the_photo_set_privacy', array('{username}' => $albumInfo['username']));
     }
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:60,代码来源:PhotoListAction.php

示例3: _checkComment

 private function _checkComment($res, $data)
 {
     $_GET['id'] = $data['id'];
     $_GET['idType'] = $data['idType'];
     // 在DISCUZ_ROOT/source/module/portal/portal_comment.php基础上二次开发
     $id = empty($_GET['id']) ? 0 : intval($_GET['id']);
     $idtype = in_array($_GET['idtype'], array('aid', 'topicid')) ? $_GET['idtype'] : 'aid';
     if (empty($id)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'comment_no_' . $idtype . '_id');
     }
     if ($idtype == 'aid') {
         $csubject = C::t('portal_article_title')->fetch($id);
         if ($csubject) {
             $csubject = array_merge($csubject, C::t('portal_article_count')->fetch($id));
         }
         // $url = fetch_article_url($csubject);
     } elseif ($idtype == 'topicid') {
         $csubject = C::t('portal_topic')->fetch($id);
         // $url = fetch_topic_url($csubject);
     }
     if (empty($csubject)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'comment_' . $idtype . '_no_exist');
     } elseif (empty($csubject['allowcomment'])) {
         return WebUtils::makeErrorInfo_oldVersion($res, $idtype . '_comment_is_forbidden');
     }
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:27,代码来源:CommentListAction.php

示例4: _runAction

 private function _runAction($params)
 {
     extract($params);
     $isSaveSuccess = false;
     $image = $avatar;
     if (!empty($image) && ($imageData = WebUtils::httpRequest($image)) != '') {
         $savePath = UploadUtils::getTempAvatarPath();
         if (!empty($savePath)) {
             $config = Yii::app()->params['mobcent']['user'];
             $this->_deleteTempAvatarFiles($uid);
             $avatarFiles = $this->_getTempAvatarFiles($uid);
             $avatarBigFile = $savePath . '/' . $avatarFiles['big'];
             $avatarMidFile = $savePath . '/' . $avatarFiles['mid'];
             $avatarSmallFile = $savePath . '/' . $avatarFiles['small'];
             file_put_contents($avatarBigFile, $imageData);
             file_put_contents($avatarMidFile, $imageData);
             file_put_contents($avatarSmallFile, $imageData);
             require_once MOBCENT_APP_ROOT . '/components/discuz/source/class/class_image.php';
             $thumb = new Mobcent_Image();
             $zoomRes = true;
             $zoomRes &= $thumb->makeThumb($avatarBigFile, '', $config['avatarBigLength']);
             $zoomRes &= $thumb->makeThumb($avatarMidFile, '', $config['avatarMidLength']);
             $zoomRes &= $thumb->makeThumb($avatarSmallFile, '', $config['avatarSmallLength']);
             $isSaveSuccess = $zoomRes && $this->_saveAvatarByUcenter($uid, $this->flashdata_encode(file_get_contents($avatarBigFile)), $this->flashdata_encode(file_get_contents($avatarMidFile)), $this->flashdata_encode(file_get_contents($avatarSmallFile)));
             $this->_deleteTempAvatarFiles($uid);
         }
     }
     if ($isSaveSuccess) {
         $this->_updateAvatarStatus();
         return $res;
     } else {
         return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('保存文件失败'));
     }
     // return $isSaveSuccess ? $res : WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('保存文件失败'));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:35,代码来源:SaveAvatarAction.php

示例5: 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);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:29,代码来源:SendAttachmentAction.php

示例6: 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);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:18,代码来源:CommentAdminAction.php

示例7: _getUserInfo

 private function _getUserInfo($res, $uid, $puid)
 {
     loadcache('usergroups');
     $space = UserUtils::getUserInfo($puid);
     if (empty($space)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'space_does_not_exist');
     }
     $spacePro = UserUtils::getUserProfile($puid);
     $spaceCount = DzUserInfo::getCommonMemberCount($puid);
     $space = array_merge($space, $spacePro, $spaceCount);
     $listCount = (int) DzUserInfo::getUserPhotosHomeAlbumCount($puid);
     $res['flag'] = $uid == $puid ? 1 : 0;
     $res['is_black'] = (int) UserUtils::isBlacklist($uid, $puid) ? 1 : 0;
     $res['is_follow'] = (int) UserUtils::isFollow($uid, $puid);
     $res['isFriend'] = (int) UserUtils::isFriend($uid, $puid) ? 1 : 0;
     $res['icon'] = UserUtils::getUserAvatar($puid, $spacePro);
     $res['level_url'] = '';
     $res['name'] = $space['username'];
     $res['email'] = $space['email'];
     $res['status'] = (int) UserUtils::getUserLoginStatus($puid);
     $res['gender'] = (int) UserUtils::getUserGender($puid, $spacePro);
     $res['email'] = $space['email'];
     $res['score'] = (int) $space['credits'];
     $res['credits'] = (int) $space['credits'];
     $res['gold_num'] = (int) $space['extcredits2'];
     $res['topic_num'] = (int) $this->_getHomeTopicNum($puid);
     $res['photo_num'] = (int) $listCount['nums'];
     $res['reply_posts_num'] = (int) DzUserInfo::getTopicsByUidWithPostCount($puid);
     $res['essence_num'] = (int) $space['digestposts'];
     $res['friend_num'] = (int) DzUserInfo::getFollowFriendsCount($puid);
     $res['follow_num'] = (int) DzUserInfo::getFollowedFriendsCount($puid);
     $res['level'] = (int) DzCommonUserList::getUserLevel($space['groupid']);
     $res['userTitle'] = UserUtils::getUserTitle($puid, $space);
     $repeatList = array();
     foreach (UserUtils::getRepeatList($uid) as $user) {
         $repeatList[] = array('userName' => $user);
     }
     $res['body']['repeatList'] = $repeatList;
     $res['body']['profileList'] = $this->_getPersonalDataInfo($puid, $space);
     $res['body']['creditList'] = $this->_getStatisticalInformation($uid, $space);
     $res['body']['creditShowList'] = $this->_getStatisticalInforSet($uid, $space);
     return $res;
 }
开发者ID:caidongyun,项目名称:CS,代码行数:43,代码来源:UserInfoAction.php

示例8: _runAction

 private function _runAction($res, $uid)
 {
     ($imageData = file_get_contents('php://input')) === false && ($imageData = $GLOBALS['HTTP_RAW_POST_DATA']);
     //$imageData = file_get_contents('http://appbyme.com/mobcentACA/resource/images/logo.jpg');
     if (!empty($imageData)) {
         if (($savePath = UploadUtils::getTempAvatarPath()) != '') {
             $fileName = sprintf('%s/avatar_%s.jpg', $savePath, $uid);
             if (($pfile = fopen($fileName, 'wb')) != false) {
                 if (fwrite($pfile, $imageData) !== false) {
                     $image = $this->_uploadAvatarByUcenter($uid, $fileName, $imageData);
                 }
                 fclose($pfile);
                 FileUtils::safeDeleteFile($fileName);
                 if (!empty($image)) {
                     return array_merge($res, array('icon_url' => '', 'pic_path' => $image));
                 }
             }
         }
     }
     return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('上传文件失败'));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:21,代码来源:UploadAvatarAction.php

示例9: _makeErrorInfo

 private function _makeErrorInfo($res, $message, $params = array())
 {
     return WebUtils::makeErrorInfo_oldVersion($res, $message, $params);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:4,代码来源:TopicActivityAction.php

示例10: makeErrorInfo

 protected function makeErrorInfo($res, $message, $params = array())
 {
     return WebUtils::makeErrorInfo_oldVersion($res, $message, $params);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:4,代码来源:MobcentAction.php

示例11: sendPost

 private function sendPost($extract)
 {
     global $_G;
     extract($extract);
     // 获取主题和帖子要插入的状态信息
     $topicStatus = ForumUtils::getPostSendStatus('topic', $_GET['platType']);
     $postStatus = ForumUtils::getPostSendStatus('post', $_GET['platType']);
     //copy from dz source/include/post/post_newthread.php
     if (empty($_G['forum']['fid']) || $_G['forum']['type'] == 'group') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_nonexistence');
     }
     if ($special == 1 && !$_G['group']['allowpostpoll'] || $special == 2 && !$_G['group']['allowposttrade'] || $special == 3 && !$_G['group']['allowpostreward'] || $special == 4 && !$_G['group']['allowpostactivity'] || $special == 5 && !$_G['group']['allowpostdebate']) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']));
     }
     if (!$_G['uid'] && !(!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']))) {
         if (!defined('IN_MOBILE')) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission', array('{login}' => 1));
         } else {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission_mobile', array('{login}' => 1));
         }
     } elseif (empty($_G['forum']['allowpost'])) {
         if (!$_G['forum']['postperm'] && !$_G['group']['allowpost']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_none_nopermission');
         } elseif ($_G['forum']['postperm'] && !forumperm($_G['forum']['postperm'])) {
             $msg = mobcent_showmessagenoperm('postperm', $_G['fid'], $_G['forum']['formulaperm']);
             return WebUtils::makeErrorInfo_oldVersion($res, $msg['message'], $msg['params']);
         }
     } elseif ($_G['forum']['allowpost'] == -1) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_forum_newthread_nopermission');
     }
     if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'postperm_login_nopermission');
     }
     if (trim($subject) == '') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sm_isnull');
     }
     if (!$sortid && !$special && trim($message) == '') {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sm_isnull');
     }
     if ($post_invalid = checkpost($subject, $message, $special || $sortid)) {
         return WebUtils::makeErrorInfo_oldVersion($res, $post_invalid, array('{minpostsize}' => $_G['setting']['minpostsize'], '{maxpostsize}' => $_G['setting']['maxpostsize']));
         //showmessage($post_invalid, '', array('minpostsize' => $_G['setting']['minpostsize'], 'maxpostsize' => $_G['setting']['maxpostsize']));
     }
     if (checkflood()) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_flood_ctrl', array('{floodctrl}' => $_G['setting']['floodctrl']));
     } elseif (checkmaxperhour('tid')) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'thread_flood_ctrl_threads_per_hour', array('{threads_per_hour}' => $_G['group']['maxthreadsperhour']));
     }
     $_GET['save'] = $_G['uid'] ? $_GET['save'] : 0;
     if ($_G['group']['allowsetpublishdate'] && $_GET['cronpublish'] && $_GET['cronpublishdate']) {
         $publishdate = strtotime($_GET['cronpublishdate']);
         if ($publishdate > $_G['timestamp']) {
             $_GET['save'] = 1;
         } else {
             $publishdate = $_G['timestamp'];
         }
     } else {
         $publishdate = $_G['timestamp'];
     }
     $typeid = isset($typeid) && isset($_G['forum']['threadtypes']['types'][$typeid]) && (empty($_G['forum']['threadtypes']['moderators'][$typeid]) || $_G['forum']['ismoderator']) ? $typeid : 0;
     $displayorder = $modnewthreads ? -2 : ($_G['forum']['ismoderator'] && $_G['group']['allowstickthread'] && !empty($_GET['sticktopic']) ? 1 : (empty($_GET['save']) ? 0 : -4));
     if ($displayorder == -2) {
         C::t('forum_forum')->update($_G['fid'], array('modworks' => '1'));
     } elseif ($displayorder == -4) {
         $_GET['addfeed'] = 0;
     }
     $digest = $_G['forum']['ismoderator'] && $_G['group']['allowdigestthread'] && !empty($_GET['addtodigest']) ? 1 : 0;
     $readperm = $_G['group']['allowsetreadperm'] ? $readperm : 0;
     $isanonymous = $_G['group']['allowanonymous'] && $_GET['isanonymous'] ? 1 : 0;
     $price = intval($price);
     $price = $_G['group']['maxprice'] && !$special ? $price <= $_G['group']['maxprice'] ? $price : $_G['group']['maxprice'] : 0;
     //强制主题类别判断
     if (!$typeid && $_G['forum']['threadtypes']['required'] && !$special) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_type_isnull');
     }
     //强制主题分类判断
     if (!$sortid && $_G['forum']['threadsorts']['required'] && !$special) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_sort_isnull');
     }
     //主题售价 客户端暂不支持
     if ($price > 0 && floor($price * (1 - $_G['setting']['creditstax'])) == 0) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
         showmessage('post_net_price_iszero');
     }
     //投票贴相关
     if ($special == 1) {
         $polloption = $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption'];
         $pollarray = array();
         foreach ($polloption as $key => $value) {
             $polloption[$key] = censor($polloption[$key]);
             if (trim($value) === '') {
                 unset($polloption[$key]);
             }
         }
         if (count($polloption) > $_G['setting']['maxpolloptions']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('post_poll_option_toomany', '', array('maxpolloptions' => $_G['setting']['maxpolloptions']));
         } elseif (count($polloption) < 2) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('post_poll_inputmore');
//.........这里部分代码省略.........
开发者ID:caidongyun,项目名称:CS,代码行数:101,代码来源:TopicAdminAction.php

示例12: _zhSearchData

 private function _zhSearchData($kw, $page, $pagesize, $res, $searchparams)
 {
     $keyword = dhtmlspecialchars(trim($kw));
     $keyword = WebUtils::t($keyword);
     require_once libfile('function/search');
     require_once libfile('function/misc');
     require_once libfile('function/post');
     // $searchHelper = Cloud::loadClass('Service_SearchHelper');
     // $searchparams = $searchHelper->makeSearchSignUrl();
     $appService = Cloud::loadClass('Service_App');
     if ($appService->getCloudAppStatus('search') && $searchparams) {
         $source = 'discuz';
         $params = array();
         $params['source'] = $source;
         $params['q'] = $keyword;
         $params['module'] = 'forum';
         $searchparams['params'] = array_merge($searchparams['params'], $params);
         $utilService = Cloud::loadClass('Service_Util');
         $url = $searchparams['url'] . '?' . $utilService->httpBuildQuery($searchparams['params'], '', '&');
     }
     $url = $url . '&page=' . $page;
     // $pageInfo = WebUtils::emptyReturnLine(file_get_contents($url));
     $pageInfo = WebUtils::emptyReturnLine(WebUtils::httpRequest($url));
     $pregIds = '/&tid=(\\d*)"/';
     $pregCount = '/<div class="allnum">(.*?)<\\/div>/';
     //取出搜索结果总数
     preg_match_all($pregIds, $pageInfo, $id);
     $ids = $id[1];
     if (empty($ids)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'search_no_results');
     }
     preg_match_all($pregCount, $pageInfo, $count);
     $countStr = trim($count[1][0]);
     preg_match_all('/\\d/', $countStr, $total);
     $total_num = (int) str_replace(',', '', implode(',', $total[0]));
     $ids = $id[1];
     $data = $topicInfo = $topicSummary = array();
     foreach ($ids as $v) {
         $topicInfo = ForumUtils::getTopicInfo($v);
         // $topicInfo['lastpost'] = dgmdate($topicInfo['lastpost'], 'u');
         $topicInfos[] = $topicInfo;
     }
     unset($ids);
     $rows = $this->_fieldInfo($topicInfos);
     $pageInfo = WebUtils::getWebApiArrayWithPage_oldVersion($page, 10, $total_num);
     $res['searchid'] = 0;
     $res = array_merge($res, $pageInfo);
     $res['list'] = $rows;
     return $res;
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:50,代码来源:SearchAction.php

示例13: _startSign

 private function _startSign($res)
 {
     global $_G;
     loadcache('pluginlanguage_script');
     $lang = $_G['cache']['pluginlanguage_script']['dsu_paulsign'];
     //获取语言包
     $var = $_G['cache']['plugin']['dsu_paulsign'];
     // 获取插件的配置信息
     if (!$var['ifopen']) {
         if ($var['plug_clsmsg'] == '') {
             $var['plug_clsmsg'] = WebUtils::t('签到插件没有开启');
         }
         return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$var['plug_clsmsg']}");
     }
     $htime = dgmdate($_G['timestamp'], 'H', $var['tos']);
     // 获取当前的时间,小时
     $groups = unserialize($var['groups']);
     // 获取允许签到的用户组
     // 本月签到的处理
     $qddb = DB::fetch_first("SELECT time FROM " . DB::table('dsu_paulsign') . " ORDER BY time DESC limit 0,1");
     $lastmonth = dgmdate($qddb['time'], 'm', $var['tos']);
     $nowmonth = dgmdate($_G['timestamp'], 'm', $var['tos']);
     if ($nowmonth != $lastmonth) {
         DB::query("UPDATE " . DB::table('dsu_paulsign') . " SET mdays=0 WHERE uid");
     }
     // 获取当前用户发贴总数
     $post = DB::fetch_first("SELECT posts FROM " . DB::table('common_member_count') . " WHERE uid='{$_G['uid']}'");
     $read_ban = explode(",", $var['ban']);
     //查看黑名单用户
     // 用户签到的信息
     $qiandaodb = DB::fetch_first("SELECT * FROM " . DB::table('dsu_paulsign') . " WHERE uid='{$_G['uid']}'");
     $tdtime = gmmktime(0, 0, 0, dgmdate($_G['timestamp'], 'n', $var['tos']), dgmdate($_G['timestamp'], 'j', $var['tos']), dgmdate($_G['timestamp'], 'Y', $var['tos'])) - $var['tos'] * 3600;
     // 心情初始化
     // $emots = unserialize($_G['setting']['paulsign_emot']);
     $_GET['qdxq'] = 'kx';
     $credit = mt_rand($var['mincredit'], $var['maxcredit']);
     // 奖励积分值的设置
     // 客户端奖励倍数
     $appbymePlug = WebUtils::getDzPluginAppbymeAppConfig('dzsyscache_sign_extcredit_base');
     $appbymePlug = $appbymePlug !== false ? $appbymePlug : 100;
     $credit = $appbymePlug * 0.01 * $credit;
     $jlxgroups = unserialize($var['jlxgroups']);
     //奖励增倍的指定用户组选择
     //前N额外奖励项自定义
     $njlmain = str_replace(array("\r\n", "\n", "\r"), '/hhf/', $var['jlmain']);
     $extreward = explode("/hhf/", $njlmain);
     $extreward_num = count($extreward);
     $stats = DB::fetch_first("SELECT * FROM " . DB::table('dsu_paulsignset') . " WHERE id='1'");
     // 判断是否开启时间段限制
     if ($var['timeopen']) {
         if ($htime < $var['stime']) {
             return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_timeearly1']}{$var[stime]}{$lang['ts_timeearly2']}");
         } elseif ($htime > $var['ftime']) {
             return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_timeov']}");
         }
     }
     // 判断允许签到的用户组
     if (!in_array($_G['groupid'], $groups)) {
         return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_notallow']}");
     }
     // 判断当前用户的发帖总数是否允许签到
     if ($var['mintdpost'] > $post['posts']) {
         return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_minpost1']}{$var[mintdpost]}{$lang['ts_minpost2']}");
     }
     //判断当前用户是否在黑名单中
     if (in_array($_G['uid'], $read_ban)) {
         return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_black']}");
     }
     // 当前用户是否签到的判断
     if ($qiandaodb['time'] > $tdtime) {
         return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT . ":{$lang['ts_yq']}");
     }
     // 心情的处理
     // if (!array_key_exists($_GET['qdxq'], $emots)) {
     //     return WebUtils::makeErrorInfo_oldVersion($res, MOBCENT_ERROR_DEFAULT.":{$lang['ts_xqnr']}");
     // }
     // 今日想说的话
     $todaysay = WebUtils::getDzPluginAppbymeAppConfig('mobile_sign_text');
     empty($todaysay) && ($todaysay = $lang['wttodaysay']);
     //判断签到进程锁
     if ($var['lockopen']) {
         while (discuz_process::islocked('dsu_paulsign', 5)) {
             usleep(100000);
         }
     }
     // jlx : 指定用户组获取奖励是一般的几倍
     if (in_array($_G['groupid'], $jlxgroups) && $var['jlx'] !== '0') {
         $credit = $credit * $var['jlx'];
     }
     // 连续签到指数开关
     if ($tdtime - $qiandaodb['time'] < 86400 && $var['lastedop'] && $qiandaodb['lasted'] !== '0') {
         $randlastednum = mt_rand($var['lastednuml'], $var['lastednumh']);
         $randlastednum = sprintf("%03d", $randlastednum);
         $randlastednum = '0.' . $randlastednum;
         $randlastednum = $randlastednum * $qiandaodb['lasted'];
         $credit = round($credit * (1 + $randlastednum));
     }
     $num = DB::result_first("SELECT COUNT(*) FROM " . DB::table('dsu_paulsign') . " WHERE time >= {$tdtime} ");
     if (!$qiandaodb['uid']) {
         DB::query("INSERT INTO " . DB::table('dsu_paulsign') . " (uid,time) VALUES ('{$_G['uid']}',{$_G['timestamp']})");
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:SignAction.php

示例14: _runAction

 private function _runAction($res, $uid)
 {
     if (empty($_FILES['userAvatar']['tmp_name'])) {
         return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('请选择上传的文件'));
     }
     if ($_FILES['userAvatar']['error'] > 0) {
         return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('上传文件失败'));
     }
     if ($_FILES['userAvatar']['size'] > 2000000) {
         return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('上传文件太大'));
     }
     $savePath = UploadUtils::getTempAvatarPath();
     $fileName = sprintf('%s/avatar_%s.jpg', $savePath, $uid);
     if (move_uploaded_file($_FILES['userAvatar']['tmp_name'], $fileName)) {
         $imageData = file_get_contents($fileName);
         $image = $this->_uploadAvatarByUcenter($uid, $fileName, $imageData);
         FileUtils::safeDeleteFile($fileName);
         if (!empty($image)) {
             return array_merge($res, array('icon_url' => '', 'pic_path' => $image));
         }
         // WebUtils::httpRequestAppAPI('user/saveavatar', array('avatar' => $image, 'hacker_uid' => 1));
         // die();
     }
     return WebUtils::makeErrorInfo_oldVersion($res, WebUtils::t('上传文件失败'));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:25,代码来源:UploadAvatarExAction.php


注:本文中的WebUtils::makeErrorInfo_oldVersion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。