[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!
Anti-Spam Guide
jayy90
Registered User
Posts: 23
Joined: Sun Feb 10, 2008 8:47 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by jayy90 »

i run on a shared server... what figures should i expect to get to without it eating my bandwidth/disk space away completely :lol:
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life »

These days you won’t hit your bandwidth usage before you hit the limits of your server resources.
It really depends on the host, each one is different and has different ceiling limits.
Having well optimised queries and caching means that phpBB3 should perform better with more users than phpBB2 did on shared servers.
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* »

Highway of Life wrote: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.
I've got it set to 5 seconds, not minutes. Doesn't seem to matter 8-)

Thanks a bunch for responding and writing this mod, highway. I owe you a root beer :D

Quite simply .... you rawwwk! Image

For your own info, the tables didn't look quite right with the mod as-written. The table data and table row tags weren't behaving. I massaged it a bit to work with each of my 4 styles. Here's what I ended up. I'm not using the top "Visitors in last 24 hours" box since I already had that through a different mod.

I've included the index_body.html code as it stands now, and screen grabs for each template. I'm using two Prosilver-based styles: Prosilver and Odyssey, and two subsilver2-based styles: subsilver2 and eTech Green.

eTech Green:

Code: Select all

<table class="tablebg" width="100%" cellspacing="{$CA_SPACING}">
{$CA_CAP_START}{L_STATISTICS}{$CA_CAP_END}
<tr>
	<td class="row1"><img src="{T_THEME_PATH}/images/stats.gif" alt="{L_STATISTICS}" /></td>
	<td class="row1 nobold" width="100%" valign="middle"><p class="genmed">{TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {AVG_POSTS} | {NEWEST_USER}</p></td>
</tr>
</table>
<br clear="all" />
<!-- IF not S_IS_BOT -->
<table class="tablebg" width="100%" cellspacing="{$CA_SPACING}">
{$CA_CAP_START}{L_24HOUR_STATS}{$CA_CAP_END}

<tr>  
<td class="row1 nobold" width="100%" valign="middle"><p class="genmed">{24HOUR_POSTS} | {24HOUR_TOPICS} | {24HOUR_USERS}</p></td>
</tr>
</table>
<!-- ENDIF -->
<br clear="all" /> 
eTech Green screen grab:

Image



subsilver2:

Code: Select all

<br clear="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} | {AVG_POSTS} | {NEWEST_USER}</p></td>
</tr>
</table>
<br clear="all" />
	<!-- IF not S_IS_BOT --> 
	<table class="tablebg" width="100%" cellspacing="1">
<tr>
<td class="cat" colspan="2"><h4>{L_24HOUR_STATS}</h4></td>
</tr> 
<tr>
	<td class="row1" width="100%" valign="middle"><p class="genmed">{24HOUR_POSTS} | {24HOUR_TOPICS} | {24HOUR_USERS}</p></td> 
</tr>
</table>
	<!-- ENDIF -->
subsilver2 screen grab:

Image



Odyssey:

Code: Select all

	<h3>{L_STATISTICS}</h3>
	<p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {AVG_POSTS} &bull; {NEWEST_USER}</p>
	<!-- IF not S_IS_BOT --> 
	<h3 id="24hour_stats">{L_24HOUR_STATS}</h3> 
	<p>{24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}</p> 
	<!-- ENDIF -->
Odyssey screen grab:

Image



Prosilver:

Code: Select all

	<h3>{L_STATISTICS}</h3>
	<p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &bull; {AVG_POSTS} &bull; {NEWEST_USER}</p>
	<!-- IF not S_IS_BOT --> 
	<h3 id="24hour_stats">{L_24HOUR_STATS}</h3> 
	<p>{24HOUR_POSTS} &bull; {24HOUR_TOPICS} &bull; {24HOUR_USERS}</p> 
	<!-- ENDIF -->
Prosilver screen grab:

Image

Note: I have an extra variable in the above code: {AVG_POSTS}. If anyone uses these code examples, remove this term unless you're using the Average Posts Per User mod ;)
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life »

*Capmaster* wrote:I've got it set to 5 seconds, not minutes. Doesn't seem to matter 8-)
Ah hmm... in that case, you don’t want it throwing to the cache at all, as at a 5 second interval, you may only be increasing the load just a bit... you could make them strict queries by commenting out the $cache->put line.

Code: Select all

        // cache this data for 1 hour, this improves performance
//        $cache->put('_activity_mod', $activity, 3600); 
Also, if you’re not using the users active over the last 24 hours, you might want to comment that out as well...

Code: Select all

// obtain user activity data
//    $active_users = obtain_active_user_data();
    
    // obtain posts/topics/new users activity
    $activity = obtain_activity_data();
/*
    // 24 hour users online list, assign to the template block: lastvisit
    foreach ($active_users as $row)
    {
            $template->assign_block_vars('lastvisit', array(
                'USERNAME_FULL'    => get_username_string((($row['user_type'] == USER_IGNORE) ? 'no_profile' : 'full'), $row['user_id'], $row['username'], $row['user_colour']),
            ));
    }
*/
    // assign the stats to the template.
    $template->assign_vars(array(
//        'USERS_24HOUR_TOTAL'    => sprintf($user->lang['USERS_24HOUR_TOTAL'], sizeof($active_users)),
        '24HOUR_TOPICS'            => sprintf($user->lang['24HOUR_TOPICS'], $activity['topics']),
        '24HOUR_POSTS'            => sprintf($user->lang['24HOUR_POSTS'], $activity['posts']),
        '24HOUR_USERS'            => sprintf($user->lang['24HOUR_USERS'], $activity['users']),
    )); 
Well done on the templates! :D
Just a personal preference, but I like the activity stats to show similar to the stats box. -- BTW, this was changed in v 0.1.2, but it looks like you have it the way you like it. :D
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* »

Thanks for the tips. I'll get those changed right away 8-)

Edit: Works like a charm.

:mrgreen:
jayy90
Registered User
Posts: 23
Joined: Sun Feb 10, 2008 8:47 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by jayy90 »

Edit: done it, looks great, no problems and looks sweet cheers.

hi HOL

i asked my host to install this mod, and he did the 0.1.1 version i think, its all good but the activity over the last 24 hours bit is in the same box as stats and i dont like it, i see on your demo you have it in a seperate box how id like it, how can i go about putting it in its own box?

im an utter phpbb noob by the way so if you will tell me where and what needs editing that would be sweet.

P.S, would be great if you could include a (last updated: TIME am/pm) as it refreshes every hour it isnt very accurate, just a suggestion! :)
jayy90
Registered User
Posts: 23
Joined: Sun Feb 10, 2008 8:47 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by jayy90 »

Hello HOL,

could you tell me why the mod isnt resetting at 12am? or does it reset 24 hours from when its installed?
User avatar
Overhead
Registered User
Posts: 56
Joined: Thu Dec 20, 2007 9:39 am

Re: [RC] Activity Stats MOD 0.1.2

Post by Overhead »

Hi HoL

should it be that topics which are sticky for normal member are not count in the statisics?

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

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life »

All topics and posts are counted, all users are counted as well.
It caches for exactly one hour, it does not "reset", it’s always activity over the last 24 hours. :)
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.
Rosca
Registered User
Posts: 21
Joined: Sat Dec 15, 2007 8:27 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by Rosca »

I have a small problem with this MODidfication, cause after i installed it i saw that the statistics with new posts, no of topics and number of new users was't working.
I can see that is posting, but number of new posts is not renewing, it is just the same as previous number. What should I do to renew the number of new posts when a new message is posted?

Thank you,
Daniel Rosca


LE: I'm so sorry, but I didn't see FAQ in the first post.
User avatar
Overhead
Registered User
Posts: 56
Joined: Thu Dec 20, 2007 9:39 am

Re: [RC] Activity Stats MOD 0.1.2

Post by Overhead »

@ HoL

ok I see - after 1 hour was gone the count was shown...

maybe it was my fault - excuse me for stealing your time...

cu Overhead
kix_mc3
Registered User
Posts: 70
Joined: Mon Aug 06, 2007 11:43 am
Location: Romania
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by kix_mc3 »

Hello everybody. I don't kown if that's normal, but look at the PrintScreen. Everything it's too bold. Is there any chance to make this not to be bold?

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

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life »

You must have given your registered users group a colour (of black)
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.
kix_mc3
Registered User
Posts: 70
Joined: Mon Aug 06, 2007 11:43 am
Location: Romania
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by kix_mc3 »

Before this MOD i had another MOD (Visitors Today) and it worked fine. And the color had never changed :?
User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by Highway of Life »

This MOD does not change the CSS.
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”