MyBB Community Forums

Full Version: Achieving a more streamlined Board Stats
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This thread was originally publish on Animaus.com.

One thing that I personally don't find very attractive about MyBB is the "Board Statistics" section at the bottom of the index page. I find it can be too large and cluttered. This is a simple little template edit to achieve more of a streamlined and cleaner Board Statistics section on your forum. I'll once again be using the default MyBB theme for this demonstration.

Previews:
[attachment=28265][attachment=28266]

Process:
First, as always - log in to your Admin CP and go to the "Templates and Style" section of the control panel. Click on "Templates" and click on the set your current theme is using. Scroll down until you see the "Index Page Templates" set. Click to expand the templates and click on index_boardstats.

Replace the contents of index_boardstats with this:
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<thead>
<tr>
<td class="thead" colspan="3">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['boardstats']}.gif" id="boardstats_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>Forum Info</strong></div>
</td>
</tr>
</thead>
<tbody style="{$collapsed['boardstats_e']}" id="boardstats_e">
<tr>
<td class="tcat" width="65%"><span class="smalltext"><strong>Who's Online</strong> [<a href="online.php">Complete List</a>]</td>
<td class="tcat" width="35%"><span class="smalltext"><strong>Board Statistics</strong> [<a href="stats.php">Full Statistics</a>]</td>
</tr>
{$forumstats}
{$birthdays}
</tbody>
</table>
<br />

Hit "Save and return to listing". Next, open the index_stats templates. Replace the contents:
<tr>
<td class="trow1" valign="top" align="left"><span class="smalltext">{$lang->online_note}<br />{$onlinemembers}</span></td>
<td class="trow1" valign="middle" align="left"><span class="smalltext">
{$lang->stats_posts_threads}<br />
{$lang->stats_numusers}<br />
{$lang->stats_newestuser}<br />
{$lang->stats_mostonline}
</span></td>
</tr>

Hit "Save and return to listing". Next, open the index_birthdays templates. Replace the contents with:
<tr><td class="tcat" colspan="2"><span class="smalltext"><strong>{$lang->todays_birthdays}</strong></span></td></tr>
<tr>
<td class="trow1" colspan="2"><span class="smalltext">{$bdays}</span></td>
</tr>
Thanks to Omar G. for pointing it out.

And that's it. It's all done. Smile If you want to change the width of either of the boxes, simple change the percentages (e.g 65%) to your desired value. You can also use px (e.g 350px). You know have a more streamlined and efficient Board Stats section on your index. Smile +Rep if you found this useful.

Like this tutorial? Check out perfect rounded corners in MyBB!
This is great, thanks Jordan. Smile
What about birthdays? And why don't you wrap the {$forumstats}{$birthdays} with tr tags? Maybe I'm missing something, but you need them for the HTML to be validated.
{$birthdays} is still in a .trow - I wasn't able to reproduce the birthday showing up on my board (it wouldn't no matter what date the birthday was set to) so I couldn't fully test it out, but it should look okay. There may be a colspan change needed though.)

(2013-01-10, 08:50 PM)Omar G. Wrote: [ -> ]And why don't you wrap the {$forumstats}{$birthdays} with tr tags? Maybe I'm missing something, but you need them for the HTML to be validated.

Actually you're quite right. Thanks for pointing that out. I didn't even realise it wasn't wrapped in a new row. I've updated the tutorial accordingly and also added in the changes to the {$birthdays}. Smile Thanks.
I know this is old but can anyone explain where I have gone wrong in the attached image with the white space?

[attachment=29849]
works well Smile
(2013-07-28, 07:37 PM)ESForum Wrote: [ -> ]I know this is old but can anyone explain where I have gone wrong in the attached image with the white space?

Find the <td> with the class="tfoot" and add to it colspan="2"