MyBB Community Forums

Full Version: Show Last active (last logged in) in postbit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hi,
is there any easy way how to show "Last active (last logged in)" information in the postbit template under the avatar? Thank you
You could try this?

<td width="15%" class="{$bgcolor}">{$user['lastvisit']}</td>
I tried, but no output
I think this needs a plugin, one that correctly hooks to the postbit.

Actually, you could try it like this:


Postbit Classic

{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<div class="post classic post{$usergroup['gid']} {$unapproved_shade}" style="{$post_visibility}" id="post_{$post['pid']}">
<div class="post_author scaleimages">
	{$post['useravatar']}
	<div class="author_information">
			<strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
			<span class="smalltext">
				{$post['usertitle']}<br />
				{$post['userstars']}
				{$post['groupimage']}

				<script>
					var timestamp = {$post['lastvisit']}; // replace your timestamp
var date = new Date(timestamp * 1000);
var formattedDate = ('0' + date.getDate()).slice(-2) + '/' + ('0' + (date.getMonth() + 1)).slice(-2) + '/' + date.getFullYear() + ' ' + ('0' + date.getHours()).slice(-2) + ':' + ('0' + date.getMinutes()).slice(-2);

				</script>

			</span>
	</div>
	<div class="author_statistics">
		{$post['user_details']}<br/><script>document.write(formattedDate);</script>
	</div>
</div>
<div class="post_content">
	<div class="post_head">
		{$post['posturl']}
		{$post['icon']}
		<span class="post_date">{$post['postdate']} <span class="post_edit" id="edited_by_{$post['pid']}">{$post['editedmsg']}</span></span>
	{$post['subject_extra']}
	</div>
	<div class="post_body scaleimages" id="pid_{$post['pid']}">
		{$post['message']}
	</div>
	{$post['attachments']}
	{$post['signature']}
	<div class="post_meta" id="post_meta_{$post['pid']}">
		{$post['iplogged']}
	</div>
</div>
<div class="post_controls">
	<div class="postbit_buttons author_buttons float_left">
		{$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
	</div>
	<div class="postbit_buttons post_management_buttons float_right">
		{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quickrestore']}{$post['button_quote_fast']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_purgespammer']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
	</div>
</div>
</div>
Is there anybody who can make a simple plugin with hook for me? Thank you in advance! Thx to leefish, I will try Smile

Unfortunately it is not working Sad
Its only on classic and it worked for me. Did you copy the whole template?

[Image: hVqXE0L.jpg]
Oh, now it works fine! Can I show it only when the user is offline? I have a conditional plugin (I dont know it is proper name)
yea, wrap this bit :

<script>document.write(formattedDate);</script>

in your if statement.
Leefish - everything is fine except one thing:

When you wanna post a new reply in quick reply box and hit post button -> time is shown but nothing else, you have to hit f5 and then you are reconnected into topic with your reply
hm, that is why a plugin is better Smile
Pages: 1 2 3 4