UBB.Dev
Posted By: Pilgrim Show Users Last on Time - 02/01/2009 3:29 AM
This mod was first introduced by Zachary and issued by Josh Pet %20Show%20Uses's%20las.html#Post276144]here.

Has this hack been done for 7.4.x? If not, it would be one which I would appreciate seeing again. It allows Admins and Mods to see the last time a member was online when viewing their profile.
Posted By: AKD96 Re: Show Users Last on Time - 02/01/2009 5:59 AM
This one's easy enough.

In showprofile.inc.php

Find:
PHP Code
t2.USER_AIM,t2.USER_SIGNATURE,t2.USER_MOOD 
Replace with:
PHP Code
t2.USER_AIM,t2.USER_SIGNATURE,t2.USER_MOOD,t3.USER_LAST_VISIT_TIME 

Find:
PHP Code

{$config['TABLE_PREFIX']}USER_PROFILE as t2
WHERE t1
.USER_ID = ?
AND
t1.USER_ID = t2.USER_ID
Replace with:
PHP Code

{$config['TABLE_PREFIX']}USER_PROFILE as t2,
{
$config['TABLE_PREFIX']}USER_DATA as t3
WHERE t1
.USER_ID = ?
AND
t1.USER_ID = t2.USER_ID
AND t1.USER_ID = t3.USER_ID

Find:
PHP Code
$Signature,$mood) = $dbh -> fetch_array($sth); 
Replace with:
PHP Code
$Signature,$mood,$lastvisit) = $dbh -> fetch_array($sth); 

Find:
PHP Code

$date
= $html -> convert_time($Registered,$toffset,$user['USER_TIME_FORMAT']);
Add after:
PHP Code

$datelastvisit
= $html -> convert_time($lastvisit,$toffset,$user['USER_TIME_FORMAT']);

Find:
PHP Code

"date" => $date,
Add after:
PHP Code

"datelastvisit" => $datelastvisit,


In showprofile.php in your languages folder

Find:
PHP Code
$ubbt_lang['REGGED_ON'] = "Registered on"; 
Add after:
PHP Code
$ubbt_lang['LAST_VISIT'] = "Last Visited"; 


In showprofile.tpl

Find:
PHP Code

<tr>
<
td>
<
b>{$lang.REGGED_ON}:</b>
</
td>
<
td>
&
nbsp; {$date} &nbsp;
</
td>
</
tr>
Add after:
PHP Code

<tr>
<
td>
<
b>{$lang.LAST_VISIT}:</b>
</
td>
<
td>
&
nbsp; {$datelastvisit} &nbsp;
</
td>
</
tr>

Voila! This will show everyone that can view profiles when the person was on last. Tested and working on 7.4.2. Enjoy!
Posted By: Gizmo Re: Show Users Last on Time - 02/01/2009 9:30 AM
Heres where I make the comment that modifying the stock code of your UBB install makes it unsupportable through official channels :x...
Posted By: Pilgrim Re: Show Users Last on Time - 02/01/2009 4:35 PM
[Linked Image]
Posted By: AKD96 Re: Show Users Last on Time - 02/01/2009 4:56 PM
Mee voyd warinteez! crazy

You're welcome Pilgrim. smile
Posted By: AKD96 Re: Show Users Last on Time - 02/02/2009 4:57 AM
I put it all in a nifty text file and posted it here.
Posted By: Pilgrim Re: Show Users Last on Time - 02/10/2009 9:53 PM
Just thought I'd say "Thanks!" here too for providing this once again. It works great. [Linked Image]
© UBB.Developers