Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 6 Years, 3 Months, 1 Week ago Postbit Colors for Groups.
#1
Solved: 6 Years, 3 Months, 1 Week ago
I want to show groupcolours on postbits.

Example.
Admin group color: red
and I want to add border-left: color: red; on postbit but only for admins.

I mean like this.
http://www.clansurreal.com/board/thread-...pid1080553

http://img487.yukle.tc/images/1901aa.jpg

Help me thanks Smile

Sorry for english.
#2
Solved: 6 Years, 3 Months, 1 Week ago
You mean like this?

http://gyazo.com/f6b86e936f88dcf6ff9cbf729140ece2
#3
Solved: 6 Years, 3 Months, 1 Week ago
please ignore this

see this guidance --> http://community.mybb.com/thread-134747.html
#4
Solved: 6 Years, 3 Months, 1 Week ago
(07-13-2013, 04:24 PM)jamie1990 Wrote: You mean like this?

http://gyazo.com/f6b86e936f88dcf6ff9cbf729140ece2

nope. I mean like this: http://img487.yukle.tc/images/1901aa.jpg
you see blue border.
#5
Solved: 6 Years, 3 Months, 1 Week ago
First we have to add a special class to our postbit templates to override the default post colors. For that open the template:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit

and find:

<td class="trow2 post_content {$unapproved_shade}">

Now we have to add our special class post{$usergroup['gid']} to it. So, change the code to:

<td class="trow2 post_content post{$usergroup['gid']} {$unapproved_shade}">

Note that: You have to place the class
a) after class 'trow2' else the 'trow2' background color will govern.
b) before class'{$unapproved_shade}' so that Unapproved post's color can lead over any user's post.

Do the same thing with postbit_classic template. Open:

ACP > Templates & Styles > Templates > [Theme Name] Templates > Postbit Templates > postbit_classic

and find:

<div id="pid_{$post['pid']}" class="post_body">

Change the code to:

<div id="pid_{$post['pid']}" class="post_body post{$usergroup['gid']}">

Now the CSS, main trick part. Our dynamic class 'post{$usergroup['gid']}' will change at runtime based on group ID. ie. for all the posts of admins (default group ID is 4) it will be post4, for all the posts of members (default group ID is 2) it will be post2

So, as we said, if we want to target the specific group, for our example, say Moderators (default group ID is 6) we will declare our CSS class as .post6

Now, open your global.css and add at the end (or any suitable location):

.post6 {
    background: none repeat scroll 0 0 #1B1B1B;
    border-bottom: medium none;
    border-left: 5px solid #YOUR USERGROUP COLOR HEX CODE;
    padding: 12px;
}

And save global.css

All the above instructions belong to a tutorial written by Effone except for the script to save in global.css

Link:
http://community.mybb.com/thread-134747.html
#6
Solved: 6 Years, 3 Months, 1 Week ago
Thanks for your messages. I will try Smile
#7
Solved: 6 Years, 3 Months, 1 Week ago
Weird my default copy of MyBB has it which I use for testing.

It should be in the postbit template, instead of CTRL + F, you need to search manually because the find feature in browsers doesn't show accurate results when searching codes.

Edited

Oh and also if you don't know where to get a color hex code, use the website below. I use it myself so I can vouch for it.

Link: http://html-color-codes.info/
#8
Solved: 6 Years, 3 Months, 1 Week ago
Thanks for helping I did it Smile
#9
Solved: 6 Years, 3 Months, 1 Week ago
No problem. Most credits go to Effone for the tutorial Smile
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)