Advertisement:

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

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 393
  • 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: 69,578
    • StoryBB/StoryBB 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.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Wellwisher

  • Jr. Member
  • **
  • Posts: 393
  • 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 »