Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 02-28-2013, 05:09 PM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Showing graphic if user=whatever

I have set up different membership levels on my forum. If someone gets to a more advanced membership level, they get added to an additional usergroup.

Is there any code that I can do that will show me a gif but only if they are a member of a certain group? It could be one of 4 different groups and the gif would change depending on which group they are in.

Thanks,

Jon
Reply With Quote
  #2  
Old 02-28-2013, 06:01 PM
darnoldy darnoldy is offline
 
Join Date: Dec 2004
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Jon-

I believe you can set an image to be displayed based on a user's usergroup using the "Ranks" system in the Admin control panel—I don't use ranks, so I can't give you specific instructions.

The thing that I am confused about from your post is, do you want these only to appear for you (the admin) or for everyone to see them?

-don
Reply With Quote
  #3  
Old 02-28-2013, 06:39 PM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The images are for everybody to see. The idea is that it will be a plaque showing the user level. So, in a typical thread, the first post might have, in the left column below where it says "Newly Registered User", an image saying Basic User. The next post in that thread might have something similar but with an image saying VIP Member, and so on.

These are basically plaques in the same area where the Avatars are, but showing user level.

Anyone know how?
Reply With Quote
  #4  
Old 03-01-2013, 09:44 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In a template you can use something like:

Code:
<vb:if condition="is_member_of($bbuserinfo, 4)">
<img src="group4.gif">
<vb:elseif condition="is_member_of($bbuserinfo, 5)" />
<img src="group5.gif">
<vb:elseif condition="is_member_of($bbuserinfo, 6)" />
<img src="group6.gif">
</vb:if>

and of course you can extend that to as many as you want.

And if you only want to specify a special image for certain groups, you could have a "catch-all" by ending with an "else", like:
Code:
...
<vb:elseif condition="is_member_of($bbuserinfo, 6)" />
<img src="group6.gif">
<vb:else />
<img src="others.gif">
</vb:if>
Reply With Quote
  #5  
Old 03-04-2013, 11:13 AM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your reply, although I think there has been a misunderstanding.

Essentially, I want this in a thread:

Post #1
User: Dave12345, Level: Basic Member. Therefore, show "Basic Member" image badge below his name.
Post #2
User: Jon-Doe, Level: Paid Member. Therefore, show "Paid Member" image badge below his name.
Post #3
User: JulieB, Level: Basic Member. Therefore, show "Basic Member" image badge below his name.
Post #4
User: MarkStone, Level: Administrator. Therefore, show "Administrator" image badge below his name.

Is that a bit clearer? Is this possible?

(You code helped me with something else I wanted to do though. )
Reply With Quote
  #6  
Old 03-05-2013, 12:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think that code will work, but to use it in the postbit template you'd want to change $bbuserinfo to $post.
Reply With Quote
  #7  
Old 03-06-2013, 10:20 PM
Jon12345 Jon12345 is offline
 
Join Date: Nov 2002
Posts: 127
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, you are right. Thanks for that distinction. Working now.
Reply With Quote
  #8  
Old 03-07-2013, 03:10 PM
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Posts: 969
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd still think you'd want to do this through the ranks system, where each usergroup has its own images. This would allow for the images, but not require any custom code to be added, unless I'm missing something with what you are hoping to achieve as the built in ranks system would seem to offer what you're after.
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04483 seconds
  • Memory Usage 2,222KB
  • 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_code
  • (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