本文整理汇总了PHP中UserUtils::pushIOSMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::pushIOSMessage方法的具体用法?PHP UserUtils::pushIOSMessage怎么用?PHP UserUtils::pushIOSMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::pushIOSMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _pmSend
//.........这里部分代码省略.........
$_G['cache']['smilies']['replacearray'][$key] = '[img]' . $_G['siteurl'] . 'static/image/smiley/' . $_G['cache']['smileytypes'][$_G['cache']['smilies']['typearray'][$key]]['directory'] . '/' . $smiley . '[/img]';
}
$message = preg_replace($_G['cache']['smilies']['searcharray'], $_G['cache']['smilies']['replacearray'], $message);
$subject = '';
if ($type == 1) {
$subject = dhtmlspecialchars(trim($_POST['subject']));
}
include_once libfile('function/friend');
$return = 0;
if ($touid || $pmid) {
if ($touid) {
if ($value = getuserbyuid($touid)) {
$value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
if ($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || $value['onlyacceptfriendpm'] == 1 && friend_check($touid)) {
$return = sendpm($touid, $subject, $message, '', 0, 0, $type);
} else {
// showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true));
return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_onlyfriend'));
}
} else {
// showmessage('message_bad_touid', '', array(), array('return' => true));
return $this->makeErrorInfo($res, lang('message', 'message_bad_touid'));
}
} else {
$topmuid = intval($_GET['topmuid']);
$return = sendpm($topmuid, $subject, $message, '', $pmid, 0);
}
} elseif ($users) {
$newusers = $uidsarr = $membersarr = array();
if ($users) {
$membersarr = C::t('common_member')->fetch_all_by_username($users);
foreach ($membersarr as $aUsername => $aUser) {
$uidsarr[] = $aUser['uid'];
}
}
if (empty($membersarr)) {
showmessage('message_bad_touser', '', array(), array('return' => true));
}
if (isset($membersarr[$_G['uid']])) {
showmessage('message_can_not_send_to_self', '', array(), array('return' => true));
}
friend_check($uidsarr);
foreach ($membersarr as $key => $value) {
$value['onlyacceptfriendpm'] = $value['onlyacceptfriendpm'] ? $value['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
if ($_G['group']['allowsendallpm'] || $value['onlyacceptfriendpm'] == 2 || $value['onlyacceptfriendpm'] == 1 && $_G['home_friend_' . $value['uid'] . '_' . $_G['uid']]) {
$newusers[$value['uid']] = $value['username'];
unset($users[array_search($value['username'], $users)]);
}
}
if (empty($newusers)) {
showmessage('message_can_not_send_onlyfriend', '', array(), array('return' => true));
}
foreach ($newusers as $key => $value) {
if (isblacklist($key)) {
showmessage('is_blacklist', '', array(), array('return' => true));
}
}
$coef = count($newusers);
$return = sendpm(implode(',', $newusers), $subject, $message, '', 0, 1, $type);
} else {
// showmessage('message_can_not_send_9', '', array(), array('return' => true));
return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_9'));
}
if ($return > 0) {
include_once libfile('function/stat');
updatestat('sendpm', 0, $coef);
C::t('common_member_status')->update($_G['uid'], array('lastpost' => TIMESTAMP));
!($_G['group']['exempt'] & 1) && updatecreditbyaction('sendpm', 0, array(), '', $coef);
if (!empty($newusers)) {
if ($type == 1) {
$returnurl = 'home.php?mod=space&do=pm&filter=privatepm';
} else {
$returnurl = 'home.php?mod=space&do=pm';
}
showmessage(count($users) ? 'message_send_result' : 'do_success', $returnurl, array('users' => implode(',', $users), 'succeed' => count($newusers)));
} else {
if (!defined('IN_MOBILE')) {
// showmessage('do_success', 'home.php?mod=space&do=pm&subop=view&touid='.$touid, array('pmid' => $return), $_G['inajax'] ? array('msgtype' => 3, 'showmsg' => false) : array());
} else {
// showmessage('do_success', 'home.php?mod=space&do=pm&subop=view'.(intval($_POST['touid']) ? '&touid='.intval($_POST['touid']) : ( intval($_POST['plid']) ? '&plid='.intval($_POST['plid']).'&daterange=1&type=1' : '' )));
}
$res = $this->makeErrorInfo($res, 'do_success', array('noError' => 1, 'alert' => 0));
$msgInfo = uc_pm_viewnode($_G['uid'], $type, $return);
$res['body']['plid'] = (int) $msgInfo['plid'];
$res['body']['pmid'] = (int) $msgInfo['pmid'];
$res['body']['sendTime'] = $msgInfo['dateline'] . '000';
// ios push
UserUtils::pushIOSMessage($touid, 'pm', $_G['username'] . WebUtils::t(' 对 您 说: ') . $message);
}
} else {
if (in_array($return, range(-16, -1))) {
// showmessage('message_can_not_send_'.abs($return));
return $this->makeErrorInfo($res, lang('message', 'message_can_not_send_' . abs($return)));
} else {
// showmessage('message_can_not_send', '', array(), array('return' => true));
return $this->makeErrorInfo($res, lang('message', 'message_can_not_send'));
}
}
return $res;
}
示例2: replyPost
//.........这里部分代码省略.........
if (getstatus($thread['status'], 3) && $postionid) {
$rushstopfloor = $rushinfo['stopfloor'];
if ($rushstopfloor > 0 && $thread['closed'] == 0 && $postionid >= $rushstopfloor) {
$updatethreaddata[] = 'closed=1';
}
}
useractionlog($_G['uid'], 'pid');
$nauthorid = 0;
if (!empty($_GET['noticeauthor']) && !$isanonymous && !$modnewreplies) {
list($ac, $nauthorid) = explode('|', authcode($_GET['noticeauthor'], 'DECODE'));
if ($nauthorid != $_G['uid']) {
if ($ac == 'q') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'fid' => $_G['fid'], 'pid' => $pid, 'from_id' => $pid, 'from_idtype' => 'quote'));
} elseif ($ac == 'r') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'fid' => $_G['fid'], 'pid' => $pid, 'from_id' => $thread['tid'], 'from_idtype' => 'post'));
}
}
if ($postcomment) {
$rpid = intval($_GET['reppid']);
if ($rpost = C::t('forum_post')->fetch('tid:' . $thread['tid'], $rpid)) {
if (!$rpost['first']) {
C::t('forum_postcomment')->insert(array('tid' => $thread['tid'], 'pid' => $rpid, 'rpid' => $pid, 'author' => $_G['username'], 'authorid' => $_G['uid'], 'dateline' => TIMESTAMP, 'comment' => $postcomment, 'score' => 0, 'useip' => $_G['clientip']));
C::t('forum_post')->update('tid:' . $thread['tid'], $rpid, array('comment' => 1));
C::t('forum_postcache')->delete($rpid);
}
}
unset($postcomment);
}
}
if ($thread['authorid'] != $_G['uid'] && getstatus($thread['status'], 6) && empty($_GET['noticeauthor']) && !$isanonymous && !$modnewreplies) {
$thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($_G['tid'], 0);
notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'fid' => $_G['fid'], 'pid' => $pid, 'from_id' => $thread['tid'], 'from_idtype' => 'post'));
// ios push
UserUtils::pushIOSMessage($thread['authorid'], 'reply', $_G['username'] . WebUtils::t(' 回复了您的帖子 ') . $thread['subject']);
}
$feedid = 0;
if (helper_access::check_module('follow') && !empty($_GET['adddynamic']) && !$isanonymous) {
require_once libfile('function/discuzcode');
require_once libfile('function/followcode');
$feedcontent = C::t('forum_threadpreview')->count_by_tid($thread['tid']);
$firstpost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
if (empty($feedcontent)) {
$feedcontent = array('tid' => $thread['tid'], 'content' => followcode($firstpost['message'], $thread['tid'], $pid, 1000));
C::t('forum_threadpreview')->insert($feedcontent);
C::t('forum_thread')->update_status_by_tid($thread['tid'], '512');
} else {
C::t('forum_threadpreview')->update_relay_by_tid($thread['tid'], 1);
}
$notemsg = cutstr(followcode($message, $thread['tid'], $pid, 0, false), 140);
$followfeed = array('uid' => $_G['uid'], 'username' => $_G['username'], 'tid' => $thread['tid'], 'note' => $notemsg, 'dateline' => TIMESTAMP);
$feedid = C::t('home_follow_feed')->insert($followfeed, true);
C::t('common_member_count')->increase($_G['uid'], array('feeds' => 1));
}
if ($thread['replycredit'] > 0 && !$modnewreplies && $thread['authorid'] != $_G['uid'] && $_G['uid']) {
$replycredit_rule = C::t('forum_replycredit')->fetch($_G['tid']);
if (!empty($replycredit_rule['times'])) {
$have_replycredit = C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'RCA', $_G['tid']);
if ($replycredit_rule['membertimes'] - $have_replycredit > 0 && $thread['replycredit'] - $replycredit_rule['extcredits'] >= 0) {
$replycredit_rule['extcreditstype'] = $replycredit_rule['extcreditstype'] ? $replycredit_rule['extcreditstype'] : $_G['setting']['creditstransextra'][10];
if ($replycredit_rule['random'] > 0) {
$rand = rand(1, 100);
$rand_replycredit = $rand <= $replycredit_rule['random'] ? true : false;
} else {
$rand_replycredit = true;
}
if ($rand_replycredit) {
示例3: _adminUser
private function _adminUser($act, $uid)
{
global $_G;
$errorMsg = '';
require_once libfile('function/spacecp');
require_once libfile('function/home');
require_once libfile('function/friend');
if (friend_request_check($uid) && $act == 'add') {
$act = 'add2';
}
if ($act == 'add' || $act == 'add2') {
if ($uid == $_G['uid']) {
$list = $this->makeErrorInfo($res, 'friend_self_error');
$this->_exitWithHtmlAlert($list['errcode']);
}
if (friend_check($uid)) {
$list = $this->makeErrorInfo($res, 'you_have_friends');
$this->_exitWithHtmlAlert($list['errcode']);
}
$tospace = getuserbyuid($uid);
if (empty($tospace)) {
$list = $this->makeErrorInfo($res, 'space_does_not_exist');
$this->_exitWithHtmlAlert($list['errcode']);
}
if (isblacklist($tospace['uid'])) {
$list = $this->makeErrorInfo($res, 'is_blacklist');
$this->_exitWithHtmlAlert($list['errcode']);
}
space_merge($space, 'count');
space_merge($space, 'field_home');
$maxfriendnum = checkperm('maxfriendnum');
if ($maxfriendnum && $space['friends'] >= $maxfriendnum + $space['addfriend']) {
if ($_G['magic']['friendnum']) {
$list = $this->makeErrorInfo($res, 'enough_of_the_number_of_friends_with_magic');
$this->_exitWithHtmlAlert($list['errcode']);
} else {
$list = $this->makeErrorInfo($res, 'enough_of_the_number_of_friends');
$this->_exitWithHtmlAlert($list['errcode']);
}
}
if ($act == 'add') {
if (!checkperm('allowfriend')) {
$list = $this->makeErrorInfo($res, 'no_privilege_addfriend');
$this->_exitWithHtmlAlert($list['errcode']);
}
if (C::t('home_friend_request')->count_by_uid_fuid($uid, $_G['uid'])) {
$list = $this->makeErrorInfo($res, 'waiting_for_the_other_test');
$this->_exitWithHtmlAlert($list['errcode']);
}
}
}
require_once libfile('function/friend');
require_once libfile('function/spacecp');
if (!empty($_POST)) {
switch ($act) {
case 'add':
$note = $_GET['note'];
if (!friend_request_check($uid)) {
$_POST['gid'] = $gid;
$_POST['note'] = censor(htmlspecialchars(cutstr($note, strtolower(CHARSET) == 'utf-8' ? 30 : 20, '')));
friend_add($uid, $_POST['gid'], $_POST['note']);
$note = array('uid' => $_G['uid'], 'url' => 'home.php?mod=spacecp&ac=friend&op=add&uid=' . $_G['uid'] . '&from=notice', 'from_id' => $_G['uid'], 'from_idtype' => 'friendrequest', 'note' => !empty($_POST['note']) ? lang('spacecp', 'friend_request_note', array('note' => $_POST['note'])) : '');
notification_add($uid, 'friend', 'friend_request', $note);
// ios push
UserUtils::pushIOSMessage($uid, 'friend', $_G['username'] . WebUtils::t(' 请求加您为好友') . $note['note']);
require_once libfile('function/mail');
$values = array('username' => $tospace['username'], 'url' => getsiteurl() . 'home.php?mod=spacecp&ac=friend&op=request');
sendmail_touser($uid, lang('spacecp', 'friend_subject', $values), '', 'friend_add');
$list = $this->makeErrorInfo($res, 'request_has_been_sent');
$this->_exitWithHtmlAlert($list['errcode']);
}
$this->_exitWithHtmlAlert($res['errcode']);
case 'add2':
global $_G;
require_once libfile('function/home');
$_POST['gid'] = intval($gid);
friend_add($uid, $uid);
if (ckprivacy('friend', 'feed')) {
require_once libfile('function/feed');
feed_add('friend', 'feed_friend_title', array('touser' => "<a href=\"home.php?mod=space&uid={$tospace['uid']}\">{$tospace['username']}</a>"));
}
notification_add($uid, 'friend', 'friend_add');
// showmessage('friends_add', dreferer(), array('username' => $tospace['username'], 'uid'=>$uid, 'from' => $_GET['from']), array('showdialog'=>1, 'showmsg' => true, 'closetime' => true));
$list = $this->makeErrorInfo($res, 'friends_add', array('{username}' => $tospace['username']));
$this->_exitWithHtmlAlert($list['errcode']);
break;
case 'ignore':
global $_G;
require_once libfile('function/friend');
friend_delete($uid);
$params['noError'] = 1;
$list = $this->makeErrorInfo($res, 'do_success', $params);
$this->_exitWithHtmlAlert($list['errcode']);
break;
case 'shield':
global $_G, $space;
// $type = empty($_GET['type'])?'':preg_replace("/[^0-9a-zA-Z\_\-\.]/", '', $_GET['type']);
// if(submitcheck('ignoresubmit')) {
$authorid = empty($_POST['authorid']) ? 0 : intval($_POST['authorid']);
$type = 'friend';
//.........这里部分代码省略.........