![]() |
sidebar block
I would like to have sidebar block "Visiting Members" That shows the visiting members for X amount of days
What is the code I would put in the content box to accomplish this. As always Thank you in advance! |
1 Attachment(s)
Here is how I set it up on my local dev site:
https://vborg.vbsupport.ru/attachmen...1&d=1449301635 And this is the PHP code I wrote: PHP Code:
https://vborg.vbsupport.ru/attachmen...1&d=1449301765 Each username is shown with their usergroup HTML markup in a bulleted list, and each username links to their profile, with a tooltip showing their last visit time. :) Please give this a try, and let me know of any changes you would like. |
gave me : 406 Not Acceptable
when i tried to save it... |
Quote:
Unfortunately, I cannot duplicate the error, it works fine on both my local and online dev sites. |
so id server issue or I should try to
refresh the blocks clear the cache and do again? Thank you for your hard work... I think will be helpful for a lot of people |
Quote:
What I suggest doing is creating a new thread, where the title indicates you are getting a 406 error when trying to save a forum block, and this will be more likely to get you some help rather than to trust that someone who knows how to fix it will stumble across this thread. :D |
Thank you again MarK...the code is a huge help and others will use too i am sure
Happy Holidays |
Cool tips Mark!
Your codes can be edited a bit to make a block on right sidebar that show users online last 24 hours...instead of showing at the bottom of homepage. |
Mark, is there a way to make it so it doesn't show banned members? All but a few of the listed visitors are spammers that got banned. I'd prefer not to show those.
|
Quote:
PHP Code:
|
Mark sorry to highjack this thread ...but how about to show only 1 usergroup even if they belong to a secondary usergroup?
|
Quote:
Code:
$users_visited = $vbulletin->db->query_read(" |
Quote:
|
Quote:
|
Quote:
:up::up::up: |
I wasn't paying attention and just put in the change you made to weed out banned members. It gave me a server error. Had one of those DOH moments. When I replaced the old with the new in its entirety, it worked as advertised. Now all that shows is me and the supermod and the folks that just signed up for S&G.
Thanks again. If I could program like you my Arduino wouldn't be sitting on my desk gathering dust. |
Quote:
|
Quote:
--------------- Added [DATE]1451590749[/DATE] at [TIME]1451590749[/TIME] --------------- Quote:
PHP Code:
PHP Code:
This will list all users currently online who are a member of the selected usergroupid, and list them in descending order by the time of their last activity. I should also add, that if you wish to use multiple groupids (and have user avatars displayed), I recommend checking out Joe's (BirdOPrey5) product here: Current Staff Online Forum Sideblock and CMS Widget by BOP5 |
Quote:
--------------- Added [DATE]1451683913[/DATE] at [TIME]1451683913[/TIME] --------------- Mark ..is it possible to edit this so that when there is only one member of said group it says "1 Officer Online" when there is only one member (Officer) instead of "1 Officers Online" --------------- Added [DATE]1451685439[/DATE] at [TIME]1451685439[/TIME] --------------- Ooops ...nevermind Mark ...this doesn't work with for additional usergroups .... it will only display members of the primary usergroup .... can this be modified to show members if they also have the groupid as the additional usergroup? --------------- Added [DATE]1451685565[/DATE] at [TIME]1451685565[/TIME] --------------- Or allow to do an array of group ids? --------------- Added [DATE]1451692168[/DATE] at [TIME]1451692168[/TIME] --------------- Bummer !!! This works but for some reason it works for some of the members and not others ... at one point it listed one member 10 times ... --------------- Added [DATE]1451692371[/DATE] at [TIME]1451692371[/TIME] --------------- This is what is happening: https://vborg.vbsupport.ru/external/2016/01/24.jpg |
I did not realize there were new posts in this thread because of doublepost merges. Sorry about that. To allow multiple usergroups and to prevent repetition, try this (of course edit the $groupid/$groupname definitions):
PHP Code:
|
Ok good this works, just one small bug .... it still shows one member active from 5 hours ago who is a test account ....
--------------- Added [DATE]1451768165[/DATE] at [TIME]1451768165[/TIME] --------------- Any update on this Mark as to why it will still show someone logged in from 5,10 and 20 hours ago? I did notice though that in order for this to consider someone active they have to actually execute something like post a comment, like a comment not just be logged on .... What other options are there for this, can this display members who are just logged on period? And does it also detect logged in users from Tapatalk? I see that there are members who are online logged in but through tapatalk but are not being displayed on this sidebar block .... Thank you ahead of time Mark !!! |
Quote:
|
Ok good stuff my Man .... thank again !!!!
|
Okay, add the following line before the query:
PHP Code:
PHP Code:
|
Where exactly do I add
PHP Code:
|
Quote:
This is what I now have: PHP Code:
|
All times are GMT. The time now is 02:23 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|