Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Mod Name / Version: My Home Post Statistics 1.2

Description: Adds a link to the My Home screen of the user which leads to a new screen with post statistics per year, month, day, day of the week and hour. There is an admin page which gives the same statistics as a total and per board.

Working Under: UBB.Threads 6.3-6.4

Mod Status: Finished

Any pre-requisites: None

Author(s): dimopoulos

Date: 08/31/03

Credits: PhotoPost (Michael) for the Day of the Week addition

Files Altered: templates/default/myhome.tmpl, admin/menu.php

New Files: images/bluebar.jpg, templates/default/myhomestats.tmpl, myhomestats.php, admin/adminpoststats.php

Database Altered: No

Info/Instructions: Very easy modification to install. It should work on previous versions of .threads although I haven't tested it.

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.
Attachments
93383-MyHomePostStatistics1.2.zip (0 Bytes, 340 downloads)

Last edited by Ian_W; 12/31/2003 4:26 AM.

Nikos
Sponsored Links
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Screenshot of the results
Attachments
93384-preview.jpg (0 Bytes, 57 downloads)


Nikos
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Awesome hack!

Just installed it, but noticed one minor graphical glitch... probably just because I post so much

Attachments
93385-glitch.gif (0 Bytes, 50 downloads)

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Excellent mod. Thanks.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Since we're on the subject... do you think you could make an admin area of this, to give the same statistics, but for everyone? As an admin, I would like to see the posting trends like this, such as what month is the most active, what time of day are people posting the most, etc.

It would seem that it could be done by just modifying the queries a bit, which could take a long time to do if you have a lot of members and a lot of posts. But it would be fun to see

Sponsored Links
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Yes that was my next release of this mod. It is really simple. Just grab the files and remove the

WHERE B_PosterId = '$Uid'

from the queries. This should give you the data you need.


Nikos
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
[]Jeremy said:
Awesome hack!

Just installed it, but noticed one minor graphical glitch... probably just because I post so much

[/]

Hmmm... I guess it is because I use <br /> instead of a full table. Let me rework this a bit...


Nikos
Joined: May 2002
Posts: 362
Junior Member
Junior Member
Offline
Joined: May 2002
Posts: 362
AWESOME Mod!

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Guys,

I changed the template a bit to cater for what Jeremy showed earlier and also added a new admin stats page which gives the same information but as a total for the whole forum and per board. It might be intensive to the database since there are 4 queries per board plus another 4 queries for the totals but this will only be used by admins so I think it is OK.


Nikos
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Most excellent, mine displays correctly now.

As for the admin stats... took about a minute to generate the stats, but very cool!!

One quick typo... for the admin stats, your last "Total" stats window says posts per month again.. when that one should be posts per hour Otherwise looks perfect

Sponsored Links
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Done! Thanks Jeremy.


Nikos
Joined: Mar 2003
Posts: 159
Member
Member
Joined: Mar 2003
Posts: 159
Very Cool

Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Very cool!

How about Dow Of Week so you see what day of the week is most popular?

Calculations based on a day number within a month isnt as useful to me as knowing which days of the week are most active, so I swapped out that section with:

Code
    // Totals in Days <br />    $strQuery = " <br />        SELECT  left(date_format(FROM_UNIXTIME(B_Posted),'%W'),3) AS DayLiteral, <br />                dayofweek(FROM_UNIXTIME(B_Posted)) AS DayStat, <br />                COUNT(B_Number) <br />        FROM    {$config['tbprefix']}Posts <br />        WHERE   B_PosterId = '$Uid' <br />        GROUP BY DayStat <br />        ORDER BY DayStat ASC"; <br /> <br />    $sth = $dbh->do_query($strQuery); <br /> <br />    $intCounter = 0; <br /> <br />    while (list($Day, $DayNum, $Posts) = $dbh->fetch_array($sth)) { <br />        $aTotalDays[$intCounter]['Day']    = $Day; <br />        $aTotalDays[$intCounter]['Posts']  = $Posts; <br />        $intCounter++; <br />    }


Which basically rewrites the query and then uses the same format as the month display.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Nice mod, thanks for posting this.

Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
Zip file updated with the Day of Week modification from Michael.


Nikos
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
Maybe I have done something wrong - but I can't see where - but if I try the admin version it times out fairly quickly if I try and load it in the mainframe - but if I open it in a new window it will take ages before timing out - and the server load increases from 0.13 to over 2.10

Th end user one runs fine.

Got 50+ users online whislt I try this. But the server is fairly powerful - so that should not affect things.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
It might be the number of boards you have also Ian. The admin page has 4 queries for the totals and 4 x No of Boards queries for the rest of them so for 10 boards you will end up with 44 queries in the database and 44 for loops to display the data.

I will see if I can split the admin section so that it doesn't kill any servers.


Nikos
Joined: Feb 2002
Posts: 1,759
Addict
Addict
Offline
Joined: Feb 2002
Posts: 1,759
Ian, server load will spike tremendously when you do this, especially on a larger forum with a lot of users/posts. Mine took a little over a minute before I got the results, and server loads were well over 2 while running it.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
[]dimopoulos said:
It might be the number of boards you have also Ian. The admin page has 4 queries for the totals and 4 x No of Boards queries for the rest of them so for 10 boards you will end up with 44 queries in the database and 44 for loops to display the data.

I will see if I can split the admin section so that it doesn't kill any servers. [/]

LOL - only 600 groups & 350 categories

Seriously - do not worry about my set-up - it is not exactly the norm

I can live without it


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Aug 2002
Posts: 1,191
Kahuna
Kahuna
Joined: Aug 2002
Posts: 1,191
No I do worry because it might be just an admin feature but if it is going to kill the server even for a minute it is not good. I will sort something out. I have some ideas for additional statistics and would like to split them out. I am also thinking of making a printable page out of them

Let me work something out before the weekend. You can see very clearly the trends on each time interval


Nikos
Joined: Feb 2003
Posts: 196
Member
Member
Offline
Joined: Feb 2003
Posts: 196
guys,

where is the admin stats exactly located at????? i am an admin and I can only see my states, but i dont see the admin stats!

Joined: Feb 2003
Posts: 196
Member
Member
Offline
Joined: Feb 2003
Posts: 196
guys,

can someone reply to me, where is the admin states located at, and why I still see the glitch that jeremy pointed earlier.

[]https://www.ubbdev.com/forum/uploads/93385-glitch.gif[/]

Joined: Feb 2003
Posts: 31
User
User
Offline
Joined: Feb 2003
Posts: 31
Just FYI this mod works fine with 6.4

Joined: Jan 2002
Posts: 674
Junior Member
Junior Member
Offline
Joined: Jan 2002
Posts: 674
salim it should be in your admin menu as a link

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
[]bdoughty said:
Just FYI this mod works fine with 6.4 [/]

Right on...thanks for confirming.

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
[]bdoughty said:
Just FYI this mod works fine with 6.4 [/]

Thanks amended the first post


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jun 2000
Posts: 190
Enthusiast
Enthusiast
Joined: Jun 2000
Posts: 190
Great hack! Thanks for making it available.

One question, though..... in the graph for "Posts per Hour", is the time representative of the user's adjusted time or the actual server time?


Artificial Intelligence is no match for natural stupidity!
Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
User stats work fine in 6.5.1 - albeit you will have to alter the path for main.inc.php to

// Require the library
require ("./includes/main.inc.php");


Admin stats are not working - but this maybe my server (as per my post above (can't recall if admin stats ever worked for me)) and not a problem with the code.

Also on the admin side - the menu system has altered so the menu changes need to be in admin_adminmenu.tmpl.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)
Joined: Jul 2002
Posts: 79
Power User
Power User
Offline
Joined: Jul 2002
Posts: 79
My Admin stats don't work properly for 6.5.1 either - they used to before I upgraded though....

Joined: Sep 2003
Posts: 803
Coder
Coder
Offline
Joined: Sep 2003
Posts: 803
This would be nice for my 6.5 board
anyone ever get it working on 6.5?

Joined: Feb 2002
Posts: 2,286
Veteran
Veteran
Joined: Feb 2002
Posts: 2,286
user stats work fine - havn't had a chance to try and see why the admin stats fail.


Fans Focus - Focusing on Fans of Sport

(Okay - mainly football (the British variety wink at the moment - but expanding all the time....)

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
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
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
Morgan 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)