Previous Thread
Next Thread
Print Thread
Hop To
#173082 01/11/2007 12:42 PM
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Well we recently lost the technical admin of the site I am on. I have been learning from him over the past 8 months just in case. He mad a little modification to the forum stats. I know it was 3 files and he forgot to upload his mods so I knew which files to change and one of them was a added language string, I remember him showing me how to run a DODBCOMMAND from ubbt_POSTS . The only thing this did was displayed how many posts where made in 24 hrs like the old threads 6 used to. If anyone could point me in the right direction I would appreciate it as I was just starting to learn sql. Here is a screen shot [Linked Image from gliderdad79.com]

Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Figured it out, thanks anyways smile

Joined: Jun 2006
Posts: 3,839
Likes: 1
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,839
Likes: 1
well done smile

Feel free to share if you feel the change could help others smile

Ian #173264 01/13/2007 12:24 AM
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
If anyone wants it here it is

In cache builders ->forum_stats.php

Add:

// 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:

$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: $ubbt_lang['NEW_POSTS'] = "Posts in 24rs";
Under: $ubbt_lang['USERS'] = "Members";
---------------------------------------------------------

In templates->island_forum_stats.tpl

Add: <b>{$new_posts}</b> {$lang.NEW_POSTS}<br />
Above: <b>{$users}</b> {$lang.USERS}<br />

Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
702 Posts in 24 hours eek

That could keep someone busy.... I "try" to read all posts, but don't think I could keep up with that.

Joined: Aug 2006
Posts: 1,659
Likes: 1
Pooh-Bah
Pooh-Bah
Joined: Aug 2006
Posts: 1,659
Likes: 1

Thanks for the code - I'll probably add that once I get 7.1 running. cool


GangsterBB.NET (Ver. 7.6.1.1)
PHP Version 8.1.34 / MySQL 5.7.23-23 / Apache 2.4.67
2007 Content Rulez Contest - Hon Mention
UBB.classic 6.7.2 - RIP
Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
Yeah thanks. I have to go play in the Web Talk boards and see what's wrong with .htaccess on Gentoo frown

Doesn't work as it should.

Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Whats not working right?

Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
Long discussion and off topic for UBB but basically when adding valid data to the file it then acts as though it doesn't see or recognize the file.

file is 644, uploaded in ASCII, etc and works well if I only have:
Options All -Indexes

As soon as I start to add other stuff it goes dumb on itself. I recently was moved from a Linux RH Server to a Gentoo Server so I could have PHP 5 and MySQL 5. It worked fine on RH but on this setup with Gentoo and Apache 1.3 it keeps giving me fits.

Though on the other hand it is a brand new CPANEL which who knows maybe that is interferring with it.

I'll discuss on one of the Webmaster boards and see if anyone has any insight on it unless it rings a bell for anyone here.

Here is what I attempted to do but it then allows folder browsing instead of locking it down.

Quote
Options All -Indexes
ErrorDocument 400 /errors/badrequest.html
ErrorDocument 401 /errors/authreqd.html
ErrorDocument 403 /errors/forbid.html
ErrorDocument 404 /errors/notfound.html
ErrorDocument 500 /errors/serverr.html
AddType text/html .shtml
AddHandler server-parsed .shtml
Options Indexes FollowSymLinks Includes


.

Joined: Jun 2006
Posts: 3,839
Likes: 1
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,839
Likes: 1
In langauges->island_forum_stats.php

is langauges->portal_islands.php

in 7.1 beta (when you get it)

Gliderdad - thanks for this - you might want to post it at ubbdev.com as well smile

Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Thanks Ian for the heads up for 7.1. I plan on posting at Dev since I just found my login info tongue

Joined: Jun 2006
Posts: 16,537
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,537
Likes: 150
I'm thining this could be cleaned up a bit, you can get the current time in unix epoch with just date(U) vs hopping through a bunch of loops.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 3,839
Likes: 1
I
Ian Offline
Carpal Tunnel
Carpal Tunnel
I Offline
Joined: Jun 2006
Posts: 3,839
Likes: 1
this doesn't seem to work in 7.1

Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Thanks for trying it on 7.1 Ian, guess this post can be scratched.

Joined: Jun 2006
Posts: 16,537
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,537
Likes: 150
A 7.1 version of this can be found here


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
Hmmm... another admin on our board already hacked ours, so you saying it may break in 7.1 ?

Guess that means one should heavily document all "mods" to their code crazy

Joined: Jun 2006
Posts: 16,537
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,537
Likes: 150
Lol considering during an upgrade you have no "mods" one should already ahve them documented wink


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Jun 2006
Posts: 1,344
G
veteran
veteran
G Offline
Joined: Jun 2006
Posts: 1,344
Yea looks like some file changed so it wouldn't work in 7.1 Had no I idea they would change, thanks for the link and thanks to Ian Spence for the re write.

Joined: Jun 2006
Posts: 16,537
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,537
Likes: 150
Yeh, things change, and new files get created for organization.

and you're more than welcome wink


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Joined: Nov 2006
Posts: 3,097
Likes: 1
Carpal Tunnel
Carpal Tunnel
Joined: Nov 2006
Posts: 3,097
Likes: 1
Well I doubt they're documented for us so I may have to just overwrite with default files and work from there again if needed.

Joined: Jun 2006
Posts: 16,537
Likes: 150
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,537
Likes: 150
It's ultimately always been that way; especially during rewrites...


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Having issues going from 7.5.5. to 8X
by Mors - 10/22/2026 5:32 PM
Slow Queries - Any Ideas?
by BellaOnline - 10/16/2026 8:34 PM
Selling a Forum?
by ECNet - 10/10/2026 2:54 PM
Who's Online Now
1 members (1 invisible), 504 guests, and 142 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20261026)