Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Mar 2006
Posts: 32
Beta Tester
Beta Tester
Offline
Joined: Mar 2006
Posts: 32
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]

Sponsored Links
gliderdad #312656 01/12/2007 11:04 PM
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
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;

Ian Spence #312657 01/13/2007 12:23 AM
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
I posted something similar (well about being able to do this) at ubbcentral wink


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Gizmo #312663 01/13/2007 12:47 PM
Joined: Mar 2006
Posts: 32
Beta Tester
Beta Tester
Offline
Joined: Mar 2006
Posts: 32
Scratch this, not gona work for 7.1

gliderdad #312666 01/14/2007 4:47 AM
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
A 7.1 version can be found here


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)