View Full Version : user title html markup
Chadi
10-11-2008, 05:47 PM
Vbulletin by default has the usergroup > html markup feature. However, I'd like one specifically for user TITLE html markup as well. Couldn't find any here, either in modification graveyard or not quite that feature but close.
I tried to figure it out on my own, but not a coder by trade.
For one, I want this applied in postbit_legacy at least. So I went to that template.
I see this:
<if condition="$post['usertitle']"><div class="smallfont">$post[usertitle]</div></if>
Now, on my home page shoutbox you cannot use it unless you're a registered member. So I have this if rule applied to the text box area of the shoutbox:
<if condition="in_array($bbuserinfo['usergroupid'], array(2,6,7,35))">
I'm trying to figure out a way to apply the same thing specifically for the admin and moderator usergroup, to the user title. Any help on this appreciated.
Lynne
10-11-2008, 08:04 PM
<if condition="is_member_of($bbuserinfo, 2,6,7,35)">
for just admins and mods:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
dannykilla
10-13-2008, 01:34 PM
So where on the postbit template do you place the code
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
Dan
Lynne
10-13-2008, 05:13 PM
So where on the postbit template do you place the code
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
Dan
Around the item that you only want shown to users in usergroup 5, 6, or 7.
dannykilla
10-13-2008, 07:56 PM
Like this?
<if condition="is_member_of($bbuserinfo, 5, 6, 7)"><div class="smallfont">$post[usertitle]</div></if>
if so it didn't work for me?
Lynne
10-13-2008, 08:16 PM
What is it you are trying to do? What you are trying to do will influence what variables to use. The condition that is written will only show certain information to a user if the *user looking at the thread* is a moderator/supermod/admin. If you only want to show it if the poster is a moderator/supermod/admin, then use $post in the condition.
dannykilla
10-13-2008, 08:23 PM
Basically I want to have my user title have the colour like my username for example :
in my postbit I have at the min this:
Dannykilla
Guild Leader
I want it to show this:
Dannykilla
Guild Leader
Lynne
10-13-2008, 10:43 PM
It's not quite that easy to do what you want. Your username actually gets processed through a function called fetch_musername to determine what is should be displayed as. You might be able to modify that function to do the same for the title (includes/functions.php). It might be easier to just modify the postbit to add the style directly. ie for red admins:
<if condition="is_member_of($post, 6)"><div style="color:red;">$post[usertitle]</div></if>
dannykilla
10-13-2008, 10:47 PM
Thanks Lynne, but I have sorted it now I just copied the <span style .... >
into the User title box and that worked !!!!!
Lynne
10-13-2008, 11:06 PM
Yes, if you use that, then that would work also. (I don't use that so I'd have to do it a different way on my site.)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.