View Full Version : Forum Display Enhancements - Military Branches v1.01
SVTCobraLTD
10-14-2008, 10:00 PM
Military Branches v1.01
Created by SVTCobraLTD for 3.6.x - 4.1.x
This will add a small Military Banner to your postbit templates. I found this useful for my forums so I hope you do. See the screen shots for more information. Right now it only contains Army, Navy, Marines and Air Force. Currently the images are made with a white background and a dark gray background. I am willing to help make the images match the background on your board for members who donate (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HY8BSGD2NT9Z2).
UPLOAD FILES
ADD USER GROUPS
TEMPLATE EDITS
ENJOY!!
Updated: 03-04-09
- Added coding for secondary groups
- Made Airforce and Marines image smaller
vb4 Instructions Included!
Do not forget to Mark as Installed
SVTCobraLTD
10-15-2008, 05:37 PM
*Reserved*
SVTCobraLTD
03-04-2009, 01:06 PM
Update: If you want to add a the Military Branches as a secondary group for the user, you need to add this coding:
<if condition="in_array($post[usergroupid], array(X,X,X,X,X)) && is_member_of($post, X)"><img src="images/misc/XXXX.gif" border="0" alt="" /></if>
Change the 'X' to the usergroup you want and change the 'XXXX' to the name of the file. If anyone needs any help, let me know.
militarytuners
04-18-2009, 02:54 PM
Will this work for 3.7?
SVTCobraLTD
05-05-2009, 11:20 AM
I do not see why it would not. Coding is the same.
SVTCobraLTD
11-02-2009, 08:59 PM
Did you test on 3.7.x? Did it work ok?
Lovinmysailor
11-03-2009, 11:42 AM
Very nice! The next time I redo our ranks I am going to use these! thanks!! I have 3.7 so I will let you know if it works. I see no problem why it shouldnt.
SVTCobraLTD
11-13-2009, 02:08 PM
Same here. I will be testing on 3.8.4 soon as well.
printedgear
12-23-2010, 07:02 PM
I tried to find bigusername in v4.XX and couldn't find it as the directions state. Any chance I'm doing something wrong? Is there a difference for this in 4.XX?
SVTCobraLTD
12-30-2010, 06:20 PM
I am not using 4.x so I am unsure.
BirdOPrey5
01-01-2011, 03:45 PM
For VB4 look for the following code in postbit_legacy:
<div class="username_container">
<vb:if condition="$post['userid']">
{vb:raw memberaction_dropdown}
{vb:raw post.onlinestatus}
<vb:else />
<span class="username guest">{vb:raw post.musername}</span>
</vb:if>
</div>
<span class="usertitle">
{vb:raw post.usertitle}
</span>
And put the following below it:
<vb:if condition="$post[usergroupid] == XX"><img src="images/misc/xxxxxxx.gif"></vb:if>
Otherwise follow the original instructions...
In general IF statements remain the same between VB3 and VB4 except add "vb:" in front of the "if".
printedgear
01-01-2011, 04:55 PM
Hi BOP5, I was able to do the first part of the instructions, but couldn't find the <div class="bugusername"... in the Templates>memberinfo edit.
to add:
<if condition="$post[usergroupid] == xx"><img src="images/misc/XXXXXX.giof"></if>
Thanks again for your help
BirdOPrey5
01-01-2011, 05:06 PM
Hey, sorry I didn't see the second edit in the instructions... for the MEMBERINFO template in VB4 look for:
<span id="userinfo">
<span class="member_username">{vb:raw prepared.musername}</span>
<span class="member_status">{vb:raw prepared.onlinestatus}</span>
<vb:if condition="$prepared['usertitle']">
<br />
<span class="usertitle">{vb:raw prepared.usertitle}</span>
</vb:if>
And put the "IF" beneath it.
However looking at the <IF> code I seriously doubt the code given in the instructions will work in MEMBERINFO...
The code given is:
<if condition="$post[usergroupid] == XX"><img src="images/misc/xxxxxxx.gif"></if>
And translated to VB4 is:
<vb:if condition="$post[usergroupid] == XX"><img src="images/misc/xxxxxxx.gif"></vb:if>
HOWEVER... $post is only available in the postbit template, it has no value in MEMBERINFO so I can't see how this would have ever worked...
I believe the correct code should be:
<vb:if condition="$vbulletin->userinfo[usergroupid] == XX"><img src="images/misc/xxxxxxx.gif"></vb:if>
printedgear
01-02-2011, 12:20 AM
Hi BOP, I think I did what you said. I tried both codes and neither worked. The second update is in memberinfo, correct? Any other thoughts? Thanks again for your time!
BirdOPrey5
01-02-2011, 12:50 AM
Yeah, looks like I was a little off on where to place it, sorry about that.
I have tested this exact code and it's working for me:
Find:
<span id="userinfo">
<span class="member_username">{vb:raw prepared.musername}</span>
<span class="member_status">{vb:raw prepared.onlinestatus}</span>
<vb:if condition="$prepared['usertitle']">
<br />
<span class="usertitle">{vb:raw prepared.usertitle}</span>
</vb:if>
</span>
</h1>
And right below </h1> add:
<vb:if condition="$userinfo[usergroupid] == 6"><img src="http://www.qapla.com/ju/jump.gif" /><br /></vb:if>
Change the number 6 to the usergroup id you want, and change the src to your image, but like I said this exact code works for me.
SVTCobraLTD
01-05-2011, 04:42 PM
Thank you to BirdsOPrey for updating instructions for vb4!! https://vborg.vbsupport.ru/showthread.php?t=256558
printedgear
01-08-2011, 01:43 AM
I just figured it out!!!! You're awesome!!!! Thanks!
BirdOPrey5
01-18-2011, 12:33 AM
I had a mistake in my code... The text to add to member info SHOULD BE:
<vb:if condition="$userinfo[usergroupid] == 6"><img src="http://www.qapla.com/ju/jump.gif" /><br /></vb:if>
The code I previously posted would have displayed the rank of the person viewing the profile, not the rank of the person's profile they were viewing.
Sorry for the confusion. I will edit my original post.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.