UBB.Dev
This is a small mod to add to your forum stats on how many posts were made in 24 hours.

In cache builders ->forum_stats.php

Add:
Code
// Get last Total Posts for Last 24hrs 
// get the current timestamp into an array
$timestamp = time();
// echo strftime('%Hh%M %A %d %b',$timestamp);
// echo '<p>';
$date_time_array = getdate($timestamp);

$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];

// use mktime to recreate the unix timestamp
// adding 19 hours to $hours
$timestamp = mktime($hours - 29,$minutes,$seconds,$month,$day,$year);
// echo strftime('%Hh%M %A %d %b',$timestamp);
// echo '<br>~E after subtracting 29 hours';

$query = "
select count(*)
from {$config['TABLE_PREFIX']}POSTS
WHERE POST_POSTED_TIME > $timestamp
";
$sth = $dbh->do_query($query);
list($new_posts) = $dbh->fetch_array($sth);

Under:
Code
$query = "
select count(USER_ID)
from {$config['TABLE_PREFIX']}USERS
where USER_IS_APPROVED = 'yes'
and USER_ID > 1
";
$sth = $dbh->do_query($query);
list($users) = $dbh->fetch_array($sth);

In langauges->island_forum_stats.php

Add:
Code
$ubbt_lang['NEW_POSTS'] = "Posts in 24rs";
Under:
Code
$ubbt_lang['USERS'] = "Members";

In templates->island_forum_stats.tpl

Add:
Code
<b>{$new_posts}</b> {$lang.NEW_POSTS}

Above:
Code
<b>{$users}</b> {$lang.USERS}

Quoting Ian from a post at ubbthreads
Originally Posted by Ian
In langauges->island_forum_stats.php

is langauges->portal_islands.php

in 7.1 beta (when you get it)

Screen shot of what it adds
[Linked Image]
Posted By: Ian Spence Re: Forum Stats - 01/13/2007 6:04 AM
Code
// Get last Total Posts for Last 24hrs 
// get the current timestamp into an array
$timestamp = time();
// echo strftime('%Hh%M %A %d %b',$timestamp);
// echo '<p>';
$date_time_array = getdate($timestamp);

$hours = $date_time_array['hours'];
$minutes = $date_time_array['minutes'];
$seconds = $date_time_array['seconds'];
$month = $date_time_array['mon'];
$day = $date_time_array['mday'];
$year = $date_time_array['year'];

// use mktime to recreate the unix timestamp
// adding 19 hours to $hours
$timestamp = mktime($hours - 29,$minutes,$seconds,$month,$day,$year);
// echo strftime('%Hh%M %A %d %b',$timestamp);
// echo '<br>~E after subtracting 29 hours';

could be simplied to

Code
$timestamp = time() - 86400;
Posted By: Gizmo Re: Forum Stats - 01/13/2007 7:23 AM
I posted something similar (well about being able to do this) at ubbcentral wink
Posted By: gliderdad Re: Forum Stats - 01/13/2007 7:47 PM
Scratch this, not gona work for 7.1
Posted By: Gizmo Re: Forum Stats - 01/14/2007 11:47 AM
A 7.1 version can be found here
© UBB.Developers