[RC] Activity Stats MOD 0.1.2

Misc MOD Downloads for phpBB3 -- Any MOD that does not fit into any other category
Forum rules
Image Please feel free to download any MOD's here, support for each MOD is located it's own thread.

To post your own MOD, please first read the MOD Guidelines

[RC] Activity Stats MOD 0.1.2

Postby Highway of Life » 28 Feb 2008, 00:36

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
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10


Re: [RC] Activity Stats MOD 0.1.0

Postby belphegor » 28 Feb 2008, 01:14

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.
belphegor    
Supporter
Supporter
 
Posts: 217
Joined: 06 Jan 2008, 00:19
Location: IL
Gender: Male

Re: [RC] Activity Stats MOD 0.1.1

Postby Highway of Life » 28 Feb 2008, 03:11

Thanks belphegor! :clapping:

Saves me the time and trouble.
subsilver2 instructions added to package.
Added missing license.txt file
Fixed index.php FIND.
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [RC] Activity Stats MOD 0.1.1

Postby Highway of Life » 28 Feb 2008, 03:14

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

Thanks!!
Watch out! I might do a code wheelie!

User avatar
Highway of Life    
STG Jedi Master
STG Jedi Master
 
Posts: 10458
Joined: 08 May 2006, 05:23
Location: Beware of Programmers carrying screwdrivers
Gender: Male
phpBB Knowledge: 10

Re: [RC] Activity Stats MOD 0.1.1

Postby Stoker » 28 Feb 2008, 05:00

Nice Job Highway :thumbsup:

I have testet it on a subsilver2 based style. I think there is an error in the subsilver2 modx instruction.
First find:
Code: Select all
<td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>


Before add:
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 -->


When this is done the code is added between a <tr> and a <td class="row1">
That doesnt look nice :)


You may want to do this instead:
Find
Code: Select all
<td class="cat" colspan="2"><!-- IF U_VIEWONLINE --><h4><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h4><!-- ELSE --><h4>{L_WHO_IS_ONLINE}</h4><!-- ENDIF --></td>


Inline find:
Code: Select all
colspan="2"


Replace with:
Code: Select all
colspan="3"


Find:
Code: Select all
<!-- IF LEGEND -->
      <tr>
         <td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>
      </tr>
   <!-- ENDIF -->


Add after:
Code: Select all
<!-- IF not S_IS_BOT --><tr>
   <td class="row1">{USERS_24HOUR_TOTAL}: <!-- BEGIN lastvisit -->{lastvisit.USERNAME_FULL}<!-- IF not lastvisit.S_LAST_ROW -->, </td>
      </tr><!-- ENDIF --><!-- END lastvisit -->
   <!-- ENDIF -->


Again, I dont use subsilver2 so this is not testet.
But I know for sure that the instructions is wrong.

Good job.
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: [RC] Activity Stats MOD 0.1.1

Postby Patricia » 28 Feb 2008, 05:10

Hi David,

Followed your instructions:

http://patricia26.pa.funpic.de

-Patricia

Edit: David, I can send you by PM the FTP details of my test site, let me know
User avatar
Patricia    
STG Moderator
STG Moderator
 
Posts: 833
Joined: 09 Feb 2007, 08:27
Location: latitude: 51.00 - longitude: 5.87
Gender: Female

Re: [RC] Activity Stats MOD 0.1.1

Postby belphegor » 28 Feb 2008, 06:06

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 -->
belphegor    
Supporter
Supporter
 
Posts: 217
Joined: 06 Jan 2008, 00:19
Location: IL
Gender: Male

Re: [RC] Activity Stats MOD 0.1.1

Postby belphegor » 28 Feb 2008, 06:20

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 -->
belphegor    
Supporter
Supporter
 
Posts: 217
Joined: 06 Jan 2008, 00:19
Location: IL
Gender: Male

Re: [RC] Activity Stats MOD 0.1.1

Postby Stoker » 28 Feb 2008, 07:47

I have a request for this mod.

Is it possible to change Activity from last 24 hours to Today?

The reason is that when last 24 hours is used the topic, post and user count will decrease when there is low activity on the board.
I think it is this piece of code that needs to be changed:
Code: Select all
// set interval to 24 hours ago
      $interval = time() - 86400;


What do I set it to if I want to display topics, posts and new users since 00:00?
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: [RC] Activity Stats MOD 0.1.1

Postby belphegor » 28 Feb 2008, 09:07

The calculus 86400 is 86400 seconds 86400/60 sec' = 1440 minutes 1440/60 = 24 hours.
So change by this calculus for what ever you want.
For example if you want 12 hours replace to 43200


BTW,
you will need to change in lang "Activity over the last 24 hours"
belphegor    
Supporter
Supporter
 
Posts: 217
Joined: 06 Jan 2008, 00:19
Location: IL
Gender: Male

Next

Return to Miscellaneous MODs, Hacks and Downloads

Who is online

Users browsing this forum: Google [Bot] and 6 guests