MyBB Community Forums

Full Version: Hide "last visit" ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I do this?
Heloo there
if you mean the last visit which appears in the user's profile, then pls in the member templates > member_profile

find and remove

 <tr>
<td class="trow2"><strong>$lang->lastvisit</strong></td>
<td class="trow2">$memlastvisitdate $memlastvisittime</td>
</tr>
Thanks!

But is it also possible to hide this only for admins, and show it for other people?
Revert the template modification zaher suggested and open the file member.php.

Search for:
PHP Code:
    if($memprofile['lastvisit'])
    {
        
$memlastvisitdate mydate($mybb->settings['dateformat'], $memprofile['lastvisit']);
        
$memlastvisitsep ', ';
        
$memlastvisittime mydate($mybb->settings['timeformat'], $memprofile['lastvisit']);
    } 
Replace with:
PHP Code:
    if($memprofile['lastvisit'])
    {
    
����if($mybb->user['usergroup'] == "4")
    
����{
    
����$memlastvisitdate "N/A";
        
$memlastvisitsep ', ';
        
$memlastvisittime "N/A";
��������}
��������else
��������
{
        
$memlastvisitdate mydate($mybb->settings['dateformat'], $memprofile['lastvisit']);
        
$memlastvisitsep ', ';
        
$memlastvisittime mydate($mybb->settings['timeformat'], $memprofile['lastvisit']);
        }
    } 
Thanks to both of you guys.
Micheal suggestion will leave the row of last visit, and will show N/A instead of the date. use this one as it removes the whole row when the user is an admin, and display it as it is when a user isn't an admin. find

if($memprofile['lastvisit'])
{
$memlastvisitdate = mydate($mybb->settings['dateformat'], $memprofile['lastvisit']);
$memlastvisitsep = ', ';
$memlastvisittime = mydate($mybb->settings['timeformat'], $memprofile['lastvisit']);
}
Replace with:
if($memprofile['lastvisit'])
	{
			if($mybb -> user [ 'usergroup' ] != 4)
			{
				$memlastvisitdate = mydate($mybb->settings['dateformat'], $memprofile['lastvisit']);
				$memlastvisitsep = ', ';
				$memlastvisittime = mydate($mybb->settings['timeformat'], $memprofile['lastvisit']);
				$lastvisit = "<tr><td class=\"trow2\"><strong>$lang->lastvisit</strong></td><td class=\"trow2\">$memlastvisitdate $memlastvisittime</td></tr>";
			} else {
				$lastvisit = '';
			}
	}

then in the template i have mentioned before , replace the code i asked to delete with $lastvisit

regards