[Release] Users Online In Past 60 Minutes

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! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
Brandons
I am too lazy to register

[Release] Users Online In Past 60 Minutes

Post by Brandons »

This Mod Won't Work Yet. Its Missing An Edit To includes/sessions.php

However I'm Stuck. Anyone Know What I Am Missing?

Code: Select all

################################################################# 
## Mod Title: Users Online In Past Hour 
## Mod Version: 1.0.0 
## Author: Brandon < Webmaster@DcTalkFans.com > - 
## Description: This Mod Will Change The Users Online At The Bottom of The Index Page From 5 Minutes To 1 Hour
## 
## Installation Level: (Easy) 
## Installation Time: 5 Minutes
## Files To Edit: viewonline.php, language/lang_english/lang_main.php, sessions.php
## Included Files: (none) 
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
## Author Note: 
## Any notes you may want to pass along should go here. 
## (the phpBB Group Reserves The Right To Remove/Edit Author Notes, Should It Be Warranted) 
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewonline.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 300 ) . " 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 3600 ) . " 


# 
#-----[ FIND ]------------------------------------------ 
# 

OR u.user_session_time >= " . ( time() - 300 ) . " ) 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

OR u.user_session_time >= " . ( time() - 3600 ) . " ) 

# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Online_explain'] = "This data is based on users active over the past five minutes"; 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

$lang['Online_explain'] = "This data is based on users active over the past hour";

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
Last edited by Brandons on Sun May 12, 2002 6:01 am, edited 5 times in total.
User avatar
Brewjah
Registered User
Posts: 265
Joined: Sun Mar 10, 2002 5:37 pm
Location: I think im lost..
Contact:

Post by Brewjah »

Could you edit the above post to use the MOD Template please, thnx

- Brewjah
Filling in that ugly white noise with a bunch of black static..
Brandons
I am too lazy to register

Done

Post by Brandons »

Done. Sorry About That :wink:
User avatar
Brewjah
Registered User
Posts: 265
Joined: Sun Mar 10, 2002 5:37 pm
Location: I think im lost..
Contact:

Post by Brewjah »

Filling in that ugly white noise with a bunch of black static..
Brandons
I am too lazy to register

bump

Post by Brandons »

Alright. Fixed Again. Still Need To Make Changes To Sessions.php.

Anyone know what changes would need to be made to that file?
User avatar
Brian_N
Registered User
Posts: 5
Joined: Thu May 09, 2002 5:25 am

Post by Brian_N »

Brandons, are you sure it works fine ?
I need this MOD!

:roll:
Brandons
I am too lazy to register

Re: [Beta] Users Online In Past 60 Minutes

Post by Brandons »

Brandons wrote: This Mod Won't Work Yet. Its Missing An Edit To includes/sessions.php

However I'm Stuck. Anyone Know What I Am Missing?



No It Doesn't Work Yet. I Stated That.
The Past Few Posts Refer To The Setup of The Mod Is All And How It Was Posted In These Forums.

It turns out you dont have to change sessions.php

Go to the config file in your admin area and change the session time to 3600.. then make the above mod changes & let me know if it works for you..
User avatar
Brian_N
Registered User
Posts: 5
Joined: Thu May 09, 2002 5:25 am

Post by Brian_N »

Brandons, still not work :( :(
maybe you need edit more files

BN
R. U. Serious
Registered User
Posts: 830
Joined: Mon Feb 11, 2002 2:07 pm

Post by R. U. Serious »

Brian_N, in another Thread you were asking how to change the 5 min who is online time to something different. It was closed with a direstion to this thread, so...

Have a look at this Thread, I hope this answers your question:
[Answered] How Do I Change....
Niels Chr. Denmark
Registered User
Posts: 1320
Joined: Thu Jan 10, 2002 1:00 pm
Contact:

Post by Niels Chr. Denmark »

You can ofcouse contiue this mod, but it sounds like you having some truble, if any help. then you can install/look at my "last visit mod"
it will record when users last vist, and display the users who have visited the last day, this can rather simple be changed to 60 minuttes

in page_header.php

Code: Select all

[FIND]
$sql = 'SELECT user_id,username,user_allow_viewonline,user_level FROM ' . USERS_TABLE . ' WHERE user_lastlogon >= '.$timetoday.' AND user_lastlogon< '.($timetoday+86399).' ORDER BY username'; 

[REPLACE WITH]
$timenow=time();
$sql = 'SELECT user_id,username,user_allow_viewonline,user_level FROM ' . USERS_TABLE . ' WHERE user_lastlogon >= '.($timenow-3600).' AND user_lastlogon<= '.$timenow.' ORDER BY username'; 

also change the lang_main.php
$lang['Users_today_explain'] = "The following %d users have visited the board today."; 

to something like
$lang['Users_today_explain'] = "The following %d users have visited the board the last hour."; 
Brandons
I am too lazy to register

Full Completed Mod

Post by Brandons »

Here Is A Completed Working Version of This Mod.
Its Been Tested. However If You Have Problems Give A Reply Post.

Code: Select all

################################################################# 
## Mod Title: Users Online In Past Hour 
## Mod Version: 1.0.0 
## Author: Brandon < Webmaster@DcTalkFans.com > - 
## Description: This Mod Will Change The Users Online At The Bottom of The Index Page From 5 Minutes To 1 Hour.
## 
## Installation Level: (Easy) 
## Installation Time: 5 Minutes
## Files To Edit: viewonline.php, language/lang_english/lang_main.php, includes/page_header.php, admin/index.php
## Included Files: (none needed) 
################################################################# 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
################################################################# 
## 
## Author Note: 
## If You Want It To Show Users In The Past 30 Minutes.. Or Past 5 Hours Simply Change The "3600" seconds (an hour) To Whatever Amount of Time You Wish.
## 
## 
################################################################# 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
################################################################# 

# 
#-----[ OPEN ]------------------------------------------ 
# 

viewonline.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 300 ) . " 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 3600 ) . " 


# 
#-----[ FIND ]------------------------------------------ 
# 

OR u.user_session_time >= " . ( time() - 300 ) . " ) 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

OR u.user_session_time >= " . ( time() - 3600 ) . " ) 

# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php 

# 
#-----[ FIND ]------------------------------------------ 
# 

$lang['Online_explain'] = "This data is based on users active over the past five minutes"; 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

$lang['Online_explain'] = "This data is based on users active over the past hour";

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/page_header.php


# 
#-----[ FIND ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 300 ) . " 
OR u.user_session_time >= " . ( time() - 300 ) . " )


# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

AND ( s.session_time >= ".( time() - 3600 ) . " 
OR u.user_session_time >= " . ( time() - 3600 ) . " )


# 
#-----[ OPEN ]------------------------------------------ 
# 

open admin/index.php


# 
#-----[ FIND ]------------------------------------------ 
# 

WHERE session_logged_in = 0
AND session_time >= " . ( time() - 300 ) . "


# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

WHERE session_logged_in = 0
AND session_time >= " . ( time() - 3600 ) . "


# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM
msibm
Registered User
Posts: 143
Joined: Sat Aug 24, 2002 11:35 am
Location: China
Contact:

Post by msibm »

Thanks :P
msibm
Registered User
Posts: 143
Joined: Sat Aug 24, 2002 11:35 am
Location: China
Contact:

Re: Full Completed Mod

Post by msibm »

Brandons wrote: Here Is A Completed Working Version of This Mod.
Its Been Tested. However If You Have Problems Give A Reply Post


It seems can not apply in 2.0.8a.
User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post by smithy_dll »

Locked under this document. Details for reclaiming the thread are within.
Systems Engineering
Locked

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