PDA

View Full Version : Mini Mods - Site Supporter Button in Postbit - Primary/Additional Usergroups supported


713JunctionP
05-31-2007, 10:00 PM
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:
<div>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</div>
</div>


AFTER, ADD THIS:
<!-- 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 (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=148629) 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:

<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
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:

<!-- 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
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:

<!-- 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:

<!-- 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:

<!-- 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.

R1lover
06-02-2007, 11:16 PM
This is built into VB why was a hack needed?

713JunctionP
06-02-2007, 11:32 PM
This is built into VB why was a hack needed?


try it. :)

R1lover
06-02-2007, 11:34 PM
try it. :)


I have been using the built in version of this for a few years.... I'm still confused why you needed a hack for this lol

R1lover
06-02-2007, 11:39 PM
Here is the placement with the built in "User Ranks" version. Of course you can place the image in any location as well.

It's all automated as well, when a user signs up for a site supporter package it changes there user group and adds the image for that rank.

So really, I'm not trying to bust your balls here, I'm interested to know why you don't' just use the User Ranks?

713JunctionP
06-03-2007, 05:14 AM
Here is the placement with the built in "User Ranks" version. Of course you can place the image in any location as well.

It's all automated as well, when a user signs up for a site supporter package it changes there user group and adds the image for that rank.

So really, I'm not trying to bust your balls here, I'm interested to know why you don't' just use the User Ranks?

if you have more than one rank set up it's not necessarily an easy task to get them all placed in various spots within your postbit or postbit_legacy.

also, you need to pay very close attention to the thread and realize why this is all needed. there are numerous code conflicts that occur between user ranks and primary/usergroups. especially when users want to be part of a 'Site Supporter' group but they don't want to change their primary group (ie moderators who are also site supporters but may also have another rank set up at the same time).

please pay more attention before assuming you know what certain code is doing. there are reasons for this thread and why people want it. :)

TheProphet
06-03-2007, 10:38 AM
Nice work m8.. *installed*

R1lover
06-03-2007, 01:49 PM
if you have more than one rank set up it's not necessarily an easy task to get them all placed in various spots within your postbit or postbit_legacy.

also, you need to pay very close attention to the thread and realize why this is all needed. there are numerous code conflicts that occur between user ranks and primary/usergroups. especially when users want to be part of a 'Site Supporter' group but they don't want to change their primary group (ie moderators who are also site supporters but may also have another rank set up at the same time).

please pay more attention before assuming you know what certain code is doing. there are reasons for this thread and why people want it. :)

The issues you are talking about are not issues if you know how to set up your user groups.

Trust me, everything you are doing with this is built into VB.... :) no need to all this work, but hey if you have the time then that's your issue not mine. :)

p.s. Your issue above is controlled by setting their primary display user group setting.

As for knowing this code and what it does, if I didn't I would not have posted. Your modification does nothing that is not there already it's as simple as that. I didn't want to bust your balls here and tell you that when I posted so I thought I would be nice and ask first. :)

713JunctionP
06-03-2007, 04:31 PM
^ TRUST ME, you are still not comprehending what I'm saying and I do not have time to argue with you about it.

if you don't want to use the hack then please stay out of the thread.

morrow
06-03-2007, 09:57 PM
Installed and working, no problems.

I do have one question though. Is there a way to limit this to only the first post in a thread? It's annoying to see this icon numerous times through-out a thread.

pds
06-03-2007, 10:45 PM
I have been using the built in version of this for a few years.... I'm still confused why you needed a hack for this lol

Some people prefer this in a hack because they want the "supporter" button to show up in a different place from where the "ranks" function does.

I understand this can be done with user ranks, and frankly it is easier to control doing so.

In my case user ranks currently gives them different icons based upon how many posts they have, and this appears right under the username. I want the site supporter button to appear lower in the postbit_legacy. (In fact the sample image of the postbit for this hack was taken from my site...even though I am not yet using the hack...must have been some creative photoshoping)

713JunctionP
06-04-2007, 02:04 AM
Installed and working, no problems.

I do have one question though. Is there a way to limit this to only the first post in a thread? It's annoying to see this icon numerous times through-out a thread.

I just let it show everytime the 'site supporter' makes it post. doesn't seem to bother us on the forums I run.

however, as far as limiting the 'site supporter' button to only appear in the first post of each page of a thread...that sounds like something along the lines of a hack I've seen here on vB.org it's a hack where the users signature only shows on their first post per page of any thread. you might be able to take the code from that and do something with it. :)

R1lover
06-04-2007, 02:38 PM
Some people prefer this in a hack because they want the "supporter" button to show up in a different place from where the "ranks" function does.

I understand this can be done with user ranks, and frankly it is easier to control doing so.

In my case user ranks currently gives them different icons based upon how many posts they have, and this appears right under the username. I want the site supporter button to appear lower in the postbit_legacy. (In fact the sample image of the postbit for this hack was taken from my site...even though I am not yet using the hack...must have been some creative photoshoping)

That makes sense in your situation... Thanks :) Funny on the image... :)

bada_bing
06-04-2007, 02:52 PM
I like this will install in the near future

713JunctionP
06-04-2007, 04:28 PM
That makes sense in your situation... Thanks :) Funny on the image... :)

funny because I got the image from another individual who originally posted this hack but had made it unclear to users the differentiation between the $bbuserinfo and $post array's.

morrow
06-05-2007, 10:43 PM
Someone on my site recommended for the Site Supporter icon to also link to paypal, so this is what I did...


<!-- Site Supporter Code -->
<br />
<if condition="$post[usergroupid] == 2 and is_member_of($post, 20)"><a href="https://www.paypal.com/cgi-bin/webscr"><img src="images/misc/supporter.gif"></if>
<!-- / Site Supporter Code -->



Now when you click on the icon, it will take you to paypal. :)

713JunctionP
06-05-2007, 11:40 PM
^ you should probably close your <a href> tag at the end before the </if> tag.

<!-- Site Supporter Code -->
<br />
<if condition="$post[usergroupid] == 2 and is_member_of($post, 20)"><a href="https://www.paypal.com/cgi-bin/webscr"><img src="images/misc/supporter.gif"></a></if>
<!-- / Site Supporter Code -->


btw, good idea. but will it link the user to YOUR website's paypal contribution page?

I just may add your contribution to this thread's first post and give you credit for it. :)

713JunctionP
06-23-2007, 07:09 PM
morrow, would you like me to add your edit to this hack and give you credit?

let me know. :)

morrow
06-25-2007, 02:53 AM
Hmmm. Nah, it's your modification. Thanks alot for asking.

JadedSouls
08-22-2007, 06:31 PM
Finally got this to work for me! *dances*

BulletNow
09-19-2007, 01:26 AM
Anyway to make the photo show up in the persons profile?

BulletNow
09-22-2007, 03:40 PM
Any1?

WoodiE
10-03-2007, 07:56 PM
Why is a hack needed for this? A simple user rank will do the same and is built right into vB!?!

TigerWare
10-06-2007, 07:50 AM
Why is a hack needed for this? A simple user rank will do the same and is built right into vB!?!

The built-in user rank system is fine, but what if you want to add a token image to postbit/postbit_legacy to specifically identify a certain type of user/usergroup?

Example. I use this hack to add postbit_legacy images to specific secondary usergroups (article writers and contributors in my forum). This identifies those group members "in addition to" any ranking system I have employed. It is a simple and very effective hack IMO. In addition, I use this hack to identify user #1 with a special 'Site Owner' image too.

Zachery
10-06-2007, 04:19 PM
Basicly all this is is a conditional, and one that could be considerably better.

<if condition="is_member_of($post, X)">

Where X is your usergroupid, it will check both their primary and secondary groups agasint this. Some people need to learn to use conditionals.

This is a template modification, not a hack.

TigerWare
10-06-2007, 08:35 PM
I use this hack to add postbit_legacy images
This is a template modification, not a hack.

Sorry Zachery, no offense was intended, just a simple phraseology error.

SVTCobraLTD
11-09-2007, 05:07 PM
Installed but one thing... anyone know how to remove the User Title for a certain user group? I added this image under the user name but want to be able to remove the user title and how this in its place.

SVTCobraLTD
11-19-2007, 05:05 PM
Installed but one thing... anyone know how to remove the User Title for a certain user group? I added this image under the user name but want to be able to remove the user title and have this in its place.


Anyone know how to do this?

SVT

griffinzx10
02-27-2008, 03:37 PM
Hello, I posted this in my POSTBIT section of my site, right after the suggested point. 21 Represents my group called Contributor and the image is loaded into the correct location. I have my test member's primary group as Contrbutor, and their secondary group as registered. But I am not seeing the image...

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

And suggestions would be greatly appreciated.

Thanks

griffinzx10
02-27-2008, 03:58 PM
HA got it, thanks anyway....

griffinzx10
02-27-2008, 04:02 PM
actually I do have a question.. I have this working when my Site Contributors group is the Primary group. Now can I leave that set up the way it is, but also incorporate the fix for haveing this work as a secondary group? So I can have it work both ways?

griffinzx10
03-02-2008, 03:09 AM
actually I do have a question.. I have this working when my Site Contributors group is the Primary group. Now can I leave that set up the way it is, but also incorporate the fix for haveing this work as a secondary group? So I can have it work both ways?


Bump, can anyone answer this?

griffinzx10
03-07-2008, 01:59 PM
bump bump I could really use some help with this.. Anyone?

Sothside40
03-12-2008, 12:40 AM
damn, i guess I dont have a chance in getting this question answered, nor the guy before me...smh

TCE Killa
03-12-2008, 06:14 PM
Is their away to get this to show up in memberinfo as well? Thanks.

MiahBeSmokin420
03-12-2008, 06:43 PM
Is their away to get this to show up in memberinfo as well? Thanks.

ya you put the code in your member info template where you want it

TCE Killa
03-12-2008, 07:14 PM
ya you put the code in your member info template where you want it


Nah I know that, but their isn't away to make it show up under location or anything. Where ever you put it, it just shows up under the templates etc...

griffinzx10
03-12-2008, 10:01 PM
actually I do have a question.. I have this working when my Site Contributors group is the Primary group. Now can I leave that set up the way it is, but also incorporate the fix for haveing this work as a secondary group? So I can have it work both ways?


seriously can anyone answer this?????

Please I need it answered????

Can this be done for 2 groups.
Set up as the primary group, and it works, but I want to set this up so I can have my site supporter group as a secondary group, and still have the image show.. I need this for my mods and admins, who's primary groups are mods/admins and their effective rights are based on that..

PLEASE???

MiahBeSmokin420
03-13-2008, 12:11 AM
im not going to give support on this cause its not my modification

but here is my code that i use in the post bit and member info

so if you can figure it out then have a ball

if not then ooh well then let the creator help you



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



thats just how i did it for the secondary user groups

Sothside40
03-13-2008, 01:12 AM
is this correct for more than one usergroup, bcuz when i use this...... the usergroup that is on the bottom has their image all the way on the bottom of their profile and it stretches the page...


<!-- Rank -->
<br /><if condition="$post[usergroupid] == 17"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 11"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 6"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 7"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 5"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 18"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 15"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --></div>

MiahBeSmokin420
03-13-2008, 04:32 AM
is this correct for more than one usergroup, bcuz when i use this...... the usergroup that is on the bottom has their image all the way on the bottom of their profile and it stretches the page...

look for the setting in the <div tag before </div>

thats probally whats messing that up

Sothside40
03-13-2008, 04:41 AM
this is exactly how i have it ....

<div><center>$post[icqicon] $post[aimicon] $post[msnicon] $post[yahooicon] $post[skypeicon]</center></div>
<!-- Rank -->
<br /><if condition="$post[usergroupid] == 17"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 11"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 6"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 7"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 5"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 18"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --><!-- Rank -->
<br /><if condition="$post[usergroupid] == 15"><center><img src="images/misc/vip3-1.gif"></center></if>
<!-- / Rank --></div>

MiahBeSmokin420
03-13-2008, 05:29 AM
this is exactly how i have it ....
can i see a live demo or somthing

Sothside40
03-13-2008, 03:29 PM
https://vborg.vbsupport.ru/external/2008/03/18.gif ......Original Image

Usergroup ID: #5
https://vborg.vbsupport.ru/external/2008/03/7.png

Usergroup ID: #6
https://vborg.vbsupport.ru/external/2008/03/8.png

Usergroup ID: #7
https://vborg.vbsupport.ru/external/2008/03/9.png

Usergroup ID: #11
https://vborg.vbsupport.ru/external/2008/03/10.png

Usergroup ID: #15
https://vborg.vbsupport.ru/external/2008/03/11.png

Usergroup ID: #18
https://vborg.vbsupport.ru/external/2008/03/12.png

griffinzx10
03-13-2008, 04:27 PM
so how would i make that work for me? Just use taht one line of code and edit it for my user groups? And where does it go?

griffinzx10
03-17-2008, 04:52 PM
????????

griffinzx10
03-20-2008, 02:18 PM
bump... HELP< and bump

Joey Link
09-23-2008, 02:21 PM
Is this mod no longer supported?

I have different levels of supporting members with different primary groups. Can this display different images depending on the users primary group?

SVTCobraLTD
09-28-2008, 12:48 PM
Is this mod no longer supported?

I have different levels of supporting members with different primary groups. Can this display different images depending on the users primary group?

Yes and its pretty simple

Big-K
02-22-2011, 04:31 PM
Does anyone know what the right conditional for this would be in VB4?

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

I tried the following but it inserts the image for everyone<vb:if condition="is_member_of($bbuserinfo,X)"><img src="images/misc/supporter.gif"></vb:if>

RedPoint
03-23-2011, 10:29 PM
Does anyone know what the right conditional for this would be in VB4?

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

I tried the following but it inserts the image for everyone<vb:if condition="is_member_of($bbuserinfo,X)"><img src="images/misc/supporter.gif"></vb:if>

Hi, i use this and is run ;)

<vb:if condition="$post[usergroupid] == 2 and is_member_of($post, 34)"><img src="images/ranks/ranksupporter.gif"></vb:if>
<vb:if condition="$post[usergroupid] == 19 and is_member_of($post, 34)"><img src="images/ranks/ranksupporter.gif"></vb:if>
<vb:if condition="$post[usergroupid] == 29 and is_member_of($post, 34)"><img src="images/ranks/ranksupporter.gif"></vb:if>
<vb:if condition="$post[usergroupid] == 30 and is_member_of($post, 34)"><img src="images/ranks/ranksupporter.gif"></vb:if>

I save my picture in ranks/picturename.gif - you must change this with your way to picture.