PDA

View Full Version : Users currently viewing this thread based on usergroup


EvanAbagail
02-11-2015, 10:42 PM
Hello,

I want to make it so only certain usergroups can view who is currently browsing a thread. Preferably, it'd also be nice if this was applicable to certain forums only, how-ever this isn't needed.

Are there any modifications that can do this? Thanks!

SaN-DeeP
02-12-2015, 06:06 PM
Not sure if a modification as per your request exists.. (not at majority/maximum require this)

But 100% doable.. probably find the right coder..
It seems vb.org is not yet dead (as per statements from many other sites)..

VB.ORG is still very active..

EvanAbagail
02-12-2015, 07:10 PM
Where can I make such a request for FREE?(I'd be able to offer a free cents, nothing more for one modification).

ozzy47
02-12-2015, 07:47 PM
Where are you talking to restrict this display, on forumdisplay.php or showthread.php

EvanAbagail
02-12-2015, 10:39 PM
Well it'd be optimal for BOTH if possible. So maybe something like having the option to set certain usergroups for specific forum boards.

kh99
02-13-2015, 07:31 PM
You could create a plugin using hook location showthread_start and this code:
$stu_usergroups = array(5, 6, 7); // usergroupis who will see "users browsing this thread"
$stu_forums = array(5); // forum id to show "users browsing this thread"

if (is_member_of($vbulletin->userinfo, $stu_usergroups) AND in_array($forumid, $stu_forums))
{
$vbulletin->options['showthreadusers']=1; // 1=alphabetical all visitors,
// 2=random order all visitors,
// 3=alphabetical registered members only
// 4=random order registered members only
}


where you'd have to edit the $stu_usergroups and $stu_forums arrays as needed, and you can also change the '1' to whichever type of display you want, as noted in the comments.

You could copy the entire block of code as many times as you needed (select it, copy it, and paste it at the end), if you want to allow different groups to see the display in different forums.

EvanAbagail
02-14-2015, 12:11 AM
How would I put this together to form a product? Can you compile it into a script for me please? Or is it just something going in showthread.php?

Elite_360_
02-14-2015, 12:39 AM
i can make a mod for you

--------------- Added 1423895374 at 1423895374 ---------------

Well the mod is finish i will upload it tomorrow and post the link to the mod here.

kh99
02-14-2015, 11:05 AM
How would I put this together to form a product? Can you compile it into a script for me please? Or is it just something going in showthread.php?

It's a plugin, so you'd go to Plugins & Products and Add New Plugin. I thought about making a full product, but it would be a little difficult to have more than one set of groups/forums so I thought this might be OK. Also, there's usually someone else willing to make it into product :).

Elite_360_
02-14-2015, 09:44 PM
here is the link to that mod e360 Usergroup Forum Permissions for Users Browsing Forums & Threads (https://vborg.vbsupport.ru/showthread.php?t=317335)

EvanAbagail
02-15-2015, 01:05 AM
Wow thanks brother! I really apprechiate you made it for me.

alcazarx
02-16-2015, 01:32 PM
Hm, can someone explain an old man why this "option" would be needed?
<- Knows only the standard "on" or "off" setting (no matter the forum script used), and got along with it over the years, so dont see any sense why to restrict it per group.
Its nothing serious or security issue to see whos reading a thread.
No offense.
Thanks.

kh99
02-16-2015, 07:22 PM
Well, only EvanAbagail can say why it was requested, but I could speculate that some people just feel it's a privacy thing (maybe you don't want someone knowing which threads you read on a forum), or it could be an issue with performance since it probably takes some resources to calculate that.

Elite_360_
02-16-2015, 11:50 PM
Its not going to get any better performance since it will run the query if they can see it or not. I'm doing an If Else Statements if they have the permissions $show['value'] will equal true else false.

--------------- Added 1424139051 at 1424139051 ---------------

I might rewrite it so it will not run the query unless their in the usergroup that can view.

--------------- Added 1424140687 at 1424140687 ---------------

1.0.2 has better performance it will not run a query for user viewing forum or thread if they don't have the usergroup permissions

EvanAbagail
02-18-2015, 02:37 PM
As aferomentioned, I want to be able to restrict the information to administrative / moderator usergroups. I do not wish regular / standard members to be able to see such information.