本文整理汇总了PHP中CFriendsHelper::isWaitingApproval方法的典型用法代码示例。如果您正苦于以下问题:PHP CFriendsHelper::isWaitingApproval方法的具体用法?PHP CFriendsHelper::isWaitingApproval怎么用?PHP CFriendsHelper::isWaitingApproval使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFriendsHelper
的用法示例。
在下文中一共展示了CFriendsHelper::isWaitingApproval方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showMiniHeader
public static function showMiniHeader($userId)
{
CMiniHeader::load();
$mainframe = JFactory::getApplication();
$jinput = $mainframe->input;
JFactory::getLanguage()->load('com_community');
$option = $jinput->get('option', '', 'STRING');
//JRequest::getVar('option', '' , 'REQUEST');
$my = CFactory::getUser();
$config = CFactory::getConfig();
if (!empty($userId)) {
$user = CFactory::getUser($userId);
$params = $user->getParams();
//links information
$photoEnabled = $config->get('enablephotos') ? true : false;
$eventEnabled = $config->get('enableevents') ? true : false;
$groupEnabled = $config->get('enablegroups') ? true : false;
$videoEnabled = $config->get('enablevideos') ? true : false;
//likes
CFactory::load('libraries', 'like');
$like = new Clike();
$isLikeEnabled = $like->enabled('profile') && $params->get('profileLikes', 1) ? 1 : 0;
$isUserLiked = $like->userLiked('profile', $user->id, $my->id);
/* likes count */
$likes = $like->getLikeCount('profile', $user->id);
//profile
$profileModel = CFactory::getModel('profile');
$profile = $profileModel->getViewableProfile($user->id, $user->getProfileType());
$profile = JArrayHelper::toObject($profile);
$profile->largeAvatar = $user->getAvatar();
$profile->defaultAvatar = $user->isDefaultAvatar();
$profile->status = $user->getStatus();
$profile->defaultCover = $user->isDefaultCover();
$profile->cover = $user->getCover();
$profile->coverPostion = $params->get('coverPosition', '');
if (strpos($profile->coverPostion, '%') === false) {
$profile->coverPostion = 0;
}
$groupmodel = CFactory::getModel('groups');
$profile->_groups = $groupmodel->getGroupsCount($profile->id);
$eventmodel = CFactory::getModel('events');
$profile->_events = $eventmodel->getEventsCount($profile->id);
$profile->_friends = $user->_friendcount;
$videoModel = CFactory::getModel('Videos');
$profile->_videos = $videoModel->getVideosCount($profile->id);
$photosModel = CFactory::getModel('photos');
$profile->_photos = $photosModel->getPhotosCount($profile->id);
/* is featured */
$modelFeatured = CFactory::getModel('Featured');
$profile->featured = $modelFeatured->isExists(FEATURED_USERS, $profile->id);
$sendMsg = CMessaging::getPopup($user->id);
$tmpl = new CTemplate();
$tmpl->set('my', $my)->set('user', $user)->set('isBlocked', $user->isBlocked())->set('isMine', COwnerHelper::isMine($my->id, $user->id))->set('sendMsg', $sendMsg)->set('config', $config)->set('isWaitingApproval', CFriendsHelper::isWaitingApproval($my->id, $user->id))->set('isLikeEnabled', $isLikeEnabled)->set('photoEnabled', $photoEnabled)->set('eventEnabled', $eventEnabled)->set('groupEnabled', $groupEnabled)->set('videoEnabled', $videoEnabled)->set('profile', $profile)->set('isUserLiked', $isUserLiked)->set('likes', $likes)->set('isFriend', CFriendsHelper::isConnected($user->id, $my->id) && $user->id != $my->id);
$showMiniHeader = $option == 'com_community' ? $tmpl->fetch('profile.miniheader') : '<div id="community-wrap" style="min-height:50px;">' . $tmpl->fetch('profile.miniheader') . '</div>';
return $showMiniHeader;
}
}
示例2: defined
/**
* @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
* @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @author iJoomla.com <webmaster@ijoomla.com>
* @url https://www.jomsocial.com/license-agreement
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/
defined('_JEXEC') or die;
$params = $user->getParams();
$config = CFactory::getConfig();
$my = CFactory::getUser();
$isMine = COwnerHelper::isMine($my->id, $user->id);
$isFriend = CFriendsHelper::isConnected($user->id, $my->id) && $user->id != $my->id;
$isWaitingApproval = CFriendsHelper::isWaitingApproval($my->id, $user->id);
$isWaitingResponse = CFriendsHelper::isWaitingApproval($user->id, $my->id);
$isBlocked = $user->isBlocked();
//links information
$photoEnabled = $config->get('enablephotos') ? true : false;
$eventEnabled = $config->get('enableevents') ? true : false;
$groupEnabled = $config->get('enablegroups') ? true : false;
$videoEnabled = $config->get('enablevideos') ? true : false;
//likes
CFactory::load('libraries', 'like');
$like = new Clike();
$isLikeEnabled = $like->enabled('profile') && $params->get('profileLikes', 1) ? 1 : 0;
$isUserLiked = $like->userLiked('profile', $user->id, $my->id);
/* likes count */
$likes = $like->getLikeCount('profile', $user->id);
$profileFields = '';
$themeModel = CFactory::getModel('theme');
示例3:
?>
</h4></a>
<span class="joms-text--title"><?php
echo JText::sprintf('COM_COMMUNITY_TOTAL_MUTUAL_FRIENDS', CFriendsHelper::getTotalMutualFriends($row->user->id));
?>
</span>
</div>
<div class="joms-list__actions joms-js--frequest-btn-<?php
echo $connectionId;
?>
">
<?php
echo CFriendsHelper::getUserCog($row->user->id, null, null, true);
?>
<?php
$connectionId = CFriendsHelper::isWaitingApproval($row->user->id, $my->id);
?>
<div class="joms-list__button--dropdown">
<button onclick="joms.api.friendReject('<?php
echo $connectionId;
?>
');" class="joms-button--neutral joms-button--full-small joms-button--smallest"><?php
echo JText::_('COM_COMMUNITY_FRIENDS_PENDING_ACTION_REJECT');
?>
</button>
<button onclick="joms.api.friendApprove('<?php
echo $connectionId;
?>
');" class="joms-button--primary joms-button--full-small joms-button--smallest"><?php
echo JText::_('COM_COMMUNITY_PENDING_ACTION_APPROVE');
?>
示例4:
</b>
<div class="small">
<a href="<?php
echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id);
?>
">
<?php
echo JText::_('COM_COMMUNITY_GO_TO_PROFILE');
?>
</a>
</div>
</div>
<div class="span8">
<ul class="cToolBox-Options unstyled">
<?php
if (!$isFriend && !$isMine && !CFriendsHelper::isWaitingApproval($my->id, $user->id)) {
?>
<li>
<a href="javascript:void(0)" onclick="joms.api.friendAdd('<?php
echo $user->id;
?>
')">
<i class="com-icon-user-plus"></i>
<span><?php
echo JText::_('COM_COMMUNITY_PROFILE_ADD_AS_FRIEND');
?>
</span>
</a>
</li>
<?php
}
示例5: getUserFriendDropdown
public static function getUserFriendDropdown($targetId)
{
$my = CFactory::getUser();
//current user
$user = CFactory::getUser($targetId);
//if user is not logged in, nothing should be displayed at all
if (!$my->id || $my->id == $targetId) {
return false;
}
$display = new stdClass();
$display->canAddFriend = false;
$display->canUnfriend = false;
$display->canRemoveFriendRequest = false;
$display->dropdown = false;
$display->dropdownTrigger = false;
$display->button = "COM_COMMUNITY_PROFILE_ADD_AS_FRIEND";
//by default
$display->buttonTrigger = "joms.api.friendAdd('" . $user->id . "')";
//is friend
if (CFriendsHelper::isConnected($my->id, $targetId)) {
$display->button = "COM_COMMUNITY_FRIENDS_COUNT";
//friend
$display->dropdown = 'COM_COMMUNITY_FRIENDS_REMOVE';
$display->dropdownTrigger = "joms.api.friendRemove('" . $user->id . "');";
$display->buttonTrigger = false;
} else {
if (CFriendsHelper::isWaitingApproval($my->id, $user->id)) {
$display->button = "COM_COMMUNITY_PROFILE_CONNECT_REQUEST_SENT";
$display->buttonTrigger = false;
$display->dropdown = "COM_COMMUNITY_CANCEL_FRIEND_REQUEST";
$display->dropdownTrigger = "joms.api.friendAddCancel('" . $user->id . "');";
} else {
if ($connectionId = CFriendsHelper::isWaitingApproval($user->id, $my->id)) {
$display->button = "COM_COMMUNITY_PENDING_APPROVAL";
$display->buttonTrigger = false;
$display->dropdown[] = "COM_COMMUNITY_FRIEND_ACCEPT_REQUEST";
$display->dropdownTrigger[] = "joms.api.friendApprove('" . $connectionId . "');";
$display->dropdown[] = "COM_COMMUNITY_FRIEND_REJECT_REQUEST";
$display->dropdownTrigger[] = "joms.api.friendReject('" . $connectionId . "');";
}
}
}
$tmpl = new CTemplate();
return $tmpl->set('options', $display)->fetch('general/friend-dropdown');
}
示例6:
</div>
<div class="joms-list__actions">
<?php
echo CFriendsHelper::getUserCog($row->user->id, null, null, true);
?>
<?php
echo CFriendsHelper::getUserFriendDropdown($row->user->id);
?>
<!-- <?php
$blockedByMe = $blockModel->getBlockStatus($my->id, $row->user->id);
if ($row->addFriend && !$blockedByMe) {
$isWaitingApproval = CFriendsHelper::isWaitingApproval($my->id, $row->user->id);
?>
<?php
if (isset($row->isMyFriend) && $row->isMyFriend == 1) {
?>
<a class="joms-button--neutral joms-button--small" href="javascript:void(0)" onclick="joms.api.friendAdd('<?php
echo $row->user->id;
?>
')"><?php
echo JText::_('COM_COMMUNITY_PROFILE_PENDING_FRIEND_REQUEST');
?>
</a>
<?php
} else {
?>
示例7: modProfileUserinfo
//.........这里部分代码省略.........
$filter = array();
$inboxModel = CFactory::getModel('inbox');
$filter['user_id'] = $my->id;
$unread = $inboxModel->countUnRead($filter);
// get how many pending connection
$friendModel = CFactory::getModel('friends');
$pending = $friendModel->countPending($my->id);
$profile = JArrayHelper::toObject($data->profile);
$profile->largeAvatar = $user->getAvatar();
$profile->defaultAvatar = $user->isDefaultAvatar();
$profile->status = $user->getStatus();
$profile->defaultCover = $user->isDefaultCover();
$profile->cover = $user->getCover();
$profile->coverPostion = $params->get('coverPosition', '');
if (strpos($profile->coverPostion, '%') === false) {
$profile->coverPostion = 0;
}
$groupmodel = CFactory::getModel('groups');
$profile->_groups = $groupmodel->getGroupsCount($profile->id);
$eventmodel = CFactory::getModel('events');
$profile->_events = $eventmodel->getEventsCount($profile->id);
$profile->_friends = $user->_friendcount;
$videoModel = CFactory::getModel('Videos');
$profile->_videos = $videoModel->getVideosCount($profile->id);
$photosModel = CFactory::getModel('photos');
$profile->_photos = $photosModel->getPhotosCount($profile->id);
if ($profile->status !== '') {
$postedOn = new JDate($user->_posted_on);
$postedOn = CActivityStream::_createdLapse($postedOn);
$profile->posted_on = $user->_posted_on == '0000-00-00 00:00:00' ? '' : $postedOn;
} else {
$profile->posted_on = '';
}
/* is featured */
$modelFeatured = CFactory::getModel('Featured');
$profile->featured = $modelFeatured->isExists(FEATURED_USERS, $profile->id);
// Assign videoId
$profile->profilevideo = $data->videoid;
$video = JTable::getInstance('Video', 'CTable');
$video->load($profile->profilevideo);
$profile->profilevideoTitle = $video->getTitle();
$addbuddy = "joms.api.friendAdd('{$profile->id}')";
$sendMsg = CMessaging::getPopup($profile->id);
$config = CFactory::getConfig();
$jConfig = JFactory::getConfig();
$lastLogin = JText::_('COM_COMMUNITY_PROFILE_NEVER_LOGGED_IN');
if ($user->lastvisitDate != '0000-00-00 00:00:00') {
$userLastLogin = new JDate($user->lastvisitDate);
$lastLogin = CActivityStream::_createdLapse($userLastLogin);
}
// @todo : beside checking the owner, maybe we want to check for a cookie,
// say every few hours only the hit get increment by 1.
if (!$isMine) {
$user->viewHit();
}
// @rule: myblog integrations
$showBlogLink = false;
$myblog = CMyBlog::getInstance();
if ($config->get('enablemyblogicon') && $myblog) {
if ($myblog->userCanPost($user->id)) {
$showBlogLink = true;
}
$tmpl->set('blogItemId', $myblog->getItemId());
}
$photoEnabled = $config->get('enablephotos') ? true : false;
$eventEnabled = $config->get('enableevents') ? true : false;
$groupEnabled = $config->get('enablegroups') ? true : false;
$videoEnabled = $config->get('enablevideos') ? true : false;
$isSEFEnabled = $jConfig->get('sef') ? true : false;
$multiprofile = JTable::getInstance('MultiProfile', 'CTable');
$multiprofile->load($user->getProfileType());
CFactory::load('libraries', 'like');
$like = new Clike();
$isLikeEnabled = $like->enabled('profile') && $params->get('profileLikes', 1) ? 1 : 0;
$isUserLiked = $like->userLiked('profile', $user->id, $my->id);
/* likes count */
$likes = $like->getLikeCount('profile', $user->id);
/* User status */
$status = new CUserStatus($user->id, 'profile');
//respect wall setting
if ($my->id && (!$config->get('lockprofilewalls') || $config->get('lockprofilewalls') && CFriendsHelper::isConnected($my->id, $profile->id)) || COwnerHelper::isCommunityAdmin()) {
// Add default status box
CUserHelper::addDefaultStatusCreator($status);
}
//$isblocked = $user->isBlocked();
$isMine = COwnerHelper::isMine($my->id, $user->id);
$isCommunityAdmin = COwnerHelper::isCommunityAdmin($user->id);
// Check if user is blocked
$getBlockStatus = new blockUser();
$isblocked = $getBlockStatus->isUserBlocked($user->id, 'profile');
// Get block user html
//$blockUserHTML = $isMine || $isCommunityAdmin ? '' : CUserHelper::getBlockUserHTML($user->id, $isBlocked);
$isMine = COwnerHelper::isMine($my->id, $user->id);
$isCommunityAdmin = COwnerHelper::isCommunityAdmin($user->id);
// Get reporting html
$report = new CReportingLibrary();
$reportsHTML = $isMine ? '' : $report->getReportingHTML(JText::_('COM_COMMUNITY_REPORT_USER'), 'profile,reportProfile', array($user->id));
$tmpl = new CTemplate();
echo $tmpl->set('karmaImgUrl', CUserPoints::getPointsImage($user))->set('reportsHTML', $reportsHTML)->set('isMine', $isMine)->set('lastLogin', $lastLogin)->set('addBuddy', $addbuddy)->set('sendMsg', $sendMsg)->set('config', $config)->set('multiprofile', $multiprofile)->set('showBlogLink', $showBlogLink)->set('isFriend', CFriendsHelper::isConnected($user->id, $my->id) && $user->id != $my->id)->set('isWaitingApproval', CFriendsHelper::isWaitingApproval($my->id, $user->id))->set('isWaitingResponse', CFriendsHelper::isWaitingApproval($user->id, $my->id))->set('isBlocked', $isblocked)->set('profile', $profile)->set('unread', $unread)->set('pending', $pending)->set('registerDate', $user->registerDate)->set('adminControlHTML', $adminControlHTML)->set('userstatus', $status)->set('user', $user)->set('isUserLiked', $isUserLiked)->set('likes', $likes)->set('isLikeEnabled', $isLikeEnabled)->set('photoEnabled', $photoEnabled)->set('eventEnabled', $eventEnabled)->set('groupEnabled', $groupEnabled)->set('videoEnabled', $videoEnabled)->set('about', $this->_getProfileHTML($data->profile))->set('isSEFEnabled', $isSEFEnabled)->set('blocked', $user->isBlocked())->fetch('profile/focus');
}