Activity Stats MOD

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Extensions Robot
Extensions Robot
Extensions Robot
Posts: 26323
Joined: Sat Aug 16, 2003 7:36 am

Activity Stats MOD

Postby Extensions Robot » Wed Mar 19, 2008 6:24 pm

Modification name: Activity Stats MOD
Author: 5hocK
Modification 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
Modification version: 1.0.2
Tested on phpBB version: 3.0.12

Download file: activity_stats_mod.1.0.2.zip
File size: 64607 Bytes

Modification overview page: View

The phpBB Team is not responsible nor required to provide support for this modification. By installing this MOD, you acknowledge that the phpBB Support Team or phpBB Modifications Team may not be able to provide support.

-->Modification support<--
Last edited by Extensions Robot on Sun Mar 30, 2014 10:38 am, edited 12 times in total.
(this is a non-active account manager for the phpBB Extensions Team)

User avatar
Paul
Extensions Team Member
Extensions Team Member
Posts: 21229
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Activity Stats MOD

Postby Paul » Wed Mar 19, 2008 6:24 pm

Modification validated/released

Notes:
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

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

Activity Stats MOD

Postby Highway of Life » Wed Mar 19, 2008 6:24 pm

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

Future Development:
If you have feature requests, bug reports or suggestions for the next version of the Activity Stats MOD, please post them here: viewtopic.php?f=70&t=1339955

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.

--------oOo--------

Q: Why does it sort based on Caps and can I get it to sort case insensitive?
A: Small oversight, you can get it to sort case insensitive by doing the following:
OPEN: includes/functions_activity_stats.php
FIND:

Code: Select all

'ORDER_BY'    => 'u.username',      
REPLACE, WITH:

Code: Select all

'ORDER_BY'    => 'u.username_clean',      


--------oOo--------

Q: How can I get the list to exclude the bots (spiders)?
A: OPEN: includes/functions_activity_stats.php
FIND:

Code: Select all

'WHERE'        => 'u.user_lastvisit > ' . (time() - 86400) . ' OR s.session_user_id <> ' . ANONYMOUS,     
REPLACE, WITH:

Code: Select all

'WHERE'        => 'u.user_type <> ' . USER_IGNORE . ' AND (u.user_lastvisit > ' . (time() - 86400) . ' OR s.session_user_id <> ' . ANONYMOUS . ')',    


--------oOo--------

Q: How do I ensure hidden users are really hidden?
A: To ensure that hidden users are hidden, perform the following change(s).
Please note that this code has NOT been tested. Ensure you know how to edit PHP well enough to implement this change prior to making these changes.

OPEN: /includes/functions_activity_stats.php

FIND:

Code: Select all

global $template, $user;   

REPLACE, WITH:

Code: Select all

global $template, $user, $auth;   


FIND:

Code: Select all

    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']),
        ));
    }   

REPLACE, WITH:

Code: Select all


    $users_online 
= 0;
    foreach ($active_users as $row)
    {
        if (!$row['user_viewonline'] && !$auth->acl_get('u_viewonline'))
        {
            // user does not have permission to view hidden users.
            continue;
        }
        
        $users_online
++;
        $username_string = get_username_string((($row['user_type'] == USER_IGNORE) ? 'no_profile' : 'full'), $row['user_id'], $row['username'], $row['user_colour']);
        
        $username_string 
= (!$row['user_viewonline']) ? '<em>' . $username_string . '</em>' : $username_string;
        
        $template
->assign_block_vars('lastvisit', array(
            'USERNAME_FULL'    => $username_string,
        ));
    }   


FIND:

Code: Select all

'USERS_24HOUR_TOTAL'    => sprintf($user->lang['USERS_24HOUR_TOTAL'], sizeof($active_users)),   

REPLACE, WITH:

Code: Select all

'USERS_24HOUR_TOTAL'    => sprintf($user->lang['USERS_24HOUR_TOTAL'], $users_online),   


FIND:

Code: Select all

'SELECT'    => 'u.user_id, u.user_colour, u.username, u.user_type',   

REPLACE, WITH:

Code: Select all

'SELECT'    => 'u.user_id, u.user_colour, u.username, u.user_type, u.user_allow_viewonline, s.session_viewonline',   


FIND:

Code: Select all

$active_users[$row['user_id']] = array(   

AFTER, ADD:

Code: Select all

    'user_viewonline'    => ($row['session_viewonline']) ? $row['session_viewonline'] : $row['user_allow_viewonline'],   


--------oOo--------

Q: How do I change the cache time from 60 minutes to 5 minutes?
A: Perform the following changes.
OPEN: functions_activity_stats.php

FIND:

Code: Select all

$cache->put('_active_users', $active_users, 3600); 

REPLACE, WITH:

Code: Select all

$cache->put('_active_users', $active_users, 300); 


FIND:

Code: Select all

$cache->put('_activity_mod', $activity, 3600); 

REPLACE, WITH:

Code: Select all

$cache->put('_activity_mod', $activity, 300); 


--------oOo--------

Q: I have a large board and one of the queries seems to be slowing down the board, how do I improve performance?
A: Download the following replacement for the functions file. This will greatly improve the speed at which the new_posts SQL Query will run. It also changes the cache time from 60 minutes down to 15 minutes.

[The extension zip has been deactivated and can no longer be displayed.]



---------oOo----------

Style instructions for any of CyberAlien's styles from Keldek

Keldek wrote:Integration instructions for eTech style

editing styles/etech/template/index_body.html

Find:

Code: Select all

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


Replace With:

Code: Select all

         <td class="row1 nobold"><b class="gensmall">
            <!-- IF not S_IS_BOT --><p>
                   {USERS_24HOUR_TOTAL}: <!-- BEGIN lastvisit -->{lastvisit.USERNAME_FULL}<!-- IF not lastvisit.S_LAST_ROW -->, <!-- ENDIF -->            <!-- END lastvisit -->
            </p><!-- ENDIF -->

            <p><b>{L_LEGEND} :: {LEGEND}</b></p></td>



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 -->
   <br /><h3 id="24hour_stats">{L_24HOUR_STATS}</h3>
   <p>{24HOUR_POSTS} | {24HOUR_TOPICS} | {24HOUR_USERS}</p>
   <!-- ENDIF -->
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.

NadineF
Registered User
Posts: 19
Joined: Thu Feb 21, 2008 9:19 pm

Re: Activity Stats MOD

Postby NadineF » Wed Mar 19, 2008 8:20 pm

Installed and working great - thank you. I have adjusted it slightly so that it shows stats for last 48 hours rather than 24. Quick and easy to install - great mod :D

Molopää
Registered User
Posts: 75
Joined: Mon Jan 15, 2007 7:15 pm

Re: Activity Stats MOD

Postby Molopää » Wed Mar 19, 2008 8:32 pm

Cool MOD thanks! :ugeek:
Last edited by Molopää on Wed Mar 19, 2008 8:51 pm, edited 1 time in total.

JasonWade
Registered User
Posts: 287
Joined: Mon Jun 05, 2006 9:22 am

Re: Activity Stats MOD

Postby JasonWade » Wed Mar 19, 2008 8:42 pm

Is this the same as the last RC or is it updated after? Cause I got the last RC version and it has a slight "error":

when in the last 24 hours 2 new people register and in the 24 hours after I delete someone and no new members register it still says 2 new people registered, how can I fix this?

ryorevo
Registered User
Posts: 53
Joined: Thu Jan 31, 2008 12:06 pm
Location: US
Contact:

Re: Activity Stats MOD

Postby ryorevo » Wed Mar 19, 2008 10:52 pm

Congrats on the Release, ditto on the last question "has anything changed"?

And one quick question in my list of Users active over the last 24 hours I'm seeing an extra space, (with the last RC version) is this intentional, or perhaps something that I did incorrectly or a conflict with another mod?
Here's a partial list from my board (same in prosilver and subsilver2)

Code: Select all

Capt U-96 AKA Mike , Google [Bot] , Jeffo , Kim , MSN [Bot] , etc
The smoker's are revolting, Join the RYO Revolution!

User avatar
sixtvs
Registered User
Posts: 215
Joined: Thu Feb 14, 2008 8:39 am
Location: Virginia Beach, VA
Contact:

Re: Activity Stats MOD

Postby sixtvs » Thu Mar 20, 2008 1:39 am

Thanks you: easy install works perfectly!
People sleep peacefully at night only because rough men stand ready to fight for them!

ryorevo
Registered User
Posts: 53
Joined: Thu Jan 31, 2008 12:06 pm
Location: US
Contact:

Re: Activity Stats MOD

Postby ryorevo » Thu Mar 20, 2008 2:52 am

Disregard my earlier question about the extra spaces, it was my fault for the way I re-formatted the code in the index_body.html files :roll:
The smoker's are revolting, Join the RYO Revolution!

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

Re: Activity Stats MOD

Postby Highway of Life » Thu Mar 20, 2008 4:46 am

JasonWade wrote:Is this the same as the last RC or is it updated after? Cause I got the last RC version and it has a slight "error":

when in the last 24 hours 2 new people register and in the 24 hours after I delete someone and no new members register it still says 2 new people registered, how can I fix this?

It’s cached for 1 hour, see FAQ on the third post.

The only things that changed were the install instructions to increment instead of replace-with, though you won’t see any difference either way you go.
Also added the missing <edit></edit> tags to make it work properly with Blinky. Other than that, there are no other changes.
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
Elias
Jr. Extension Validator
Posts: 4388
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias
Contact:

Re: Activity Stats MOD

Postby Elias » Thu Mar 20, 2008 4:47 am

On the demo board prosilver, where does it show the topics?
http://www.Front-Host.com
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

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

Re: Activity Stats MOD

Postby Highway of Life » Thu Mar 20, 2008 4:48 am

EY wrote:On the demo board prosilver, where does it show the topics?

See the second screenshot for New topics in the last 24 hours (count) :)
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
Elias
Jr. Extension Validator
Posts: 4388
Joined: Sat Feb 25, 2006 4:31 pm
Location: In the Water!
Name: Elias
Contact:

Re: Activity Stats MOD

Postby Elias » Thu Mar 20, 2008 4:51 am

Ah thanks.
Screenshots had an red X on them and was not able to see them.

Thanks for the fast reply.
http://www.Front-Host.com
"Mystery creates wonder, and wonder is the basis of man's desire to understand." - Neil Armstrong
|Installing Extensions|Writing Extensions|Extension Validation Policy|

JasonWade
Registered User
Posts: 287
Joined: Mon Jun 05, 2006 9:22 am

Re: Activity Stats MOD

Postby JasonWade » Thu Mar 20, 2008 9:36 am

Highway of Life wrote:
JasonWade wrote:Is this the same as the last RC or is it updated after? Cause I got the last RC version and it has a slight "error":

when in the last 24 hours 2 new people register and in the 24 hours after I delete someone and no new members register it still says 2 new people registered, how can I fix this?

It’s cached for 1 hour, see FAQ on the third post.

The only things that changed were the install instructions to increment instead of replace-with, though you won’t see any difference either way you go.
Also added the missing <edit></edit> tags to make it work properly with Blinky. Other than that, there are no other changes.


I know the one hour thing but like I typed in the last 24 hours (more even) 0 new members registered but it still said 2 so I figure that's because I deleted a member in those 24 hours, that's what the problem is ;)

And thnx for letting me know about the edits

xnitelifex
Registered User
Posts: 126
Joined: Wed Jun 27, 2007 6:35 pm

Re: Activity Stats MOD

Postby xnitelifex » Thu Mar 20, 2008 2:44 pm

Guest - Can view profiles, memberlist and online list: no
4 Users active over the last 24 hours: test1, test2, test3, test4

Registered Users - Can view profiles, memberlist and online list: no
4 Users active over the last 24 hours: test1, test2, test3, test4

Why the difference?


Return to “[3.0.x] MOD Database Releases”

Who is online

Users browsing this forum: No registered users and 14 guests