MyBB Source

everyBB - The forum owners community

4,000 Members! | Small Policy Change

Latest Releases: Valid Referrals - Bonus - Mark Thread Read

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Default post color defined by user
Author Message
Svizy Away
Support Team
*******
Support

Posts: 1,865
Joined: Aug 2009
Reputation: 8
MyBux: 1181
Post: #1
Default post color defined by user
I've recently been editing and modding vBulletin for my new forum and I came accross this simple code edit which can be ported to MyBB without any complications or risks and its really easy to do it. Now enought chit-chat and lets go to work Tongue

Edited files:
  • postbit (MyBB default postbit)
  • postbit_classic (MyBB secondary postbit)
Whichever you are using, works with both. Names next to the postbits are just to help you indicate the right part of the tutorial Wink

Easiest part of this tutorial
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to Custom Profile Fields (Configuration -> Custom Profile Fields)
  3. Create new profile field and make sure to set its maximum lenght to 7
  4. Save the profile field
  5. Hoover your mouse over the profile field to see its id which is important for the template edit
So, now if you go to your User CP and Edit Profile, there you should be able to see the field you just created.

Easy part of this tutorial (MyBB default postbit)
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
  3. Locate Post Bit Templates and expand it (Click its name or click Expand)
  4. Click the 1st template located in Post Bit Templates, its called postbit
  5. Find this part of code:
    PHP Code:
    <div class="post_body" id="pid_{$post['pid']}">
                        {
    $post['message']}
                    </
    div
    Replace above code with this one:
    PHP Code:
    <div class="post_body" id="pid_{$post['pid']}">
                        <
    span style="color:{$post['fid<numberhere>']};">{$post['message']}</span>
                    </
    div
    Replace <numberhere> with your Custom Profile Field number!
  6. Save your edit by clicking Save and Return to Listing button
At this point you're done if you don't allow users to use vertical postbit. Follow steps bellow if you use vertical postbit as well Wink

Easy part of this tutorial (MyBB secondary postbit)
  1. Login to Admin CP using your username and password (duh!)
  2. Navigate yourself to YOURTHEME templates (Templates & Style -> Templates -> YOURTHEME)
  3. Locate Post Bit Templates and expand it (Click its name or click Expand)
  4. Click the 13th template located in Post Bit Templates, its called postbit_classic
  5. Find this part of code:
    PHP Code:
    <div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
                    {
    $post['message']}
                </
    div
    Replace above code with this one:
    PHP Code:
    <div id="pid_{$post['pid']}" style="padding: 5px 0 5px 0;">
                    <
    span style="color:{$post['fid<numberhere>']}">{$post['message']}</span>
                </
    div
    Replace <numberhere> with your Custom Profile Field number!
  6. Save your edit by clicking Save and Return to Listing button
At this point you're really finished. Enjoy this new feature of your board Wink

Demo: http://community.old-sql.net/

Credits:
  • Guy who "created" this feature for vBulletin
  • Svizy (meh) for porting it to MyBB

Svizy - MyBBSource Support Team
02-25-2010 05:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply

Advertisement

euantor Offline
Designer/Themer
****

Posts: 503
Joined: Jun 2009
Reputation: 1
MyBux: 577
Post: #2
RE: Default post color defined by user
Pretty simple stuff =P You could do the same with fonts etc too though ^^

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
02-25-2010 05:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Svizy Away
Support Team
*******
Support

Posts: 1,865
Joined: Aug 2009
Reputation: 8
MyBux: 1181
Post: #3
RE: Default post color defined by user
(02-25-2010 05:57 PM)euantor Wrote:  Pretty simple stuff =P You could do the same with fonts etc too though ^^
Yeah, but that would mean a lot of textboxes (if you do it this way) and then it would need own User CP settings page Tongue

And yeah, why should we complicate it if it can be done in a easy way? Wink

Svizy - MyBBSource Support Team
02-25-2010 06:08 PM
Visit this user's website Find all posts by this user Quote this message in a reply
euantor Offline
Designer/Themer
****

Posts: 503
Joined: Jun 2009
Reputation: 1
MyBux: 577
Post: #4
RE: Default post color defined by user
Yeah. I guess =P

Love to play XBox 360? Visit http://www.360elites.net for News, Reviews & Previews of the biggest up-coming and current games like Halo:Reach, Battlefield: Bad Company 2 and more. We have forums too!

Visit http://www.mypurebb.com/ to see some examples of my work with MyBB themes and web designs. I even sometimes take on custom jobs, so why not sign up to the forums so you know when I'm open and designing?
02-25-2010 08:43 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mastermunj Offline
Senior Member
****

Posts: 546
Joined: Aug 2009
Reputation: 2
MyBux: 954
Post: #5
RE: Default post color defined by user
Easy and tiny tutorial!

Would have been great if a demo link where you implemented it can be available OR a screenshot of the outcome be shown 001_smile

PTC Squad - Against All Scams | Local Search Talks - Localization of Search Engines | SEO Help Forums
02-25-2010 09:42 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Svizy Away
Support Team
*******
Support

Posts: 1,865
Joined: Aug 2009
Reputation: 8
MyBux: 1181
Post: #6
RE: Default post color defined by user
(02-25-2010 09:42 PM)mastermunj Wrote:  Would have been great if a demo link where you implemented it can be available OR a screenshot of the outcome be shown 001_smile
I know its a little late, but still, I've added link to the forum where you can check out this feature.

I've also noticed that this doesn't work on forum portal, so I'll try to make it for portal as well Wink

Demo: http://community.old-sql.net/

Svizy - MyBBSource Support Team
04-03-2010 08:01 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Mikers Offline
Tutorials Team Member
***
Tuts Team

Posts: 146
Joined: Mar 2010
Reputation: 3
MyBux: 1939
Post: #7
RE: Default post color defined by user
Pretty cash tutorial there, Svizy.

Meaning it's great. 001_smile

MyBB Source Tutorials
04-05-2010 02:21 AM
Find all posts by this user Quote this message in a reply
Post Reply 





Web Design | Web Design Jobs