MyBB Community Forums

Full Version: Todays Posts Todays Threads Total Visitors Code Help Please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am looking for the code for 'Todays Posts'

What I am after is the following to display on my front page.

Todays Post: 5
Total Threads Today: 10
Total Visitors Today: 9000

I was looking for the {$posts_bla_bla} for example but have got stuck.

Thanks for your help.

Screenshot attached I circled the area I'm trying to get right.

url http://articlechase.com/beyondnews/forum....php?fid=4
Your Theme's Templates > Index Page Templates > index_stats

Smile
echo $stats['numposts'];

print_r($stats); //all info
(2011-09-19, 07:20 PM)Malcolm. Wrote: [ -> ]
echo $stats['numposts'];

print_r($stats); //all info

Hi Malcolm, thanks for that. Does that build the stats like this below:

Todays Posts: 5
Todays Threads: 10
Todays Visitors: 9000

You can see what I am doing with the stats in the small black table, top left under my header here http://articlechase.com/beyondnews/forum....php?fid=4

Thank you again for your time Smile
$stats['numposts'] will give you the number of posts, print_r($stats) will give you the other values.
(2011-09-19, 08:16 PM)Malcolm. Wrote: [ -> ]$stats['numposts'] will give you the number of posts, print_r($stats) will give you the other values.

Thanks dude. I'm trying to build the code into a small table. But I tried the method you have provided and my forum crashes. Here is the code if you can help me with it. Then the info is there for us all Smile

<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}</strong></font color></TD>
</TR>
</table>
Each stat would be on the next line.
(2011-09-19, 08:31 PM)Article Chase Wrote: [ -> ]
(2011-09-19, 08:16 PM)Malcolm. Wrote: [ -> ]$stats['numposts'] will give you the number of posts, print_r($stats) will give you the other values.

Thanks dude. I'm trying to build the code into a small table. But I tried the method you have provided and my forum crashes. Here is the code if you can help me with it. Then the info is there for us all Smile

<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}</strong></font color></TD>
</TR>
</table>
Each stat would be on the next line.

Just a quick bump to see if anyone can help. I tried Malcolm's help but I started to see a blank page instead of my forum.

As I said you can see in the code that I am trying to get the stats in a black background box. With the figures displaying like I said in the first thread post. Kinda ripping my hair out here lol.

Thanks peepz
File attached
Quick bump Smile[/u]
What's the full code you are using?
(2011-09-23, 02:12 PM)Malcolm. Wrote: [ -> ]What's the full code you are using?

I tried to add your code into the table below but it made my page blank.

<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}</strong></font color></TD>
</TR>
<td bgcolor="#A4A4A4"><font color="white">{$multipage}</font color></td>
</tr>
</table>

I made a separate <tr> to cater for the code. I tried {$posts} that didn't work.

Thanks Malcolm
You need to encase $stats['numposts'] with braces, and put it where you want it to show.
Pages: 1 2