MyBB Community Forums

Full Version: Hide Last Visit on Members List?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some of my posters like to browse my forum in invisible mode, but:

1) Their profiles still show when they were last online.
2) The member list still shows when they were last online.

I've installed the "Hide Last Visit for Invisible Users" plugin by AJS to address the first issue. I'm still looking for a fix for the second issue, though.

Right now I have my members list disabled completely, but that's not ideal.

[Image: memberslistlastvisit.jpg]

Is there a way I can have "Last Visit" show up as "N/A" for invisible users?

Failing that, how can I remove the "Last Visit" column entirely?
most probably it is fixed in myBB 1.6.5 AND it will be available in a couple of weeks ...

AND in meanwhile code similar to following may be removed from member_profile template

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

on memberlist template find codes similar to below & remove ...

<td class="tcat" width="15%" align="center"><span class="smalltext"><strong>{$lang->lastvisit}</strong></span></td>

<option value="lastvisit"{$sort_selected['lastvisit']}>{$lang->sort_by_lastvisit}</option>

on memberlist_user template , remove code similar to below
<td class="{$alt_bg}" align="center">{$user['lastvisit']}</td>

you may also have to adjust the colspan / column widths ...
Sama34, that's the plugin I already have installed. It doesn't change the Members List.

Thanks ranjani. I didn't realize 1.6.5 is coming out so soon - I guess I'll just wait. Smile
Nothing will change regards this is 1.6.5 - I've been meaning to update my plugin with this for a while but for now you can edit memberlist.php if you like.

Find:
		$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
Replace with:
		if($user['invisible'] == 1  && $mybb->user['usergroup'] != 4)
		{
			$user['lastvisit'] = "N/A";
		}
		else
		{
			$user['lastvisit'] = my_date($mybb->settings['dateformat'], $user['lastactive']).", ".my_date($mybb->settings['timeformat'], $user['lastactive']);
		}

Thanks AJS! Smile
Hi,

I'm sorry to bump such an old thread, but I'm trying to replace the code as per Alan Shepperson's post and am getting this error:

Quote:Parse error: syntax error, unexpected T_STRING in .../memberlist.php on line 353

Any idea what the problem could be?