[MODDB] Activity Stats MOD 1.0.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

[MODDB] Activity Stats MOD 1.0.0

Post by Highway of Life » Thu Feb 28, 2008 6:38 am

MOD Title: Activity Stats MOD
MOD Description: - Lists of all registered users who have visited the board in the last 24 hours.
- Lists stats on the number of new posts, new topics and new users within the last 24 hours on the index page.
MOD Version: 0.1.2 RC3
phpBB Version: 3.0.0
Tested on:
  • 3.0.0
  • 3.0.1-dev
Author: Highway of Life

MOD Features:
  • Lists all users who have visited in the last 24 hours
  • Lists a legend of stats showing new posts, new topics and new registered users over the last 24 hours
Supported Languages: (Credits)
  • English by Highway of Life
Styles supported:
  • prosilver
  • subsilver2
MOD Format:
Image

Notes:
  • If you enjoy this MOD, please consider supporting our MODing effort by donating to phpBB Academy at StarTrekGuide. Thanks!
Credits:
Geoffreak for the awesome automated MODX generator

Support Topics:
STG Support Topic
phpBB.com Support Topic
phpBBModders Support Topic

Screenshots:
Image
[ Click for full size ]

Image
[ Click for full size ]

Demo:
prosilver demo
subsilver2 demo

FAQ:
Q: Why won’t it update the new posts/topics every time a new post is made?
A: This is because it caches the data for one hour, this means that this MOD will not be a burden on the server.
If the data refreshed for each post, it would be an unnecessary load on the Database with the extra queries for each user who loads the index page.

MOD Download: Download
MD5 Checksum: 3c3bd07c05d606a359ba3e3f23450311
Last edited by MHobbit on Wed Mar 19, 2008 8:50 pm, edited 1 time in total.
Reason: Version number in subject raised
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [RC] Activity Stats MOD 0.1.0

Post by RedTrinity » Thu Feb 28, 2008 6:59 am

Hi HOL,

Have been looking forward to this one :D

Any chance of Subsilver template instructions though for the index_body edits? Otherwise i will have to wait patiently for a future release as our only template in use is a Subsilver2 based one.

Regardless though, thank you so much for this MOD :) I am sure it will be of good use and others will appreciate it too.

Cheers,

Nikki :)

ibelphegor
Registered User
Posts: 452
Joined: Wed Oct 24, 2007 8:37 am

Re: [RC] Activity Stats MOD 0.1.0

Post by ibelphegor » Thu Feb 28, 2008 7:29 am

Hi Highway of Life,
Thanks for the mod.

First in INDEX it's need to be find(?!)

Code: Select all

page_header($user->lang['INDEX']);
not

Code: Select all

page_header($user->lang['INDEX_TITLE']);
secondly: subsilver2

Find:

Code: Select all

<td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>
Add befor:

Code: Select all

<!-- IF not S_IS_BOT --><br /><br />
	{USERS_24HOUR_TOTAL}: <!-- BEGIN lastvisit -->{lastvisit.USERNAME_FULL}<!-- IF not lastvisit.S_LAST_ROW -->, <!-- ENDIF --><!-- END lastvisit -->
	<!-- ENDIF -->
Find:

Code: Select all

<p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p>
Add After:

Code: Select all

	<!-- IF not S_IS_BOT -->
	<h3 id="24hour_stats">{L_24HOUR_STATS}</h3>
	<p>{24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}</p>
	<!-- ENDIF -->
NOT TESTED BUT SHOULD BE OK.

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.1

Post by Highway of Life » Thu Feb 28, 2008 9:12 am

Thanks belphegor! :D

Saves me the time and trouble.
subsilver2 instructions added to package.
Added missing license.txt file
Fixed index.php FIND.
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.1

Post by Highway of Life » Thu Feb 28, 2008 9:14 am

Just need someone to test the installation and subsilver2 instructions, if all goes well, I’ll submit it to the MOD Database.

Thanks!!
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [RC] Activity Stats MOD 0.1.0

Post by RedTrinity » Thu Feb 28, 2008 9:18 am

ibelphegor wrote: secondly: subsilver2

Find:

Code: Select all

<td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>
Add befor:

Code: Select all

<!-- IF not S_IS_BOT --><br /><br />
	{USERS_24HOUR_TOTAL}: <!-- BEGIN lastvisit -->{lastvisit.USERNAME_FULL}<!-- IF not lastvisit.S_LAST_ROW -->, <!-- ENDIF --><!-- END lastvisit -->
	<!-- ENDIF -->
Find:

Code: Select all

<p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p>
Add After:

Code: Select all

	<!-- IF not S_IS_BOT -->
	<h3 id="24hour_stats">{L_24HOUR_STATS}</h3>
	<p>{24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}</p>
	<!-- ENDIF -->
NOT TESTED BUT SHOULD BE OK.
Thank you :) I used the 2nd block which works fine, I am sure the first one is too but can't confirm (I already have a users online today MOD installed lol)

Thanks again HOL :D

I have one feature request for a future version, maybe the option to view new registrations/posts/topics within X days? So that way for example it will display the total reached over a certain amount of days :)

Cheers :D

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.0

Post by Highway of Life » Thu Feb 28, 2008 9:24 am

RedTrinity wrote:I have one feature request for a future version, maybe the option to view new registrations/posts/topics within X days? So that way for example it will display the total for a certain amount of days :)
This MOD is the "Activity" MOD, what you’re proposing is more of a Stats MOD.
Which I also have about 70% complete (maybe further along if I look at it).
In addition to the stats, it will utilise the JPGraph (released under the QPL 1.0 (Qt Free Licensee) For non-commercial, open-source distribution) engine to generate dynamic stat graphs, which you can preview here.
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
Jammy Johnny
Registered User
Posts: 149
Joined: Sun Feb 17, 2008 11:08 am
Location: Scotland
Name: John
Contact:

Re: [RC] Activity Stats MOD 0.1.1

Post by Jammy Johnny » Thu Feb 28, 2008 9:33 am

Thanks for another gr8 mod :D , Im using Aeroblue style, And it works perfectly ;)

JammY

[link removed -- you may put a link in your signature, but not in the post body. AJD

ibelphegor
Registered User
Posts: 452
Joined: Wed Oct 24, 2007 8:37 am

Re: [RC] Activity Stats MOD 0.1.1

Post by ibelphegor » Thu Feb 28, 2008 12:06 pm

you are welcome Highway of Life.

I make LocalHost test and make some improvement:
Image

Find:

Code: Select all

<span class="genmed">{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}
Add after:

Code: Select all

<!-- IF not S_IS_BOT --><br /><br />
	{USERS_24HOUR_TOTAL}: <!-- BEGIN lastvisit -->{lastvisit.USERNAME_FULL}<!-- IF not lastvisit.S_LAST_ROW -->, <!-- ENDIF --><!-- END lastvisit -->
	<!-- ENDIF -->
Find:

Code: Select all

<table class="tablebg" width="100%" cellspacing="1">
<tr>
	<td class="cat" colspan="2"><h4>{L_STATISTICS}</h4></td>
</tr>
<tr>
	<td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td>
	<td class="row1" width="100%" valign="middle"><p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}</p></td>
</tr>
</table>
Add after:

Code: Select all

<!-- IF not S_IS_BOT -->
	<br clear="all" />
<table class="tablebg" width="100%" cellspacing="1">
<tr>
	<td class="cat" colspan="2"><h4>{L_24HOUR_STATS}</h4></td>
</tr>
<tr>
	<td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td>
	<td class="row1" width="100%" valign="middle"><p class="genmed">{24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}</p></td>
</tr>
</table><!-- ENDIF -->

ibelphegor
Registered User
Posts: 452
Joined: Wed Oct 24, 2007 8:37 am

Re: [RC] Activity Stats MOD 0.1.1

Post by ibelphegor » Thu Feb 28, 2008 12:19 pm

Another way for "24HOUR STATS"
Image

Find:

Code: Select all

<p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER} 
Add after:

Code: Select all

 <!-- IF not S_IS_BOT --> <br />{L_24HOUR_STATS}: &bull; {24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}<!-- ENDIF -->
And... more way.. :roll:
Image
Find:

Code: Select all

<p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}
Add after:

Code: Select all

 <!-- IF not S_IS_BOT -->| {L_24HOUR_STATS}: &bull; {24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}<!-- ENDIF -->

User avatar
foxxy111
Registered User
Posts: 31
Joined: Sun Dec 16, 2007 8:03 pm

Re: [RC] Activity Stats MOD 0.1.1

Post by foxxy111 » Thu Feb 28, 2008 1:00 pm

Amazing Mod
Thanks Highway , gonna try it now :?

User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [RC] Activity Stats MOD 0.1.1

Post by *Capmaster* » Thu Feb 28, 2008 5:55 pm

Great mod. Thanks HOL.

One little problem, though - It won't update the new posts unless the cache is purged. Any ideas how to get around this so it updates each time a new post is made?

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life » Thu Feb 28, 2008 6:14 pm

Updated to 0.1.2, decided on some subsilver2 instructions that I like.
See the subsilver2 demo (link in first post).

Added FAQ for Capmaster's question. -- That is a feature. :)
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by *Capmaster* » Thu Feb 28, 2008 6:29 pm

Highway of Life wrote:Updated to 0.1.2, decided on some subsilver2 instructions that I like.
See the subsilver2 demo (link in first post).

Added FAQ for Capmaster's question. -- That is a feature. :)
Ahh ...Thanks Highway 8-)

I was poking around while waiting, and I found this in the /includes/functions_activity_stats.php file:

Code: Select all

// cache this data for 1 hour, this improves performance
		$cache->put('_activity_mod', $activity, 3600);
I changed it to this:

Code: Select all

// cache this data for 1 hour, this improves performance
		$cache->put('_activity_mod', $activity, 5);
This gives me 5-second update intervals, and seems to work just fine without any bad effects on the forum performance. Of course we're running on a dedicated server and it runs like a striped-arsed ape anyways :lol:

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Spokane, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life » Thu Feb 28, 2008 6:35 pm

Indeed it was designed so that it can run on a shared server without a problem.
My board is running on a colo server, so it’s more than enough to handle, but start adding thousands of users per hour and you have a problem with all those extra queries, no matter how powerful the server is. :)
Though for your situation currently 5 minutes should be fine.
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

Locked

Return to “[3.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 9 guests