本文整理汇总了PHP中friend_check函数的典型用法代码示例。如果您正苦于以下问题:PHP friend_check函数的具体用法?PHP friend_check怎么用?PHP friend_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了friend_check函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getNotifyInfo
private function _getNotifyInfo($uid, $type, $page, $pageSize)
{
$info = array('count' => 0, 'list' => array(), 'data' => array());
$count = DzHomeNotification::getCountByUid($uid, $type);
$notifyData = DzHomeNotification::getAllNotifyByUid($uid, $type, $page, $pageSize);
foreach ($notifyData as $data) {
$isAllowData = true;
$actions = array();
$matches = array();
preg_match('/<a onclick="showWindow.+?>(\\S+)<\\/a>/mi', $data['note'], $matches);
if (!empty($matches)) {
$actions = array();
$action = array('redirect' => '', 'title' => $matches[1], 'type' => '');
// 添加好友按钮
$tempMatches = array();
preg_match('/ac=friend&op=(\\w+)&uid=(\\d+)/mi', $matches[0], $tempMatches);
if (!empty($tempMatches)) {
$action['redirect'] = WebUtils::createUrl_oldVersion('user/useradminview', array('act' => $tempMatches[1], 'uid' => $tempMatches[2]));
$action['type'] = self::NOTIFY_TYPE_FRIEND;
}
$data['note'] = str_replace($matches[1], '', $data['note']);
// 暂时屏蔽已经是好友的动作
if (friend_check($tempMatches[2])) {
$isAllowData = false;
$count--;
}
$actions[] = $action;
}
if ($isAllowData) {
$tmpData['dateline'] = $data['dateline'] . '000';
$tmpData['type'] = $data['type'];
$tmpData['note'] = WebUtils::emptyHtml($data['note']);
$tmpData['fromId'] = (int) $data['from_id'];
$tmpData['fromIdType'] = $data['from_idtype'];
$tmpData['author'] = $data['author'];
$tmpData['authorId'] = (int) $data['authorid'];
$tmpData['authorAvatar'] = UserUtils::getUserAvatar($data['authorid']);
$tmpData['actions'] = $actions;
$info['data'][] = $tmpData;
}
}
if ($type == self::NOTIFY_TYPE_POST || $type == self::NOTIFY_TYPE_AT) {
foreach ($notifyData as $data) {
$matches = array();
preg_match_all('/&ptid=(\\d+?)&pid=(\\d+?)"/i', $data['note'], $matches);
$ptid = $matches[1][0];
$pid = $matches[2][0];
$postInfo = $this->_getPostInfo($ptid, $pid);
if (!empty($postInfo)) {
$info['list'][] = $postInfo;
} else {
--$count;
}
}
}
$info['count'] = $count;
return $info;
}
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:58,代码来源:NotifyListAction.php
示例2: post_bene_invite_message
function post_bene_invite_message($params) {
global $_G;
if(!self::$isopen) return false;
list($message, $forwordURL, $threadValue) = $params['param'];
$_setting = $_G['cache']['plugin']['bene_invite'];
if(!empty($_POST['username'])) {
$_POST['users'][] = $_POST['username'];
}
$users = empty($_POST['users']) ? array() : $_POST['users'];
$coef = 1;
if(!empty($users)) {
$coef = count($users);
}
include_once libfile('function/friend');
$return = 0;
if($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) {
$thread = C::t('forum_thread')->fetch($threadValue['tid']);
notification_add($value['uid'], 'friend', lang('plugin/bene_invite', 'm1') . ' '.$_G['username'].lang('plugin/bene_invite', 'm2').$thread['subject'].lang('plugin/bene_invite', 'm3').'<span class="a"><a href="forum.php?mod=viewthread&tid='.$threadValue['tid'].'">'.lang('plugin/bene_invite', 'm4').'</a></span>');
}
}
return true;
}
开发者ID:TedaLIEz,项目名称:Backup,代码行数:45,代码来源:bene_invite.class.php
示例3: if
<li class="ul_diy"><a href="home.php?mod=space&do=index&diy=yes">装扮空间</a></li>
<?php } if(helper_access::check_module('wall')) { ?>
<li class="ul_msg"><a href="home.php?mod=space&do=wall">查看留言</a></li>
<?php } ?>
<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">编辑头像</a></li>
<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">更新资料</a></li>
<?php } else { if(helper_access::check_module('follow')) { ?>
<li class="ul_broadcast"><a href="home.php?mod=space&uid=<?php echo $space['uid'];?>">查看广播</a></li>
<?php } if(helper_access::check_module('follow') && $space['uid'] != $_G['uid']) { ?>
<li class="ul_flw"><?php $follow = 0;?><?php $follow = C::t('home_follow')->fetch_all_by_uid_followuid($_G['uid'], $space['uid']);?><?php if(!$follow) { ?>
<a id="followmod" onclick="showWindow(this.id, this.href, 'get', 0);" href="home.php?mod=spacecp&ac=follow&op=add&hash=<?php echo FORMHASH;?>&fuid=<?php echo $space['uid'];?>">收听TA</a>
<?php } else { ?>
<a id="followmod" onclick="showWindow(this.id, this.href, 'get', 0);" href="home.php?mod=spacecp&ac=follow&op=del&fuid=<?php echo $space['uid'];?>">取消收听</a>
<?php } ?>
</li>
<?php } require_once libfile('function/friend');$isfriend=friend_check($space[uid]);?><?php if(!$isfriend) { ?>
<li class="ul_add"><a href="home.php?mod=spacecp&ac=friend&op=add&uid=<?php echo $space['uid'];?>&handlekey=addfriendhk_<?php echo $space['uid'];?>" id="a_friend_li_<?php echo $space['uid'];?>" onclick="showWindow(this.id, this.href, 'get', 0);">加为好友</a></li>
<?php } else { ?>
<li class="ul_ignore"><a href="home.php?mod=spacecp&ac=friend&op=ignore&uid=<?php echo $space['uid'];?>&handlekey=ignorefriendhk_<?php echo $space['uid'];?>" id="a_ignore_<?php echo $space['uid'];?>" onclick="showWindow(this.id, this.href, 'get', 0);">解除好友</a></li>
<?php } if(helper_access::check_module('wall')) { ?>
<li class="ul_contect"><a href="home.php?mod=space&uid=<?php echo $space['uid'];?>&do=wall">给我留言</a></li>
<?php } ?>
<li class="ul_poke"><a href="home.php?mod=spacecp&ac=poke&op=send&uid=<?php echo $space['uid'];?>&handlekey=propokehk_<?php echo $space['uid'];?>" id="a_poke_<?php echo $space['uid'];?>" onclick="showWindow(this.id, this.href, 'get', 0);">打个招呼</a></li>
<li class="ul_pm"><a href="home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_<?php echo $space['uid'];?>&touid=<?php echo $space['uid'];?>&pmid=0&daterange=2" id="a_sendpm_<?php echo $space['uid'];?>" onclick="showWindow('showMsgBox', this.href, 'get', 0)">发送消息</a></li>
<?php } ?>
</ul>
<?php if(checkperm('allowbanuser') || checkperm('allowedituser') || $_G['adminid'] == 1) { ?>
<hr class="da mtn m0">
<ul class="ptn xl xl2 cl">
<?php if(checkperm('allowbanuser') || checkperm('allowedituser')) { ?>
开发者ID:noikiy,项目名称:ejia,代码行数:31,代码来源:2_diy_home_space_album_view.tpl.php
示例4: ckfriend_album
function ckfriend_album($album)
{
global $_G, $space;
if ($_G['adminid'] != 1) {
if (!ckfriend($album['uid'], $album['friend'], $album['target_ids'])) {
if (empty($_G['uid'])) {
showmessage('to_login', null, array(), array('showmsg' => true, 'login' => 1));
}
require_once libfile('function/friend');
$isfriend = friend_check($album['uid']);
space_merge($space, 'count');
space_merge($space, 'profile');
$_G['privacy'] = 1;
require_once libfile('space/profile', 'include');
include template('home/space_privacy');
exit;
} elseif (!$space['self'] && $album['friend'] == 4) {
$cookiename = "view_pwd_album_{$album['albumid']}";
$cookievalue = empty($_G['cookie'][$cookiename]) ? '' : $_G['cookie'][$cookiename];
if ($cookievalue != md5(md5($album['password']))) {
$invalue = $album;
include template('home/misc_inputpwd');
exit;
}
}
}
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:27,代码来源:space_album.php
示例5: array
$userapp = array();
if ($appid) {
$userapp = C::t('common_myapp')->fetch($appid);
}
$space = getuserbyuid($uid);
if (empty($space)) {
showmessage('space_does_not_exist', '', array(), array('return' => true));
}
$jumpurl = $appid ? "userapp.php?mod=app&id={$appid}&my_extra=invitedby_bi_{$uid}_{$_GET['c']}&my_suffix=Lw%3D%3D" : 'home.php?mod=space&uid=' . $uid;
if ($acceptconfirm) {
dsetcookie('invite_auth', '');
if ($_G['uid'] == $uid) {
showmessage('should_not_invite_your_own', '', array(), array('return' => true));
}
require_once libfile('function/friend');
if (friend_check($uid)) {
showmessage('you_have_friends', $jumpurl);
}
friend_make($space['uid'], $space['username']);
if ($id) {
C::t('common_invite')->update($id, array('fuid' => $_G['uid'], 'fusername' => $_G['username'], 'regdateline' => $_G['timestamp'], 'status' => 2));
notification_add($uid, 'friend', 'invite_friend', array('actor' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '" target="_blank">' . $_G['username'] . '</a>'), 1);
}
space_merge($space, 'field_home');
if (!empty($space['privacy']['feed']['invite'])) {
require_once libfile('function/feed');
$tite_data = array('username' => '<a href="home.php?mod=space&uid=' . $_G['uid'] . '">' . $_G['username'] . '</a>');
feed_add('friend', 'feed_invite', $tite_data, '', array(), '', array(), array(), '', '', '', 0, 0, '', $space['uid'], $space['username']);
}
if ($_G['setting']['inviteconfig']['inviteaddcredit']) {
updatemembercount($_G['uid'], array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['inviteaddcredit']));
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:home_invite.php
示例6: elseif
} elseif ($_GET['view'] == 'me') {
$filter = in_array($_G['gp_filter'], array('publish', 'join')) ? $_G['gp_filter'] : 'publish';
if ($filter == 'join') {
$wheresql = "p.uid = '{$space['uid']}' AND p.tid = t.tid";
$apply_sql = ', ' . DB::table('forum_pollvoter') . ' p ';
} else {
$wheresql = "t.authorid = '{$space['uid']}'";
}
$filteractives = array($filter => ' class="a"');
} else {
space_merge($space, 'field_home');
if ($space['feedfriend']) {
$fuid_actives = array();
require_once libfile('function/friend');
$fuid = intval($_GET['fuid']);
if ($fuid && friend_check($fuid, $space['uid'])) {
$wheresql = "t.authorid='{$fuid}'";
$fuid_actives = array($fuid => ' selected');
} else {
$wheresql = "t.authorid IN ({$space['feedfriend']})";
$theurl = "home.php?mod=space&uid={$space['uid']}&do={$do}&view=we";
}
$query = DB::query("SELECT * FROM " . DB::table('home_friend') . " WHERE uid='{$space['uid']}' ORDER BY num DESC LIMIT 0,100");
while ($value = DB::fetch($query)) {
$userlist[] = $value;
}
} else {
$need_count = false;
}
}
$actives = array($_GET['view'] => ' class="a"');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:space_poll.php
示例7: getblockhtml
function getblockhtml($blockname, $parameters = array())
{
global $_G, $space;
$parameters = empty($parameters) ? array() : $parameters;
$list = array();
$sql = $title = $html = $wheresql = $ordersql = $titlemore = $do = $view = $contentclassname = '';
$contenttagname = 'div';
$shownum = 6;
$uid = intval($space['uid']);
$shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
switch ($blockname) {
case 'profile':
$do = $blockname;
$managehtml = '';
$avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar'];
$html .= "<div class=\"hm\"><p><a href=\"home.php?mod=space&uid={$uid}\" target=\"__blank\">" . avatar($uid, $avatar) . '</a></p>';
$html .= "<h2><a href=\"home.php?mod=space&uid={$uid}\" target=\"__blank\">" . $space['username'] . "</a></h2>";
$html .= '</div><ul class="xl xl2 cl ul_list">';
$magicinfo = $showmagicgift = false;
if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
$showmagicgift = true;
$magicinfo = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
}
if ($space['self']) {
$html .= '<li class="ul_diy"><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
$html .= '<li class="ul_msg"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
$html .= '<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
$html .= '<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
if ($showmagicgift) {
$html .= '<li class="ul_magicgift"><div style="' . 'background: url(' . STATICURL . 'image/magic/gift.small.gif) no-repeat 0 50%;' . '">';
if ($magicinfo) {
$html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=retiregift">' . lang('magic/gift', 'gift_gc') . '</a>';
} else {
$html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=magic&mid=gift">' . lang('magic/gift', 'gift_use') . '</a>';
}
$html .= '</div></li>';
}
} else {
require_once libfile('function/friend');
$isfriend = friend_check($uid);
if (!$isfriend) {
$html .= "<li class='ul_add'><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
} else {
$html .= "<li class='ul_ignore'><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
}
$html .= "<li class='ul_msg'><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
$html .= "<li class='ul_poke'><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
$html .= "<li class='ul_pm'><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
}
$html .= '</ul>';
$encodeusername = rawurlencode($space['username']);
if (checkperm('allowbanuser')) {
$managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
} elseif (checkperm('allowedituser')) {
$managehtml .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" id="usermanageli" onmouseover="showMenu(this.id)" class="showmenu" target="_blank">' . lang('home/template', 'member_manage') . '</a></li>';
}
if ($_G['adminid'] == 1) {
$managehtml .= "<li><a href=\"forum.php?mod=modcp&action=thread&op=post&do=search&searchsubmit=1&users={$encodeusername}\" id=\"umanageli\" onmouseover=\"showMenu(this.id)\" class=\"showmenu\">" . lang('home/template', 'content_manage') . "</a></li>";
}
if (!empty($managehtml)) {
$html .= '<hr class="da mtn m0" /><ul class="ptn xl xl2 cl">' . $managehtml . '</ul><ul id="usermanageli_menu" class="p_pop" style="width: 80px; display:none;">';
if (checkperm('allowbanuser')) {
$html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=ban&username={$encodeusername}&frames=yes" : "forum.php?mod=modcp&action=member&op=ban&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_ban') . '</a></li>';
}
if (checkperm('allowedituser')) {
$html .= '<li><a href="' . ($_G['adminid'] == 1 ? "admin.php?action=members&operation=search&username={$encodeusername}&submit=yes&frames=yes" : "forum.php?mod=modcp&action=member&op=edit&uid={$space['uid']}") . '" target="_blank">' . lang('home/template', 'user_edit') . '</a></li>';
}
$html .= '</ul>';
if ($_G['adminid'] == 1) {
$html .= '<ul id="umanageli_menu" class="p_pop" style="width: 80px; display:none;">';
$html .= '<li><a href="admin.php?action=threads&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_post') . '</a></li>';
$html .= '<li><a href="admin.php?action=doing&searchsubmit=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_doing') . '</a></li>';
$html .= '<li><a href="admin.php?action=blog&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_blog') . '</a></li>';
$html .= '<li><a href="admin.php?action=feed&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_feed') . '</a></li>';
$html .= '<li><a href="admin.php?action=album&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_album') . '</a></li>';
$html .= '<li><a href="admin.php?action=pic&searchsubmit=1&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_pic') . '</a></li>';
$html .= '<li><a href="admin.php?action=comment&searchsubmit=1&authorid=' . $uid . '" target="_blank">' . lang('space', 'manage_comment') . '</a></li>';
$html .= '<li><a href="admin.php?action=share&searchsubmit=1&uid=' . $uid . '" target="_blank">' . lang('space', 'manage_share') . '</a></li>';
$html .= '<li><a href="admin.php?action=threads&operation=group&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_threads') . '</a></li>';
$html .= '<li><a href="admin.php?action=prune&searchsubmit=1&operation=group&users=' . $encodeusername . '" target="_blank">' . lang('space', 'manage_group_prune') . '</a></li>';
$html .= '</ul>';
}
}
if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
$info = !empty($space['magicgift']) ? unserialize($space['magicgift']) : array();
if ($space['self']) {
} elseif ($info) {
if ($info['left'] && !in_array($_G['uid'], (array) $info['receiver'])) {
$percredit = min($info['percredit'], $info['left']);
if ($info['credittype'] == 'credits') {
$credittype = lang('core', 'title_credit');
} else {
$extcredits = str_replace('extcredits', '', $info['credittype']);
$credittype = $_G['setting']['extcredits'][$extcredits]['title'];
}
$html .= '<div id="magicreceivegift">';
$html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=receivegift&uid=' . $uid . '" title="' . lang('magic/gift', 'gift_receive_gift', array('percredit' => $percredit, 'credittype' => $credittype)) . '">';
$html .= '<img src="' . STATICURL . 'image/magic/gift.gif" alt="gift" />';
$html .= '</a>';
$html .= '</div>';
//.........这里部分代码省略.........
开发者ID:v998,项目名称:discuzx-en,代码行数:101,代码来源:function_space.php
示例8: _userFriendSetting
private function _userFriendSetting($res, $uid, $gid, $note)
{
global $_G;
require_once libfile('function/friend');
require_once libfile('function/spacecp');
require_once libfile('function/home');
if (!checkperm('allowfriend')) {
return $this->makeErrorInfo($res, 'no_privilege_addfriend');
}
if ($uid == $_G['uid']) {
return $this->makeErrorInfo($res, 'friend_self_error');
}
if (friend_check($uid)) {
return $this->makeErrorInfo($res, 'you_have_friends');
}
$tospace = getuserbyuid($uid);
if (empty($tospace)) {
return $this->makeErrorInfo($res, 'space_does_not_exist');
}
if (isblacklist($tospace['uid'])) {
return $this->makeErrorInfo($res, 'is_blacklist');
}
// $res['body']['gidInfo'] = $this->_getFriendGroupList();
space_merge($space, 'count');
space_merge($space, 'field_home');
$maxfriendnum = checkperm('maxfriendnum');
if ($maxfriendnum && $space['friends'] >= $maxfriendnum + $space['addfriend']) {
if ($_G['magic']['friendnum']) {
return $this->makeErrorInfo($res, 'enough_of_the_number_of_friends_with_magic');
} else {
return $this->makeErrorInfo($res, 'enough_of_the_number_of_friends');
}
}
if (friend_request_check($uid)) {
// if(submitcheck('add2submit')) {
$_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));
return $this->makeErrorInfo($res, 'friends_add', array('{username}' => $tospace['username']));
// }
// $op = 'add2';
// $groupselect = empty($space['privacy']['groupname']) ? array(1 => ' checked') : array();
// $navtitle = lang('core', 'title_friend_add');
// include template('home/spacecp_friend');
// exit();
} else {
if (C::t('home_friend_request')->count_by_uid_fuid($uid, $_G['uid'])) {
return $this->makeErrorInfo($res, 'waiting_for_the_other_test');
}
$_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);
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');
return $this->makeErrorInfo($res, 'request_has_been_sent');
}
return $res;
}
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:66,代码来源:UserAdminAction.php
示例9: getblockhtml
function getblockhtml($blockname, $parameters = array())
{
global $_G, $space;
$parameters = empty($parameters) ? array() : $parameters;
$list = array();
$sql = $title = $html = $wheresql = $ordersql = $titlemore = $do = $contentclassname = '';
$view = $from = false;
$contenttagname = 'div';
$shownum = 6;
$uid = intval($space['uid']);
$shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
switch ($blockname) {
case 'personalinfo':
$do = 'profile';
space_merge($space, 'profile');
require_once libfile('function/friend');
$isfriend = friend_check($space['uid']);
require_once libfile('function/spacecp');
loadcache('profilesetting');
include_once libfile('function/profile');
$profiles = array();
$privacy = $space['privacy']['profile'] ? $space['privacy']['profile'] : array();
foreach ($_G['cache']['profilesetting'] as $fieldid => $field) {
if (!$field['available'] || in_array($fieldid, array('birthprovince', 'birthdist', 'birthcommunity', 'resideprovince', 'residedist', 'residecommunity'))) {
continue;
}
if ($field['available'] && $field['invisible'] != '1' && strlen($space[$fieldid]) > 0 && ($field['showinthread'] || $field['showincard'] || ($space['self'] || empty($privacy[$fieldid]) || $isfriend && $privacy[$fieldid] == 1))) {
$val = profile_show($fieldid, $space);
if ($val !== false) {
if ($fieldid == 'realname' && $_G['uid'] != $space['uid'] && !ckrealname(1)) {
continue;
}
if ($field['formtype'] == 'file' && $val) {
$imgurl = getglobal('setting/attachurl') . './profile/' . $val;
$val = '<span><a href="' . $imgurl . '" target="_blank"><img src="' . $imgurl . '" style="max-width: 300px;" /></a></span>';
}
if ($val == '') {
$val = '';
}
$html .= '<li><em>' . $field['title'] . '</em>' . $val . '</li>';
}
}
}
$html = $html ? $html : '<li>' . lang('space', 'block_view_profileinfo_noperm') . '</li>';
$html = '<ul id="pprl" class="mbm pbm bbda cl">' . $html . $more . '</ul>';
$more = lang('space', 'block_profile_all', array('uid' => $uid));
$html = $html . $more;
$titlemore = $space['self'] ? lang('space', 'block_profile_edit') : '';
break;
case 'profile':
$do = $blockname;
$managehtml = '';
$avatar = empty($parameters['banavatar']) ? 'middle' : $parameters['banavatar'];
$html .= "<div class=\"hm\"><p><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . avatar($uid, $avatar) . '</a></p>';
$memberfieldforum = C::t('common_member_field_forum')->fetch($space['uid']);
$space['medals'] = $memberfieldforum['medals'];
unset($memberfieldforum);
$usermedals = $medal_detial = $usermedalmenus = '';
if ($space['medals']) {
loadcache('medals');
foreach ($space['medals'] = explode("\t", $space['medals']) as $key => $medalid) {
list($medalid, $medalexpiration) = explode("|", $medalid);
if (isset($_G['cache']['medals'][$medalid]) && (!$medalexpiration || $medalexpiration > TIMESTAMP)) {
$usermedals .= '<img src="' . STATICURL . 'image/common/' . $_G['cache']['medals'][$medalid]['image'] . '" id="md_' . $medalid . '" alt="' . $_G['cache']['medals'][$medalid]['name'] . '\'" onmouseover="showMenu({\'ctrlid\':this.id, \'menuid\':\'md_' . $medalid . '_menu\', \'pos\':\'12!\'});" /> ';
$usermedalmenus .= '
<div id="md_' . $medalid . '_menu" class="tip tip_4" style="display: none;">
<div class="tip_horn"></div>
<div class="tip_c">
<h4>' . $_G['cache']['medals'][$medalid]['name'] . '</h4>
<p>' . $_G['cache']['medals'][$medalid]['description'] . '</p>
</div>
</div>';
}
}
if ($usermedals) {
$usermedals = '<p class="md_ctrl"><a href="home.php?mod=medal">' . $usermedals . '</a></p>' . $usermedalmenus;
}
}
$html .= "<h2 class=\"mbn\"><a href=\"home.php?mod=space&uid={$uid}\" target=\"_blank\">" . $space['username'] . "</a></h2>{$usermedals}";
$html .= '</div><ul class="xl xl2 cl ul_list">';
$magicinfo = $showmagicgift = false;
if ($_G['setting']['magicstatus'] && $_G['setting']['magics']['gift']) {
$showmagicgift = true;
$magicinfo = !empty($space['magicgift']) ? dunserialize($space['magicgift']) : array();
}
if (helper_access::check_module('follow')) {
$html .= '<li class="ul_broadcast"><a href="home.php?mod=space&uid=' . $uid . '">' . lang('space', 'block_profile_follow') . '</a></li>';
}
if ($space['self']) {
$html .= '<li class="ul_diy"><a href="home.php?mod=space&do=index&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
$html .= '<li class="ul_msg"><a href="home.php?mod=space&uid=' . $uid . '&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
$html .= '<li class="ul_avt"><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
$html .= '<li class="ul_profile"><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
if ($showmagicgift) {
$html .= '<li class="ul_magicgift"><div style="' . 'background: url(' . STATICURL . 'image/magic/gift.small.gif) no-repeat 0 50%;' . '">';
if ($magicinfo) {
$html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=spacecp&ac=magic&op=retiregift">' . lang('magic/gift', 'gift_gc') . '</a>';
} else {
$html .= '<a onclick="showWindow(\'magicgift\', this.href, \'get\', 0)" href="home.php?mod=magic&mid=gift">' . lang('magic/gift', 'gift_use') . '</a>';
}
//.........这里部分代码省略.........
开发者ID:dalinhuang,项目名称:healthshop,代码行数:101,代码来源:function_space.php
示例10: elseif
}
} elseif ($_GET['op'] == 'appendmember') {
$memberusername = trim($_GET['memberusername']);
$members = array();
if ($memberusername) {
$members = C::t('common_member')->fetch_all_by_username(explode(',', $memberusername));
}
if (empty($members)) {
showmessage('pm_appendkmember_error_nopm');
}
if (submitcheck('pmappendmembersubmit')) {
include_once libfile('function/friend');
$returns = array();
foreach ($members as $member) {
$member['onlyacceptfriendpm'] = $member['onlyacceptfriendpm'] ? $member['onlyacceptfriendpm'] : ($_G['setting']['onlyacceptfriendpm'] ? 1 : 2);
if ($_G['group']['allowsendallpm'] || $member['onlyacceptfriendpm'] == 2 || $member['onlyacceptfriendpm'] == 1 && friend_check($member['uid'])) {
$return = uc_pm_appendchatpm($plid, $_G['uid'], $member['uid']);
$returns[] = array('uid' => $member['uid'], 'username' => $member['username'], 'return' => $return);
} else {
$returns[] = array('uid' => $member['uid'], 'username' => $member['username'], 'return' => 0);
}
}
$cannotappend = array();
foreach ($returns as $value) {
if ($value['return'] < 0) {
$cannotappend[] = $value['username'] . '(' . lang('spacecp', 'message_can_not_send_' . abs($value['return'])) . ')';
} elseif ($value['return'] == 0) {
$cannotappend[] = $value['username'] . '(' . lang('spacecp', 'message_can_not_send_onlyfriend') . ')';
}
}
if (empty($cannotappend)) {
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:spacecp_pm.php
示例11: getblockhtml
function getblockhtml($blockname, $parameters = array())
{
global $_G, $space;
$parameters = empty($parameters) ? array() : $parameters;
$list = array();
$sql = $title = $html = $wheresql = $ordersql = '';
$shownum = 6;
$uid = intval($space['uid']);
$shownum = empty($parameters['shownum']) ? $shownum : intval($parameters['shownum']);
switch ($blockname) {
case 'profile':
$html .= '<div class="avt avtm">' . avatar($space['uid'], 'middle');
$html .= '<h2>' . $space['username'] . '</h2>';
$html .= '</div><ul class="xl xl2 cl">';
if ($space['self']) {
$html .= '<li><a href="home.php?mod=space&diy=yes">' . lang('space', 'block_profile_diy') . '</a></li>';
$html .= '<li><a href="home.php?mod=space&do=wall">' . lang('space', 'block_profile_wall') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=avatar">' . lang('space', 'block_profile_avatar') . '</a></li>';
$html .= '<li><a href="home.php?mod=spacecp&ac=profile">' . lang('space', 'block_profile_update') . '</a></li>';
} else {
require_once libfile('function/friend');
$isfriend = friend_check($space['uid']);
if (!$isfriend) {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=add&uid={$space['uid']}&handlekey=addfriendhk_{$space[uid]}\" id=\"a_friend_li_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_add') . "</a></li>";
} else {
$html .= "<li><a href=\"home.php?mod=spacecp&ac=friend&op=ignore&uid={$space['uid']}&handlekey=ignorefriendhk_{$space[uid]}\" id=\"a_ignore_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_friend_ignore') . "</a></li>";
}
$html .= "<li><a href=\"home.php?mod=space&uid={$space['uid']}&do=wall\">" . lang('space', 'block_profile_wall_to_me') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=poke&op=send&uid={$space['uid']}&handlekey=propokehk_{$space[uid]}\" id=\"a_poke_{$space[uid]}\" onclick=\"showWindow(this.id, this.href, 'get', 0);\">" . lang('space', 'block_profile_poke') . "</a></li>";
$html .= "<li><a href=\"home.php?mod=spacecp&ac=pm&op=showmsg&handlekey=showmsg_{$space['uid']}&touid={$space['uid']}&pmid=0&daterange=2\" id=\"a_sendpm_{$space['uid']}\" onclick=\"showWindow('showMsgBox', this.href, 'get', 0)\">" . lang('space', 'block_profile_sendmessage') . "</a></li>";
}
$html .= '</ul>';
$html = '<div class="content"><div id="pcd">' . $html . '</div></div>';
break;
case 'doing':
$dolist = array();
$sql = "SELECT * FROM " . DB::table('home_doing') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}";
$query = DB::query($sql);
while ($value = DB::fetch($query)) {
$dolist[] = $value;
}
if ($dolist) {
foreach ($dolist as $dv) {
$doid = $dv['doid'];
$_G[gp_key] = $key = random(8);
$html .= "<li class=\"pbn bbda\">";
$html .= $dv['message'];
$html .= " <a href=\"home.php?mod=space&uid={$dv['uid']}&do=doing&view=me&from=space&doid={$dv['doid']}\" target=\"_blank\" class=\"xg1\">" . lang('space', 'block_doing_reply') . "</a>";
$html .= "</li>";
}
} else {
$html .= "<p class=\"emp\">" . lang('space', 'block_doing_no_content') . "</p>";
}
$html = '<div class="content"><ul class="xl">' . $html . '</ul></div>';
break;
case 'blog':
$query = DB::query("SELECT bf.*, b.* FROM " . DB::table('home_blog') . " b\n\t\t\t\tLEFT JOIN " . DB::table('home_blogfield') . " bf ON bf.blogid=b.blogid\n\t\t\t\tWHERE b.uid='{$uid}'\n\t\t\t\tORDER BY b.dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
if ($value['pic']) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
}
$value['message'] = $value['friend'] == 4 ? '' : getstr($value['message'], 150, 0, 0, 0, 0, -1);
$html .= lang('space', 'blog_li', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'subject' => $value['subject'], 'date' => dgmdate($value['dateline'], 'Y-m-d')));
if ($parameters['showmessage']) {
if ($value['pic']) {
$html .= lang('space', 'blog_li_img', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'src' => $value['pic']));
}
$html .= "<dd>{$value['message']}</dd>";
}
$html .= lang('space', 'blog_li_ext', array('uid' => $value['uid'], 'blogid' => $value['blogid'], 'viewnum' => $value['viewnum'], 'replynum' => $value['replynum']));
$html .= "</dl>";
} else {
$html .= '<p>' . lang('space', 'block_view_noperm') . '</p>';
}
}
$more = $html ? '<p class="ptm" style="text-align: right;"><a href="home.php?mod=space&uid=' . $space['uid'] . '&do=blog&view=me&from=space">' . lang('space', 'viewmore') . '</a></p>' : '';
$html = '<div class="content xld">' . $html . $more . '</div>';
break;
case 'album':
if (ckprivacy('album', 'view')) {
$query = DB::query("SELECT * FROM " . DB::table('home_album') . " WHERE uid='{$uid}' ORDER BY updatetime DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$value['pic'] = pic_cover_get($value['pic'], $value['picflag']);
$html .= lang('space', 'album_li', array('albumid' => $value['albumid'], 'src' => $value['pic'], 'albumname' => $value['albumname'], 'uid' => $value['uid'], 'picnum' => $value['picnum'], 'date' => dgmdate($value['updatetime'], 'n-j')));
}
}
} else {
$html .= '<li>' . lang('space', 'block_view_noperm') . '</li>';
}
$html = '<div class="content"><ul class="ml mla cl">' . $html . '</ul></div>';
break;
case 'feed':
if (ckprivacy('feed', 'view')) {
require_once libfile('function/feed');
$query = DB::query("SELECT * FROM " . DB::table('home_feed') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
while ($value = DB::fetch($query)) {
if (ckfriend($value['uid'], $value['friend'], $value['target_ids'])) {
$html .= mkfeedhtml(mkfeed($value));
//.........这里部分代码省略.........
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:101,代码来源:function_space.php
示例12: _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']) {
|
请发表评论