Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 11 Months, 2 Weeks ago Show Last active (last logged in) in postbit
#1
Solved: 3 Years, 11 Months, 2 Weeks ago Question 
Hi,
is there any easy way how to show "Last active (last logged in)" information in the postbit template under the avatar? Thank you
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#2
Solved: 3 Years, 11 Months, 2 Weeks ago
You could try this?

<td width="15%" class="{$bgcolor}">{$user['lastvisit']}</td>
Reply
#3
Solved: 3 Years, 11 Months, 2 Weeks ago
I tried, but no output
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#4
Solved: 3 Years, 11 Months, 2 Weeks ago
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>
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#5
Solved: 3 Years, 11 Months, 2 Weeks ago
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
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#6
Solved: 3 Years, 11 Months, 2 Weeks ago
Its only on classic and it worked for me. Did you copy the whole template?

[Image: hVqXE0L.jpg]
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#7
Solved: 3 Years, 11 Months, 2 Weeks ago
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)
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#8
Solved: 3 Years, 11 Months, 2 Weeks ago
yea, wrap this bit :

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

in your if statement.
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#9
Solved: 3 Years, 11 Months, 2 Weeks ago
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
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#10
Solved: 3 Years, 11 Months, 2 Weeks ago
hm, that is why a plugin is better Smile
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)