MyBB Community Forums

Full Version: Make Index Boardstats box auto collapse
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This small modification will let you allow to auto collapse Index Boardstats's tcat area (of table) making your Index page a little smaller in height.

Go to: ACP > Templates > Your theme's Templates > Ungropuped Templates > headerinclude > and find;
{$stylesheets}

and Add the following code just after that;
<script type="text/javascript">
function indexstats()
{
	if (document.getElementById("indexstatsbit").style.display == "none")
	{
	document.getElementById("indexstatsbit").style.display="table-row";
	}
	else
	{
	document.getElementById("indexstatsbit").style.display="none";
	}
}
</script>
<script type="text/javascript">
function indexstats1()
{
	if (document.getElementById("indexstatsbit1").style.display == "none")
	{
	document.getElementById("indexstatsbit1").style.display="table-row";
	}
	else
	{
	document.getElementById("indexstatsbit1").style.display="none";
	}
}
</script>
<script type="text/javascript">
function indexstats2()
{
	if (document.getElementById("indexstatsbit2").style.display == "none")
	{
	document.getElementById("indexstatsbit2").style.display="table-row";
	}
	else
	{
	document.getElementById("indexstatsbit2").style.display="none";
	}
}
</script>

Save Template.

Now go to: ACP > Templates > Your theme's templates > Index Templates > index_whosonline > and Replace all the code with the following;
<tr>
<td class="tcat"><span class="smalltext"><strong>{$lang->whos_online}</strong> [<a href="online.php">{$lang->complete_list}</a>]</span>
<div class="smalltext" style="float: right;"><a style="cursor: pointer;" onclick="indexstats1()">Show/Hide</a></div>
</td>
</tr>
<tr id="indexstatsbit1" style="display: none;">
<td class="trow1"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
</tr>

Now go to: ACP > Templates > Your theme's templates > Index Templates > index_birthdays > and Replace all the code with the following;
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span>
<div class="smalltext" style="float: right;"><a style="cursor: pointer;" onclick="indexstats2()">Show/Hide</a></div>
</td></tr>
<tr id="indexstatsbit2" style="display: none;">
<td class="trow1"><span class="smalltext">{$bdays}</span></td>
</tr>

Now go to: ACP > Templates > Your theme's templates > Index Templates > index_stats > and Replace all the code with the following;
<tr><td class="tcat"><span class="smalltext"><strong>{$lang->boardstats}</strong></span>
<div class="smalltext" style="float: right;"><a style="cursor: pointer;" onclick="indexstats()">Show/Hide</a></div>
</td></tr>
<tr id="indexstatsbit" style="display: none;">
<td class="trow1"><span class="smalltext">
{$lang->stats_posts_threads}<br />
{$lang->stats_numusers}<br />
{$lang->stats_newestuser}<br />
{$lang->stats_mostonline}
</span>
</td>
</tr>

Save all templates.

Previews:
[Image: attachment.php?aid=439]

[Image: attachment.php?aid=440]