Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x
Author Message
wap-2-go
New Member
New Member



Joined: Mar 25, 2009
Posts: 1

PostPosted: Thu Oct 18, 2012 1:38 pm Reply with quote

Ever since the (dark) days of standard PHP-Nuke I've noticed that the "Last Visit" field in "Your_Account" module has never functioned correctly (am I alone here?).

Apologies if I've posted this in the wrong place (please move this thread if necessary), but I have not managed to find a similar topic/discussion any where else - or anywhere that fits the 'fixes' bill for RN 2.5x.

Please find the simple fix included below...

FILE: /modules/Your_Account/public/userinfo.php Line 248

Code:
        echo '<tr><td width="30%" align="left">' . _YA_LASTVISIT . '</td><td width="70%" align="left"><strong>' . $usrinfo['lastsitevisit'] . '</strong></td></tr>' ;

Replace with:
Code:
        echo '<tr><td width="30%" align="left">' . _YA_LASTVISIT . '</td><td width="70%" align="left"><strong>' . date('D, j M \'y \a\t G:i', $usrinfo['user_lastvisit']) . '</strong></td></tr>' ;


I have formatted the above to display in my own chosen format (e.g. Thu, 18 Oct '12 at 20:34), but you can modify the date format to whatever you fancy using the standard php date() formatting options.


The above value is taken from the _users table field users_lastvisit, which I believe is only updated on visits to the Forum - I am going to check this as my personal preference is for any login to be recorded so that you can quickly identify the last date any individual user has accessed/logged into your CMS.

Hope the above is helpful to someone else - very simple, maybe a fix to be incorporated into a forthcoming update?

Regards,

Phil
 
View user's profile Send private message
neralex
Site Admin



Joined: Aug 22, 2007
Posts: 1772

PostPosted: Thu Oct 18, 2012 2:58 pm Reply with quote

I haven't this issue. In all my installations with RN25 is all fine with this file... and i have the constant _YA_LASTVISIT in line 201. Above that line is the date definition.
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Nov 09, 2012 7:55 am Reply with quote

Thanks for posting this. I have been meaning to verify (or refute) this but just haven't had the time.

Quote:
The above value is taken from the _users table field users_lastvisit, which I believe is only updated on visits to the Forum -


I was concerned because I was considering deleting users who hadn't visited in years and if the statistic was wrong (many of my users never visit the forums at all) I could cause damage.

So, on a localhost system I changed the password on a normal user account and logged in after noting the value of lastsitevisit in the users table. No visit to Forums involved. The value was updated. Moreover it continued to be updated as I moved through the system using her account.

Doing a global search on "lastsitevisit" in my editor I found that there is an update statement in /includes/mainfileend.php. And that file is automatically included when mainfile executes ... which is on every page load by every user. So it looks like we can rely on lastsitevisit to be an accurate indicator of when a person last used the system.
 
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> RavenNuke(tm) v2.5x

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©