PDA

View Full Version : Custom username colour based on profile field


RobLeonard
05-11-2020, 04:19 PM
Hi all,

I have searched long and hard on here but cannot find the answer to my question. I want to create a plugin on the fetch_musername hook which changes the username colour if my VIP usergroup have set the option for it.

VIP usergroup ID: 10
Profile field Id: 5

Profile field is limited to 7 characters which is the hex code and the hash.

If a custom colour is selected, this should be shown globally across the forum and not just on the users posts. This should cover staff page, profiles, etc.

Many thanks
Rob

Dr.CustUmz
05-15-2020, 06:18 AM
I cant relly play around with the plugins right now, but an idea of what you'll want to replace username with change both instances of USERNAME to the username variable, and give this a try in postbit template.

<if condition="$post['usergroupid'] == 10">
<if condition="$userinfo['field7']">
<span style="color: #$userinfo['field7']">
USERNAME
</if>
<else />
Username
</if>