Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: S3NTYN3L on January 15, 2011, 12:25:04 PM

Title: Remove Child Boards
Post by: S3NTYN3L on January 15, 2011, 12:25:04 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2864)


Remove Child Boards

Latest Version: 2.3.4
Compatible With SMF: 1.1.X, 2.X


Summary


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

If you want to selectively remove child boards:
You simply provide the ID number of the parent whose children you want removed.

In SMF 1.1.X, the option can be found at: Admin > Features and Options > Remove Child Boards
In SMF 2.X, the option can be found at: Admin > Configuration > Modification Settings > Remove Child Boards



Changelog

+06/11/2013 - Updated package for SMF 1.1.18 & SMF 2.0.4 compatibility
+01/29/2012 - Extended functionality to include sub-boards and updated package for SMF 1.1.16 & SMF 2.0.2 compatibility
+10/08/2011 - Updated package for SMF 1.1.15 & SMF 2.0.1 compatibility
+06/12/2011 - Updated package for SMF 1.1.14 & SMF 2.0 compatibility
+02/21/2011 - Updated package for SMF 1.1.13, SMF 2.0 RC4 Security Patch & SMF 2.0 RC5 compatibility
+01/01/2011 - Corrected code in attempt to keep errors from occurring
+12/31/2010 - Added option to selectively Remove Child Boards
+12/18/2010 - Added option to enable/disable Remove Child Boards
+12/14/2010 - Created mod for SMF



Files effected by this mod

SMF 1.1.X
./$languagedir/Modifications.English.php
./$sourcedir/ModSettings.php
./$themedir/BoardIndex.Template.php
./$themedir/MessageIndex.Template.php

SMF 2.X
./$languagedir/Modifications.English.php
./$sourcedir/Admin.php
./$sourcedir/ManageSettings.php
./$themedir/BoardIndex.Template.php
./$themedir/MessageIndex.Template.php

Title: Re: Remove Child Boards
Post by: Blade_Runner on January 17, 2011, 12:27:42 PM
will this mod affect seo?
Title: Re: Remove Child Boards
Post by: S3NTYN3L on January 20, 2011, 10:53:35 AM
No idea...
Why would it?

This mod only prevents the child boards from displaying on the forum index, nothing else (ie; site map, etc) gets touched.
Title: Re: Remove Child Boards
Post by: Blade_Runner on January 20, 2011, 10:58:58 AM
Quote from: S3NTYN3L on January 20, 2011, 10:53:35 AM
No idea...
Why would it?

This mod only prevents the child boards from displaying on the forum index, nothing else (ie; site map, etc) gets touched.

I have read somewhere that the more links for the forum, the better it is for SEO. Not sure if it is true. That is why I asked.
Title: Re: Remove Child Boards
Post by: Bigguy on January 20, 2011, 11:00:43 AM
The more links you have pointing to your site from other sites is better for you but this mod has nothing to do with that. :)
Title: Re: Remove Child Boards
Post by: S3NTYN3L on January 20, 2011, 04:56:12 PM
Thanks for the assist on the SEO question, Bigguy. ;)
Title: Re: Remove Child Boards
Post by: Bigguy on January 20, 2011, 05:05:21 PM
Not a problem at all. :)
Title: Re: Remove Child Boards
Post by: hcfwesker on February 04, 2011, 08:32:18 AM
Thank You Thank you Thank You!!!!!

I've been asking for THIS exact feature since back in July, wish I would have found this the minute it was released. :)

http://www.simplemachines.org/community/index.php?topic=392416.msg2716219#msg2716219

Works like a charm :)  you have a new fan, S3NTYN3L!!!

Title: Re: Remove Child Boards
Post by: S3NTYN3L on February 06, 2011, 10:51:28 AM
You're welcome. 8)
Title: Re: Remove Child Boards
Post by: S3NTYN3L on February 21, 2011, 06:03:52 PM
Updated package for SMF 1.1.13, SMF 2.0 RC4 Security Patch & SMF 2.0 RC5 compatibility
Title: Re: Remove Child Boards
Post by: mrkid on May 25, 2011, 12:09:22 PM
Great mod. I've been looking for this for a while! Loaded automatically with no issues on all my themes for RC5. That doesn't happen often ;D
Title: Re: Remove Child Boards
Post by: Joker™ on May 25, 2011, 12:27:52 PM
Nice mod specially for forums having too many child boards. Great work S3NTYN3L.
Title: Re: Remove Child Boards
Post by: S3NTYN3L on June 12, 2011, 02:23:05 PM
Thanks for the flowers guys. ;) :-*



Updated package for SMF 1.1.14, SMF 2.0 compatibility
Title: Re: Remove Child Boards
Post by: savy118 on June 30, 2011, 05:19:37 PM
Nice little mod, im just wondering tho as im thinking of installing a new theme and that is how to edit a mod to work with a theme, do i edit remove child boards mod or the actual smf forum mod, and if i have another mod installed to edit can i only make the one mod compatible or both.

thanks for your time

savy  :D
Title: Re: Remove Child Boards
Post by: hcfwesker on June 30, 2011, 06:19:50 PM
Quote from: savy118 on June 30, 2011, 05:19:37 PM
Nice little mod, im just wondering tho as im thinking of installing a new theme and that is how to edit a mod to work with a theme, do i edit remove child boards mod or the actual smf forum mod, and if i have another mod installed to edit can i only make the one mod compatible or both.

thanks for your time

savy  :D

To make the edits to another theme, just Parse the package on the MOD page, and follow the instructions on your custom/added themes for

Themes/theme name/BoardIndex.template.php

Which would be this one and only, simple edit ;)

Find
foreach ($category['boards'] as $board)
{


Add AFTER

global $modSettings, $context;

if (!isset($context['kill']))
$context['kill'] = empty($modSettings['kill_some_children']) ? array() : explode(",", $modSettings['kill_some_children']);

if (!empty($modSettings['kill_all_children']) || in_array($board['id'], $context['kill']))
$board['children'] = array();


I hope that's what you were asking.

and, to add, installed perfectly on SMF 2.0.  Still one of the most necessary MOds on my site, thenk you again, S3NTYN3L

Also, you need a link to the MOD in the first post ;)


Title: Re: Remove Child Boards
Post by: S3NTYN3L on July 01, 2011, 11:04:56 AM
Quote from: hcfwesker on June 30, 2011, 06:19:50 PM
To make the edits to another theme, just Parse the package on the MOD page, and follow the instructions on your custom/added themes for

<snip>

v2 allows for install to different themes via a checkbox, no? :-\


Quote from: hcfwesker on June 30, 2011, 06:19:50 PM
Also, you need a link to the MOD in the first post ;)

Yeah, I just noticed that.
It's fixed now.
Title: Re: Remove Child Boards
Post by: hcfwesker on July 02, 2011, 12:19:19 AM
Quote from: S3NTYN3L on July 01, 2011, 11:04:56 AM
v2 allows for install to different themes via a checkbox, no? :-\

Yes.  But the way I read his question, it was if he ADDED a new theme after he installed this MOD.
Title: Re: Remove Child Boards
Post by: savy118 on July 02, 2011, 05:50:30 PM
hi guys i think i understand now, or correct me if im wrong , so no mater what mod we have rc5 or 2.0 gold we should have the theme for those versions but if theme doesnt support them we parse the mod first and see what it says to edit.

thanks savy
Title: Re: Remove Child Boards
Post by: hcfwesker on July 02, 2011, 06:25:17 PM
Quote from: savy118 on July 02, 2011, 05:50:30 PM
hi guys i think i understand now, or correct me if im wrong , so no mater what mod we have rc5 or 2.0 gold we should have the theme for those versions but if theme doesnt support them we parse the mod first and see what it says to edit.

thanks savy

Exactly.  One KEY thing to look out for, is any edits that are made to Themes/default/XXXXX files   will also need to be made in your custom theme.  Usually most edits are done in index.template.php or BoardIndex.template.php of your custom/added themes.
Title: Re: Remove Child Boards
Post by: savy118 on July 02, 2011, 06:55:41 PM
ok thanks a lot i feel more comfortable understanding, i think i will try and make my self run into this problem an give it a try before i go online.

thanks for your suppport

regards


savy..
Title: Re: Remove Child Boards
Post by: savy118 on July 02, 2011, 07:10:45 PM
Quote from: savy118 on July 02, 2011, 06:55:41 PM
ok thanks a lot i feel more comfortable understanding, i think i will try and make my self run into this problem an give it a try before i go online.
so really use all mods that are compatible, but any older mods make sure theme is updated in all themes unles i choose people to stick to one.
"please tel me ive got it" LOL..

thanks for your suppport


regards


savy..
Title: Re: Remove Child Boards
Post by: The Wizard on October 02, 2011, 03:35:56 PM
How can I get the package manager to accept this mod on smf 1.1.15?

thanks
Title: Re: Remove Child Boards
Post by: S3NTYN3L on October 08, 2011, 08:39:50 AM
Updated package for SMF 1.1.15, SMF 2.0.1 compatibility
Title: Re: Remove Child Boards
Post by: The Wizard on November 04, 2011, 02:49:21 PM
This mod only affects the index/ main page.

What if I wanted to make child board disappear inside a child board? Any idea what code I would need to add and where? I'm using version 1.1.15.

Thanks

The Wizard
Title: Re: Remove Child Boards
Post by: S3NTYN3L on November 15, 2011, 05:26:03 AM
Quote from: The Wizard on November 04, 2011, 02:49:21 PM
This mod only affects the index/ main page.

What if I wanted to make child board disappear inside a child board? Any idea what code I would need to add and where?


As it should.

I've not bothered to test it, but have you tried inserting the ID of the parent, (in your case, that parent would be the first level child), in my mod?
What happens?

I'll have to look into this feature as time permits (and it really doesn't lately).
I didn't bother thinking about this feature because, in v2, an admin can nest MANY children.
I forget if in v1 there was a limit to this. :-\
Title: Re: Remove Child Boards
Post by: hcfwesker on November 15, 2011, 02:05:57 PM
I just tried it to test it myself, and it didn't work.  Probably just have to make changes to the sub-boards portion of the code.
Title: Re: Remove Child Boards
Post by: S3NTYN3L on November 18, 2011, 11:38:25 AM
Thanks.
I'll look into adding this functionality soon.
I've a lot on my plate right now, so...
Title: Re: Remove Child Boards
Post by: S3NTYN3L on January 29, 2012, 08:53:34 AM
Updated package for SMF 1.1.16 & SMF 2.0.2 compatibility.
Title: Re: Remove Child Boards
Post by: hcfwesker on January 29, 2012, 11:09:02 AM
Thanx for the update.  Updated without a hitch.

Quote from: S3NTYN3L on November 18, 2011, 11:38:25 AM
Thanks.
I'll look into adding this functionality soon.
I've a lot on my plate right now, so...

Just going to add, the same code for BoardIndex.template.php can be added to MessageIndex.template.php and it will work.  just tested.

Find
foreach ($context['boards'] as $board)
{


Add after

global $modSettings, $context;

if (!isset($context['kill']))
$context['kill'] = empty($modSettings['kill_some_children']) ? array() : explode(",", $modSettings['kill_some_children']);

if (!empty($modSettings['kill_all_children']) || in_array($board['id'], $context['kill']))
$board['children'] = array();


Just add this to the install.xml

<file name="$themedir/MessageIndex.template.php">
<operation>
<search position="before"><![CDATA[ foreach ($context['boards'] as $board)
{]]></search>
<add><![CDATA[
global $modSettings, $context;

if (!isset($context['kill']))
$context['kill'] = empty($modSettings['kill_some_children']) ? array() : explode(",", $modSettings['kill_some_children']);

if (!empty($modSettings['kill_all_children']) || in_array($board['id'], $context['kill']))
$board['children'] = array();]]></add>
</operation>


</file>
Title: Re: Remove Child Boards
Post by: S3NTYN3L on January 29, 2012, 03:38:52 PM
Thanks hcfwesker, I completely forgot about looking into that.

I've updated the mod to reflect your changes...
Title: Re: Remove Child Boards
Post by: studiowi33 on April 07, 2012, 01:01:13 PM
Hi all-

Running 2.0.2 and using a Curve variant theme (Prince of Darkness) and I get this when I try to install. Normally, I'd just manually install, but this might be the first time I've ever seen a error message quite like this.
Any ideas?

-s.w
Title: Re: Remove Child Boards
Post by: hcfwesker on April 07, 2012, 01:11:12 PM
Yeah, I can see something went wrong with how the files are spelled out incorrectly.  English, should be english , and Template should be template in both cases.

Title: Re: Remove Child Boards
Post by: S3NTYN3L on April 08, 2012, 07:33:46 AM
Fixed...
Title: Re: Remove Child Boards
Post by: studiowi33 on April 08, 2012, 12:43:11 PM
Quote from: S3NTYN3L on April 08, 2012, 07:33:46 AM
Fixed...
Yes it is.
Thanks S3NTYN3L.

-s.w
Title: Re: Remove Child Boards
Post by: Srinib on April 28, 2012, 04:40:18 PM
This should be a rather very simple question. But i am very new to these MODs.

I was trying to download this package by Admin » Package Manager » Download Packages.
When i Browse the Package servers section, i am not able to find this package with the name Remove Child Boards.

What went wrong?
Am i following the correct procedure?Or am i looking for the wrong Mod Name?

I want this MOD for 2.0.2.
Title: Re: Remove Child Boards
Post by: TheListener on April 28, 2012, 04:47:39 PM
Quote from: Srinib on April 28, 2012, 04:40:18 PM
This should be a rather very simple question. But i am very new to these MODs.

I was trying to download this package by Admin » Package Manager » Download Packages.
When i Browse the Package servers section, i am not able to find this package with the name Remove Child Boards.

What went wrong?
Am i following the correct procedure?Or am i looking for the wrong Mod Name?

I want this MOD for 2.0.2.

Are you saying you have downloaded the mod or don't know how to?
Title: Re: Remove Child Boards
Post by: Srinib on April 28, 2012, 04:56:51 PM
Quote from: Old Fossil on April 28, 2012, 04:47:39 PM
Quote from: Srinib on April 28, 2012, 04:40:18 PM
This should be a rather very simple question. But i am very new to these MODs.

I was trying to download this package by Admin » Package Manager » Download Packages.
When i Browse the Package servers section, i am not able to find this package with the name Remove Child Boards.

What went wrong?
Am i following the correct procedure?Or am i looking for the wrong Mod Name?

I want this MOD for 2.0.2.

Are you saying you have downloaded the mod or don't know how to?

I havenot downloaded the mod. I want to download.
But when i follow the above procedure, I am unable to search this MOD with the file name Remove Child Boards.
Title: Re: Remove Child Boards
Post by: TheListener on April 28, 2012, 07:01:23 PM
The section you want is Package to Upload:

The mod has to be downloaded to your desktop first.
Title: Re: Remove Child Boards
Post by: Srinib on April 29, 2012, 03:14:30 AM
It was so funny i never thought of that. I kept browsing the download packages.
Thanks a lot.
Title: Re: Remove Child Boards
Post by: YourFanfiction on July 16, 2012, 07:08:37 AM
Hi,

I've just tried to install this mod and got this error message come up:

Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.

and then these messages with the files:

1.   Execute Modification   ./Themes/default/languages/Modifications.English.php   File not found
2.   Execute Modification   ./Sources/ModSettings.php   Test successful
3.   Execute Modification   ./Themes/default/BoardIndex.Template.php   File not found
4.   Execute Modification   ./Themes/default/MessageIndex.Template.php   File not found

I've got SMF version 1.1.16 - any idea what I'm doing wrong?
Title: Re: Remove Child Boards
Post by: Arantor on July 16, 2012, 08:13:42 AM
The installer is wrong, because the files are not .English.php or .Template.php, but .english.php and .template.php - it was obviously developed and tested on a Windows installation where files are not case sensitive.
Title: Re: Remove Child Boards
Post by: S3NTYN3L on July 16, 2012, 08:14:17 AM
Quote from: YourFanfiction on July 16, 2012, 07:08:37 AM

<snip>

I've got SMF version 1.1.16 - any idea what I'm doing wrong?

It's nothing you're doing wrong.

I neglected to correct the file names for v1.1.X when I corrected them for 2.X months ago (http://www.simplemachines.org/community/index.php?topic=417516.msg3308690#msg3308690).


My bad, all fixed now...
Title: Re: Remove Child Boards
Post by: YourFanfiction on July 18, 2012, 12:54:13 PM
Thanks - that works brilliantly now :)
Title: Re: Remove Child Boards
Post by: ktm450ds on February 28, 2013, 08:20:23 PM
I'm trying to install this mod, and I keep getting this message.
"The package you are trying to download or install is either corrupt or not compatible with this version of SMF."
What can I do to load it on my fourm?
Title: Re: Remove Child Boards
Post by: Srinib on March 10, 2013, 03:09:45 AM
It should be an issue with the versions. Right now the latest version of this MOD is compatible with to 2.0.2. Maybe you are trying to install this MOD on your forum which should be more than this(maybe 2.0.3/2.0.4). While installing, you need to goto the "Advanced" options and enter your current SMF version in "Emulate Version". Thats should solve your issue.
Title: Re: Remove Child Boards
Post by: S3NTYN3L on March 10, 2013, 04:14:14 AM
I haven't gotten around to updating my mods for the new version yet.
I will do so this week.
Title: Re: Remove Child Boards
Post by: S3NTYN3L on June 11, 2013, 12:27:51 PM
Wow, that was a long week, huh?  :P

Updated package for SMF 1.1.18 & SMF 2.0.4 compatibility.
Title: Re: Remove Child Boards
Post by: Srinib on August 18, 2013, 02:57:25 AM
I installed this MOD while it was compatible with 2.0.2. Now a version compatible with 2.0.4 has come.

Can i continue using the 2.0.2 one? Or should i go for 2.0.4?(ie. uninstall 2.0.2 and re-install 2.0.4)
Title: Re: Remove Child Boards
Post by: hcfwesker on August 19, 2013, 01:58:14 AM
Quote from: Srinib on August 18, 2013, 02:57:25 AMCan i continue using the 2.0.2 one?

As long as it still works then yeah.  most of the times (most MOds from 2.0.1 - 2.0.5)  MOds are just updated to list the latest version in the install script, while still having the same code.  I'm on 2.0.4 and still using the 2.0 version of the MOd
Title: Re: Remove Child Boards
Post by: stormiecub on December 01, 2013, 01:06:46 PM
Will this mod be updated for SMF 2.0.6? I just upgraded today and I hate the way that the child boards display on my main page. I want them gone.
Title: Re: Remove Child Boards
Post by: Arantor on December 01, 2013, 01:09:44 PM
How can I install a mod that doesn't work in my SMF version? (http://wiki.simplemachines.org/smf/How_can_install_a_mod_that_doesn%27t_work_in_my_SMF_version)

(use version SMF 2.0.4)
Title: Re: Remove Child Boards
Post by: ViewFromTheBoundary on January 01, 2014, 12:26:18 PM
I have just installed a new theme, and having read through this topic Im still not sure which files need updating so it will show on the new theme. Please could I have some guidance
Title: Re: Remove Child Boards
Post by: hcfwesker on January 01, 2014, 01:08:22 PM
Quote from: DomesticCricketForum on January 01, 2014, 12:26:18 PM
I have just installed a new theme, and having read through this topic Im still not sure which files need updating so it will show on the new theme. Please could I have some guidance

Just the BoardIndex.template.php file for your new theme.  check the mod download page, click parse, and do the same edits that are shown for default/BoardIndex.template.php
Title: Re: Remove Child Boards
Post by: ViewFromTheBoundary on January 01, 2014, 01:54:06 PM
There is only a index.template.php and the code that the parse suggests isnt there

foreach ($category['boards'] as $board)
{
Title: Re: Remove Child Boards
Post by: hcfwesker on January 01, 2014, 02:15:06 PM
Quote from: DomesticCricketForum on January 01, 2014, 01:54:06 PM
There is only a index.template.php and the code that the parse suggests isnt there

the MOd DOWNLOAD page, not your package manager  ;)  http://custom.simplemachines.org/mods/index.php?mod=2864
(select 2.0.4 in the drop down and click 'Parse')

I get these 2 edits ... attached below.  if any of those files appear in your custom theme, then make the edits.
Title: Re: Remove Child Boards
Post by: ViewFromTheBoundary on January 01, 2014, 04:45:20 PM
Sorry that was my point on the theme there isnt either of those files
Title: Re: Remove Child Boards
Post by: Arantor on January 01, 2014, 04:47:17 PM
Which means that theme will reuse the default theme's files.
Title: Re: Remove Child Boards
Post by: Steve on November 21, 2014, 08:26:32 AM
With this mod, if there's a new post in the sub-board, is there any indication of that on the forum index?
Title: Re: Remove Child Boards
Post by: hcfwesker on November 22, 2014, 01:26:04 AM
Quote from: Steve on November 21, 2014, 08:26:32 AM
With this mod, if there's a new post in the sub-board, is there any indication of that on the forum index?

Yes, as long as it's a sub-board of that Parent Board that shows on the home page.  Sub-boards removed from homepage view, the new posts will still show on the home page as new posts, within that Parent Board on the Board Index. 

But, as you should know, sub-boards of sub-boards don't show on the homepage at all, which is default with SMF
Title: Re: Remove Child Boards
Post by: Steve on November 22, 2014, 10:26:20 AM
Hopefully I'm reading you correctly. Easiest way to find out is to install this and see, eh? :D
Title: Re: Remove Child Boards
Post by: hcfwesker on November 22, 2014, 11:59:19 PM
Think of it like this

I. Parent(Main) Board (set to hide all sub-boards from main page)
   A. sub-board 1 of I  ( will show newest post on last post on boardindex ....)
   B. sub-board 2 of I ( will show newest post on last post on boardindex ....)
        1. sub-board of B (will not show posts on last post in boardindex, which is smf default)

Simplified, the answer to your question is Yes.
Title: Re: Remove Child Boards
Post by: Steve on November 23, 2014, 10:36:01 AM
Last question then I'll drop it.

On the board index, when there is a new post in the parent board, there is a 'new post' icon to the left of the board name.
If there is no new post in the parent board, there is a 'no new post' icon.

If there are new posts in the sub board but not in the parent board, will that 'new post' icon show?

And I do understand what you're saying about the newest post to the right of the board name. :)
Title: Re: Remove Child Boards
Post by: Arantor on November 23, 2014, 10:38:09 AM
Yes since the mod just hides the content, the whole 'new icon' thing is still worked out in the meantime.
Title: Re: Remove Child Boards
Post by: Steve on November 23, 2014, 10:45:52 AM
Awesome. Thanks again. :D
Title: Re: Remove Child Boards
Post by: SMiFFER on October 26, 2016, 10:08:35 AM
Feedback:

When I try to install this mod to 2.0.12 I get an error saying that this mod is either corrupted or incompatible.
Title: Re: Remove Child Boards
Post by: br360 on October 26, 2016, 03:57:03 PM
This mod will work for version 2.0.12. Take a look at this link which will show you how to install a mod for a different version- http://wiki.simplemachines.org/smf/How_can_I_install_a_mod_that_doesn't_work_in_my_SMF_version
Title: Re: Remove Child Boards
Post by: davo88 on January 17, 2024, 02:14:35 PM
I am uninstalling mods prior to converting a 2.10.19 forum to 2.1.4. However this mod has no 'Uninstall' option in the 2.0.19 Packager Manager. As far as I can tell, it has only one field in the Settings table of the database called 'kill_some_children'.

Has anyone converted to 2.1.4 without uninstalling this mod?
If I don't uninstall and just delete the field from the Settings table. Is that going to be sufficient to avoid error messages etc in 2.1.4?
Title: Re: Remove Child Boards
Post by: Arantor on January 17, 2024, 02:16:28 PM
When you update to 2.1.4 it will replace all the files (and you'll need a new theme) so you can just go ahead and delete it once you've done the upgrade.
Title: Re: Remove Child Boards
Post by: davo88 on January 17, 2024, 05:51:35 PM
Thanks Arantor, there's a lot of debris in the database from old mods and phpBB circa 2004. So I'll see if it can be cleaned up a bit.