MyBB Tutorials

Different usertitle style based on defined uid

Submitted by linkzy, , Thread ID: 52

Thread Closed
15-01-2015, 07:55 AM
This post was last modified: 17-01-2015, 09:19 AM by linkzy
#1
You Need Php Template conditional plugin

1- Now open postbit template or postbit_classic whatever one you actually using
Find:
Code (Text):
{$post['usertitle']}
Replace it with:
PHP:
PHP Code:
<if $post['uid'] == 2 then>
                <
span style="color: red;">{$post['usertitle']}</span>
<else />
{
$post['usertitle']}
</if><
br /> 

This will give the user with the id = 2 different usertitle style wich ofc is defined by you.


Now this will work on postbit only, if you want to change it on member profile too do this:
1- Open Member Template -> member_profile
Find:
PHP Code:
{$usertitle
Replace it with:

PHP Code:
<if $memprofile['uid'] == 2 then>
                <
span style="color: red;">paki wizard</span>
<else>
{
$usertitle}
</if><
br /> 


That's it, hope you enjoyed the tutorial.
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Different usertitle style based on defined uid

OP
#2
17-01-2015, 08:59 AM
dnyan247 Wrote:
How i can provide different styles to each user of same group

Well you mean user in a group right ??

if so then


<if $post['usergroup'] == groupidhere then>

Stuffs done D:


In Member prof

<if $memprofile['usergroup'] == groupidhere then>
Done D:
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Different usertitle style based on defined uid

This post was last modified: 17-01-2015, 09:17 AM by Blowjob
#3
Quick suggestion,

replace
Code:
<if $memprofile['uid'] == 2 then>
                <span style="color: red;">paki wizard</span><br />
<else>
{$usertitle}
</if>

with

Code:
( <if $memprofile['uid'] == 1 then>
                <span style="color: red;">paki wizard</span>
<else>
{$usertitle}
</if> )<br/>

as if you don't, you'll get this:

[Image: oKaKk6I.png]

but if you do, you'll get this

[Image: ZI7mbIo.png]

RE: Different usertitle style based on defined uid

OP
#4
17-01-2015, 09:16 AM
Hug Wrote:
Quick suggestion,

replace

Code:
<if $memprofile['uid'] == 2 then>
                <span style="color: red;">paki wizard</span><br />
<else>
{$usertitle}
</if>

with


Code:
( <if $memprofile['uid'] == 1 then>
                <span style="color: red;">paki wizard</span>
<else>
{$usertitle}
</if> )<br/>

as if you don't, you'll get this:

[Image: oKaKk6I.png]

but if you do, you'll get this

[Image: ZI7mbIo.png]

oh yeah use the second one broh
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Different usertitle style based on defined uid

This post was last modified: 23-01-2015, 03:15 AM by Blowjob
#5
17-01-2015, 09:19 AM
Mr_Devil Wrote:
17-01-2015, 09:16 AM
Hug Wrote:
Quick suggestion,

replace


Code:
<if $memprofile['uid'] == 2 then>
                <span style="color: red;">paki wizard</span><br />
<else>
{$usertitle}
</if>

with



Code:
( <if $memprofile['uid'] == 1 then>
                <span style="color: red;">paki wizard</span>
<else>
{$usertitle}
</if> )<br/>

as if you don't, you'll get this:

[Image: oKaKk6I.png]

but if you do, you'll get this

[Image: ZI7mbIo.png]

oh yeah use the second one broh

Thank you for noticing you're mistake ~

RE: Different usertitle style based on defined uid

OP
#6
17-01-2015, 09:21 AM
Hug Wrote:
17-01-2015, 09:19 AM
Mr_Devil Wrote:
17-01-2015, 09:16 AM
Hug Wrote:
Quick suggestion,

replace



Code:
<if $memprofile['uid'] == 2 then>
                <span style="color: red;">paki wizard</span><br />
<else>
{$usertitle}
</if>

with




Code:
( <if $memprofile['uid'] == 1 then>
                <span style="color: red;">paki wizard</span>
<else>
{$usertitle}
</if> )<br/>

as if you don't, you'll get this:

[Image: oKaKk6I.png]

but if you do, you'll get this

[Image: ZI7mbIo.png]

oh yeah use the second one broh

lol what?

Well i wrote that code by mistake :'( so ok use the one which ur using now
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Different usertitle style based on defined uid

#7
Hug I should of done it on your forum first...

RE: Different usertitle style based on defined uid

#8
Also question, will you have to do this for every user or will it still use usergroup colours by it self?

RE: Different usertitle style based on defined uid

OP
#9
17-01-2015, 10:09 AM
Tom Wrote:
Also question, will you have to do this for every user or will it still use usergroup colours by it self?

i didnt got you
| A | v4hl| Addicted | Senpai | Sui | Sensei | H | fdigl |


RE: Different usertitle style based on defined uid

#10
17-01-2015, 09:24 AM
Tom Wrote:
Hug I should of done it on your forum first...

Nope!

Users browsing this thread: 5 Guest(s)