Incorrect last visit date - Last Visit in Viewtopic
Incorrect last visit date
I love the idea of this mod, but the last visit date in view topic is incorrect. It doesnt display the same time as in the profile.
View topic = Last Visit: Today, 01:42
Profile = Last visited: less than a minute ago
It seems like it only works with users that isnt online.
-
- Registered User
- Posts: 1934
- Joined: Wed Feb 28, 2007 8:06 pm
- Contact:
Re: Incorrect last visit date
So it isn't necessarily incorrect it just doesn't take into account if a user is currently on the forum.
Appreciate the extensions/mods/support then buy me a beer
- RMcGirr83
- Former Team Member
- Posts: 22016
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
- Contact:
Re: Incorrect last visit date
-
- Registered User
- Posts: 85
- Joined: Tue Dec 28, 2010 4:06 pm
- Contact:
Re: Incorrect last visit date
Appreciate the extensions/mods/support then buy me a beer
- RMcGirr83
- Former Team Member
- Posts: 22016
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
- Contact:
Re: Incorrect last visit date
-
- Registered User
- Posts: 85
- Joined: Tue Dec 28, 2010 4:06 pm
- Contact:
Re: Incorrect last visit date
ALIENQuake wrote:Or this functionality will require massive rewrite of you mod ??
This
Appreciate the extensions/mods/support then buy me a beer
- RMcGirr83
- Former Team Member
- Posts: 22016
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
- Contact:
Re: Incorrect last visit date
-
- Registered User
- Posts: 85
- Joined: Tue Dec 28, 2010 4:06 pm
- Contact:
Re: Incorrect last visit date
Code: Select all
//-- BEGIN Last Visit in Viewtopic ------
'POSTER_LASTVISIT' => $user_cache[$poster_id]['online'] ? $user->lang['ONLINE'] : (!empty($user_cache[$poster_id]['lastvisit']) ? $user->format_date($user_cache[$poster_id]['lastvisit']) : ''),
//-- END Last Visit In Viewtopic ------
Appreciate the extensions/mods/support then buy me a beer
- RMcGirr83
- Former Team Member
- Posts: 22016
- Joined: Wed Jun 22, 2005 4:33 pm
- Location: Your display
- Name: Rich McGirr
- Contact:
Re: Incorrect last visit date
I create additional instruction to match different languages:
language\en\common.php
Find:
Code: Select all
'CURRENT_TIME' =>
Add after:
Code: Select all
'CURRENTLY_ONLINE' => 'User is online',
Find:
viewtopic.php
Find:
Code: Select all
//-- BEGIN Last Visit in Viewtopic ------
'POSTER_LASTVISIT' => ($poster_id != ANONYMOUS && $user_cache[$poster_id]['lastvisit']) ? $user->format_date($user_cache[$poster_id]['lastvisit']) : '',
//-- END Last Visit In Viewtopic ------
Replace to:
Code: Select all
//-- BEGIN Last Visit in Viewtopic ------
'POSTER_LASTVISIT' => $user_cache[$poster_id]['online'] ? $user->lang['CURRENTLY_ONLINE'] : (!empty($user_cache[$poster_id]['lastvisit']) ? $user->format_date($user_cache[$poster_id]['lastvisit']) : ''),
//-- END Last Visit In Viewtopic ------
It will be nice to include such improvement in you mod. Anyway thank you again
-
- Registered User
- Posts: 85
- Joined: Tue Dec 28, 2010 4:06 pm
- Contact:
Re: Incorrect last visit date
viewtopic.php
Find:
Code: Select all
'SELECT' => 'u.*, z.friend, z.foe, p.*',
Replace with:
Code: Select all
'SELECT' => 'u.*, z.friend, z.foe, p.*, (SELECT MAX(session_time) from ' . SESSIONS_TABLE . ' WHERE session_user_id = u.user_id) session_time',
Find:
Code: Select all
'lastvisit' => $row['user_lastvisit'],
Replace with:
Code: Select all
'lastvisit' => (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit'],
-
- Registered User
- Posts: 1
- Joined: Wed Mar 02, 2011 4:06 am
- Contact:
Re: Incorrect last visit date
JustinCasey wrote:Here's a better fix that makes it the same as the last visit time in the member profile page (in addition to the original modification).viewtopic.php
Find:Code: Select all
'SELECT' => 'u.*, z.friend, z.foe, p.*',
Replace with:Code: Select all
'SELECT' => 'u.*, z.friend, z.foe, p.*, (SELECT MAX(session_time) from ' . SESSIONS_TABLE . ' WHERE session_user_id = u.user_id) session_time',
Find:Code: Select all
'lastvisit' => $row['user_lastvisit'],
Replace with:Code: Select all
'lastvisit' => (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit'],
with this fix it shows users last visit time even if the user was hidden
can we add something to the above code to Not show the hidden users time?
thanks
edit:
for hidden users:
in viewtopic it shows
Last Visit: less than a minute ago
and in memberlist it shows
Last visited: -
how can i adjust the viewtopic to look like memberlist?
- nuke_q7
- Registered User
- Posts: 21
- Joined: Wed Mar 10, 2010 1:36 am
- Contact:
Re: Incorrect last visit date
ALIENQuake wrote:It's work ! Thank you very much !! Pure genius !
I create additional instruction to match different languages:language\en\common.php
Find:Code: Select all
'CURRENT_TIME' =>
Add after:Code: Select all
'CURRENTLY_ONLINE' => 'User is online',
Find:viewtopic.php
Find:Code: Select all
//-- BEGIN Last Visit in Viewtopic ------
'POSTER_LASTVISIT' => ($poster_id != ANONYMOUS && $user_cache[$poster_id]['lastvisit']) ? $user->format_date($user_cache[$poster_id]['lastvisit']) : '',
//-- END Last Visit In Viewtopic ------
Replace to:Code: Select all
//-- BEGIN Last Visit in Viewtopic ------
'POSTER_LASTVISIT' => $user_cache[$poster_id]['online'] ? $user->lang['CURRENTLY_ONLINE'] : (!empty($user_cache[$poster_id]['lastvisit']) ? $user->format_date($user_cache[$poster_id]['lastvisit']) : ''),
//-- END Last Visit In Viewtopic ------
It will be nice to include such improvement in you mod. Anyway thank you again
i had made this change, so i had put a little green circle for user online :
language\en\common.php
Code: Select all
'CURRENTLY_ONLINE' => '<img src="../test-on-2011/images/icon_user_online.png" title="User is online"/></a>',
i want to add also, a little red circle for user offline (icon_user_offline.png)
and add in a second line, the time of last visit
can you help me to add the image to the format date
thanks a lot
-
- Registered User
- Posts: 180
- Joined: Sun Jul 25, 2010 3:36 am
- Contact:
Re: Incorrect last visit date
-
- Registered User
- Posts: 180
- Joined: Sun Jul 25, 2010 3:36 am
- Contact:
-
- Registered User
- Posts: 180
- Joined: Sun Jul 25, 2010 3:36 am
- Contact: