This doesn't work for 1.4. The tab is added, but then when you click it - it just displays 'Most Messages' users.
@Jake BunceCool!
Quick question, how would I go about changing the default tab from most messages to staff members ?
<xen:title>{xen:phrase notable_members}</xen:title>
<xen:container var="$head.canonical">
<link rel="canonical" href="{xen:link 'canonical:members'}" /></xen:container>
<xen:require css="member_list.css" />
<xen:require css="xenforo_member_list_item.css" />
<xen:if is="{$userNotFound}">
<div class="importantMessage">{xen:phrase specified_member_cannot_be_found_enter_entire_name}</div>
</xen:if>
<ul class="tabs">
<li class="{xen:if '{$type} == "messages"', active}"><a href="{xen:link members}">{xen:phrase most_messages}</a></li>
<li class="{xen:if '{$type} == "likes"', active}"><a href="{xen:link members, '', 'type=likes'}">{xen:phrase most_likes}</a></li>
<li class="{xen:if '{$type} == "points"', active}"><a href="{xen:link members, '', 'type=points'}">{xen:phrase most_points}</a></li>
<li class="{xen:if '{$type} == "staff"', active}"><a href="{xen:link members, '', 'type=staff'}">{xen:phrase staff_members}</a></li>
<li class="{xen:if '{$type} == "vip"', active}"><a href="{xen:link members, '', 'type=vip'}">Server Admins</a></li>
</ul>
<div class="section">
<ol class="memberList">
<xen:foreach loop="$users" value="$user">
<xen:include template="member_list_item">
<xen:set var="$noOverlay">1</xen:set>
<xen:set var="$extraTemplate"><xen:if is="{$bigKey}"><span class="bigNumber">{xen:number {$user.{$bigKey}}}</span></xen:if></xen:set>
</xen:include>
</xen:foreach>
</ol>
</div>
<xen:sidebar>
<div class="section">
<form action="{xen:link members}" method="post" class="secondaryContent findMember">
<h3><a href="{xen:link online}" title="{xen:phrase see_all_online_users}">{xen:phrase find_member}</a></h3>
<input type="search" name="username" placeholder="{xen:phrase name}..." results="0" class="textCtrl AutoComplete" data-autoSubmit="true" />
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
</form>
</div>
<xen:if is="{$birthdays}">
<div class="section">
<div class="secondaryContent avatarHeap">
<h3>{xen:phrase todays_birthdays}</h3>
<ol>
<xen:foreach loop="$birthdays" value="$user">
<li><xen:avatar user="$user" size="s" text="{$user.username}" class="Tooltip" data-tipclass="flipped" title="{$user.username}" /></li>
</xen:foreach>
</ol>
</div>
</div>
</xen:if>
<xen:if is="{$latestUsers}">
<div class="section newestMembers">
<div class="secondaryContent avatarHeap">
<h3>{xen:phrase newest_members}</h3>
<ol>
<xen:foreach loop="$latestUsers" value="$user">
<li><xen:avatar user="$user" size="s" text="{$user.username} ({xen:datetime $user.register_date})" class="Tooltip" data-tipclass="flipped" title="{$user.username}, {xen:phrase joined}: {xen:datetime $user.register_date}" /></li>
</xen:foreach>
</ol>
</div>
</div>
</xen:if>
<xen:if is="{$xenOptions.facebookAppId} AND {$xenOptions.facebookFacepile}">
<div class="fbWidgetBlock">
<xen:container var="$facebookSdk">1</xen:container>
<div class="section">
<fb:facepile width="@sidebar.width" size="small" colorscheme="@fbColorScheme"></fb:facepile>
</div>
</div>
</xen:if>
</xen:sidebar>
protected function _getNotableMembers($type, $limit)
{
$userModel = $this->_getUserModel();
$notableCriteria = array(
'is_banned' => 0
);
if ($type == 'vip')
{
$notableCriteria['secondary_group_ids'] = array(7,8);
}
$typeMap = array(
'messages' => 'message_count',
'likes' => 'like_count',
'points' => 'trophy_points',
'vip' => 'message_count'
);
if (!isset($typeMap[$type]))
{
return false;
}
Amendment in blue:
library/XenForo/ControllerPublic/Member.php
Rich (BB code):protected function _getNotableMembers($type, $limit) { $userModel = $this->_getUserModel(); $notableCriteria = array( 'is_banned' => 0 ); if ($type == 'vip') { $notableCriteria['secondary_group_ids'] = array(3); } $typeMap = array( 'messages' => 'message_count', 'likes' => 'like_count', 'points' => 'trophy_points', 'vip' => 'message_count' ); if (!isset($typeMap[$type])) { return false; } return array($userModel->getUsers($notableCriteria, array( 'join' => XenForo_Model_User::FETCH_USER_FULL, 'limit' => $limit, 'order' => $typeMap[$type], 'direction' => ($type == 'vip' ? 'asc' : 'desc') )), $typeMap[$type]); }
protected function _getNotableMembers($type, $limit)
{
$userModel = $this->_getUserModel();
$notableCriteria = array(
'is_banned' => 0
);
$typeMap = array(
'messages' => 'message_count',
'likes' => 'like_count',
'points' => 'trophy_points',
'latest' => 'join_date'
);
if (!isset($typeMap[$type]))
{
return false;
}
return array($userModel->getUsers($notableCriteria, array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'limit' => $limit,
'order' => $typeMap[$type],
'direction' => ($type == 'latest' ? 'asc' : 'desc')
)), $typeMap[$type]);
}
if ($type == 'latest')
{
$notableCriteria['secondary_group_ids'] = array(3,5);
}
$typeMap = array(
'messages' => 'message_count',
'likes' => 'like_count',
'points' => 'trophy_points',
'latest' => 'join_date'
);
if (!isset($typeMap[$type]))
{
return false;
}
$field = $typeMap[$type];
$notableCriteria[$field] = array('>', 0);
return array($userModel->getUsers($notableCriteria, array(
'join' => XenForo_Model_User::FETCH_USER_FULL,
'limit' => $limit,
'order' => $field,
'direction' => ($type == 'latest' ? 'asc' : 'desc')
)), $typeMap[$type]);
}
anyone know how to do this still?Is it possible to add more than one tab to notable members?
This is my Code, but only the last if statement will be work. The other give a blank page under there tabs ..Code:if ($type == 'dcm') { $notableCriteria['secondary_group_ids'] = array(9); } if ($type == 'freund') { $notableCriteria['secondary_group_ids'] = array(15); } if ($type == 'hod') { $notableCriteria['secondary_group_ids'] = array(11); } $typeMap = array( 'messages' => 'message_count', 'likes' => 'like_count', 'points' => 'trophy_points', 'dcm' => 'usernames', 'freund' => 'usernames', 'hod' => 'usernames' );
<?php
protected function _getNotableMembers($type, $limit)
{
$userModel = $this->_getUserModel();
$notableCriteria = array(
'is_banned' => 0
);
if ($type == 'bod')
{
$notableCriteria['secondary_group_ids'] = array(10);
}
$typeMap = array(
'messages' => 'message_count',
'likes' => 'like_count',
'points' => 'trophy_points',
'direction' => ($type == 'bod' ? 'asc' : 'desc')
);
We use essential cookies to make this site work, and optional cookies to enhance your experience.