本文整理汇总了PHP中Phpfox::getComponentSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getComponentSetting方法的具体用法?PHP Phpfox::getComponentSetting怎么用?PHP Phpfox::getComponentSetting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getComponentSetting方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* Controller
*/
public function process()
{
$aUser = PHPFOX_IS_AJAX ? Phpfox::getService('user')->get(Phpfox::getUserId(), true) : $this->getParam('aUser');
if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'friend.view_friend')) {
return false;
}
$iTotal = (int) Phpfox::getComponentSetting($aUser['user_id'], 'friend.friend_display_limit_profile', Phpfox::getParam('friend.friend_display_limit'));
$aRows = Friend_Service_Friend::instance()->get('friend.is_page = 0 AND friend.user_id = ' . $aUser['user_id'], 'friend.is_top_friend DESC, friend.ordering ASC, RAND()', 0, $iTotal, false);
$iCount = count($aRows);
if (!$iCount) {
return false;
}
$sFriendsLink = Phpfox::getService('user')->getLink($aUser['user_id'], $aUser['user_name'], 'friend');
$this->template()->assign(array('sHeader' => '<a href="' . $this->url()->makeUrl($aUser['user_name'], 'friend') . '">' . Phpfox::getPhrase('friend.friends') . '<span>' . $aUser['total_friend'] . '</span></a>', 'aFriends' => $aRows, 'sFriendsLink' => $sFriendsLink, 'sBlockJsId' => 'profile_friend'));
/*
if (Phpfox::getUserParam('friend.can_remove_friends_from_profile') && $aUser['user_id'] == Phpfox::getUserId())
{
$this->template()->assign(array(
'aEditBar' => array(
'ajax_call' => 'friend.getEditBar',
'params' => '&type_id=profile'
)
)
);
$this->template()->assign('sDeleteBlock', 'profile');
}
*/
return 'block';
}
示例2: getRecentLoggedInUsers
public function getRecentLoggedInUsers()
{
$iFriendsOnly = (int) Phpfox::getComponentSetting(Phpfox::getUserId(), 'log.user_login_display_limit', 0);
$iLimit = 10;
if ($iFriendsOnly === 1)
{
$aUsers = $this->database()->select(Phpfox::getUserField())
->from(Phpfox::getT('friend'), 'f')
->join(Phpfox::getT('user'), 'u', 'u.user_id = f.friend_user_id')
->where('f.user_id = ' . Phpfox::getUserId() . ' AND is_invisible != 1')
->order('u.last_login DESC')
->limit($iLimit)
->execute('getSlaveRows');
}
else
{
$aUsers = $this->database()->select(Phpfox::getUserField())
->from(Phpfox::getT('user'), 'u')
->order('u.last_login DESC')
->where('u.user_id != ' . Phpfox::getUserId() .' AND is_invisible != 1 AND u.status_id = 0 AND u.view_id = 0')
->limit($iLimit)
->execute('getSlaveRows');
}
return $aUsers;
}
示例3: process
/**
* Controller
*/
public function process()
{
if (!defined('PHPFOX_IS_USER_PROFILE') && !Phpfox::isUser()) {
return false;
}
$aUser = $this->getParam('aUser');
$iTotal = (int) Phpfox::getComponentSetting(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), 'friend.friend_display_limit_profile', Phpfox::getParam('friend.friend_display_limit'));
$aTopFriends = Friend_Service_Friend::instance()->getTop(defined('PHPFOX_IS_USER_PROFILE') ? $aUser['user_id'] : Phpfox::getUserId(), $iTotal);
$iCount = count($aTopFriends);
if (defined('PHPFOX_IS_USER_PROFILE') && !$iCount) {
return false;
}
$this->template()->assign(array('aTopFriends' => $aTopFriends));
if (defined('PHPFOX_IS_USER_PROFILE')) {
$this->template()->assign(array('bMoveCursor' => false));
} else {
$this->template()->assign(array('bMoveCursor' => true));
}
if (!$this->getParam('bIsAjax')) {
$this->template()->assign(array('sHeader' => Phpfox::getPhrase('friend.top_friends'), 'sBlockJsId' => 'top_friends'));
$bCanEditSettings = false;
if (defined('PHPFOX_IS_USER_PROFILE')) {
if ($aUser['user_id'] == Phpfox::getUserId()) {
// $bCanEditSettings = true;
}
$bCanEditSettings = false;
} else {
$bCanEditSettings = true;
}
if ($bCanEditSettings) {
$this->template()->assign(array('aEditBar' => array('ajax_call' => 'friend.getEditBar', 'params' => '&type_id=profile&no_delete_link=true&is_edit_top=true')));
}
return 'block';
}
}
示例4: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
Phpfox::isUser(true);
if (($aVals = $this->request()->getArray('val')) && !empty($aVals['status'])) {
if ($iId = Phpfox::getService('user.process')->updateStatus(Phpfox::getUserId(), $aVals['status'])) {
$this->url()->send('');
}
}
$iFeedPage = $this->request()->get('page', 1);
if (Phpfox::isModule('feed')) {
$aFeeds = Phpfox::getService('feed')->get(null, null, $iFeedPage);
$iTotalFeeds = (int) Phpfox::getComponentSetting(Phpfox::getUserId(), 'feed.feed_display_limit_dashboard', Phpfox::getParam('feed.feed_display_limit'));
$this->url()->setParam(array('core', 'index-member'));
// Phpfox::getLib('pager')->set(array('page' => $iFeedPage, 'size' => $iTotalFeeds, 'count' => $iFeedCount));
$this->template()->setMobileHeader(array('feed.css' => 'module_feed'))->assign(array('bMobileHomeIsActive' => true, 'aFeeds' => $aFeeds));
}
}
示例5: getRecentLoggedInUsers
public function getRecentLoggedInUsers()
{
if (Phpfox::getParam('user.cache_recent_logged_in') > 0) {
$sCacheId = $this->cache()->set(array('user', 'recentloggedin'));
}
if (Phpfox::getParam('user.cache_recent_logged_in') > 0 && ($aUsers = $this->cache()->get($sCacheId, Phpfox::getParam('user.cache_recent_logged_in')))) {
} else {
$iFriendsOnly = (int) Phpfox::getComponentSetting(Phpfox::getUserId(), 'log.user_login_display_limit', 0);
$iLimit = 10;
($sPlugin = Phpfox_Plugin::get('log.service_log_getrecentloggedinusers_1')) ? eval($sPlugin) : false;
if ($iFriendsOnly === 1) {
$aUsers = $this->database()->select(Phpfox::getUserField())->from(Phpfox::getT('friend'), 'f')->join(Phpfox::getT('user'), 'u', 'u.user_id = f.friend_user_id')->where('f.user_id = ' . Phpfox::getUserId() . ' AND is_invisible != 1')->order('u.last_login DESC')->limit($iLimit)->execute('getSlaveRows');
} else {
$aUsers = $this->database()->select(Phpfox::getUserField())->from(Phpfox::getT('user'), 'u')->order('u.last_login DESC')->where('u.user_id != ' . Phpfox::getUserId() . ' AND is_invisible != 1 AND u.status_id = 0 AND u.view_id = 0')->limit($iLimit)->execute('getSlaveRows');
}
if (Phpfox::getParam('user.cache_recent_logged_in') > 0) {
$this->cache()->save($sCacheId, $aUsers);
}
}
if (is_bool($aUsers)) {
$aUsers = array();
}
return $aUsers;
}
示例6: process
/**
* Controller
*/
public function process()
{
$aUser = Phpfox::getService('user')->get($this->request()->get('req1'), false);
if (!isset($aUser['user_id'])) {
return Phpfox_Module::instance()->setController('error.404');
}
define('PHPFOX_IS_USER_PROFILE', true);
$sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true, $aUser)), array('title' => $aUser['full_name'], 'path' => 'core.url_user', 'file' => $aUser['user_image'], 'suffix' => '_120', 'max_width' => 120, 'max_height' => 120, 'no_default' => Phpfox::getUserId() == $aUser['user_id'] ? false : true, 'no_link' => true)));
$oUser = Phpfox::getService('user');
$aUser['gender_name'] = $oUser->gender($aUser['gender']);
$aUser['birthday_time_stamp'] = $aUser['birthday'];
$aUser['birthday'] = $oUser->age($aUser['birthday']);
$aUser['location'] = Phpfox::getPhraseT(Phpfox::getService('core.country')->getCountry($aUser['country_iso']), 'country');
if (isset($aUser['country_child_id']) && $aUser['country_child_id'] > 0) {
$aUser['location_child'] = Phpfox::getService('core.country')->getChild($aUser['country_child_id']);
}
$this->setParam('aUser', $aUser);
$this->template()->setMobileHeader(array('profile.css' => 'style_css'));
if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_profile')) {
return Phpfox_Module::instance()->setController('profile.private');
}
Phpfox::getUserParam('profile.can_view_users_profile', true);
$aProfileMenu = array($this->url()->makeUrl($aUser['user_name']) => Phpfox::getPhrase('profile.wall'));
if (Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.basic_info')) {
$aProfileMenu[$this->url()->makeUrl($aUser['user_name'], 'info')] = Phpfox::getPhrase('profile.info');
}
$this->template()->assign(array('aUser' => $aUser, 'sProfileImage' => $sImage, 'bMobileProfileIsActive' => true, 'aMobileSubMenus' => $aProfileMenu, 'sActiveMobileSubMenu' => $this->url()->makeUrl($aUser['user_name'], $this->request()->get('req2') == '' ? null : $this->request()->get('req2'))));
if ($this->request()->get('req2') == 'info') {
return Phpfox_Module::instance()->setController('profile.info-mobile');
}
if ($aVals = $this->request()->getArray('val')) {
Phpfox::isUser(true);
if (isset($aVals['status'])) {
if (!empty($aVals['status'])) {
if ($iId = Phpfox::getService('user.process')->updateStatus(Phpfox::getUserId(), $aVals['status'])) {
$this->url()->send($aUser['user_name']);
}
}
} else {
Phpfox::getUserParam('comment.can_post_comments', true);
if (!Phpfox::getService('user.privacy')->hasAccess($aVals['item_id'], 'comment.add_comment')) {
Phpfox_Error::set(Phpfox::getPhrase('feed.you_do_not_have_permission_to_add_a_comment_on_this_persons_profile'));
}
if (($iFlood = Phpfox::getUserParam('comment.comment_post_flood_control')) !== 0) {
$aFlood = array('action' => 'last_post', 'params' => array('field' => 'time_stamp', 'table' => Phpfox::getT('feed'), 'condition' => 'type_id = \'comment_profile_my\' AND user_id = ' . Phpfox::getUserId(), 'time_stamp' => $iFlood * 60));
// actually check if flooding
if (Phpfox::getLib('spam')->check($aFlood)) {
Phpfox_Error::set(Phpfox::getPhrase('feed.posting_a_comment_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());
}
}
if (Phpfox::getLib('parse.format')->isEmpty($aVals['feed_text'])) {
Phpfox_Error::set(Phpfox::getPhrase('feed.add_some_text_to_your_comment'));
}
if (Phpfox_Error::isPassed() && ($iId = Phpfox::getService('feed.process')->addComment($aVals))) {
$this->url()->send($aUser['user_name']);
}
}
}
$bHideFeedOnProfile = false;
if (Phpfox::isModule('feed')) {
$iFeedPage = $this->request()->get('page', 1);
list($iFeedCount, $aFeeds) = Feed_Service_Feed::instance()->get($aUser['user_id'], null, $iFeedPage);
if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'feed.display_on_profile')) {
$iFeedCount = 0;
$aFeeds = array();
$bHideFeedOnProfile = true;
}
$iTotalFeeds = (int) Phpfox::getComponentSetting(Phpfox::getUserId(), 'feed.feed_display_limit_dashboard', Phpfox::getParam('feed.feed_display_limit'));
Phpfox_Pager::instance()->set(array('page' => $iFeedPage, 'size' => $iTotalFeeds, 'count' => $iFeedCount));
$this->template()->setMobileHeader(array('feed.css' => 'module_feed'))->assign(array('aFeeds' => $aFeeds));
}
$this->template()->assign(array('bHideFeedOnProfile' => $bHideFeedOnProfile));
}
示例7: get
public function get($iUserid = null, $iFeedId = null, $iPage = 0, $bForceReturn = false)
{
$params = [];
if (is_array($iUserid)) {
$params = $iUserid;
$iUserid = null;
if (isset($params['id'])) {
$iFeedId = $params['id'];
}
if (isset($params['page'])) {
$iPage = $params['page'];
}
}
$oUrl = Phpfox_Url::instance();
$oReq = Phpfox_Request::instance();
$oParseOutput = Phpfox::getLib('parse.output');
$bIsCheckForUpdate = defined('PHPFOX_CHECK_FOR_UPDATE_FEED') ? 1 : 0;
$iLastFeedId = defined('PHPFOX_CHECK_FOR_UPDATE_FEED_ID') ? PHPFOX_CHECK_FOR_UPDATE_FEED_ID : 0;
if ($oReq->get('get-new')) {
// $bForceReturn = true;
}
if ($iCommentId = $oReq->getInt('comment-id')) {
if (isset($this->_aCallback['feed_comment'])) {
$aCustomCondition = array('feed.type_id = \'' . $this->_aCallback['feed_comment'] . '\' AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id']);
} else {
$aCustomCondition = array('feed.type_id IN(\'feed_comment\', \'feed_egift\') AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $iUserid);
}
$iFeedId = true;
} elseif ($iStatusId = $oReq->getInt('status-id')) {
$aCustomCondition = array('feed.type_id = \'user_status\' AND feed.item_id = ' . (int) $iStatusId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iLinkId = $oReq->getInt('link-id')) {
$aCustomCondition = array('feed.type_id = \'link\' AND feed.item_id = ' . (int) $iLinkId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iLinkId = $oReq->getInt('plink-id')) {
$aCustomCondition = array('feed.type_id = \'link\' AND feed.item_id = ' . (int) $iLinkId . ' AND feed.parent_user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iPokeId = $oReq->getInt('poke-id')) {
$aCustomCondition = array('feed.type_id = \'poke\' AND feed.item_id = ' . (int) $iPokeId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
}
$iTotalFeeds = (int) Phpfox::getComponentSetting($iUserid === null ? Phpfox::getUserId() : $iUserid, 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));
if (isset($params['limit'])) {
$iTotalFeeds = $params['limit'];
}
$iOffset = $iPage * $iTotalFeeds;
$extra = '';
($sPlugin = Phpfox_Plugin::get('feed.service_feed_get_start')) ? eval($sPlugin) : false;
if (isset($params['type_id'])) {
$extra .= ' AND type_id ' . (is_array($params['type_id']) ? 'IN(' . implode(',', array_map(function ($value) {
return "'{$value}'";
}, $params['type_id'])) . ')' : '= \'' . $params['type_id'] . '\'') . '';
// d($extra); exit;
}
$sOrder = 'feed.time_update DESC';
if (Phpfox::getUserBy('feed_sort') || defined('PHPFOX_IS_USER_PROFILE')) {
$sOrder = 'feed.time_stamp DESC';
}
$aCond = array();
if (isset($this->_aCallback['module'])) {
$aNewCond = array();
if ($iCommentId = $oReq->getInt('comment-id')) {
if (!isset($this->_aCallback['feed_comment'])) {
$aCustomCondition = array('feed.type_id = \'' . $this->_aCallback['module'] . '_comment\' AND feed.item_id = ' . (int) $iCommentId . '');
}
}
$aNewCond[] = 'AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id'];
if ($iUserid !== null && $iFeedId !== null) {
$aNewCond[] = 'AND feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid;
}
if ($iUserid === null && $iFeedId !== null) {
$aNewCond = [];
$aNewCond[] = 'AND feed.feed_id = ' . (int) $iFeedId;
}
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from(Phpfox::getT($this->_aCallback['table_prefix'] . 'feed'), 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where(isset($aCustomCondition) ? $aCustomCondition : $aNewCond)->order($sOrder)->limit($iOffset, $iTotalFeeds, null, false, true)->execute('getSlaveRows');
// Fixes missing page_user_id, required to create the proper feed target
if ($this->_aCallback['module'] == 'pages') {
foreach ($aRows as $iKey => $aValue) {
$aRows[$iKey]['page_user_id'] = $iUserid;
}
}
} elseif ($sIds = $oReq->get('ids')) {
$aParts = explode(',', $oReq->get('ids'));
$sNewIds = '';
foreach ($aParts as $sPart) {
$sNewIds .= (int) $sPart . ',';
}
$sNewIds = rtrim($sNewIds, ',');
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where('feed.feed_id IN(' . $sNewIds . ')')->order('feed.time_stamp DESC')->execute('getSlaveRows');
} elseif ($iUserid === null && $iFeedId !== null) {
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where('feed.feed_id = ' . (int) $iFeedId)->order('feed.time_stamp DESC')->execute('getSlaveRows');
} elseif ($iUserid !== null && $iFeedId !== null) {
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where(isset($aCustomCondition) ? $aCustomCondition : 'feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid . '')->order('feed.time_stamp DESC')->limit(1)->execute('getSlaveRows');
} elseif ($iUserid !== null) {
if ($iUserid == Phpfox::getUserId()) {
$aCond[] = 'AND feed.privacy IN(0,1,2,3,4)';
} else {
if (Phpfox::getService('user')->getUserObject($iUserid)->is_friend) {
$aCond[] = 'AND feed.privacy IN(0,1,2)';
} else {
//.........这里部分代码省略.........
示例8: process
/**
* Controller
*/
public function process()
{
$bIsProfile = $this->request()->get('type_id') == 'profile' ? true : false;
$this->template()->assign(array('bIsProfile' => $bIsProfile, 'iDefaultSetting' => Phpfox::getComponentSetting(Phpfox::getUserId(), 'feed.feed_display_limit_' . ($bIsProfile ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit')), 'sSettingName' => 'feed.feed_display_limit_' . ($bIsProfile ? 'profile' : 'dashboard'), 'aSettings' => Phpfox::getParam('feed.user_feed_display_limit'), 'iProfileUserId' => Phpfox::getUserId()));
}
示例9: process
//.........这里部分代码省略.........
Phpfox::getService('notification.process')->delete('feed_comment_profile', $this->request()->getInt('comment-id'), Phpfox::getUserId());
} elseif ($this->request()->getInt('feed')) {
$sCustomViewType = Phpfox::getPhrase('feed.feed');
}
}
if (!isset($aFeedCallback['item_id']) || $aFeedCallback['item_id'] == 0) {
$aFeedCallback['item_id'] = (int) $this->request()->get('amp;callback_item_id') > 0 ? $this->request()->get('amp;callback_item_id') : $this->request()->get('callback_item_id');
}
$bForceReloadOnPage = PHPFOX_IS_AJAX ? false : Phpfox::getParam('feed.force_ajax_on_load');
$aRows = array();
if (PHPFOX_IS_AJAX || !$bForceReloadOnPage || $bIsCustomFeedView) {
$aRows = Phpfox::getService('feed')->callback($aFeedCallback)->get($bIsProfile > 0 ? $iUserId : null, $this->request()->get('feed') ? $this->request()->get('feed') : null, $iFeedPage);
if (empty($aRows)) {
$iFeedPage++;
$aRows = Phpfox::getService('feed')->callback($aFeedCallback)->get($bIsProfile > 0 ? $iUserId : null, $this->request()->get('feed') ? $this->request()->get('feed') : null, $iFeedPage);
}
}
/*
else
{
$aRows = Phpfox::getService('feed')->callback($aFeedCallback)->get(($bIsProfile > 0 ? $iUserId : null), ($this->request()->get('feed') ? $this->request()->get('feed') : null), $iFeedPage);
}
*/
if (($this->request()->getInt('status-id') || $this->request()->getInt('comment-id') || $this->request()->getInt('link-id') || $this->request()->getInt('poke-id') || $this->request()->getInt('feed')) && isset($aRows[0])) {
$aRows[0]['feed_view_comment'] = true;
$this->setParam('aFeed', array_merge(array('feed_display' => 'view', 'total_like' => $aRows[0]['feed_total_like']), $aRows[0]));
}
($sPlugin = Phpfox_Plugin::get('feed.component_block_display_process')) ? eval($sPlugin) : false;
if ($bIsCustomFeedView && !count($aRows) && $bIsProfile) {
$aUser = $this->getParam('aUser');
$this->url()->send($aUser['user_name'], null, Phpfox::getPhrase('feed.the_activity_feed_you_are_looking_for_does_not_exist'));
}
$iUserid = $bIsProfile > 0 ? $iUserId : null;
$iTotalFeeds = (int) Phpfox::getComponentSetting($iUserid === null ? Phpfox::getUserId() : $iUserid, 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));
/*
if (isset($sActivityFeedHeader))
{
$this->template()->assign(array(
'sHeader' => $sActivityFeedHeader
)
);
}
*/
$aUserLocation = Phpfox::getUserBy('location_latlng');
if (!empty($aUserLocation)) {
$this->template()->assign(array('aVisitorLocation' => json_decode($aUserLocation, true)));
}
$bLoadCheckIn = false;
if (!defined('PHPFOX_IS_PAGES_VIEW') && Phpfox::getParam('feed.enable_check_in') && (Phpfox::getParam('core.ip_infodb_api_key') || Phpfox::getParam('core.google_api_key'))) {
$bLoadCheckIn = true;
}
$oFeed = Phpfox::getService('feed');
foreach ($aRows as $iKey => $aRow) {
if (!isset($aRow['feed_like_phrase'])) {
if (Phpfox::isModule('like')) {
$aRows[$iKey]['feed_like_phrase'] = $oFeed->getPhraseForLikes($aRow);
}
}
}
$bIsHashTagPop = $this->request()->get('hashtagpopup') ? true : false;
if ($bIsHashTagPop) {
define('PHPFOX_FEED_HASH_POPUP', true);
}
// http://www.phpfox.com/tracker/view/15392/
$sIsHashTagSearchValue = urldecode(strip_tags($this->request()->get('hashtagsearch') ? $this->request()->get('hashtagsearch') : ($this->request()->get('req1') == 'hashtag' ? $this->request()->get('req2') : '')));
if (preg_match_all('/[0-9]+/', $sIsHashTagSearchValue, $aMatches)) {
示例10: process
/**
* Controller
*/
public function process()
{
$this->template()->assign(array('iDefaultSetting' => (int) Phpfox::getComponentSetting(Phpfox::getUserId(), 'log.user_login_display_limit', '0')));
}
示例11: get
public function get($iUserid = null, $iFeedId = null, $iPage = 0, $bForceReturn = false)
{
$oUrl = Phpfox::getLib('url');
$oReq = Phpfox::getLib('request');
$oParseOutput = Phpfox::getLib('parse.output');
if ($oReq->get('get-new')) {
// $bForceReturn = true;
}
if ($iCommentId = $oReq->getInt('comment-id')) {
if (isset($this->_aCallback['feed_comment'])) {
$aCustomCondition = array('feed.type_id = \'' . $this->_aCallback['feed_comment'] . '\' AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id']);
} else {
$aCustomCondition = array('feed.type_id IN(\'feed_comment\', \'feed_egift\') AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $iUserid);
}
$iFeedId = true;
} elseif ($iStatusId = $oReq->getInt('status-id')) {
$aCustomCondition = array('feed.type_id = \'user_status\' AND feed.item_id = ' . (int) $iStatusId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iLinkId = $oReq->getInt('link-id')) {
$aCustomCondition = array('feed.type_id = \'link\' AND feed.item_id = ' . (int) $iLinkId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iLinkId = $oReq->getInt('plink-id')) {
$aCustomCondition = array('feed.type_id = \'link\' AND feed.item_id = ' . (int) $iLinkId . ' AND feed.parent_user_id = ' . (int) $iUserid);
$iFeedId = true;
} elseif ($iPokeId = $oReq->getInt('poke-id')) {
$aCustomCondition = array('feed.type_id = \'poke\' AND feed.item_id = ' . (int) $iPokeId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
}
$iTotalFeeds = (int) Phpfox::getComponentSetting($iUserid === null ? Phpfox::getUserId() : $iUserid, 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));
$iOffset = $iPage * $iTotalFeeds;
($sPlugin = Phpfox_Plugin::get('feed.service_feed_get_start')) ? eval($sPlugin) : false;
$sOrder = 'feed.time_update DESC';
if (Phpfox::getUserBy('feed_sort') || defined('PHPFOX_IS_USER_PROFILE')) {
$sOrder = 'feed.time_stamp DESC';
}
$aCond = array();
if (isset($this->_aCallback['module'])) {
$aNewCond = array();
if ($iCommentId = $oReq->getInt('comment-id')) {
if (!isset($this->_aCallback['feed_comment'])) {
$aCustomCondition = array('feed.type_id = \'' . $this->_aCallback['module'] . '_comment\' AND feed.item_id = ' . (int) $iCommentId . '');
}
}
$aNewCond[] = 'AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id'];
if ($iUserid !== null && $iFeedId !== null) {
$aNewCond[] = 'AND feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid;
}
$iTimelineYear = 0;
if (($iTimelineYear = Phpfox::getLib('request')->get('year')) && !empty($iTimelineYear)) {
$iMonth = 12;
$iDay = 31;
if (($iTimelineMonth = Phpfox::getLib('request')->get('month')) && !empty($iTimelineMonth)) {
$iMonth = $iTimelineMonth;
$iDay = Phpfox::getLib('date')->lastDayOfMonth($iMonth, $iTimelineYear);
}
$aNewCond[] = 'AND feed.time_stamp <= \'' . mktime(0, 0, 0, $iMonth, $iDay, $iTimelineYear) . '\'';
}
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from(Phpfox::getT($this->_aCallback['table_prefix'] . 'feed'), 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where(isset($aCustomCondition) ? $aCustomCondition : $aNewCond)->order($sOrder)->limit($iOffset, $iTotalFeeds)->execute('getSlaveRows');
// Fixes missing page_user_id, required to create the proper feed target
if ($this->_aCallback['module'] == 'pages') {
foreach ($aRows as $iKey => $aValue) {
$aRows[$iKey]['page_user_id'] = $iUserid;
}
}
} elseif ($sIds = $oReq->get('ids')) {
$aParts = explode(',', $oReq->get('ids'));
$sNewIds = '';
foreach ($aParts as $sPart) {
$sNewIds .= (int) $sPart . ',';
}
$sNewIds = rtrim($sNewIds, ',');
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where('feed.feed_id IN(' . $sNewIds . ')')->order('feed.time_stamp DESC')->execute('getSlaveRows');
} elseif ($iUserid === null && $iFeedId !== null) {
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->where('feed.feed_id = ' . (int) $iFeedId)->order('feed.time_stamp DESC')->execute('getSlaveRows');
} elseif ($iUserid !== null && $iFeedId !== null) {
$aRows = $this->database()->select('feed.*, apps.app_title, ' . Phpfox::getUserField() . ', u.view_id')->from($this->_sTable, 'feed')->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')->leftJoin(Phpfox::getT('app'), 'apps', 'apps.app_id = feed.app_id')->where(isset($aCustomCondition) ? $aCustomCondition : 'feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid . '')->order('feed.time_stamp DESC')->limit(1)->execute('getSlaveRows');
} elseif ($iUserid !== null) {
if ($iUserid == Phpfox::getUserId()) {
$aCond[] = 'AND feed.privacy IN(0,1,2,3,4)';
} else {
if (Phpfox::getService('user')->getUserObject($iUserid)->is_friend) {
$aCond[] = 'AND feed.privacy IN(0,1,2)';
} else {
if (Phpfox::getService('user')->getUserObject($iUserid)->is_friend_of_friend) {
$aCond[] = 'AND feed.privacy IN(0,2)';
} else {
$aCond[] = 'AND feed.privacy IN(0)';
}
}
}
// There is no reciprocal feed when you add someone as friend
$this->database()->select('feed.*')->from($this->_sTable, 'feed')->where('feed.type_id = \'friend\' AND feed.user_id = ' . (int) $iUserid)->union();
($sPlugin = Phpfox_Plugin::get('feed.service_feed_get_userprofile')) ? eval($sPlugin) : '';
$iTimelineYear = 0;
if (($iTimelineYear = Phpfox::getLib('request')->get('year')) && !empty($iTimelineYear)) {
$iMonth = 12;
$iDay = 31;
if (($iTimelineMonth = Phpfox::getLib('request')->get('month')) && !empty($iTimelineMonth)) {
$iMonth = $iTimelineMonth;
$iDay = Phpfox::getLib('date')->lastDayOfMonth($iMonth, $iTimelineYear);
//.........这里部分代码省略.........
示例12: process
/**
* Controller
*/
public function process()
{
$bIsProfile = $this->request()->get('type_id') == 'profile' ? true : false;
$this->template()->assign(array('bIsProfile' => $bIsProfile, 'iDefaultSetting' => Phpfox::getComponentSetting(Phpfox::getUserId(), 'friend.friend_display_limit_' . ($bIsProfile ? 'profile' : 'dashboard'), Phpfox::getParam('friend.friend_display_limit')), 'sSettingName' => 'friend.friend_display_limit_' . ($bIsProfile ? 'profile' : 'dashboard'), 'aSettings' => Phpfox::getParam('friend.friend_user_feed_display_limit'), 'bNoDeleteLink' => $this->request()->get('no_delete_link') ? true : false, 'bIsEditTop' => $this->request()->get('is_edit_top') ? true : false));
}
示例13: getNewMenu
public function getNewMenu($bForEdit = false)
{
$sCacheId = $this->cache()->set('core_new_menu');
$sModuleBlock = '';
if (!($aSubMenus = $this->cache()->get($sCacheId))) {
/*
$aMenus1['user'] = array(
'Members' => array(
'ajax' => '#user.getNew?id=js_new_item_holder',
'id' => 'member',
'block' => 'user.new'
)
);
$aMenus2 = Phpfox::massCallback('getWhatsNew');
$aMenus = array_merge($aMenus1, $aMenus2);
*/
$aMenus = Phpfox::massCallback('getWhatsNew');
$aSubMenus = array();
foreach ($aMenus as $sModule => $aMenu) {
$aKey = array_keys($aMenu);
$aValue = array_values($aMenu);
$aSubMenus[$aKey[0]] = $aValue[0];
}
$this->cache()->save($sCacheId, $aSubMenus);
}
if ($aSubMenus === true) {
$aSubMenus = array();
}
if ($bForEdit === true) {
$sUserSettings = Phpfox::getComponentSetting(Phpfox::getUserId(), 'core.whats_new_blocks', null);
if ($sUserSettings !== null) {
$aUserSettings = unserialize($sUserSettings);
}
foreach ($aSubMenus as $sName => $aSubMenu) {
$aSubMenus[$sName]['name'] = Phpfox::getPhrase($sName);
$aSubMenus[$sName]['is_used'] = isset($aUserSettings['m']) && in_array($aSubMenu['id'], $aUserSettings['m']) ? true : ($sUserSettings === null ? true : false);
}
return $aSubMenus;
} else {
$sUserSettings = Phpfox::getComponentSetting(Phpfox::getUserId(), 'core.whats_new_blocks', null);
if ($sUserSettings !== null) {
$aUserSettings = unserialize($sUserSettings);
}
$iCnt = 0;
$aFinalMenu = array();
foreach ($aSubMenus as $sName => $aSubMenu) {
if (isset($aUserSettings['m']) && !in_array($aSubMenu['id'], $aUserSettings['m'])) {
continue;
}
$iCnt++;
if ($iCnt === 1) {
$sModuleBlock = $aSubMenu['block'];
}
$aFinalMenu[Phpfox::getPhrase($sName)] = $aSubMenu['ajax'];
}
return array($aFinalMenu, $sModuleBlock);
}
}
示例14: get
public function get($iUserid = null, $iFeedId = null, $iPage = 0, $bForceReturn = false)
{
$oUrl = Phpfox::getLib('url');
$oReq = Phpfox::getLib('request');
$oParseOutput = Phpfox::getLib('parse.output');
if ($oReq->get('get-new'))
{
// $bForceReturn = true;
}
if (($iCommentId = $oReq->getInt('comment-id')))
{
if (isset($this->_aCallback['feed_comment']))
{
$aCustomCondition = array('feed.type_id = \'' . $this->_aCallback['feed_comment'] . '\' AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id']);
}
else
{
$aCustomCondition = array('feed.type_id IN(\'feed_comment\', \'feed_egift\') AND feed.item_id = ' . (int) $iCommentId . ' AND feed.parent_user_id = ' . (int) $iUserid);
}
$iFeedId = true;
}
elseif (($iStatusId = $oReq->getInt('status-id')))
{
$aCustomCondition = array('feed.type_id = \'user_status\' AND feed.item_id = ' . (int) $iStatusId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
}
elseif (($iLinkId = $oReq->getInt('link-id')))
{
$aCustomCondition = array('feed.type_id = \'link\' AND feed.item_id = ' . (int) $iLinkId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
}
elseif (($iPokeId = $oReq->getInt('poke-id')))
{
$aCustomCondition = array('feed.type_id = \'poke\' AND feed.item_id = ' . (int) $iPokeId . ' AND feed.user_id = ' . (int) $iUserid);
$iFeedId = true;
}
$iTotalFeeds = (int) Phpfox::getComponentSetting(($iUserid === null ? Phpfox::getUserId() : $iUserid), 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));
$iOffset = ($iPage * $iTotalFeeds);
(($sPlugin = Phpfox_Plugin::get('feed.service_feed_get_start')) ? eval($sPlugin) : false);
$aCond = array();
if (isset($this->_aCallback['module']))
{
$aNewCond = array();
if (($iCommentId = $oReq->getInt('comment-id')))
{
if (!isset($this->_aCallback['feed_comment']))
{
$aCustomCondition = array('feed.type_id = \'event_comment\' AND feed.item_id = ' . (int) $iCommentId . '');
}
}
$aNewCond[] = 'AND feed.parent_user_id = ' . (int) $this->_aCallback['item_id'];
if ($iUserid !== null && $iFeedId !== null)
{
$aNewCond[] = 'AND feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid;
}
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField())
->from(Phpfox::getT($this->_aCallback['table_prefix'] . 'feed'), 'feed')
->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')
->where((isset($aCustomCondition) ? $aCustomCondition : $aNewCond))
->order('feed.time_stamp DESC')
->limit($iOffset, $iTotalFeeds)
->execute('getSlaveRows');
}
elseif (($sIds = $oReq->get('ids')))
{
$aParts = explode(',', $oReq->get('ids'));
$sNewIds = '';
foreach ($aParts as $sPart)
{
$sNewIds .= (int) $sPart . ',';
}
$sNewIds = rtrim($sNewIds, ',');
$aRows = $this->database()->select('feed.*, ' . Phpfox::getUserField())
->from($this->_sTable, 'feed')
->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')
->where('feed.feed_id IN(' . $sNewIds . ')')
->order('feed.time_stamp DESC')
->execute('getSlaveRows');
}
elseif ($iUserid !== null && $iFeedId !== null)
{
$aRows = $this->database()->select('feed.*, apps.app_title, ' . Phpfox::getUserField())
->from($this->_sTable, 'feed')
->join(Phpfox::getT('user'), 'u', 'u.user_id = feed.user_id')
->leftJoin(Phpfox::getT('app'), 'apps', 'apps.app_id = feed.app_id')
->where((isset($aCustomCondition) ? $aCustomCondition : 'feed.feed_id = ' . (int) $iFeedId . ' AND feed.user_id = ' . (int) $iUserid))
->order('feed.time_stamp DESC')
->limit(1)
->execute('getSlaveRows');
}
elseif ($iUserid !== null)
//.........这里部分代码省略.........
示例15: process
//.........这里部分代码省略.........
if (defined('PHPFOX_IS_USER_PROFILE') && !Phpfox::getService('user.privacy')->hasAccess($iUserId, 'feed.view_wall'))
{
return false;
}
if (defined('PHPFOX_IS_PAGES_VIEW') && !Phpfox::getService('pages')->hasPerm(null, 'pages.share_updates'))
{
$aFeedCallback['disable_share'] = true;
}
$iFeedPage = $this->request()->get('page', 0);
if ($this->request()->getInt('status-id')
|| $this->request()->getInt('comment-id')
|| $this->request()->getInt('link-id')
|| $this->request()->getInt('poke-id')
|| $this->request()->getInt('feed')
)
{
$bIsCustomFeedView = true;
if ($this->request()->getInt('status-id'))
{
$sCustomViewType = 'Status Update: #' . $this->request()->getInt('status-id');
}
elseif ($this->request()->getInt('link-id'))
{
$sCustomViewType = 'Link: #' . $this->request()->getInt('link-id');
}
elseif ($this->request()->getInt('poke-id'))
{
$sCustomViewType = 'Poke: #' . $this->request()->getInt('poke-id');
}
elseif ($this->request()->getInt('comment-id'))
{
$sCustomViewType = 'Wall Comment: #' . $this->request()->getInt('comment-id');
Phpfox::getService('notification.process')->delete('feed_comment_profile', $this->request()->getInt('comment-id'), Phpfox::getUserId());
}
elseif ($this->request()->getInt('feed'))
{
$sCustomViewType = 'Feed';
}
}
$aRows = Phpfox::getService('feed')->callback($aFeedCallback)->get(($bIsProfile > 0 ? $iUserId : null), ($this->request()->get('feed') ? $this->request()->get('feed') : null), $iFeedPage);
if (($this->request()->getInt('status-id')
|| $this->request()->getInt('comment-id')
|| $this->request()->getInt('link-id')
|| $this->request()->getInt('poke-id')
)
&& isset($aRows[0]))
{
$aRows[0]['feed_view_comment'] = true;
$this->setParam('aFeed', array_merge(array('feed_display' => 'view', 'total_like' => $aRows[0]['feed_total_like']), $aRows[0]));
}
(($sPlugin = Phpfox_Plugin::get('feed.component_block_display_process')) ? eval($sPlugin) : false);
if ($bIsCustomFeedView && !count($aRows) && $bIsProfile)
{
$aUser = $this->getParam('aUser');
$this->url()->send($aUser['user_name'], null, Phpfox::getPhrase('feed.the_activity_feed_you_are_looking_for_does_not_exist'));
}
$iUserid = ($bIsProfile > 0 ? $iUserId : null);
$iTotalFeeds = (int) Phpfox::getComponentSetting(($iUserid === null ? Phpfox::getUserId() : $iUserid), 'feed.feed_display_limit_' . ($iUserid !== null ? 'profile' : 'dashboard'), Phpfox::getParam('feed.feed_display_limit'));
if (!Phpfox::isMobile())
{
$this->template()->assign(array(
'sHeader' => 'Activity Feed'
)
);
}
$this->template()->assign(array(
'aFeeds' => $aRows,
'iFeedNextPage' => ($iFeedPage + 1),
'iFeedCurrentPage' => $iFeedPage,
'iTotalFeedPages' => 1,
'aFeedVals' => $this->request()->getArray('val'),
'sCustomViewType' => $sCustomViewType,
'aFeedStatusLinks' => Phpfox::getService('feed')->getShareLinks(),
'aFeedCallback' => $aFeedCallback,
'bIsCustomFeedView' => $bIsCustomFeedView
)
);
if ($bIsProfile)
{
if (!Phpfox::getService('user.privacy')->hasAccess($iUserId, 'feed.display_on_profile'))
{
return false;
}
}
return 'block';
}