Back to vBulletin 4.x Template Modifications

Allow users to change user title color
Mod Version: 2.0, by Brundun

vB Version: 4.2.1 Rating: (0 vote - 0 average) Installs: 4
Released: 06 Mar 2014 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code  

Hi all, this is my first release, I'm not sure if this has been released before but I thought of this the other day and implemented it onto a forum of mine.

About:
This template modification allows users of your forum community to change the color and font weight of their user title by entering a color HEX code in the Edit Profile in UserCP.

How to do this:

First Step:
What you're going to do is go to your AdminCP and find 'User Profile Fields' and select 'Add New Profile Field'.

You're going to need to create two separate fields:
Code:
First one needs to be - Single-Line Text Box with a title of Custom User title color or what ever you want it to be
Second one needs to be - Single-Selection Radio Buttons with a title of Bold or Normal or what ever u want it, for options on this one you need it to be bold and normal like this: http://i.imgur.com/KxGb26X.png
Second Step:

Go to Styles & Templates > Style Manager > {Your Theme Name} > Edit Templates > Posbit > Postbit_Legacy

Search for:
Code:
<span class="usertitle">   {vb:raw post.usertitle}  </span>
and replace it with
Code:
<span class="usertitle">
			<span style="color:<vb:if condition="$post['fieldX']">{vb:raw post.fieldX}</vb:if>; font-weight:<vb:if condition="$post['fieldX]">{vb:raw post.fieldX}</vb:if>;">{vb:raw post.usertitle}</span>
</span>
Replace the Red X in my code with the field number in your admincp for the Custom User Title Color field.

Replace the Green X in my code with the field number in your admincp for the Bold and Normal field.

users should be able to edit the color of their user title and font-weight in UserCP > Edit Profile and scroll to the bottom.
Code:
 http://i.imgur.com/RJP9Xyh.png
Version 2:
Added 3 more styling options, Glow, Marquee Scroll and Ability to add sparkle image(note: doesnt look good with a scroll)

You need to add 5 user profile fields.

First one needs to be - Single-Line Text Box with a title of Custom User title color or what ever you want it to be

Second one needs to be - Single-Selection Radio Buttons with a title of Bold or Normal or what ever u want it, for options on this one you need it to be bold and normal like dis

Third one needs to be Single-Line Text Box with the title of Sparkle Image or what ever you want lol

Fourth one needs to be Single-Line Text Box with the title of Glow.

Fifth needs to be a Single-Selection Menu with the title or Marquee or Scroll w.e, when setting this one up where it says Set Default, have it to None

Go to Styles & Templates > Style Manager > { your theme name} > Edit Templates > Posbit > Postbit_Legacy

Search for:
Code:
<span class="usertitle">
{vb:raw post.usertitle}
</span>
replace it with:
Code:

<span class="usertitle">
			<span style="color:<vb:if condition="$post['fieldX']">{vb:raw post.fieldX}</vb:if>; font-weight:<vb:if condition="$post['fieldX]">{vb:raw post.fieldX}</vb:if>; background: url(<vb:if condition="$post['fieldX']">{vb:raw post.fieldX}</vb:if>)">; <vb:if condition="$post['fieldX']"> text-shadow: 0 0 1em {vb:raw post.fieldX}";</vb:if>"><vb:if condition="$post['fieldX']"><marquee behavior="scroll" direction="{vb:raw post.fieldX}"></vb:if>{vb:raw post.usertitle}</span></marquee>
</span>
Red X - User Title Color Field Number
Green X - Bold or Normal Field Number
Blue X - Sparkle Image Field Number
Orange X - Glow Field Number
Purple X - Marquee Scroll Field Number

Thanks for reading and I hope this is useful to some people and I'm sorry if this is done before.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2024