本文整理汇总了PHP中Phpfox::getUserField方法的典型用法代码示例。如果您正苦于以下问题:PHP Phpfox::getUserField方法的具体用法?PHP Phpfox::getUserField怎么用?PHP Phpfox::getUserField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phpfox
的用法示例。
在下文中一共展示了Phpfox::getUserField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLatestForUser
/**
* Gets the Latest relation status of $iUser
* @param int $iUserId user_id
* @param int $iBeforeId Used to get the second to newest. relation_data_id
* @return array
*/
public function getLatestForUser($iUserId, $iBeforeId = null, $bStarted = false)
{
$sWhere = '';
if ($iBeforeId != null) {
$sWhere .= 'crd.relation_data_id < ' . (int) $iBeforeId;
}
if ($bStarted == true) {
$sWhere .= '(crd.user_id = ' . (int) $iUserId . ')';
} else {
$sWhere = '(crd.user_id = ' . (int) $iUserId . ') OR crd.with_user_id = ' . (int) $iUserId . '';
}
$aRelation = $this->database()->select('*')->from(Phpfox::getT('custom_relation_data'), 'crd')->where($sWhere)->join(Phpfox::getT('custom_relation'), 'cr', 'cr.relation_id = crd.relation_id')->order('crd.relation_data_id DESC')->limit(1)->execute('getSlaveRow');
/* we dont need the phrase or do we...? */
if (empty($aRelation)) {
return array();
}
/* get the other user's full_name and image */
$this->database()->select(Phpfox::getUserField())->from(Phpfox::getT('user'), 'u');
if ($aRelation['with_user_id'] == $iUserId) {
$this->database()->where('user_id = ' . $aRelation['user_id']);
} else {
$this->database()->where('user_id = ' . $aRelation['with_user_id']);
}
$aWith = $this->database()->execute('getSlaveRow');
$aRelation['with_user'] = array_merge($aRelation, $aWith);
return $aRelation;
}
示例2: get
public function get($iUserId = null)
{
if ($iUserId === null) {
$iUserId = Phpfox::getUserId();
}
return $this->database()->select('ub.block_user_id, ' . Phpfox::getUserField())->from($this->_sTable, 'ub')->join(Phpfox::getT('user'), 'u', 'u.user_id = ub.block_user_id')->where('ub.user_id = ' . (int) $iUserId)->execute('getSlaveRows');
}
示例3: get
public function get($sCategory = null)
{
$sSelect = 'p.photo_id, p.server_id, p.destination, p.time_stamp, ' . Phpfox::getUserField();
$aConds = array();
$aConds[] = 'AND p.privacy = 0 AND p.allow_rate = 1';
if ($sCategory !== null) {
$sCategoryIds = Phpfox::getService('photo.category')->getAllCategories($sCategory);
if (!empty($sCategoryIds)) {
$aConds[] = ' AND pcd.category_id IN (' . $sCategoryIds . ')';
$this->database()->innerJoin(Phpfox::getT('photo_category_data'), 'pcd', 'pcd.photo_id = p.photo_id');
}
}
$aRows = $this->database()->select($sSelect)->from($this->_sTable, 'p')->join(Phpfox::getT('user'), 'u', 'u.user_id = p.user_id')->where($aConds)->order('RAND()')->limit(2)->execute('getSlaveRows');
if (!count($aRows)) {
return false;
}
if (count($aRows) < 2) {
return false;
}
$sMode = Phpfox::getLib('request')->get('mode') == 'full' ? 'full' : '';
$aPhotos = array();
foreach ($aRows as $iKey => $aRow) {
if ($iKey === 0) {
$aRow['link'] = Phpfox::getLib('url')->makeUrl('photo.battle', array('w' => $aRow['photo_id'], 'l' => $aRows[1]['photo_id'], 'mode' => $sMode));
} else {
$aRow['link'] = Phpfox::getLib('url')->makeUrl('photo.battle', array('w' => $aRow['photo_id'], 'l' => $aRows[0]['photo_id'], 'mode' => $sMode));
}
$aPhotos[$iKey === 0 ? 'one' : 'two'] = $aRow;
}
return $aPhotos;
}
示例4: getJavascript
public function getJavascript($iPhotoId)
{
$aTags = $this->database()->select('p.user_id AS photo_owner_id, pt.tag_id, pt.user_id AS post_user_id, pt.content, pt.position_x, pt.position_y, pt.width, pt.height, ' . Phpfox::getUserField())->from($this->_sTable, 'pt')->leftJoin(Phpfox::getT('user'), 'u', 'u.user_id = pt.tag_user_id')->join(Phpfox::getT('photo'), 'p', 'p.photo_id = pt.photo_id')->where('pt.photo_id = ' . (int) $iPhotoId)->execute('getSlaveRows');
if (!count($aTags)) {
return false;
}
$sNotes = '[';
foreach ($aTags as $aTag) {
$sNotes .= '{';
$sNotes .= 'note_id: ' . $aTag['tag_id'] . ', ';
$sNotes .= 'x1: ' . $aTag['position_x'] . ', ';
$sNotes .= 'y1: ' . $aTag['position_y'] . ', ';
$sNotes .= 'width: ' . $aTag['width'] . ', ';
$sNotes .= 'height: ' . $aTag['height'] . ', ';
$sRemove = $aTag['post_user_id'] == Phpfox::getUserId() || $aTag['photo_owner_id'] == Phpfox::getUserId() || $aTag['user_id'] == Phpfox::getUserId() ? ' <a href="#" onclick="if (confirm(\\\'' . Phpfox::getPhrase('photo.are_you_sure') . '\\\')) { $(\\\'#noteform\\\').hide(); $(\\\'#js_photo_view_image\\\').imgAreaSelect({ hide: true }); $(this).parent(\\\'span:first\\\').remove();$(\\\'.notep#notep_' . $aTag['tag_id'] . '\\\').remove();$.ajaxCall(\\\'photo.removePhotoTag\\\', \\\'tag_id=' . $aTag['tag_id'] . '\\\'); } return false;"><i class="fa fa-remove"></i></a>' : '';
if (!empty($aTag['user_id'])) {
$sNotes .= 'note: \'<a href="' . Phpfox_Url::instance()->makeUrl($aTag['user_name']) . '" id="js_photo_tag_user_id_' . $aTag['user_id'] . '">' . $aTag['full_name'] . '</a>' . $sRemove . '\'';
} else {
$sNotes .= 'note: \'' . str_replace("'", "\\'", Phpfox::getLib('parse.output')->clean($aTag['content'])) . $sRemove . '\'';
}
$sNotes .= '},';
}
$sNotes = rtrim($sNotes, ',');
$sNotes .= ']';
return $sNotes;
}
示例5: get
/**
* Gets the featured members according to Phpfox::getParam('user.how_many_featured_members').
* Uses cache to save a query (stores a cache if none found)
* @return array( array of users, int total featured users )
*/
public function get()
{
if ($sPlugin = Phpfox_Plugin::get('user.service_featured_get_1')) {
eval($sPlugin);
if (isset($mPluginReturn)) {
return $mPluginReturn;
}
}
$iTotal = Phpfox::getParam('user.how_many_featured_members');
// the random will be done with php logic
$sCacheId = $this->cache()->set('featured_users');
if (!($aUsers = $this->cache()->get($sCacheId))) {
$aUsers = $this->database()->select(Phpfox::getUserField() . ', uf.ordering')->from(Phpfox::getT('user'), 'u')->join($this->_sTable, 'uf', 'uf.user_id = u.user_id')->order('ordering DESC')->execute('getSlaveRows');
if (Phpfox::getParam('user.cache_featured_users')) {
$this->cache()->save($sCacheId, $aUsers);
}
}
if (!is_array($aUsers)) {
return array(array(), 0);
}
$aOut = array();
if (Phpfox::getParam('user.randomize_featured_members')) {
shuffle($aUsers);
}
$iCount = count($aUsers);
// using count instead of $this->database()->limit to measure the real value
for ($i = 0; $i <= $iTotal; $i++) {
if (!isset($aUsers[$iCount - $i])) {
continue;
}
// availability check
$aOut[] = $aUsers[$iCount - $i];
}
return array($aOut, count($aUsers));
}
示例6: getMessages
/**
* Get the latest shoutouts.
*
* @param int $iLimit Define the limit so we don't return all the shoutouts.
* @return array Array of shoutouts.
*/
public function getMessages($iLimit = 5)
{
if (isset($this->_aCallback['module'])) {
if (Phpfox::hasCallback($this->_aCallback['module'], 'getShoutboxData')) {
$aCallback = Phpfox::callback($this->_aCallback['module'] . '.getShoutboxData');
if (isset($aCallback['table'])) {
$this->_sTable = Phpfox::getT($aCallback['table']);
$this->database()->where('item_id = ' . (int) $this->_aCallback['item']);
}
}
}
$aMessages = $this->database()->select('s.shout_id, s.text, s.time_stamp, ' . Phpfox::getUserField())->from($this->_sTable, 's')->join(Phpfox::getT('user'), 'u', 'u.user_id = s.user_id')->limit($iLimit)->order('s.time_stamp DESC')->execute('getSlaveRows');
foreach ($aMessages as $iKey => $aMessage) {
$aMessage['text'] = Phpfox::getLib('parse.output')->replaceHashTags(Phpfox::getLib('parse.output')->split(Phpfox::getLib('parse.output')->clean($aMessage['text']), Phpfox::getParam('shoutbox.shoutbox_wordwrap')));
if (Phpfox::isModule('emoticon')) {
$aMessages[$iKey]['text'] = Phpfox::getService('emoticon')->parse($aMessage['text']);
}
$aMessages[$iKey]['module'] = isset($this->_aCallback['module']) ? $this->_aCallback['module'] : '';
}
// FUDGE Lovinity January 5, 2016: Filter shouts by users who have been blocked or are blocking
$bIsBlocked = Phpfox::getService('user.block')->isBlocked($aMessages[$iKey]['user_id'], Phpfox::getUserId());
$bIsBlocked2 = Phpfox::getService('user.block')->isBlocked(Phpfox::getUserId(), $aMessages[$iKey]['user_id']);
if ($bIsBlocked || $bIsBlocked2) {
$aMessages[$iKey]['text'] = '<img src="file/public/blocked.png">';
}
// END FUDGE
return $aMessages;
}
示例7: query
public function query($sQuery, $iPage, $iTotalShow, $sView = null)
{
if ($sView !== null && Phpfox::isModule($sView))
{
$aModuleResults = Phpfox::callback($sView . '.globalUnionSearch', $this->preParse()->clean($sQuery));
}
else
{
$aModuleResults = Phpfox::massCallback('globalUnionSearch', $this->preParse()->clean($sQuery));
}
$iOffset = ($iPage * $iTotalShow);
$aRows = $this->database()->select('item.*, ' . Phpfox::getUserField())
->unionFrom('item')
->join(Phpfox::getT('user'), 'u', 'u.user_id = item.item_user_id')
->limit($iOffset, $iTotalShow)
->order('item_time_stamp DESC')
->execute('getSlaveRows');
$aResults = array();
foreach ($aRows as $iKey => $aRow)
{
$aResults[] = array_merge($aRow, (array) Phpfox::callback($aRow['item_type_id'] . '.getSearchInfo', $aRow));
}
return $aResults;
}
示例8: 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;
}
示例9: getFilters
public function getFilters($sType)
{
$aFilters = $this->database()->select('b.*, ' . Phpfox::getUserField())
->from($this->_sTable, 'b')
->leftJoin(Phpfox::getT('user'), 'u', 'u.user_id = b.user_id')
->where('b.type_id = \'' . $this->database()->escape($sType) . '\'')
->execute('getRows');
foreach ($aFilters as $iKey => $aFilter)
{
if (!empty($aFilter['user_groups_affected']))
{
$aUserGroups = unserialize($aFilter['user_groups_affected']);
$aFilters[$iKey]['user_groups_affected'] = array();
$sWhere = '';
foreach ($aUserGroups as $iUserGroup)
{
$sWhere .= 'user_group_id = ' . $iUserGroup . ' OR ';
}
$sWhere = rtrim($sWhere, ' OR ');
$aFilters[$iKey]['user_groups_affected'] = Phpfox::getService('user.group')->get($sWhere);
}
}
return $aFilters;
}
示例10: getMessages
/**
* Get the latest shoutouts.
*
* @param int $iLimit Define the limit so we don't return all the shoutouts.
* @return array Array of shoutouts.
*/
public function getMessages($iLimit = 5)
{
if (isset($this->_aCallback['module']))
{
if (Phpfox::hasCallback($this->_aCallback['module'], 'getShoutboxData'))
{
$aCallback = Phpfox::callback($this->_aCallback['module'] . '.getShoutboxData');
if (isset($aCallback['table']))
{
$this->_sTable = Phpfox::getT($aCallback['table']);
$this->database()->where('item_id = ' . (int) $this->_aCallback['item']);
}
}
}
$aMessages = $this->database()->select('s.shout_id, s.text, s.time_stamp, ' . Phpfox::getUserField())
->from($this->_sTable, 's')
->join(Phpfox::getT('user'), 'u', 'u.user_id = s.user_id')
->limit($iLimit)
->order('s.time_stamp DESC')
->execute('getSlaveRows');
foreach ($aMessages as $iKey => $aMessage)
{
$aMessage['text'] = Phpfox::getLib('parse.output')->split(Phpfox::getLib('parse.output')->clean($aMessage['text']), Phpfox::getParam('shoutbox.shoutbox_wordwrap'));
$aMessages[$iKey]['text'] = Phpfox::getService('emoticon')->parse($aMessage['text']);
$aMessages[$iKey]['module'] = (isset($this->_aCallback['module']) ? $this->_aCallback['module'] : '');
}
return $aMessages;
}
示例11: process
/**
* Class process method wnich is used to execute this component.
*/
public function process()
{
//Set How many records to return
$iLimit = 9;
$aUsers = Phpfox::getLib('database')->select('u.user_id, ua.activity_points, ' . Phpfox::getUserField())->from(Phpfox::getT('user'), 'u')->join(Phpfox::getT('user_activity'), 'ua', 'u.user_id = ua.user_id')->order('ua.activity_points DESC')->limit($iLimit)->execute('getSlaveRows');
$this->template()->assign(array('sHeader' => Phpfox::getPhrase('user.point_title'), 'aUsers' => $aUsers));
return 'block';
}
示例12: getReports
public function getReports($iId)
{
$aReport = $this->database()->select('item_id')->from($this->_sTable)->where('data_id = ' . (int) $iId)->execute('getRow');
if (!isset($aReport['item_id']) && !isset($aReport['feedback'])) {
return false;
}
$aReports = $this->database()->select('rd.*, r.message, ' . Phpfox::getUserField())->from($this->_sTable, 'rd')->join(Phpfox::getT('user'), 'u', 'u.user_id = rd.user_id')->join(Phpfox::getT('report'), 'r', 'r.report_id = rd.report_id')->where('item_id = \'' . $aReport['item_id'] . '\'')->execute('getRows');
return $aReports;
}
示例13: getAppById
public function getAppById($iId, $iUserId)
{
$aApp = $this->database()->select('a.*, p.page_id, p.total_like, au.install_id as is_installed, ac.category_id, ac.name as category_name, ' . Phpfox::getUserField())->from(Phpfox::getT('app'), 'a')->join(Phpfox::getT('user'), 'u', 'u.user_id = a.user_id')->leftjoin(Phpfox::getT('app_installed'), 'au', 'au.app_id = a.app_id AND au.user_id = ' . $iUserId)->leftjoin(Phpfox::getT('app_category_data'), 'acd', 'acd.app_id = a.app_id')->leftjoin(Phpfox::getT('app_category'), 'ac', 'ac.category_id = acd.category_id')->leftjoin(Phpfox::getT('pages'), 'p', 'p.app_id = a.app_id')->where('a.public_key = \'' . $iId . '\'')->execute('getSlaveRow');
if (empty($aApp)) {
return Phpfox_Error::display(Phpfox::getPhrase('apps.this_app_does_not_exist'));
}
$aApp['category_name'] = Phpfox::getLib('locale')->convert($aApp['category_name']);
return $aApp;
}
示例14: getPage
public function getPage($iPage)
{
$aPage = Phpfox::getService('pages')->getForView($iPage);
$aUser = $this->database()->select(Phpfox::getUserField('u'))->from(Phpfox::getT('user'), 'u')->where('u.user_id = ' . $aPage['user_id'])->execute('getRow');
$aPage = array_merge($aPage, $aUser);
$aPage['profile_page_id'] = $this->database()->select('u.user_id')->from(Phpfox::getT('user'), 'u')->where('u.profile_page_id = ' . $aPage['page_id'])->execute('getField');
$aPage = $this->processPage($aPage);
return $aPage;
}
示例15: getList
public function getList($iPage, $iPageSize)
{
$iCnt = $this->database()->select('COUNT(*)')->from($this->_sTable)->execute('getSlaveField');
$aReceivedList = $this->database()->select('ki.*, ' . Phpfox::getUserField('u', 'u_'))->from($this->_sTable, 'ki')->join(Phpfox::getT('user'), 'u', 'u.user_id = ki.user_id')->order('ki.koinfractions_id DESC')->limit($iPage, $iPageSize, $iCnt)->execute('getRows');
foreach ($aReceivedList as $iKey => $aInfraction) {
$aReceivedList[$iKey]['admin_user'] = $this->database()->select(Phpfox::getUserField())->from(Phpfox::getT('user'), 'u')->where('u.user_id =' . $aInfraction['admin_user_id'])->execute('getRow');
}
return array($iCnt, $aReceivedList);
}