News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

i have search but cant find it ! hiding childboard/subforum from main forum

Started by MichaelBrian, September 13, 2013, 10:17:02 PM

Previous topic - Next topic

MichaelBrian

Is any one could help me with that ?

http://sprb.ca/forum/index.php?action=forum    i would like all subfurom list to be hide .
What ever i try by using answer in some thread i have find by using the search function nothing can help me, or i missed it.

thanks


Sir Osis of Liver


If you hide them, no one will know they're there, so why not just delete them?

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

MichaelBrian

Quote from: Krash. on September 13, 2013, 10:24:06 PM

If you hide them, no one will know they're there, so why not just delete them?
dont get me wrong i want they stay there.

lets say i click on British columbia ( state / province ) http://sprb.ca/forum/index.php?board=208.0
i enter this forum where all subforum are.

but i would like the subforum just be hide from the view on the main page but still accessible
http://sprb.ca/forum/index.php?action=forum

Sir Osis of Liver


In BoardIndex.template.php delete this -



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



Back up the file before you try it, and make sure you get the brackets right at the end.

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

MichaelBrian

Well usually i dont touch the coding my self but i remember have done it before by ADMIN CP > Board > Setting but from there i cant remember where is it. i was just check or uncheck a box and the subforum was no more visible on the main page.

But thanks for your help

br360

If you don't want to edit code yourself, try this mod here- http://custom.simplemachines.org/mods/index.php?mod=2864

It will hide the child boards from the main index page, but if someone clicks on a board, the child boards will show then.

It works fine for version 2.0 and above, but you have to emulate to SMF 2.0. RC2

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: