MyBB Community Forums

Full Version: Category defauly setting help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a category that will have forumsĀ  under it for all 50 states. I want the default view of the category to be closed (-) so you only see the category title. then you click on the (+) to open it up to see all sub forums.

any help appreciated.


chris
Try to change lines 417 - 429 of inc/functions_forumlist .php from:


if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;")
{
	$expcolimage = "collapse_collapsed.png";
	$expdisplay = "display: none;";
	$expthead = " thead_collapsed";
	$expaltext = "[+]";
}
else
{
	$expcolimage = "collapse.png";
	$expthead = "";
	$expaltext = "[-]";
}

To:
if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] != "display: show;")
{
	$expcolimage = "collapse.png";
	$expthead = "";
	$expaltext = "[-]";
}
else
{
	$expcolimage = "collapse_collapsed.png";
	$expdisplay = "display: none;";
	$expthead = " thead_collapsed";
	$expaltext = "[+]";
}

I tried it with my test forum and it worked.
But it must be checked whether it works for all users.
Will this collapse just the "Your Reviews" category? or all of them? usafoodreview.com
As I see it all catagories, being Welcome, Your Reviews and Supporting Establishments (when that gets forums).

Simply try it.

I just see that it does not work properly, because when you unfold a category, go to a forum, and return to the index it is folded again.

This will require some further study. It can be done for one category only.
it seems to collapse all open categories when you go to another page and come back....but I would like it to collapse on the "your reviews" category at this time. can that be done?

thanks

chris
(07-24-2015, 09:34 PM)chris.t Wrote: [ -> ]but I would like it to collapse on the "your reviews" category at this time. can that be done?

I think it will be possible, but the problem that the category is closed every time you return to the index page will persist.

I will have a look at it tomorrow. For now it is childrem's bedtime here Big Grin Wink .
Im okay with that.....tuck those children in....thanks!
Promise is a promise.
When you replace lines 417 - 429 of inc/functions_forumlist.php by:


if ($forum['fid'] == 4)
	if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] != "display: show;")
	{
		$expcolimage = "collapse.png";
		$expthead = "";
		$expaltext = "[-]";
	}
	else
	{
		$expcolimage = "collapse_collapsed.png";
		$expdisplay = "display: none;";
		$expthead = " thead_collapsed";
		$expaltext = "[+]";
	}
else
{
	if(isset($collapsed[$collapsed_name]) && $collapsed[$collapsed_name] == "display: show;")
	{
		$expcolimage = "collapse_collapsed.png";
		$expdisplay = "display: none;";
		$expthead = " thead_collapsed";
		$expaltext = "[+]";
	}
	else
	{
		$expcolimage = "collapse.png";
		$expthead = "";
		$expaltext = "[-]";
	}
}


then you achieve what you want.
I am still not happy with this solution, but I could not find something better. I also looked at the javascript involved with collapsing and expanding, but could not find the solution either.