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
Something like this
<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}</strong></font color></TD>
</TR>
<!-- this is your new table row -->
<tr>
<td bgcolor="#A4A4A4"><font color="white">Number of posts: <?php echo $stats['numposts'];
?> whatever else you want here <?php print_r($stats);?></font></td>
</tr>
</table>
(You can make the lines longer - I chopped the td line to keep from messing the board up.)
(2011-09-23, 02:26 PM)Malcolm. Wrote: [ -> ]You need to encase $stats['numposts'] with braces, and put it where you want it to show.

Did this:
<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}</strong></font color></TD>
</tr>
<td>{$stats['numposts']}</td>
</tr>
<td bgcolor="#A4A4A4"><font color="white">{$multipage}</font color></td>
</tr>
</table>

And nothing shows... IUndecided
Rukbat, you can't use PHP in templates.

AC, it seems $stats isn't a valid array for forumdisplay.php

A simple solution would be putting:

$stats = $cache->read("stats");

at the bottom of global.php before ?>
Cool thanks I got that, I will give it a go after work and let you know Smile
(2011-09-23, 02:57 PM)Malcolm. Wrote: [ -> ]Rukbat, you can't use PHP in templates.

AC, it seems $stats isn't a valid array for forumdisplay.php

A simple solution would be putting:

$stats = $cache->read("stats");

at the bottom of global.php before ?>

Yes this seems to work for the total posts Malcolm so now my example of the code reads 110. Brilliant -

But what I intend is to get Just todays posts. I will try to figure it in the meantime and i will be sure to post the results here for all users to look at if we get it right Smile
(2011-09-23, 03:16 PM)Article Chase Wrote: [ -> ]Cool thanks I got that, I will give it a go after work and let you know Smile
(2011-09-23, 02:57 PM)Malcolm. Wrote: [ -> ]Rukbat, you can't use PHP in templates.

AC, it seems $stats isn't a valid array for forumdisplay.php

A simple solution would be putting:

$stats = $cache->read("stats");

at the bottom of global.php before ?>

Yes this seems to work for the total posts Malcolm so now my example of the code reads 110. Brilliant -

But what I intend is to get Just todays posts. I will try to figure it in the meantime and i will be sure to post the results here for all users to look at if we get it right Smile

<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}Total Posts: {$stats['numposts']}, Posts Today: {$posts}</font color></strong></font color></TD>
</tr>
<td bgcolor="#A4A4A4"><font color="white">{$multipage}</font color></td>
</tr>
</table>

That's so far Smile But {$posts} does not work for todays posts, what did I do wrong?
Which is the code for todays posts? Thanks.
(2011-09-23, 03:16 PM)Article Chase Wrote: [ -> ]Cool thanks I got that, I will give it a go after work and let you know Smile
(2011-09-23, 02:57 PM)Malcolm. Wrote: [ -> ]Rukbat, you can't use PHP in templates.

AC, it seems $stats isn't a valid array for forumdisplay.php

A simple solution would be putting:

$stats = $cache->read("stats");

at the bottom of global.php before ?>

Yes this seems to work for the total posts Malcolm so now my example of the code reads 110. Brilliant -

But what I intend is to get Just todays posts. I will try to figure it in the meantime and i will be sure to post the results here for all users to look at if we get it right Smile
(2011-09-23, 03:16 PM)Article Chase Wrote: [ -> ]Cool thanks I got that, I will give it a go after work and let you know Smile
(2011-09-23, 02:57 PM)Malcolm. Wrote: [ -> ]Rukbat, you can't use PHP in templates.

AC, it seems $stats isn't a valid array for forumdisplay.php

A simple solution would be putting:

$stats = $cache->read("stats");

at the bottom of global.php before ?>

Yes this seems to work for the total posts Malcolm so now my example of the code reads 110. Brilliant -

But what I intend is to get Just todays posts. I will try to figure it in the meantime and i will be sure to post the results here for all users to look at if we get it right Smile

<table border="0"><TR>
<TD BGCOLOR="black"><font color ="white"<strong>{$usersbrowsing}Total Posts: {$stats['numposts']}, Posts Today: {$posts}</font color></strong></font color></TD>
</tr>
<td bgcolor="#A4A4A4"><font color="white">{$multipage}</font color></td>
</tr>
</table>

That's so far Smile But {$posts} does not work for todays posts, what did I do wrong?
Which is the code for todays posts? Thanks.

Just going to bump this.

I'm looking for the todays posts code. This is the Todays posts found in the Admin Control Panel admin/index.php Dashboard

Thanks for any help and help so far - If I get this the job is complete and I will share my code.
Pages: 1 2