本文整理汇总了PHP中WebUtils::t方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::t方法的具体用法?PHP WebUtils::t怎么用?PHP WebUtils::t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebUtils
的用法示例。
在下文中一共展示了WebUtils::t方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionRewardEdit
public function actionRewardEdit($id = 0)
{
if (!empty($_POST)) {
$sponsor = isset($_POST['sponsor']) ? $_POST['sponsor'] : '';
$startTime = isset($_POST['startTime']) ? strtotime($_POST['startTime']) : '';
$stopTime = isset($_POST['stopTime']) ? strtotime($_POST['stopTime']) : '';
$firstReward = isset($_POST['firstReward']) ? $_POST['firstReward'] : '';
$inviteReward = isset($_POST['inviteReward']) ? $_POST['inviteReward'] : '';
$exchangeMin = isset($_POST['exchangeMin']) ? $_POST['exchangeMin'] : '';
// $exchangeType = isset($_POST['exchangeType']) ? $_POST['exchangeType'] : '';
$virtualName = isset($_POST['virtualName']) ? $_POST['virtualName'] : '';
$exchangeRatio = isset($_POST['exchangeRatio']) ? $_POST['exchangeRatio'] : '';
$limitUser = isset($_POST['limitUser']) ? $_POST['limitUser'] : '';
$limitDevice = isset($_POST['limitDevice']) ? $_POST['limitDevice'] : '';
$limitTime = isset($_POST['limitTime']) ? $_POST['limitTime'] : '';
$limitDays = isset($_POST['limitDays']) ? $_POST['limitDays'] : '';
$limitNum = isset($_POST['limitNum']) ? $_POST['limitNum'] : '';
$activityRule = isset($_POST['activityRule']) ? $_POST['activityRule'] : '';
$shareAppUrl = isset($_POST['shareAppUrl']) ? $_POST['shareAppUrl'] : '';
if ($limitDays == '') {
$limitDays = abs($startTime - $stopTime) / 3600 / 24;
}
$updateRewardInvite = array('sponsor' => WebUtils::t($sponsor), 'start_time' => $startTime, 'stop_time' => $stopTime, 'first_reward' => $firstReward, 'invite_reward' => $inviteReward, 'exchange_min' => $exchangeMin, 'virtual_name' => WebUtils::t($virtualName), 'exchange_ratio' => $exchangeRatio, 'limit_user' => $limitUser, 'limit_device' => $limitDevice, 'limit_time' => $limitTime, 'limit_days' => $limitDays, 'limit_num' => $limitNum, 'activity_rule' => $activityRule, 'share_appurl' => $shareAppUrl);
$activityId = $_POST['activityId'];
AppbymeActivityInviteModel::updateActivityInvite($activityId, $updateRewardInvite);
$cacheKey = CacheUtils::getActivityInviteKey(array('invite', $activityId));
Yii::app()->cache->delete($cacheKey);
header('location:' . $this->rootUrl . '/index.php?r=admin/reward/rewardlist');
}
$inviteInfo = AppbymeActivityInviteModel::getActivityInviteById($id);
$this->renderPartial('rewardedit', array('inviteInfo' => $inviteInfo));
}
示例2: getTopicSort
public function getTopicSort($threadsortshow)
{
$sort = array('title' => '', 'summary' => '');
if ($threadsortshow['optionlist']) {
if ($threadsortshow['optionlist'] == 'expire') {
$sort['summary'] = WebUtils::t("该信息已经过期\n");
} else {
global $_G;
$sort['title'] = $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']];
if (is_array($threadsortshow['optionlist'])) {
foreach ($threadsortshow['optionlist'] as $option) {
if ($option['type'] != 'info') {
$sort['summary'] .= sprintf("%s :\t", $option['title']);
if ($option['value'] || $option['type'] == 'number' && $option['value'] !== '') {
$option['value'] = WebUtils::emptyHtml($option['value']);
$sort['summary'] .= $option['value'] . $option['unit'];
}
$sort['summary'] .= "\n";
}
}
}
}
}
return $sort;
}
示例3: run
public function run($getSetting, $longitude = 0, $latitude = 0, $location = '')
{
$res = $this->initWebApiArray();
// $longitude='116.3093650';$latitude='40.0611250';$location='北京市海淀区上地东路';
$location = WebUtils::t(rawurldecode($location));
global $_G;
($uid = $_G['uid']) && $this->_saveUserLocation($uid, $longitude, $latitude, $location);
// $getSetting ="{'body': {'postInfo': {'forumIds': '0'}}}";
$settings = rawurldecode($getSetting);
$settings = WebUtils::jsonDecode($settings);
$postInfo = isset($settings['body']['postInfo']) ? $settings['body']['postInfo'] : array();
if (!empty($postInfo)) {
$res['body']['postInfo'] = $this->_getPostInfo($postInfo);
}
$res['body']['serverTime'] = time() . '000';
$res['body']['misc'] = $this->_getMiscSetting();
$res['body']['plugin'] = $this->_getPluginSetting();
$res['body']['forum'] = $this->_getForumSetting();
$res['body']['portal'] = $this->_getPortalSetting();
$res['body']['user'] = $this->_getUserSetting();
$res['body']['message'] = $this->_getMessageSetting();
$res['body']['moduleList'] = PortalUtils::getModuleList(6);
// 2014/11/4 门户资讯分类模块列表
echo WebUtils::outputWebApi($res, '', false);
}
示例4: 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);
}
示例5: _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('保存文件失败'));
}
示例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($username, $oauthToken, $password, $openId, $email = '', $gender = 0, $act = 'register', $platformId = 20)
{
$username = WebUtils::t(rawurldecode($username));
$email = WebUtils::t(rawurldecode($email));
$res = $this->initWebApiArray();
$res = $this->getPlatFormInfo($res, $username, $oauthToken, $password, $openId, $email, $gender, $act, $platformId);
echo WebUtils::outputWebApi($res, '', false);
}
示例8: run
public function run($longitude, $latitude, $location)
{
$res = $res = $this->initWebApiArray();
// $longitude='116.3093650';$latitude='40.0611250';$location='北京市海淀区上地东路xxx';
$location = WebUtils::t(rawurldecode($location));
$this->_getSaveUserLocation($longitude, $latitude, $location);
echo WebUtils::outputWebApi($res, '', false);
}
示例9: _login
private function _login($res, $username, $password, $mobile, $code, $isValidation)
{
global $_G;
$username = rawurldecode($username);
$password = rawurldecode($password);
if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
$token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
$secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
$uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
// 客户端传的登录状态失效
if (!$uid) {
return $this->makeErrorInfo($res, 'mobcent_login_status');
}
$result['member'] = getuserbyuid($uid);
$_G['username'] = $result['member']['username'];
// 把登录信息写入cookie中,并且更新登录的状态
UserUtils::updateCookie($result['member'], $uid);
// 需要整理token和secret再返回给客户端
$userInfo = array('token' => $token, 'secret' => $secret);
} else {
$username = WebUtils::t($username);
$logInfo = UserUtils::login($username, $password);
if ($logInfo['errcode']) {
UserUtils::delUserAccessByUsername($username);
return $this->makeErrorInfo($res, $logInfo['message']);
}
if ($isValidation == 1) {
// 是否开启了登录手机验证
$isLoginValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_login_validation');
if ($isLoginValidation) {
$userMobileBind = AppbymeSendsms::getBindInfoByUid($_G['uid']);
if (!$userMobileBind) {
// 当前登录的用户没有绑定手机号码
if ($mobile == '' && $code == '') {
$res['isValidation'] = 1;
return $this->makeErrorInfo($res, '', array('noError' => 0, 'alert' => 0));
}
$checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
if ($checkInfo['rs'] == 0) {
return $this->makeErrorInfo($res, $checkInfo['errcode']);
}
$updataArr = array('uid' => $_G['uid']);
AppbymeSendsms::updateMobile($mobile, $updataArr);
}
}
}
$userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
}
$userAvatar = UserUtils::getUserAvatar($_G['uid']);
$res['isValidation'] = 0;
$res['token'] = (string) $userInfo['token'];
$res['secret'] = (string) $userInfo['secret'];
$res['uid'] = (int) $_G['uid'];
$res['avatar'] = (string) $userAvatar;
$res['userName'] = (string) $_G['username'];
return $res;
}
示例10: run
public function run($username, $password, $email)
{
$username = WebUtils::t(rawurldecode($username));
$password = rawurldecode($password);
$email = rawurldecode($email);
$res = $this->initWebApiArray();
$res = $this->_register($res, $username, $password, $email);
echo WebUtils::outputWebApi($res, '', false);
}
示例11: _commentReply
private function _commentReply($res, $data)
{
global $_G;
require DISCUZ_ROOT . './source/function/function_home.php';
require_once libfile('function/portalcp');
// 在DISCUZ_ROOT/source/include/portalcp/portalcp_comment.php基础上二次开发
if (!checkperm('allowcommentarticle')) {
return $this->makeErrorInfo($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']), array('login' => 1));
}
switch ($data['idType']) {
case 'aid':
$_POST['aid'] = $data['id'];
break;
case 'tid':
$_POST['topicid'] = $data['id'];
break;
default:
return $this->makeErrorInfo($res, 'mobcent_error_params');
}
$id = 0;
$idtype = '';
if (!empty($_POST['aid'])) {
$id = intval($_POST['aid']);
$idtype = 'aid';
} elseif (!empty($_POST['topicid'])) {
$id = intval($_POST['topicid']);
$idtype = 'topicid';
}
// 获取评论内容
$_POST['message'] = $commentText = '';
foreach ($data['content'] as $line) {
$line['type'] = $this->_transCommentType($line['type']);
// 引用评论
if (isset($data['quoteCommentId']) && $data['quoteCommentId'] > 0) {
$quoteComment = DzPortalComment::getCommentById($data['quoteCommentId']);
if (!empty($quoteComment)) {
$commentText .= $this->_getCommentMessage($quoteComment);
}
}
if ($line['type'] == 'text') {
$line['infor'] = rawurldecode($line['infor']);
$commentText .= WebUtils::t($line['infor']);
}
}
$_POST['message'] = $commentText;
$message = $_POST['message'];
require_once libfile('function/spacecp');
if (($checkMessage = mobcent_cknewuser()) != '') {
return $this->makeErrorInfo($res, WebUtils::emptyHtml($checkMessage));
}
$waittime = interval_check('post');
if ($waittime > 0) {
return $this->makeErrorInfo($res, 'operating_too_fast', array('{waittime}' => $waittime), array('return' => true));
}
$retmessage = addportalarticlecomment($id, $message, $idtype);
return $this->makeErrorInfo($res, $retmessage, array('noError' => $retmessage == 'do_success' ? 1 : 0));
}
示例12: _userReportType
private function _userReportType($res, $rtype, $rid, $message)
{
global $_G;
if ($rtype == 'post') {
$tid = UserReport::getTidByPid($rid);
}
$fid = intval($_GET['fid']);
$uid = intval($_GET['uid']);
$message = WebUtils::t(rawurldecode($message));
$default_url = array('user' => 'home.php?mod=space&uid=', 'post' => 'forum.php?mod=redirect&goto=findpost&ptid=' . $tid . '&pid=', 'thread' => 'forum.php?mod=viewthread&tid=', 'group' => 'forum.php?mod=group&fid=', 'album' => 'home.php?mod=space&do=album&uid=' . $uid . '&id=', 'blog' => 'home.php?mod=space&do=blog&uid=' . $uid . '&id=', 'pic' => 'home.php?mod=space&do=album&uid=' . $uid . '&picid=');
$url = '';
if ($rid && !empty($default_url[$rtype])) {
$url = $default_url[$rtype] . intval($rid);
} else {
$url = addslashes(dhtmlspecialchars(base64_decode($_GET['url'])));
$url = preg_match("/^http[s]?:\\/\\/[^\\[\"']+\$/i", trim($url)) ? trim($url) : '';
}
if (empty($url)) {
$res = $this->makeErrorInfo($res, 'report_parameters_invalid');
} else {
$urlkey = md5($url);
$message = censor(cutstr(dhtmlspecialchars(trim($message)), 200, ''));
$message = $_G['username'] . ' : ' . rtrim($message, "\\");
if ($reportid = C::t('common_report')->fetch_by_urlkey($urlkey)) {
C::t('common_report')->update_num($reportid, $message);
} else {
$data = array('url' => $url, 'urlkey' => $urlkey, 'uid' => $_G['uid'], 'username' => $_G['username'], 'message' => $message, 'dateline' => TIMESTAMP);
if ($fid) {
$data['fid'] = $fid;
}
C::t('common_report')->insert($data);
$report_receive = unserialize($_G['setting']['report_receive']);
$moderators = array();
if ($report_receive['adminuser']) {
foreach ($report_receive['adminuser'] as $touid) {
notification_add($touid, 'report', 'new_report', array('from_id' => 1, 'from_idtype' => 'newreport'), 1);
}
}
if ($fid && $rtype == 'post') {
foreach (C::t('forum_moderator')->fetch_all_by_fid($fid, false) as $row) {
$moderators[] = $row['uid'];
}
if ($report_receive['supmoderator']) {
$moderators = array_unique(array_merge($moderators, $report_receive['supmoderator']));
}
foreach ($moderators as $touid) {
$touid != $_G['uid'] && !in_array($touid, $report_receive) && notification_add($touid, 'report', 'new_post_report', array('fid' => $fid, 'from_id' => 1, 'from_idtype' => 'newreport'), 1);
}
}
}
$params['noError'] = 1;
$res = $this->makeErrorInfo($res, 'report_succeed', $params);
}
return $res;
}
示例13: _saveAlbum
private function _saveAlbum($ids, $picDesc, $albumId)
{
global $_G;
$ids = rawurldecode($ids);
$picDesc = WebUtils::t(rawurldecode($picDesc));
$pidIdArray = explode(',', $ids);
foreach ($pidIdArray as $picid) {
C::t('home_pic')->update_for_uid($_G['uid'], $picid, array('title' => $picDesc, 'albumid' => $albumId));
}
require_once libfile('function/spacecp');
album_update_pic($albumId);
return $this->makeErrorInfo($res, 'mobcent_save_album_success', array('noError' => 1, 'alert' => 1));
}
示例14: _doNewApp
private function _doNewApp($res, $appKey, $test)
{
// $url = 'http://192.168.1.211:9797/mobcentACA/app/wAMkQjefj3HPHsrfCk/profile';
$url = 'http://www.appbyme.com/mobcentACA/app/' . $appKey . '/profile';
$temRes = WebUtils::httpRequest($url, 30);
$temRes = WebUtils::jsonDecode($temRes);
$appInfo = array('appName' => WebUtils::t($temRes['appName']), 'appAuthor' => WebUtils::t($temRes['appAuthor']), 'appDescribe' => WebUtils::t($temRes['appDescribtion']), 'appVersion' => WebUtils::t($temRes['appVersion']), 'appIcon' => $temRes['appIcon'], 'appImage' => $temRes['appCover'], 'appContentId' => $temRes['contentId'], 'appDownloadUrl' => array('android' => $temRes['apkUrl'], 'apple' => $temRes['ipaUrl'], 'appleMobile' => $temRes['plistUrl']), 'appQRCode' => array('android' => $temRes['qrcode'], 'apple' => $temRes['qrcode']));
if ($test == 0) {
AppbymeConfig::saveDownloadOptions($appInfo);
AppbymeConfig::saveForumkey($temRes['forumKey']);
}
return $res;
}
示例15: _switchVest
private function _switchVest($res, $username)
{
global $_G;
$username = WebUtils::t(rawurldecode($username));
$_GET['username'] = $username;
$myrepeatsusergroups = (array) dunserialize($_G['cache']['plugin']['myrepeats']['usergroups']);
if (!in_array($_G['groupid'], $myrepeatsusergroups)) {
$users = C::t('#myrepeats#myrepeats')->fetch_all_by_username($_G['username']);
if (!$users) {
return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
} else {
$permusers = array();
foreach ($users as $user) {
$permusers[] = $user['uid'];
}
$member = C::t('common_member')->fetch_by_username($_GET['username']);
if (!$member || !in_array($member['uid'], $permusers)) {
return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'usergroup_disabled'));
}
}
}
$user = C::t('#myrepeats#myrepeats')->fetch_all_by_uid_username($_G['uid'], $_GET['username']);
$user = current($user);
$olddiscuz_uid = $_G['uid'];
$olddiscuz_user = $_G['username'];
$olddiscuz_userss = $_G['member']['username'];
if (!$user) {
$newuid = C::t('common_member')->fetch_uid_by_username($_GET['username']);
if (C::t('#myrepeats#myrepeats')->count_by_uid_username($newuid, $olddiscuz_userss)) {
// 第一次登录,需要输入密码
}
//return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_nonexistence'));
} elseif ($user['locked']) {
return $this->makeErrorInfo($res, lang('plugin/myrepeats', 'user_locked', array('user' => $_GET['username'])));
}
list($password, $questionid, $answer) = explode("\t", authcode($user['logindata'], 'DECODE', $_G['config']['security']['authkey']));
$logInfo = UserUtils::login($username, $password);
if ($logInfo['errcode']) {
return $this->makeErrorInfo($res, $logInfo['message']);
}
$userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
$userAvatar = UserUtils::getUserAvatar($_G['uid']);
$res['token'] = (string) $userInfo['token'];
$res['secret'] = (string) $userInfo['secret'];
$res['uid'] = (int) $_G['uid'];
$res['avatar'] = (string) $userAvatar;
$res['userName'] = (string) $_G['username'];
return $res;
}