News:

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

Main Menu

Childboards Only Mod

Started by Galaxy Computers, April 23, 2014, 12:30:52 PM

Previous topic - Next topic

Galaxy Computers

I am looking for a mod that show just only childboards. I have found this mod:


http://custom.simplemachines.org/mods/index.php?mod=1745


And it says: "This mod is incompatible with your forum."  Is there another way to do this or it would be nice if some has an updated version.
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

Steve

What smf version are you using? It parses for 2.0.7 if you want to manually install.
DO NOT pm me for support!

Galaxy Computers

I will be using the latest/newest version. 2.0.7
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum


Galaxy Computers

I have downloaded it when an earlier version now it says this

The package you are trying to download or install is either corrupt or not compatible with this version of SMF.

Compatible With:
    1.1.9, 2.0 RC1-1
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

Kindred

It is extremely unlikely that a mod for rc1 will work in 2.0.x
Сл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."

Galaxy Computers

It would be nice if someone can have an updated version that will work.
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

br360

There are a few parse edits you will most likely have to make in ManageBoards.template.php and MessageIndex.template.php, but looks like it will install if you emulate to 2.0

nevermind. Just checked the code that needed to be replaced in Message index, and what needs to be replaced or edited, isn't even there. ::)

margarett

That's the thing, the theme changed significantly between RC1 and final...

Anyway, this is doable with an easy file edit, look at the attachment

In MessageIndex.template.php find:

if (!empty($options['show_board_desc']) && $context['description'] != '')
echo '
<p class="description_board">', $context['description'], '</p>';

Add before:
$only_childs_array = array(1,2);
if (!in_array($context['current_board'], $only_childs_array))
{

Find:
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
</div>';
}

Add after:
}
else
{
if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';
}
}


In the line --> $only_childs_array = array(1,2);
You specify which board IDs this should occur. Of course this needs to be complemented with proper permissions on said board.
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

Galaxy Computers

Quote from: margarett on April 24, 2014, 05:05:36 AM
That's the thing, the theme changed significantly between RC1 and final...

Anyway, this is doable with an easy file edit, look at the attachment

In MessageIndex.template.php find:

if (!empty($options['show_board_desc']) && $context['description'] != '')
echo '
<p class="description_board">', $context['description'], '</p>';

Add before:
$only_childs_array = array(1,2);
if (!in_array($context['current_board'], $only_childs_array))
{

Find:
echo '
<div class="pagesection">
', template_button_strip($normal_buttons, 'right'), '
<div class="pagelinks">', $txt['pages'], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><strong>' . $txt['go_up'] . '</strong></a>' : '', '</div>
</div>';
}

Add after:
}
else
{
if ($context['user']['is_logged'])
{
echo '
<div id="posting_icons" class="floatleft">
<ul class="reset">
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_some.png" alt="" /> ', $txt['new_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_none.png" alt="" /> ', $txt['old_posts'], '</li>
<li class="floatleft"><img src="', $settings['images_url'], '/', $context['theme_variant_url'], 'new_redirect.png" alt="" /> ', $txt['redirect_board'], '</li>
</ul>
</div>';
}
}


In the line --> $only_childs_array = array(1,2);
You specify which board IDs this should occur. Of course this needs to be complemented with proper permissions on said board.

Will this show the parent board too if needed? Also is that the only file that needs to be edited to make it work?
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

margarett

Can you rephrase? Didn't get what you mean...
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

Galaxy Computers

So this will work for the newest SMF Version?
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

margarett

The code I sent you does not require any mod to be installed and I did it in 2.0.7.
Backup your original file and implement that, see if it fits your needs ;)
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

Galaxy Computers

#13
Margarett,

I have added the code into the file. But when I add the childboards as this:

Sub Board 1
Sub Board 2

Here is the link to my Test Board

http://test.mtechama.com/index.php?board=4.0

The problem I am having is when you click on Sub Board 1 I am unable to add a topic to the board and if you click on Sub Board 2 I can able to add topic to that board. How can I fix this?
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

margarett

You need to adapt this line:
$only_childs_array = array(1,2);
With the IDs of the boards you want to disallow posts into. In your case, you probably just want array(4) (which is the ID of the main board)
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

Galaxy Computers

Will it work when I add more main boards and child boards?
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

margarett

Yes, providing you correctly adjust that line ;)

If you create new boards and you don't want to apply this "childboards only" layout, just don't do anything :P Just add to that array all the IDs of the boards where you just wish to show only childboards.
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

Galaxy Computers

So I need to change the array from (1,2) to (4)?
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

margarett

For now, yes, because you only have one "parent board" and that has ID 4 ;)
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

Galaxy Computers

Thank you, Margarett. I think its going to work for me the way I need it.
Wade Morris
Amarillo, Texas

Morris Technologies Computer Support Forum

Advertisement: