Hello Guest
No Avatar
Sign In to Remove
Posts: 
17
Reputation: 
3
Posted: April 5, 2013, 1:25 AM
  • Group: Member
Hi,

In my forum I have lots of sub forums which I dont like the look of so I would like to find a way to get rid of them, everything I have tried so far has failed.

So if anyone has the answer please could I have the exact code to make it as simple as possible for me

Thanks

Alex
Posts: 
400
Reputation: 
20
Posted: April 5, 2013, 1:58 AM  -- Last Edit: April 8, 2013, 1:43 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Heya!

In BoardIndex.template.php for Vertex find:

Code: [Select]
// 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'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($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=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '
<tr id="board_', $board['id'], '_children">
<td colspan="3" class="children windowbg">
<strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '
</td>
</tr>';
}

Just comment that whole block out by putting "/*" at the beginning and "*/" at the end so it looks like the code below. Beware of the nested /* ... */ comment inside that block of code. I just got rid of it and changed it to // comments (just see below)

Code: [Select]
/*
// 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'] . '" ' . ($child['new'] ? 'class="new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><img src="' . $settings['lang_images_url'] . '/new.gif" class="new_posts" alt="" />' : '') . '</a>';
else
$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($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=' . ($child['unapproved_topics'] > 0 ? 'topics' : 'posts') . ';brd=' . $child['id'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . sprintf($txt['unapproved_posts'], $child['unapproved_topics'], $child['unapproved_posts']) . '" class="moderation_link">(!)</a>';

$children[] = $child['new'] ? '<strong>' . $child['link'] . '</strong>' : $child['link'];
}
echo '
<tr id="board_', $board['id'], '_children">
<td colspan="3" class="children windowbg">
<strong>', $txt['parent_boards'], '</strong>: ', implode(', ', $children), '
</td>
</tr>';
}
*/

One more thing.

Find:
Code: [Select]
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
Replace With:
Code: [Select]
<td class="icon windowbg">
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
17
Reputation: 
3
Posted: April 8, 2013, 1:32 AM
  • Group: Member
Hello,

I tried your suggestion, only to get the follow issue on my forum index.

The placement is wrong on those sections below a section which contains child forums, that is to say (as can be seen in the attachment) the layout is misplaced for 'Odd Balls' as the section above has child forums. The same is true for 'LV County Champions Division 1'.

Thanks,
Posts: 
400
Reputation: 
20
Posted: April 8, 2013, 1:42 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
The placement is wrong on those sections below a section which contains child forums, that is to say (as can be seen in the attachment) the layout is misplaced for 'Odd Balls' as the section above has child forums. The same is true for 'LV County Champions Division 1'.

One more thing. I updated the post before but the instructions are below.

Find:
Code: [Select]
<td class="icon windowbg"', !empty($board['children']) ? ' rowspan="2"' : '', '>
Replace With:
Code: [Select]
<td class="icon windowbg">
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
17
Reputation: 
3
Posted: April 8, 2013, 3:14 AM
  • Group: Member
Thanks for that! It finally worked, would it be possible to change the term "child board" to "sub forum"?