Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Custom Username colours Details »»
Custom Username colours
Version: 1.00, by shaunceb shaunceb is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.8.3 Rating:
Released: 08-09-2009 Last Update: 08-09-2009 Installs: 23
Template Edits
Re-useable Code Translations  
No support by the author.

This is my first posted template edit so be gentle.
It comes courtesy of the username and font hack by gio~logist.

This mod will allow you to define a list of colours for your users to pick from instead of them having to use hex codes. There is also the option of just letting particular user groups use this.

STEP 1

Goto User Profile Fields > Add new user profile field.

Select Single Selection Menu.

Title: Custom Username Colour
Description: Select a custom username colour.

Select your colours from the long list at http://www.w3schools.com/HTML/html_colornames.asp and enter them into the Options box. One colour per line.

Once you're done, save it and make a note of the field number

STEP 2

Edit your Postbit template.
Find

PHP Code:
div id="postmenu_$post[postid]">
                    <if 
condition="$show['profile']">
                    <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a>
                    
$post[onlinestatus]
                    <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
                    <else />
                    
$post[musername]
                    </if>
                </
div
and replace with
PHP Code:
<div id="postmenu_$post[postid]">
                    <if 
condition="$show['profile']">
                    <
class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">
<if 
condition="$post['fieldx'] != ''  ">
<
font style="color:$post[fieldx]">$post[musername]</font>
<else />
$post[musername]
</if>
</
a>
                    
$post[onlinestatus]
                    <
script type="text/javascript"vbmenu_register("postmenu_$post[postid]"true); </script>
                    <else />


                    
$post[musername]
                    </if>
                </
div
Change the x for your field id.


STEP 3

If you want to display this for certain usergroups;

Go to your Styles & Templates and select the userfield_select_option template.
Replace it with:

PHP Code:
<if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(A, B, C)) OR is_member_of($bbuserinfo, 1, 2, 3))">
<
option value="$key$selected>$val</option>

</if> 
Change the A, B, C to your field id and the 1, 2, 3 to the usergroups you want to allow this for

Select the userfield_wrapper and replace that with the following:

PHP Code:
<if condition="THIS_SCRIPT != 'profile' OR (!in_array($profilefield[profilefieldid], array(A, B, C)) OR is_member_of($bbuserinfo, 1, 2, 3))">
<
fieldset class="fieldset">
    <
legend>$profilefield[title]</legend>
    
$custom_field_holder
</fieldset>


</if> 
Change the A, B, C to your field id and the 1, 2, 3 to the usergroups you want to allow this for

My coding abilities at best can be described as amateur but I'll try to help with any problems.

Download Now

File Type: txt custom usernames.txt (2.7 KB, 193 views)

Screenshots

File Type: jpg Untitled.jpg (4.5 KB, 0 views)
File Type: jpg Untitled1.jpg (21.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 10-16-2009, 09:16 AM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks

how to make the color choose from dropdown menu like this

Reply With Quote
  #23  
Old 08-22-2010, 12:25 PM
MagicThemeParks's Avatar
MagicThemeParks MagicThemeParks is offline
 
Join Date: Sep 2009
Posts: 850
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by baghdad4ever View Post
thanks

how to make the color choose from dropdown menu like this

Step 1 in the instructions is this.
Reply With Quote
  #24  
Old 08-22-2010, 03:29 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice mod, one of my users was asking for something similar, will check this out today
would this work on 4.x as well?

thx
Reply With Quote
  #25  
Old 10-10-2010, 09:08 AM
DIBBLE DIBBLE is offline
 
Join Date: Jul 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yes it would work on vB4
Reply With Quote
  #26  
Old 10-11-2010, 02:24 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THIS WILL NOT WORK on VB4 as is... the template code would need to be updated,
Reply With Quote
  #27  
Old 10-11-2010, 03:50 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The "font" tag is being depreciated from HTML, you can get the same results by using "SPAN" instead.

Change:
Code:
<font style="color:$post[fieldx]">$post[musername]</font>
to:
Code:
<span style="color:$post[fieldx]">$post[musername]</span>
But my issue is when I do this the color of the link no longer changes when the house hovers over it- is there any way to allow it to keep changing color when you mouse-over?
Reply With Quote
  #28  
Old 10-20-2010, 04:49 PM
DIBBLE DIBBLE is offline
 
Join Date: Jul 2010
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i get it to work on the homepage and in shoutbox?
Reply With Quote
  #29  
Old 12-07-2010, 06:51 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
The "font" tag is being depreciated from HTML, you can get the same results by using "SPAN" instead.

Change:
Code:
<font style="color:$post[fieldx]">$post[musername]</font>
to:
Code:
<span style="color:$post[fieldx]">$post[musername]</span>
But my issue is when I do this the color of the link no longer changes when the house hovers over it- is there any way to allow it to keep changing color when you mouse-over?
thanks, I'll try it out and bump this thread
it would be great to get a plugin for this with zero template edits :up:
Reply With Quote
  #30  
Old 03-02-2011, 05:08 AM
DarkGizmo DarkGizmo is offline
 
Join Date: Apr 2008
Location: NYC
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey man, I installed your mod and did some tiny modifications to it, however, I was wondering if it's possible to get this to appear in the active users bit? It seems that the variable $activeusers needs to be edited, but i'm not sure how that can be done? Any help on getting this working in the active users bit would be fantastic!

Also if you can post instructions on how to get it in:
-Memberlist
-Forumhome/viewing a forum
-Showgroups

Thanks!
Reply With Quote
  #31  
Old 11-13-2012, 03:44 PM
Robbie P Robbie P is offline
 
Join Date: Mar 2011
Location: England
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This isn't working on vBulletin 3.8.7 PL3 - could someone provide me with a fix?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:43 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.16473 seconds
  • Memory Usage 2,366KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (4)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete