Just want to have the membergroup legend display at bottom of memberlist....
// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';
}
Would first need to have that information available in the memberlist action.
Sources/Memberlist.php
global $scripturl, $txt, $modSettings, $context;
// Make sure they can view the memberlist.
isAllowedTo('view_mlist');
loadTemplate('Memberlist');
global $scripturl, $txt, $modSettings, $context, $settings;
// Make sure they can view the memberlist.
isAllowedTo('view_mlist');
loadTemplate('Memberlist');
// Are we showing all membergroups on the board index?
if (!empty($settings['show_group_key']))
$context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array());
Memberlist.template.php
// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<div class="buttonlist floatright">
<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>
</div>';
echo '
</div>
</div><!-- #memberlist -->';
// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<div class="buttonlist floatright">
<a class="button" href="', $scripturl, '?action=mlist;sa=search;search=', $context['old_search_value'], '">', $txt['mlist_search_again'], '</a>
</div>';
echo '
</div>
</div><!-- #memberlist -->';
// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';
Thank you, Sir!
I don't suppose you could tell me how to achieve the same result on the edit buddies page? ;)
Well I'm don't have a setup to test right now but it would be similar.
Sources/Profile-Modify.php
global $context, $txt, $modSettings;
// Do a quick check to ensure people aren't getting here illegally!
if (!$context['user']['is_owner'] || empty($modSettings['enable_buddylist']))
fatal_lang_error('no_access', false);
global $context, $txt, $modSettings, $settings;
// Do a quick check to ensure people aren't getting here illegally!
if (!$context['user']['is_owner'] || empty($modSettings['enable_buddylist']))
fatal_lang_error('no_access', false);
// Are we showing all membergroups on the board index?
if (!empty($settings['show_group_key']))
$context['membergroups'] = cache_quick_get('membergroup_list', 'Subs-Membergroups.php', 'cache_getMembergroupList', array());
And since I can't test it right now, I'm not entirely sure but perhaps it would be in Themes/{default_or_yourtheme}/Profile.template.php
function template_editBuddies()
{
global $context, $scripturl, $txt;
function template_editBuddies()
{
global $context, $scripturl, $txt, $settings;
<script>
var oAddBuddySuggest = new smc_AutoSuggest({
sSelf: \'oAddBuddySuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'new_buddy\',
sControlId: \'new_buddy\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
</script>';
<script>
var oAddBuddySuggest = new smc_AutoSuggest({
sSelf: \'oAddBuddySuggest\',
sSessionId: smf_session_id,
sSessionVar: smf_session_var,
sSuggestId: \'new_buddy\',
sControlId: \'new_buddy\',
sSearchType: \'member\',
sTextDeleteItem: \'', $txt['autosuggest_delete_item'], '\',
bItemList: false
});
</script>';
// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<span class="membergroups">' . implode(', ', $context['membergroups']) . '</span>';