vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Mini Mods - Site Supporter Button in Postbit - Primary/Additional Usergroups supported (https://vborg.vbsupport.ru/showthread.php?t=148629)

713JunctionP 05-31-2007 10:00 PM

Site Supporter Button in Postbit - Primary/Additional Usergroups supported
 
This mod will probably work in other versions but was only coded and tested on vBulletin 3.6.7

If you've got members who have donated to your forums and you would like them to be recognized, this simple mod will add a nice 'Site Supporter' button underneath the member's messenger icons. However, you can place this piece of code anywhere you'd like. The option is up to you. This is just the way I thought looked best. Enjoy. :)

Installation:

1) Choose which button you want to use (supporter.gif or supporter2.gif) and upload it to your 'images/misc' folder in your forums directory.

2) Create a NEW usergroup. Go to ADMINCP -> Usergroups -> Add New Usergroup and name it whatever you want, just remember, this new usergroup needs to represent your 'Site Supporter' group, so remember the usergroup ID (uID) for this after you set all the permissions, etc.

3) Open your postbit OR postbit_legacy, whichever one you use, and...

FIND THIS CODE:
Code:

<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
                        </div>


AFTER, ADD THIS:
Code:

<!-- Site Supporter Code -->
<br /><if condition="$post[usergroupid] == X"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->

The 'X' above needs to be changed to the usergroup ID number (uID) corresponding to your new 'Site Supporter' usergroup that you created in STEP 2.

PLEASE REMEMBER TO CLICK INSTALLED IF YOU USE THIS MOD!

This is my first mod so please be nice. :o

713JunctionP 06-01-2007 04:04 AM

An issue has arisen with the 'Site Supporter' graphic not showing up for members belonging to two usergroups (a primary usergroup and an additional usergroup).

Using the code originally mentioned in the post above will only recognize members who's PRIMARY USERGROUP = 'Site Supporter'. Here is a quick fix that will help recognize members who belong to two usergroups (with 'Site Supporter' usergroup being the ADDITIONAL usergroup):

EXAMPLE:

- Member's PRIMARY USERGROUP = Moderators / ADDITIONAL USERGROUP = Site Supporter

- In order for the 'Site Supporter' graphic to appear without altering any changes in a member's PRIMARY usergroup you must use the following code:

Code:

<if condition="$post[usergroupid] == PRIMARYID and is_member_of($post, ADDITIONALID)"><img src="images/misc/supporter.gif"></if>
the words 'PRIMARYID' and 'ADDITIONALID' need to be substituted out for their corresponding uID #'s.

Make sure the 'Site Supporter' usergroup is always set as a member's ADDITIONAL usergroup, never primary. It's just easier that way. :)

This should help fix the problems associated with the graphic not showing up if 'Site Supporter' is a member's ADDITIONAL usergroup. :up:

713JunctionP 06-01-2007 05:43 AM

Quote:

Originally Posted by MARKETPROFITS (Post 1258787)
Thanks mate!
*Installed*

thank you for being my first install!

if you need any help, give me a buzz. :cool:

fpattberg 06-01-2007 09:48 AM

Hi.

I can seem to get to show the picture.

I have uploaded the pics to the folder, created the additional usergroup (registered usergroup 2 and sitesupporter 9) and insert this code in post legacy:

<!-- Site Supporter Code -->
<if condition="$post[usergroupid] == PRIMARYid2 and is_member_of($post, ADDITIONALid9)"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->

I am no coder and not really good at HTML. Is there a problem in my code?

Thanks.
Fabian

713JunctionP 06-01-2007 03:56 PM

Fabian,

Yes, there is a problem in your code. I'm sorry you misunderstood me. Your code needs to look like this:

Code:

<!-- Site Supporter Code -->
<if condition="$post[usergroupid] == 2 and is_member_of($post, 9)"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->

you were supposed to take the words 'PRIMARYid' and 'ADDITIONALid' and substitute them out with the actual ID #'s. :)

I hope this clears up any confusion for you.

fpattberg 06-02-2007 10:23 AM

Thanks 713junctionP.

I have got in the postbit now and works like a charm!

Thanks for the patience and tutorial! ;)

INSTALLED


Fabian

pds 06-02-2007 04:42 PM

Can I have multiple usergroups listed for the "PRIMARYid2" variable? if so, would they simply be separated by commas?

My "Site Supporter" usergroup is always the secondary group. I want the site supporter button to show up no matter what their primary group is. Now that i type this out i wonder if i am misunderstanding something and this is a terribly stupid question?!?

713JunctionP 06-02-2007 04:56 PM

Quote:

Originally Posted by pds (Post 1259858)
Can I have multiple usergroups listed for the "PRIMARYid2" variable? if so, would they simply be separated by commas?

My "Site Supporter" usergroup is always the secondary group. I want the site supporter button to show up no matter what their primary group is. Now that i type this out i wonder if i am misunderstanding something and this is a terribly stupid question?!?


I'm sorry but I'm not quite understanding what you're telling me. maybe you're saying you have a few different primary groups and you want the site supporter button to show up for each of those members who belong to different primary groups? in that case, you will need to create an <if></if> statement for each condition. Here's an example of mine on my forums:

Code:

<!--  Site Contributor button -->
<br /><if condition="$post[usergroupid] == 5 and is_member_of($post, 11)"><img src="images/misc/supporter2.gif"></if>
<if condition="$post[usergroupid] == 6 and is_member_of($post, 11)"><img src="images/misc/supporter2.gif"></if>
<if condition="$post[usergroupid] == 7 and is_member_of($post, 11)"><img src="images/misc/supporter2.gif"></if>
<if condition="$post[usergroupid] == 9 and is_member_of($post, 11)"><img src="images/misc/supporter2.gif"></if>
<if condition="$post[usergroupid] == 10 and is_member_of($post, 11)"><img src="images/misc/supporter2.gif"></if>
<if condition="$post[usergroupid] == 11"><img src="images/misc/supporter2.gif"></if>
<!-- / Site Contributor button -->

anyway, you should be able to seperate ADDITIONAL usergroups with commas like this:

Code:

<!-- Site Supporter Code -->
<if condition="$post[usergroupid] == 2 and is_member_of($post, 9,10,11,12)"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->


pds 06-02-2007 05:48 PM

Sorry for not being clear. :)

My "Site Supporter" user group is always an additional usergroup. I want the graphic to show up when there additional usergroup = "Site Supporter" regardless of their primary usergroup.

I would also prefer not to have to list every possible primary usergroup in the code. The way the code is now, if I ever added a primary usergroup, I would have to go in and add the ID to the code.

713JunctionP 06-02-2007 10:00 PM

I think I understand what you want. Try this:

Code:

<!-- Site Supporter Code -->
<if condition="is_member_of($post, XX)"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->

XX = additional usergroup ID#

as far as having to list every primary usergroup, that's the only other way I can think of to do it. maybe another coder will come in here and help.


All times are GMT. The time now is 07:32 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.01896 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (7)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete