Different usertitle style based on defined uid

by linkzy - 15-01-2015, 07:55 AM
لا إله إلا الله‎
Posts:
6,327
Joined:
Jan 2015
Likes:
299
Credits:
318
Reputation:
162
2 Years of Service
#1
OP
Posted: 15-01-2015, 07:55 AM (This post was last modified: 17-01-2015, 09:19 AM by linkzy.)
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.
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

Novice
Posts:
31
Joined:
Jan 2015
Likes:
0
Credits:
28
Reputation:
0
2 Years of Service
#2
Posted: 17-01-2015, 08:59 AM
How i can provide different styles to each user of same group
لا إله إلا الله‎
Posts:
6,327
Joined:
Jan 2015
Likes:
299
Credits:
318
Reputation:
162
2 Years of Service
#3
OP
Posted: 17-01-2015, 09:09 AM
(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:
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

Closed Account
Posts:
2,770
Joined:
Jan 2015
Likes:
140
Credits:
1,402
Reputation:
26
2 Years of Service
#4
Posted: 17-01-2015, 09:16 AM (This post was last modified: 17-01-2015, 09:17 AM by Hug.)
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]
لا إله إلا الله‎
Posts:
6,327
Joined:
Jan 2015
Likes:
299
Credits:
318
Reputation:
162
2 Years of Service
#5
OP
Posted: 17-01-2015, 09:19 AM
(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
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

Closed Account
Posts:
2,770
Joined:
Jan 2015
Likes:
140
Credits:
1,402
Reputation:
26
2 Years of Service
#6
Posted: 17-01-2015, 09:21 AM (This post was last modified: 23-01-2015, 03:15 AM by Hug.)
(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 ~
لا إله إلا الله‎
Posts:
6,327
Joined:
Jan 2015
Likes:
299
Credits:
318
Reputation:
162
2 Years of Service
#7
OP
Posted: 17-01-2015, 09:23 AM
(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
| Monopoly- Best forever .. | v4hl - ;) | Addicted | Senpai | Nyan | Sensei | H | fdigl |
[Image: gZD4Fba.png]

Tom yum soup <3
Angels
Posts:
1,695
Joined:
Jan 2015
Likes:
77
Credits:
1,233
Reputation:
41
2 Years of Service
#8
Posted: 17-01-2015, 09:24 AM
Hug I should of done it on your forum first...
Novice
Posts:
31
Joined:
Jan 2015
Likes:
0
Credits:
28
Reputation:
0
2 Years of Service
#9
Posted: 17-01-2015, 09:38 AM
Thanks Devil i got it
Tom yum soup <3
Angels
Posts:
1,695
Joined:
Jan 2015
Likes:
77
Credits:
1,233
Reputation:
41
2 Years of Service
#10
Posted: 17-01-2015, 10:09 AM
Also question, will you have to do this for every user or will it still use usergroup colours by it self?
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)