Hi Michelle,

I know you're always looking for good ideas, so I figured I would pass this on.

I am working on a forum that has a lot of sub-forums. Having them all displayed on the forum listing is very over whelming. I used $forum->depth to limit the forum to only display parent forums.

Anyhow, it's an easy enough bit of code, which I have attached. I figure it might be easy for you to work something like this into the adv forum config page, so no one has to edit the template.

I modified Bluee_Lagoon, my changes are on lines 50 and 102. I know enough PHP to be dangerous, so I'm not sure if there is a better way to do this, but it seems to work for me. Hopefully you can think of a more elegant way to include this concept. If not, maybe this will help someone else.

CommentFileSizeAuthor
advf-forum-list.tpl_.php_.txt4.66 KBKirk

Comments

michelle’s picture

Status: Active » Closed (duplicate)
NeoID’s picture

Is there a way to print the forums that are removed as links?
Like.. instead of having a subforum shown on the forum index, we can use that code of yours, and then try to make the subforums display like phpBB3:
http://www.phpbb.com/community/ (Subforums are displayed as links underneath the parent forums description)...

I'm trying to find a solution to this in order to add this feature to my phpBB3 theme for advanced forum, based on prosilver... :)

Kirk’s picture

I'm sure there is, but the easy, no code way would be to simply include the links in the forum descriptions.

michelle’s picture

Please don't keep adding onto this issue or your posts will be lost as this is marked duplicate.

Michelle

ronnie482’s picture

Version: 5.x-1.0-alpha16 » 6.x-1.2

You can easily do this without hacking the core file using pre-process function

function mytemplate_preprocess_forum_list(&$variables) {

		foreach($variables['forums'] as $id => $forum) {
			if ($forum->depth>=1) {
				unset($variables['forums'][$id]);
		}

	}
}

I know the post is very old but still it may help.