phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

[BETA] Outside Sessions MOD


 
Search this topic... | Search MOD Development... | Search Box
Register or Login to Post    Index » MOD Development  Previous TopicPrint TopicNext Topic
Author Message
Ornette
Board Member



Joined: 16 Mar 2009

Posts: 37



PostPosted: Thu Mar 19, 2009 6:16 pm 
Post subject: Outside Sessions MOD

MOD Name: Outside Sessions MOD
Author: Ornette
MOD Description: Allows phpBB to better deal with authenticated pages external to the forum.

Inspired by: "Integrating phpBB into my site"
http://www.phpbb.com/community/viewtopic.php?f=35&t=578633

Ok this is an interesting one. I've rejigged sessions.php to stop the 'user_lastvisit' geting updated when a user views an authenticated page external to the forum (by checking for defined constant 'OUTSIDE_SESSION') - stopping new threads from being marked as read.

I've put in a bit of thought to this, and have inserted two new fields into the users table:
    user_lastvisit_site
    user_session_time_forum

I have also fixed an annoying 'bug' of phpBB that makes user_lastvisit reflect the moment a user logged out of a forum. If a user leaves a browser window open, and logs out say an hour later, the user will loose all unread post information for that hour! Now, 'user_lastvisit' will always reflect the time of the last true activity by the user on the forum.

Basically, I skip updating of user session information whenever in login.php. This only has negative effect of not showing a registered user as 'logging on' in the instance someone is logging into the ACP

I have also removed the 60 second delay of updating page changes, as per mods:



outside_sessions_0.1.0.zip
 Description:

Download
 Filename:  outside_sessions_0.1.0.zip
 Filesize:  3.32 KB
 Downloaded:  1035 Time(s)

Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Sun Mar 22, 2009 10:59 pm 
Post subject: Re: Outside Sessions MOD

This sounds interesting. I'll take a look at it soon. icon_smile.gif
_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Ornette
Board Member



Joined: 16 Mar 2009

Posts: 37



PostPosted: Tue Mar 24, 2009 4:06 pm 
Post subject: Re: Outside Sessions MOD

I must say, this whole mod is kinda made redundant if you have

keep unread flags
http://www.phpbb.com/community/viewtopic.php?t=309059

installed on your forum! Maybe I should improve the description

Its basically a simple way to improve the handling of "unread topics" on your forum, especially if you have a 'portal' that the user might visit without actually accessing the forum.

By making phpBB take note of when the user actually visited the forum rather than an external portal, the normal way of working out what threads the user might have seen is strengthened.

My approach to stop the updating of 'user_session_time' when a user logs out also helps with this - now logging out of forum is more akin to simply closing your browser and logging back on later.

I'm all for simple fixes to the phpBB system - the keep unread flags appears to be a very complex beast of a mod, where as this one is a very simple proceedural change to sessions.php. Not only, I kinda prefer the highlighting of threads based on 'user_lastvisit' - facing a forum full of marked unread threads is off-putting, in my opinion.
Back to top
Dog Cow
Board Member



Joined: 18 Nov 2008

Posts: 378


flag
PostPosted: Tue Mar 24, 2009 7:04 pm 
Post subject: Re: Outside Sessions MOD

I looked at this MOD, and it looks like the point of it is to update the user's last activity time only when browsing forum pages, such as viewforum, or viewtopic. Another timer is then created when the user is browsing pages still powered by phpBB, but aren't related to forum messages, such as an add-on gallery, or any other sort of page connected in with phpBB.
_________________
Moof!
Lincoln's Tomb, Oak Ridge Cemetery, Springfield IL Mac 512K Blog Mac GUI
Back to top
Ornette
Board Member



Joined: 16 Mar 2009

Posts: 37



PostPosted: Fri May 22, 2009 9:46 am 
Post subject: Re: Outside Sessions MOD

Small update to this mod

I noticed, that on return from session_pagestart(), the returned $userdata array always holds the details of the users previous page session!

So I updated this to hold current details. I also removed the outside session testcase



outside_sessions-0.1.2.txt
 Description:

Download
 Filename:  outside_sessions-0.1.2.txt
 Filesize:  7.62 KB
 Downloaded:  1262 Time(s)

Back to top
Murmur
Board Member



Joined: 20 Aug 2009

Posts: 57
Location: California


flag
PostPosted: Fri Oct 16, 2009 1:45 am 
Post subject: Re: Outside Sessions MOD

Ah...Bravo!

This was on the to-do for my CMS. Of course, it's still there. But now it reads "implement" rather than "write".

Thanks.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Development  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0319 seconds using 18 queries. (SQL 0.0031 Parse 0.0024 Other 0.0264)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo