[How to] Get usercolor on Rank text

How-to's, little tricks, tutorials, code examples (snippets) and read-me's.

[How to] Get usercolor on Rank text

Postby Stoker » 25 Mar 2008, 17:28

Hello :hello:

I like the way Sniper_E has colored the Rank text on the Sniperblue style here at STG :good:
I searched but couldn't find out how he did this.

I figured out that it had to be something with usercolor.
And here it is.

Open styles/prosilver/template/viewtopic_body.html
Find:
Code: Select all
<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd>{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->

Inline find:
Code: Select all
{postrow.RANK_TITLE}

Replace with:
Code: Select all
<b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="font-size:12px; color: {postrow.POST_AUTHOR_COLOUR}" <!-- ENDIF -->>{postrow.RANK_TITLE}</b>


Open styles/subsilver2/template/viewtopic_body.html
Find:
Code: Select all
<td class="postdetails">{postrow.RANK_TITLE}</td>

Replace with:
Code: Select all
<td class="postdetails"><b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="font-size:12px; color: {postrow.POST_AUTHOR_COLOUR}" <!-- ENDIF -->>{postrow.RANK_TITLE}</b></td>


About the:
Code: Select all
font-size:12px;

You can increase, decrease or remove this if You want.
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4


Re: [How to] Get usercolor on Rank text

Postby Brandon05 » 25 Apr 2008, 04:41

Very nice tutorial. I will bookmark this one for my upcoming phpBB3 Style.

Thanks. :thumbsup:
Brandon Kaylor
Web & Graphic Designer
User avatar
Brandon05    
Style Author
Style Author
 
Posts: 323
Joined: 22 Apr 2008, 18:39
Location: Grand Rapids, Michigan
Gender: Male
phpBB Knowledge: 9

Re: [How to] Get usercolor on Rank text

Postby Sniper_E » 25 Apr 2008, 06:41

You could have asked how I did it.
Code: Select all
               <td class="postdetails" align="center"><b class="genmed"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.RANK_TITLE}</b></td>
There.

I even had the message in the user's color at one time, but that was WAY to much.
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How to] Get usercolor on Rank text

Postby Stoker » 25 Apr 2008, 06:55

Sniper_E wrote:You could have asked how I did it.
Code: Select all
               <td class="postdetails" align="center"><b class="genmed"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.RANK_TITLE}</b></td>
There.

I even had the message in the user's color at one time, but that was WAY to much.


You are right. But then I would have missed the fun in figuring it out :grin:
Stoker
Stoker    
Borg Drone
Borg Drone
 
Posts: 401
Joined: 24 Nov 2007, 11:05
Location: Denmark
Favorite Team: Highslide JS
Gender: Male
phpBB Knowledge: 4

Re: [How to] Get usercolor on Rank text

Postby Sniper_E » 26 Apr 2008, 21:08

Noticed how our 2 lines were written almost exactly the same? Great minds think something alike! ;)

Good tutorial by the way.... you do good work everywhere Stoker. :good:
I like your style!
Image
No is NEVER an Option and NEVER is the only Option when it comes to Giving Up!
User avatar
Sniper_E    
STG Jedi Master
STG Jedi Master
 
Posts: 6991
Joined: 31 May 2006, 06:29
Location: Shreveport, LA
Favorite Team: The STG Team
Gender: Male
phpBB Knowledge: 6

Re: [How to] Get usercolor on Rank text

Postby Potku » 11 Dec 2008, 06:49

Great MOD, we like this one :cool:

Would there be a way that on top this the rank title would be link to a certain group (to which that user belongs and is that user's default group)?
Potku    
Cadet II
Cadet II
 
Posts: 25
Joined: 25 Jun 2008, 06:12
Gender: Male
phpBB Knowledge: 1

Re: [How to] Get usercolor on Rank text

Postby Gekozen » 02 Feb 2009, 06:41

Thanks i like a lot :D I had to search to fine what i change to change the colours, so maybe you could explain this in your post, so people without as much PHPBB3 knoledge can find it. Thanks Dan. (First post tehe)
Gekozen    
Crewman
Crewman
 
Posts: 3
Joined: 02 Feb 2009, 06:34
Gender: Male
phpBB Knowledge: 5

Re: [How to] Get usercolor on Rank text

Postby Sir Glen » 14 Jun 2011, 01:22

I love this. :)

Odd Question though; say I wanted the rank title to be below the rank image, rathen than above, how would I do that? I tried it myself (and it worked) but the spacing was wrong. There was a line break between the username and the rank image, and the rank image itself was all the way left against the virtical line separating the post text and the info area. I don't know enough html to know how to fix it, though obviously it has something to do with the <br /> tag.
Sir Glen
Supporter
Supporter
 
Posts: 235
Joined: 21 Jun 2008, 20:19
Gender: Male
phpBB Knowledge: 2

Re: [How to] Get usercolor on Rank text

Postby imant7 » 08 Mar 2012, 11:03

Thank you for color tutorial! Very useful..
imant7    
Crewman
Crewman
 
Posts: 1
Joined: 08 Mar 2012, 10:32
Gender: Female
phpBB Knowledge: 5


Return to Tutorials and How-Tos

Who is online

Users browsing this forum: MSNbot Media and 7 guests