Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 6 Months, 3 Weeks ago Show Last active (last logged in) in postbit
#11
Solved: 3 Years, 6 Months, 3 Weeks ago
I've made a small plugin for this - try it if you like:
=> https://github.com/SvePu/MyBB-Postbit-La...active.php

Only member of groupID 3,4,6 (supermods, admins, mods) can see the last active time.
I'm working on a better version with settings & lang support. Wink
Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#12
Solved: 3 Years, 6 Months, 3 Weeks ago
Try this:

{$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 myid = {$post['pid']};
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/>Last Active: <span id ="myDiv{$post['pid']}"></span><script>$("#myDiv"+myid).append(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>

Replaces document.write with jquery.append.

Thanks SvePu Smile A plugin is better,but I just wanted to play with the javascript Big Grin
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#13
Solved: 3 Years, 6 Months, 3 Weeks ago
To show it with JS is also a nice idea.

First official plugin release is now available on GitHub
=> https://github.com/SvePu/MyBB-Postbit-La...s/tag/v1.0
Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#14
Solved: 3 Years, 6 Months, 3 Weeks ago
Leefish, how did you get so good at this stuff?
Reply
#15
Solved: 3 Years, 6 Months, 3 Weeks ago
Guys, thank you very much! You are just amazing! Thank you for your time you spent because of my issue. I would like to have these knowledge in JS and PHP as you both have! Thx!

@SvePu - just one thing, I installed and activated your plugin. Set it to enable in ACP + selected groups who can view this... anyway I cannot see it in postbit - I checked and {$post['lastactive']} is added into templates. Is there anything wrong? Moreover, would you please add a setting for time format output into your plugin? Thank you!

EDIT2: Is possible to show ONLINE when the user is active in forum instead of last active time?
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#16
Solved: 3 Years, 6 Months, 3 Weeks ago
Dont you already have that in your theme? The green dot for online?
Random Fish and Sims Maniac
MY PLUGINS
Help MyBBSupport help you - remember to mark your threads as solved


Reply
#17
Solved: 3 Years, 6 Months, 3 Weeks ago
I made the plugin on this way that the variable "{$post['lastactive']}" is empty while the user is online.

In next version I'll integrate a time format settings option.

Quote:Is possible to show ONLINE when the user is active in forum instead of last active time?
For this you'll need another plugin. But MyBB has already a core function "Who's browsing in this forum".
Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#18
Solved: 3 Years, 6 Months, 3 Weeks ago
OK, so hide it when the user is online would be great. I cannot see any output from your plugin in postbit Sad even user is offline
[MyBB 1.8 Czech translation] [MyBB 1.8 plugins]: Prune old PMs + optimize DB plugin --- Thank you/like system
Reply
#19
Solved: 3 Years, 6 Months, 3 Weeks ago
Could you temporary allow output of plugin for all user groups please - I'll take a look on your forum.


EDIT:
I've tested it again and it works:
   
Greetings Sven (ps: Sorry for my bad english!!)

My plugins - [email protected]
Reply
#20
Solved: 3 Years, 6 Months, 3 Weeks ago
Does is_member take additional groups into account?
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)