Author |
Message |
t_henson
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Feb 02, 2007
Posts: 65
Location: Cincinnati, Ohio
|
Posted:
Wed Feb 07, 2007 2:49 pm |
|
im trying to find out how i can retrieve the users last visit time, and also the users total post count. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
montego
Site Admin
![](modules/Forums/images/avatars/0c0adf824792d6d341ef4.gif)
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Wed Feb 07, 2007 5:53 pm |
|
These are on the nuke_users table as properties user_posts and user_lastvisit. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
Former Moderator in Good Standing
![](modules/Forums/images/avatars/0cd76dcf45da5de2cf864.jpg)
Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Wed Feb 07, 2007 6:10 pm |
|
Be aware that user_lastvisit is apparently only updated when the user visits the phpBB forums. I was going to write a script to delete members who stopped visiting the site after x months, and was going to use that field. But then a member who submits news stories on a regular basis came up on the list of people to delete. After scratching my head for a while, I determined that was something that was added for phpBB. Nuke doesn't really use it. Maybe that is good enough for what you want though. |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
gotcha
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/blank.gif)
Joined: Mar 14, 2005
Posts: 91
|
Posted:
Thu Feb 08, 2007 4:26 pm |
|
That would be useful to have it work throughout the whole site.
Could probably do this by adding something like this to the header.php
Code:
if (is_user($user) && $name != 'Forums')
{
$cookie = cookiedecode($user);
$user_id = intval($cookie[0]);
$sql = "UPDATE ".$user_prefix."_users SET user_lastvisit='".time()."' WHERE user_id='$user_id'";
if (!$db->sql_query($sql))
{
// error updating
}
}
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
Former Moderator in Good Standing
![](modules/Forums/images/avatars/803d73f6452557b947721.jpg)
Joined: Apr 30, 2004
Posts: 3221
|
Posted:
Thu Feb 08, 2007 10:30 pm |
|
Note that this could affect the usage of the forums, as phpBB uses that to determine which posts it counts as "new" |
_________________ - Only registered users can see links on this board! Get registered or login! -
Need help? Only registered users can see links on this board! Get registered or login! |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
gotcha
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Thu Feb 08, 2007 11:37 pm |
|
Probably be best to just add a new field then ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
evaders99
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Sun Feb 11, 2007 10:14 pm |
|
If you're looking for code to use, Protector used a field called 'last_seen_blocker' which stored the last seen time as a timestamp. That's what I use for some of my scripts |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
t_henson
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Feb 12, 2007 3:46 pm |
|
well my site basically revolves around the forums, so user_lastvisit will work fine for me. but im still new to php, and i was wondering how i go about getting the user_posts and user_lastvisit properties from the nuke_users table.
i just want to add on to the user info block to say:
last visit: last visit date here
total post: total post count here
sorry for being a newb lol. thanks guys. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
t_henson
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 13, 2007 4:12 am |
|
okay with some patience i got it figured out, but the user_lastvisit shows up like 1171318172. any ideas? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Gremmie
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 13, 2007 9:40 am |
|
It is a unix timestamp (basically the number of seconds since an epoch date). There are many PHP functions that accept timestamps and do math on them. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
t_henson
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Feb 13, 2007 1:47 pm |
|
okay i got it all figured out. thanks for the help everyone. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
myrtletrees
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/44fbb573445a9d36e3110.jpg)
Joined: Sep 13, 2005
Posts: 259
Location: Cornfields of Indiana
|
Posted:
Tue Apr 17, 2007 9:29 am |
|
t_henson wrote: | okay i got it all figured out. thanks for the help everyone. |
care to share?
Also, I noticed your Gallery is not working on your website. Just an FYI... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|