[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
Wintermute42
Registered User
Posts: 3
Joined: Sun Jul 15, 2007 4:43 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by Wintermute42 »

hi,

anyone can help me with the necessary code changes if I only want the list of last 24h users filled with users who have public profiles (Hide my online status = no)?
jimcarrel
Registered User
Posts: 671
Joined: Fri Jul 27, 2007 10:49 pm
Location: Oklahoma City, Oklahoma

Re: [RC] Activity Stats MOD 0.1.2

Post by jimcarrel »

Highway,
Request please, could we get a mouse over pop up containing users last logged time in the last 24 hour list?
I always found that quite usable.
Grace--Getting what I don't deserve
Mercy--Not getting what I do deserve
User avatar
CrossoverX
Registered User
Posts: 121
Joined: Thu Apr 05, 2007 2:35 pm
Location: 5-X
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by CrossoverX »

hi thanks for this mod...

I have a question.

Is possible to change the time stat not from 24H but to 48 or something else?!

Thanks
.

Add your board to phpBB-topsites.com

.
Forke
Registered User
Posts: 102
Joined: Fri Feb 08, 2008 6:03 am

Re: [RC] Activity Stats MOD 0.1.2

Post by Forke »

Hi Highway, this is a great mod. Really easy to install.

I use it in my forum, but only for the "Activity in the last 24 hours (new posts, new topics and new users)" part.

Is there a way to eliminate the other part of the mod? I didn't install it in my template, but I guess the functions_activity_stats.php file still collects the data I don't want.

Is it worthy to remove that part from the functions_activity_stats.php file or that wont make any difference?

Thanks!
My first validated mod!
Adaptive Quick Search
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 »

Forke, this might help:
Highway of Life wrote:
*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
Perhaps for the next version I’ll make these two configurable.
I’m surprised how many people don’t use the users active over the last 24 hours list...

Any reason why? :? :|
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.
RedTrinity
Registered User
Posts: 1327
Joined: Sat May 06, 2006 3:32 am

Re: [RC] Activity Stats MOD 0.1.2

Post by RedTrinity »

Highway of Life wrote: I’m surprised how many people don’t use the users active over the last 24 hours list...
Any reason why? :? :|
I already had the "Visitors Today" MOD installed which I had assumed did the same as what the component of this one did, so it wasn't necessary to install a 2nd or replacement one ;) That was my reason anyway.
los-norway
Registered User
Posts: 14
Joined: Wed Jan 23, 2008 9:28 am

Re: [RC] Activity Stats MOD 0.1.2

Post by los-norway »

Great mod.Easy to install,and works as h***. :mrgreen:
Thanks :)
Forke
Registered User
Posts: 102
Joined: Fri Feb 08, 2008 6:03 am

Re: [RC] Activity Stats MOD 0.1.2

Post by Forke »

Highway of Life wrote:Forke, this might help:
Highway, I deleted that part from the functions file, and... the part I wanted in my forum stopped working! :shock:

I wanted to leave out the "active users" part.

I don't use that because... well, I don't know, I think it would expand too much my statistics table. :)
My first validated mod!
Adaptive Quick Search
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 »

Now I’m confused... the instructions I gave Capmaster are for omitting the active users over the last 24 hours.
If that’s what you wanted to omit, then performing the commenting out that I illustrated in my quote should work. Else I don’t quite understand your request.
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.
RooMeat
Registered User
Posts: 204
Joined: Sat Jun 24, 2006 10:39 pm
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by RooMeat »

Not sure why...
But have uploaded files, done edits, refreshed templates, cleared cache... but don't see anything.
Board is using Stargate Portal and other than that.. it's pretty much standard.
Any ideas??
Board is at http://www.ozsportsbikes.com
Live site: http://www.ozsportsbikes.com (Converted from Nuked phpbb2 to stand alone phpBB3)
Test site: http://www.ozsuperbikes.com
Local Test site with XAMPP
spudlet
Registered User
Posts: 76
Joined: Tue Jun 29, 2004 9:04 pm

Re: [RC] Activity Stats MOD 0.1.2

Post by spudlet »

For those that want case insensitive sorting, just change line 90 of functions_activity_stats.php:

Find:

Code: Select all

'ORDER_BY'	=> 'u.username',
Replace With:

Code: Select all

'ORDER_BY'	=> 'LOWER(u.username)',
Thank you very much for the mod.
Forke
Registered User
Posts: 102
Joined: Fri Feb 08, 2008 6:03 am

Re: [RC] Activity Stats MOD 0.1.2

Post by Forke »

Highway of Life wrote:Now I’m confused... the instructions I gave Capmaster are for omitting the active users over the last 24 hours.
If that’s what you wanted to omit, then performing the commenting out that I illustrated in my quote should work. Else I don’t quite understand your request.
Then I must be doing something wrong. I deleted this from the functions file:

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']),
        )); 
But now I'm guessing I didn't have to delete it all!

Sorry to bother you again Highway,before in the topic tags (which work great) and now here :oops:
My first validated mod!
Adaptive Quick Search
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 »

RooMeat wrote:Not sure why...
But have uploaded files, done edits, refreshed templates, cleared cache... but don't see anything.
Board is using Stargate Portal and other than that.. it's pretty much standard.
Any ideas??
You performed the edits, installed the new file.
Did ACP > General > Purge Cache
then ACP > Styles > Templates > prosilver :: refresh.
That’s it, it should show up... if not, I would wager that the files are that the index file is not edited or the template files have not been properly edited and/or uploaded.
spudlet wrote:For those that want case insensitive sorting, just change line 90 of functions_activity_stats.php:

Find:

Code: Select all

'ORDER_BY'	=> 'u.username',
Replace With:

Code: Select all

'ORDER_BY'	=> 'LOWER(u.username)',
Thank you very much for the mod.
Better to use:

Code: Select all

'ORDER_BY'    => 'u.username_clean', 
Forke wrote:But now I'm guessing I didn't have to delete it all!

Sorry to bother you again Highway,before in the topic tags (which work great) and now here
Delete?
No, just comment it out as illustrated. :)
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.
RooMeat
Registered User
Posts: 204
Joined: Sat Jun 24, 2006 10:39 pm
Contact:

Re: [RC] Activity Stats MOD 0.1.2

Post by RooMeat »

Highway of Life wrote:You performed the edits, installed the new file.
YES
Highway of Life wrote:then ACP > Styles > Templates > prosilver :: refresh.
YES
Highway of Life wrote:That’s it, it should show up... if not, I would wager that the files are that the index file is not edited or the template files have not been properly edited and/or uploaded.
LOL.. You would loose that wager :D :D :D

index.php

Code: Select all

	'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
	'U_MCP'				=> ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
);

	include($phpbb_root_path . 'includes/functions_activity_stats.' . $phpEx);
	activity_mod();
	// Output page
page_header($user->lang['INDEX']);

$template->set_filenames(array(
	'body' => 'index_body.html')
);
index_body.html

Code: Select all

<!-- IF S_DISPLAY_ONLINE_LIST -->
	<!-- IF U_VIEWONLINE --><h3><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h3><!-- ELSE --><h3>{L_WHO_IS_ONLINE}</h3><!-- ENDIF -->
	<p>{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /> <br />{LOGGED_IN_USER_LIST}
			<!-- 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 -->
	<!-- IF LEGEND --><br /><em>{L_LEGEND}: {LEGEND}</em><!-- ENDIF --></p>
<!-- ENDIF -->

Code: Select all

<!-- IF NEWEST_USER -->
	<h3>{U_STATISTICS}</h3>
	<p>{TOTAL_POSTS} &bull; {TOTAL_TOPICS} &bull; {TOTAL_USERS} &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 -->
<!-- ENDIF -->
Live site: http://www.ozsportsbikes.com (Converted from Nuked phpbb2 to stand alone phpBB3)
Test site: http://www.ozsuperbikes.com
Local Test site with XAMPP
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 »

It’s simple though: If you’ve made all the edits properly, uploaded them to your server, and refreshed your template cache, it *will* show up there.
There’s nothing magic or fancy about it, it’s not even a science. :P
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”