![]() |
Custom VIP username color
Hi everyone,
So I've searched the forums for some sort of custom vip, but no joy. I managed to get hold of a custom VIP script however what gives anyone within the VIP group to change their user rank colour . How do I go about making this possible for usernames too? This is the script I used for my usergroup (placed in postbit_legacy): Code:
<if condition="is_member_of($post, 14)"> Code:
<div id="postmenu_$post[postid]"> |
You would need to make changes in the memberaction_dropdown template, as that is where the posters username is pulled from.
|
Quote:
|
in usergroup manager edit your vip group and in the Username HTML Markup
first box put Code:
<span style="color:yellow;font-weight:bold;text-shadow: 1px 1px 10px yellow;"> Code:
</span> not sure if this is the type of thing you are looking for |
Quote:
|
Quote:
Code:
<a class="bigusername" href="member.php?$session[sessionurl]u=$post[userid]">$post[musername]</a> |
Update;
I've managed to get the username colour working on postbit, however, it isn't on the forum home.. Any idea? Postbit code: Code:
<if condition="$show['profile']"> Code:
<tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]"> |
They are Usergroup colours that show in the forumhome, the usergroup colours are set in the usergroup manager for each usergroup.
|
Yeah I don't think you can do that easily, as the $post variable is only available in the postbit template.
|
Quote:
|
Actually you want to use $bbuserinfo['fieldX'] instead of $post[fieldX] for forumhome.
|
Using $bbuserinfo['fieldX'] will use your fieldX for every user.
I think this can be done everywhere with a plugin using hook fetch_musername and code like this: Code:
if (is_member_of($user, 27)) |
Yeah, that's not going to work in the "who's online" because of missing field9 for those users. A few other people have asked about similar things over the past few years, and I looked at the threads quickly but didn't find a complete answer. I'll look at it a little more tomorrow if you haven't worked it out by then.
|
Quote:
I've seen several sites use it, but non are prepared to share the code. |
1 Attachment(s)
OK, I made you a product xml that you should be able to import, and attached it. In case you don't know already, to do that you go to Plugins & Products > Manage Products and click on the "Add/Import Products" link at the bottom. Then press the "Choose File" button and find the xml file (you would have saved to your computer already), then press "Import".
I did try this but I'm not 100% certain it will add the color everywhere you need (some places just don't have it at all even if you set it in the usergroup manager). But you should be able to remove the edits you made in the postbit template, if you want. Hopefully this is what you wanted. Otherwise, let me know. |
Quote:
|
I thought it would work for users online. Sorry if this is a stupid question, but what part are you talking about exactly? Is it "Currently Active Users" on index.php? Maybe I'm thinking of a different section.
|
Quote:
|
Hmm...it's working for me in "Currently Active Users" (which was kind of the point of it). I don't think I can help you with the mod, I don't know anything about it.
Your VIP group is 27, and the profile field is 9, right? I hard-coded those in that plugin. If you right click one of the user names and "Inspect Element" (or whatever it is for your browser), do you see the <span style="... tags around the user name? |
Quote:
Just one more thing, how do I bold the usernames? as I currently have <b> </b> in the usergroup manager for that user, but isn't showing as bold? I'm guessing I need to modify the plugin you gave? |
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'])) |
Quote:
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. |
OK, how will you know when you want the display usergroup and when you want the profile field color?
|
Quote:
https://vborg.vbsupport.ru/external/2015/01/5.gif 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 |
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. |
Quote:
|
1 Attachment(s)
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. |
Oh good, I was meaning to get back to that. Now you've saved me the trouble.
|
Quote:
|
Quote:
|
Quote:
- Thread Starters - Last Posters - Online users info per forum Does anyone know how to add a hook to cover those? Thanks! |
All times are GMT. The time now is 05:06 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|