News:

Wondering if this will always be free?  See why free is better.

Main Menu

Hiding Child Board from Parent Board Page

Started by Bodom, December 21, 2013, 07:54:07 PM

Previous topic - Next topic

Bodom

Hello,

What I'm looking to do is to remove the child board from the parent board page...


So it would just look like this;


Thanks for the help in advance,
-Bodom

shadow82x

It requires some template modifications. Mind attaching your themes messageindex.template.php here?

Edit - Looks like there is a modification for it. :) http://custom.simplemachines.org/mods/index.php?mod=2864
Colin B
Former Spammer, Customize, & Support Team Member

Bodom

#2
Do you know if the mod keeps them on the main page still?

This mod isn't compatible with the current version of SMF. (2.0.6)
I should have stated what version I was using in the first place sorry..

I'd also like to keep the main page unchanged and like this,

shadow82x

Colin B
Former Spammer, Customize, & Support Team Member

Bodom

Sorry it took so long to reply, but I've been busy.
Anyway, that mod does the exact opposite of what I want, it hides the child boards from the main forum index and not the index of the parent forums (refer to pics)

QuoteSummary

This mod prevents child boards from appearing in their parent's index.
Children still show as normal inside their parent boards.

Kindred

Why do you want to hide the child board inside the parent?  That seems extremely counter intuitive... How else would users GET into the child boards?

If you want them hidden, why even bother using child boards?
Сл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."

kat

Confusion?

This is a board: http://bodomsden.com/forum/index.php?board=1.0

This is it's parent, which is the message index:

http://bodomsden.com/forum

So, what you want, is that "Connect to server" thing, removing. Is that right?

There's something that seems a bit weird, though. On your message index, the boards in the "Counter-Strike: Source Server Discussion" category have a "Connect to server" thing, showing. Are they supposed to be there? I was gonna check, using the SMF default theme. But, you're not allowing theme selection, so I can't do that. :(

Bodom

It's using a modified version of the default theme (Main_Block.png changes and menu gfx)..
And I want them hidden inside the board because it's a redirect to connect to the server, I just want it displayed on the main page so if someone wants, they can connect to our servers from there. Since it's a redirect there will never be any posts inside those child boards.

Yes, I want the connect server to be there, but for example, http://bodomsden.com/forum/index.php?board=1.0 [nofollow], I want the child board at the top of that page removed and for all others.

Kindred

you will have to modifiy messageindex.template.php then...   it should be pretty clearly marked which code snip deals with the display of the child boards.
Сл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."

margarett

MessageIndex.template.php

Find:

if (!empty($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
Add before
unset($context['boards']);

This would be the less "invasive" way to do it (and the easiest to revert). You can even choose some specific boards where to do this:
$array_dont_show = array(1,2,3); //Board IDs where to hide the child boards
if (in_array($_REQUEST['board'], $array_dont_show))
unset($context['boards']);
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Bodom

Do i add
$array_dont_show = array(1,2,3); //Board IDs where to hide the child boards
if (in_array($_REQUEST['board'], $array_dont_show))
unset($context['boards']);

before?
unset($context['boards']);

margarett

No, you either use one or other option.

If you want to hide child boards everywhere then you use my first code (just the unset).

If you want to hide child boards in just some boards, then you use my second code ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Bodom


Advertisement: