Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #21  
Old 01-04-2015, 06:39 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, yeah, I probably could have done it so that the markup from the usergroup manager was preserved. Try going to Plugins & Products > Plugin Manager, and find "Set username markup from profile field" and click on it. Then replace the code with this:
Code:
if (is_member_of($user, 9) && !empty($user['field5']))
{
   $user[musername] = '<span style="color:'.$user['field5'].'">'.$user[musername].'</span>';
}
and press Save, and see how that looks.
Reply With Quote
Благодарность от:
TC-Jamech
  #22  
Old 01-04-2015, 11:35 PM
TC-Jamech TC-Jamech is offline
 
Join Date: Sep 2011
Location: UK
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Oh, yeah, I probably could have done it so that the markup from the usergroup manager was preserved. Try going to Plugins & Products > Plugin Manager, and find "Set username markup from profile field" and click on it. Then replace the code with this:
Code:
if (is_member_of($user, 9) && !empty($user['field5']))
{
   $user[musername] = '<span style="color:'.$user['field5'].'">'.$user[musername].'</span>';
}
and press Save, and see how that looks.
Cheers, I noticed a slight problem, When I have more than 1 usergroup it only shows the Custom VIP colour. Is there a way to have it so it only uses the "Display Usergroup"?

For instance, my admin usergroup is red, and despite having that as my primary & diplay usergroup it still has my name showing the additional userroup colour preference.
Reply With Quote
  #23  
Old 01-05-2015, 12:50 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, how will you know when you want the display usergroup and when you want the profile field color?
Reply With Quote
  #24  
Old 01-05-2015, 01:55 AM
TC-Jamech TC-Jamech is offline
 
Join Date: Sep 2011
Location: UK
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
OK, how will you know when you want the display usergroup and when you want the profile field color?
I want it so that if you go to www.site.com/profile.php?do=editusergroups



And select "identify me as admin" it identifies you in your red username (which is within the usergroup manager for that group) whilst "identify me as VIP" would change your username to the custom colour.

At the moment, the only way to get a different colour shown is if that user removes the user colour hexcode in their settings
Reply With Quote
  #25  
Old 01-05-2015, 01:58 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...OK. So it might work out better if we take a different approach, and instead of using is_member_of() and adding markup, we could just check if the markup is the 'VIP' markup (maybe by putting an id attribute in the span tag), and if so, add the color.

I'll look at it tomorrow.

ETA: oh, and they're able to enter any hexcode they want? Then the plugin also needs to check for that, otherwise the could enter something like #000000;"> followed by any html or css they wanted.
Reply With Quote
  #26  
Old 01-05-2015, 03:10 AM
TC-Jamech TC-Jamech is offline
 
Join Date: Sep 2011
Location: UK
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Hmm...OK. So it might work out better if we take a different approach, and instead of using is_member_of() and adding markup, we could just check if the markup is the 'VIP' markup (maybe by putting an id attribute in the span tag), and if so, add the color.

I'll look at it tomorrow.

ETA: oh, and they're able to enter any hexcode they want? Then the plugin also needs to check for that, otherwise the could enter something like #000000;"> followed by any html or css they wanted.
I can always edit the field so it only allows the #000000 *7 character
Reply With Quote
  #27  
Old 01-06-2015, 12:35 PM
Scandal's Avatar
Scandal Scandal is offline
 
Join Date: Dec 2005
Location: Athens / Greece
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try also this product (I had develope it some months ago). It is for vB4 but I test it and works fine with vB3.
After installation check vbulletin options. You can add usergroups (who can change color) and exclude colors from use.
You have only to add the field ID of the profile field which use for username colors and set the usergroup IDs.

Username color is changed globally.
Attached Files
File Type: zip product-sc_username_color.zip (1.6 KB, 29 views)
Reply With Quote
  #28  
Old 01-06-2015, 01:37 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh good, I was meaning to get back to that. Now you've saved me the trouble.
Reply With Quote
  #29  
Old 01-06-2015, 06:08 PM
TC-Jamech TC-Jamech is offline
 
Join Date: Sep 2011
Location: UK
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Scandal View Post
Try also this product (I had develope it some months ago). It is for vB4 but I test it and works fine with vB3.
After installation check vbulletin options. You can add usergroups (who can change color) and exclude colors from use.
You have only to add the field ID of the profile field which use for username colors and set the usergroup IDs.

Username color is changed globally.
Will give it a shot, do i need to undo the other changes I made to postbit etc?
Reply With Quote
  #30  
Old 01-07-2015, 10:25 AM
Scandal's Avatar
Scandal Scandal is offline
 
Join Date: Dec 2005
Location: Athens / Greece
Posts: 409
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by TC-Jamech View Post
Will give it a shot, do i need to undo the other changes I made to postbit etc?
Yes, this hack doesn't need template edits.
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 10:44 AM.


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.04339 seconds
  • Memory Usage 2,283KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete