vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Miscellaneous Hacks - Clan Tag In Post Bit (https://vborg.vbsupport.ru/showthread.php?t=273551)

iDHKHCM 11-06-2011 11:00 PM

Clan Tag In Post Bit
 
1 Attachment(s)
this edit just adds a clan tag next to your username or wherever you decide to put it

first you will need to make a profile field

Go to AdminCP --> User Profile Fields --> Add New User Profile Field

for profile field type select Single-Line Text Box

Title= Clan Tag
Profile Field Category= (Uncategorized)
Max length of allowed user input= 4
Field Required= Yes, at registration and profile updating
Field Editable by User= Yes
Private Field= No
Field Searchable on Members List= Yes
Show on Members List= Yes

should look like this:
http://i447.photobucket.com/albums/q...e/other/pf.png



Now Go To postbit_legacy And Find:
HTML Code:

<vb:else />


{vb:raw post.musername}



right above it add: (Replace Red XX with the profile feild number)
Code:

<vb:if condition="$post['fieldXX']">
<font color="red" size="4"><B>{vb:rawphrase fieldXX}[{vb:raw post.fieldXX}]</B></font></vb:if>

after its done it will look like this
http://i447.photobucket.com/albums/q...e/other/ct.png

djscoop 11-18-2011 01:36 AM

Cant get this one to work - Something about a tag

iDHKHCM 11-19-2011 06:18 AM

Quote:

Originally Posted by djscoop (Post 2269085)
Cant get this one to work - Something about a tag

fixed try again

UncleGrundle 01-19-2012 02:04 AM

Reserved for future use.

Spectre_Aidan 01-21-2012 07:46 AM

thanks for this i got it working perfectly on my forum running 4.1.10 and it was just what i needed aswell :D

MrBeastlymfe 02-22-2012 11:02 PM

You add the code above
Code:

<vb:if condition="$post['userid']">
And under
Code:

<div class="username_container">

SnaKe |WiH| 03-25-2012 03:16 PM

Thank you for the great edit. Is there anyway to link the color to the usergroups color?

iDHKHCM 03-25-2012 08:57 PM

Quote:

Originally Posted by SnaKe |WiH| (Post 2313159)
Thank you for the great edit. Is there anyway to link the color to the usergroups color?

i wouldnt know how to do it....im sure its possible though

SnaKe |WiH| 03-26-2012 08:56 PM

Hmmm......okay....we will have to look into it.

Dogma21cw 07-20-2012 04:40 AM

GREAT WORK! Love it. Is there a way for it to read the contents of the field and set the color dependent on that?

Dogma21cw 07-20-2012 04:51 AM

See below.

Dogma21cw 07-20-2012 05:08 AM

YAY! I figgered it out. I had to create a custom phrase in the phrase mananger.

Went AdminCP>Phrase Manager.
Phrase type: GLOBAL, then add new phrase.
Product: vBulletin
Varname: oppdiv//this was the name of the team
Text: [TEAM1]
Translations: [TEAM1]

Then used the following code when editing the postbit template:
Code:

EDIT: See my next post
Works great, automatically assigns team tags & colors based on the usergroup.

Dogma21cw 07-20-2012 06:08 AM

Ok, I fixed it. Had to use $post instead of $bbuserinfo. $post made it look at the poster's usergroup, not the viewers.

Code:

<vb:if condition="is_member_of($post, 779)">
  <font color=#FF0000 size="2"><B><I>{vb:rawphrase oppdiv}</I></B></font></vb:if>
<vb:if condition="is_member_of($post, 780)">
  <font color=#FF0000 size="2"><B>{vb:rawphrase oppdiv}</B></font></vb:if>
<vb:if condition="is_member_of($post, 778)">
  <font color=#FF0000 size="2">{vb:rawphrase oppdiv}</font></vb:if>

That's for 1/2 of our tournament. oppdiv is the phrase I created for their team. 779 is the top ranks in BOLD & ITALICS. 780 is the mid ranks in BOLD. And 778 is the lowest with nothing special about it.

Thanks for your hard work in showing me the way, I hope this post of mine helps others.

Dogma21cw 07-20-2012 08:08 AM

Ok, that all works for the postbit. But does anyone know where I'd do to add this to the user profile page, and the currently active users sections?

MG Zebra 10-05-2012 09:04 AM

How could I get text next to it so it would say Clan Tag: {[DM]} or something different than the question for the box.

Checkmate MK8 03-07-2014 02:04 AM

How can I set this field to accept ALT characters? Currently, when a user enters an ALT character, it defaults to the numerical reference to the character.

In other words, what should be showing as ★ is showing as "&9733" in the profile field upon clicking "save".

Thanks,
CheckM8

ForceHSS 03-07-2014 03:29 AM

You done it like this
Code:

<vb:if condition="$post['field5']">
<font color="red" size="4"><B>{vb:rawphrase field5}[{vb:raw post.field5}]</B></font></vb:if>

5 being profile field number

Checkmate MK8 03-07-2014 03:31 AM

Yes

ForceHSS 03-07-2014 03:39 AM

can you post a ss of the template you edited

Checkmate MK8 03-27-2014 03:31 AM

1 Attachment(s)
Quote:

Originally Posted by ForceHSS (Post 2485612)
can you post a ss of the template you edited

Sorry for the delay, here you go @ForceHSS

ForceHSS 03-27-2014 03:58 AM

You put it to far up it needs to be above

Code:

<vb:else />
                <span class="username guest">{vb:raw post.musername}</span>

So it looks like
Code:

<vb:if condition="$post['field5']">
<font color="red" size="4"><B>{vb:rawphrase field5}[{vb:raw post.field5}]</B></font></vb:if>
            <vb:else />
                <span class="username guest">{vb:raw post.musername}</span>

also you said you used profile field 5 but in that ss you have it as 4

Checkmate MK8 03-27-2014 04:29 AM

Quote:

Originally Posted by ForceHSS (Post 2489827)
You put it to far up it needs to be above

Code:

<vb:else />
                <span class="username guest">{vb:raw post.musername}</span>

So it looks like
Code:

<vb:if condition="$post['field5']">
<font color="red" size="4"><B>{vb:rawphrase field5}[{vb:raw post.field5}]</B></font></vb:if>
            <vb:else />
                <span class="username guest">{vb:raw post.musername}</span>

also you said you used profile field 5 but in that ss you have it as 4

That method only puts the clan tag to the right of the username. My original coding puts it to the left of the username, which is where I want it. It also does not change the fact that the clan tag doesn't display ALT characters correctly and that is what I am looking to correct..

blind-eddie 03-27-2014 01:11 PM

I am having no issues with ATL characters displaying correctly.
Only issue I see is when you use to many ALT characters.

http://blind-eddie.com/forum/imageho...4217b78408.png http://blind-eddie.com/forum/imageho...4217bb7ad1.png http://blind-eddie.com/forum/imageho...4217bb865a.png http://blind-eddie.com/forum/imageho...4217bb8e22.png

Also, I edited your code, see below

Code:

<vb:if condition="$post['field11']">
<font color="red" size="4"><B>{vb:rawphrase field5}<br />[{vb:raw post.field11}]</B></font></vb:if>

Adding the <br /> will add clan tag on new line, looks better.

blind-eddie 03-27-2014 02:09 PM

Strange, alt9733 shows a club symbol for me in IE11 FF.


All times are GMT. The time now is 04:47 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.01594 seconds
  • Memory Usage 1,770KB
  • 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
  • (11)bbcode_code_printable
  • (1)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete