Stuart Wright
Well-known member
I want to list our advertisers in a page node laid out rather like this:
http://xenforo.com/community/members/
How do I do it please?
http://xenforo.com/community/members/
How do I do it please?
$criteria = array(
'secondary_group_ids' => array(1,2)
);
$options = array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'order' => 'username'
));
$users = $this->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options);
That would be perfect if it showed all the users in the usergroup.You could use this http://xenforo.com/community/resources/add-another-notable-member-tab.2403/
You would have to make a new usergroup and put users in that group
I'm getting an error. What do I put instead of $this?You could also use
PHP:$criteria = array( 'secondary_group_ids' => array(1,2) ); $options = array( 'join' => XenForo_Model_User::FETCH_USER_FULL, 'order' => 'username' )); $users = $this->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options);
class AVForums_AdvertiserList_ControllerPublic_AdvertiserList
{
public static function getAdvertiserList(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
{
$criteria = array(
'secondary_group_ids' => array(10,13,16)
);
$options = array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'order' => 'username'
);
$users = $this->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options);
print_r($users);
$pageout = "";
$response->params['pageout'] = $pageout;
}
}
Post your codeI'm getting an error. What do I put instead of $this?
PHP:class AVForums_AdvertiserList_ControllerPublic_AdvertiserList { public static function getAdvertiserList(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response) { $criteria = array( 'secondary_group_ids' => array(10,13,16) ); $options = array( 'join' => XenForo_Model_User::FETCH_USER_FULL, 'order' => 'username' ); $users = $this->getModelFromCache('XenForo_Model_User')->getUsers($criteria, $options); print_r($users); $pageout = ""; $response->params['pageout'] = $pageout; } }
Posted in an edit ^. Just want to see what's in the $users array to start off with.Post your code
$controller->getModelFromCache('XenForo_Model_User'
$this->getModelFromCache('XenForo_Model_User'
<ol class="section memberList">
<xen:foreach loop="$users" value="$user">
<xen:include template="member_list_item">
<xen:set var="$noOverlay">1</xen:set>
</xen:include>
</xen:foreach>
</ol>
That would be perfect if it showed all the users in the usergroup.
<xen:sidebar>
<xen:edithint template="sidebar.css" />
<xen:hook name="forum_list_sidebar">
</xen:hook>
<xen:include template="sidebar_online_users" />
<div class="section">
<div class="secondaryContent statsList" id="boardStats">
<h3>{xen:phrase forum_statistics}</h3>
<div class="pairsJustified">
<dl class="discussionCount"><dt>{xen:phrase discussions}:</dt>
<dd>{xen:number $boardTotals.discussions}</dd></dl>
<dl class="messageCount"><dt>{xen:phrase messages}:</dt>
<dd>{xen:number $boardTotals.messages}</dd></dl>
<dl class="memberCount"><dt>{xen:phrase members}:</dt>
<dd>{xen:number $boardTotals.users}</dd></dl>
<dl><dt>{xen:phrase latest_member}:</dt>
<dd><a href="{xen:link members, $boardTotals.latestUser}" class="username">{$boardTotals.latestUser.username}</a></dd></dl>
</div>
</div>
</div>
</xen:sidebar>
$visitor = XenForo_Visitor::getInstance();
$sessionModel = $this->getModelFromCache('XenForo_Model_Session');
$onlineUsers = $sessionModel->getSessionActivityQuickList(
$visitor->toArray(),
array('cutOff' => array('>', $sessionModel->getOnlineStatusTimeout())),
($visitor['user_id'] ? $visitor->toArray() : null)
);
$boardTotals = $this->getModelFromCache('XenForo_Model_DataRegistry')->get('boardTotals');
if (!$boardTotals)
{
$boardTotals = $this->getModelFromCache('XenForo_Model_Counters')->rebuildBoardTotalsCounter();
}
$response->params['onlineUsers'] = $onlineUsers;
$response->params['boardTotals'] = $boardTotals;
We use essential cookies to make this site work, and optional cookies to enhance your experience.