Advertisement:

Author Topic: Question: How do you remove moderator names from the "breadcrumbs"?  (Read 441 times)

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 385
  • Gender: Male
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.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,432
    • Arantor on GitHub
Re: Question: How do you remove moderator names from the "breadcrumbs"?
« Reply #1 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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 385
  • Gender: Male
Re: Question: How do you remove moderator names from the "breadcrumbs"?
« Reply #2 on: December 23, 2017, 06:55:53 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  :):

Code: [Select]

// 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']) . ')';
}

« Last Edit: December 23, 2017, 07:16:53 PM by Wellwisher »