Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Wellwisher on December 23, 2017, 05:23:44 PM

Title: Question: How do you remove moderator names from the "breadcrumbs"?
Post by: Wellwisher on December 23, 2017, 05:23:44 PM
Hello people,

Got a quick question, how do you remove moderator names from the SMF "breadcrumbs"?

I am trying to shorten the breadcrumbs as much as possible.
Title: Re: Question: How do you remove moderator names from the "breadcrumbs"?
Post by: Arantor on December 23, 2017, 06:06:19 PM
Two ways. Either edit the index.template.php file to not output the 'extra' parts (since they're defined in the extra_before and extra_after) or simply tell the code not to add them in the first place to the linktree. Probably in Load.php.
Title: Re: Question: How do you remove moderator names from the "breadcrumbs"?
Post by: Wellwisher on December 23, 2017, 06:55:53 PM
Quote from: Arantor on December 23, 2017, 06:06:19 PM
Two ways. Either edit the index.template.php file to not output the 'extra' parts (since they're defined in the extra_before and extra_after) or simply tell the code not to add them in the first place to the linktree. Probably in Load.php.

Nice, thanks mate. Mine was in "Sources/display" + "Sources/MessageIndex.php" then I just removed this code from it, already looks beautiful  :):



// Build a list of this board's moderators.
$context['moderators'] = &$board_info['moderators'];
$context['link_moderators'] = array();
if (!empty($board_info['moderators']))
{
// Add a link for each moderator...
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

// And show it after the board's name.
$context['linktree'][count($context['linktree']) - 2]['extra_after'] = ' (' . (count($context['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators']) . ': ' . implode(', ', $context['link_moderators']) . ')';
}