Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2010, 02:57 PM
Ninos Ninos is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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!
Reply With Quote
  #2  
Old 11-04-2010, 09:48 PM
Ninos Ninos is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #3  
Old 11-04-2010, 10:00 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 11-05-2010, 09:16 PM
Ninos Ninos is offline
 
Join Date: Jul 2010
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 11-06-2010, 12:07 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
and Template 2:
HTML Code:
<vb:if condition="$show['member'] AND !is_member_of($bbuserinfo, x)">stuff</vb:if>
I would guess that would work but I've never tried something like that.
Reply With Quote
  #6  
Old 01-08-2011, 03:34 PM
sportsfroma2 sportsfroma2 is offline
 
Join Date: Aug 2006
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 01-08-2011, 04:35 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by sportsfroma2 View Post
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
vB4 Template Conditionals List
Reply With Quote
  #8  
Old 07-13-2012, 09:00 PM
charlesr charlesr is offline
 
Join Date: Aug 2009
Posts: 177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:17 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
  • Page Generation 0.04988 seconds
  • Memory Usage 2,231KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete