|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
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]](http://www.gliderdad79.com/images/stats.jpg)
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
Joined: Jun 2006
Posts: 1,344 |
Figured it out, thanks anyways 
|
|
|
|
|
Joined: Jun 2006
Posts: 3,839 Likes: 1
Carpal Tunnel
|
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,839 Likes: 1 |
well done  Feel free to share if you feel the change could help others 
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
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  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. 
|
|
|
|
|
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  Doesn't work as it should.
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
Joined: Jun 2006
Posts: 1,344 |
|
|
|
|
|
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. 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
Carpal Tunnel
|
|
Carpal Tunnel
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
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
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 
|
|
|
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150
|
|
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.
|
|
|
|
|
Joined: Jun 2006
Posts: 3,839 Likes: 1
Carpal Tunnel
|
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,839 Likes: 1 |
this doesn't seem to work in 7.1
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
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
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150 |
A 7.1 version of this can be found here
|
|
|
|
|
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 
|
|
|
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150 |
Lol considering during an upgrade you have no "mods" one should already ahve them documented 
|
|
|
|
|
Joined: Jun 2006
Posts: 1,344
veteran
|
|
veteran
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
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150 |
Yeh, things change, and new files get created for organization. and you're more than welcome 
|
|
|
|
|
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
|
|
Joined: Jun 2006
Posts: 16,537 Likes: 150 |
It's ultimately always been that way; especially during rewrites...
|
|
|
|
1 members (1 invisible),
504
guests, and
142
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
|