News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Remove Childboard Links from index

Started by m1ss1nnocent, July 21, 2008, 03:04:13 PM

Previous topic - Next topic

m1ss1nnocent

Hi guys,

loving the SMF 2 I must say!

Anyhoo, I am wanting to remove childboard links from the main board index only (I'm happy for child-childboards to be visible once in each board if that makes sense :-\ ) I want to do this so that people have to enter each main board rather than clicking the childboard links and possibly missing stuff we have to offer....anyhoo, I digress.

As the board index is slightly different on the SMF 2, can someone please advise me as to what I need to remove/replace so as to not mess things up (which being a relative newbie still I have a tendency to do  >:( )

Many thanx in advance  :-*

Rumbaar

The process is relatively the same as for 1.1.x, but here goes.

BoardIndex.template.php
Find and remove:
' , !empty($board['children']) ? 'rowspan="2"' : '' , '

Find and remove:
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
if (!$child['is_redirect'])
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . $child['topics'] . ', ' . $txt['posts'] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . $child['posts'] . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';

// Has it posts awaiting approval?
if ($child['can_approve_posts'] && ($child['unapproved_posts'] | $child['unapproved_topics']))
$child['link'] .= ' <a href="' . $scripturl . '?action=moderate;area=postmod;sa=topics;brd=' . $child['id'] . ';sesc=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}

echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['separate_sticky_lock']) ? '3' : '', '">
<span class="smalltext"><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</span>
</td>
</tr>';
}
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

m1ss1nnocent

thank you so much  :-*

Worked like a dream  :D

Advertisement: