MyBB Community Forums
Show Last active (last logged in) in postbit - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: Show Last active (last logged in) in postbit (/thread-185830.html)

Pages: 1 2 3 4


Show Last active (last logged in) in postbit - Eldenroot - 10-29-2015

Hi,
is there any easy way how to show "Last active (last logged in)" information in the postbit template under the avatar? Thank you


RE: Show Last active (last logged in) in postbit - Zaneman122 - 10-29-2015

You could try this?

<td width="15%" class="{$bgcolor}">{$user['lastvisit']}</td>



RE: Show Last active (last logged in) in postbit - Eldenroot - 10-30-2015

I tried, but no output


RE: Show Last active (last logged in) in postbit - Leefish - 10-30-2015

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>



RE: Show Last active (last logged in) in postbit - Eldenroot - 10-30-2015

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


RE: Show Last active (last logged in) in postbit - Leefish - 10-30-2015

Its only on classic and it worked for me. Did you copy the whole template?

[Image: hVqXE0L.jpg]


RE: Show Last active (last logged in) in postbit - Eldenroot - 10-30-2015

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)


RE: Show Last active (last logged in) in postbit - Leefish - 10-30-2015

yea, wrap this bit :

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

in your if statement.


RE: Show Last active (last logged in) in postbit - Eldenroot - 10-30-2015

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


RE: Show Last active (last logged in) in postbit - Leefish - 10-30-2015

hm, that is why a plugin is better Smile