The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Widget display to certain usergroups only
I have searched but I cannot seem to find the mod I am looking for.
At the moment, if a widget is created it is displayed to every usergroup. You cannot change this. I want to be able to restrict the widget to certain usergroups (in my case: [if guest] display widget [if not] do not display widget) Surely this is a simple thing to do? Isn't there some code I can add somewhere?? Can anyone give me advice/the correct code on how to do this? All help greatly appreciated! Thanks! |
#2
|
|||
|
|||
bump
|
#3
|
||||
|
||||
Just use your own template (enter it in the configure screen) and put a condition around it so it only shows to guests (or whoever).
|
#4
|
|||
|
|||
Thanks for your answer Lynne!
Can you help me out with the code however? I'd like to do the following if possible: - Let me just briefly explain what the widget is so you understand my intentions. It is a HTML widget that displays an image and text that prompts guests to register. - I'd like to display it ONLY to the guest usergroup - When logged in, the content should change to a prompt (again custom text/image in html form) that prompts regular users to upgrade to a paid subscription - If the user is already in the paid subscription usergroup the widget shouldn't display. Is that possible? I'm thinking something like: "if usergroup (guest_usergroup_id) display <CODE>; if usergroup (all_usergoups_except_guest) display <CODE>; if usergroup (subscribed_usergroup_id) hide" I don't know much about php/the inner workings of vBulletin so I hope that makes sense and something similar can be achieved. If not possible, I suppose I'd just create 2 SEPERATE widgets: - The register prompt widget: displays only to guests - The upgrade account prompt: displays all groups apart from the subcribed group Thanks for your help so far |
#5
|
||||
|
||||
I don't know which method would work best. I think you'd have to see which is easier for you to do. I'd probably go for the two separate widgets each with custom templates and a condition around that template:
Template 1: HTML Code:
<vb:if condition="$show['guest']">stuff</vb:if> HTML Code:
<vb:if condition="$show['member'] AND !is_member_of($bbuserinfo, x)">stuff</vb:if> |
#6
|
|||
|
|||
Hi, sorry for the n00bish question, but on a related note- if someone wanted to make a widget appear for all except a certain usergroup, what would be the correct code?
thanks |
#7
|
||||
|
||||
Quote:
|
#8
|
|||
|
|||
Just to say I found the info in this thread useful. Cheers.
It wouldn't let me "like" the posts (too old?), so thought it worth posting to say thanks properly. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|