MyBB Community Forums

Full Version: Coloured postbit backgrounds
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Ok, I also had a look at your site. Big Grin You have an image on the post content, so it would actually make sense to use an image rather than a colour, or make the background image none.

so, in css:

.usergroup4 { 
background-color: red;
background-image: none;
color: white;
}

{$ignore_bit}
 <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
 <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
     <tbody>
         <tr>
             <td class="tcat">
                 <div class="float_left smalltext">
                     {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
                 </div>
                 {$post['posturl']}
             </td>
         </tr>

         <tr>
             <td class="trow1 {$unapproved_shade}">
                 <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                     <tr>
                         <td class="post_avatar" width="1" style="{$post['avatar_padding']}">
                             {$post['useravatar']}
                         </td>
                         <td class="post_author">
                             <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
                             <span class="smalltext">
                                 {$post['usertitle']}<br />
                                 {$post['userstars']}
                                 {$post['groupimage']}
                             </span>
                         </td>
                         <td class="smalltext post_author_info" width="165">
                             {$post['user_details']}
                         </td>
                     </tr>
                 </table>
             </td>
         </tr>

         <tr>
             <td class="trow2 post_content usergroup{$post['usergroup']} {$unapproved_shade}">
                 <span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

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

                 <div class="post_meta" id="post_meta_{$post['pid']}">
                 {$post['iplogged']}
                 </div>
             </td>
         </tr>

         <tr>
             <td class="trow1 post_buttons {$unapproved_shade}">
                 <div class="author_buttons float_left">
                     {$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
                 </div>
                 <div class="post_management_buttons float_right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
                 </div>
             </td>
         </tr>
     </tbody>
 </table>
(2012-11-09, 04:54 PM)Leefish Wrote: [ -> ]Ok, I also had a look at your site. Big Grin You have an image on the post content, so it would actually make sense to use an image rather than a colour, or make the background image none.

so, in css:

.usergroup4 { 
background-color: red;
background-image: none;
color: white;
}

{$ignore_bit}
 <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
 <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
     <tbody>
         <tr>
             <td class="tcat">
                 <div class="float_left smalltext">
                     {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
                 </div>
                 {$post['posturl']}
             </td>
         </tr>

         <tr>
             <td class="trow1 {$unapproved_shade}">
                 <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                     <tr>
                         <td class="post_avatar" width="1" style="{$post['avatar_padding']}">
                             {$post['useravatar']}
                         </td>
                         <td class="post_author">
                             <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
                             <span class="smalltext">
                                 {$post['usertitle']}<br />
                                 {$post['userstars']}
                                 {$post['groupimage']}
                             </span>
                         </td>
                         <td class="smalltext post_author_info" width="165">
                             {$post['user_details']}
                         </td>
                     </tr>
                 </table>
             </td>
         </tr>

         <tr>
             <td class="trow2 post_content usergroup{$post['usergroup']} {$unapproved_shade}">
                 <span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

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

                 <div class="post_meta" id="post_meta_{$post['pid']}">
                 {$post['iplogged']}
                 </div>
             </td>
         </tr>

         <tr>
             <td class="trow1 post_buttons {$unapproved_shade}">
                 <div class="author_buttons float_left">
                     {$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
                 </div>
                 <div class="post_management_buttons float_right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
                 </div>
             </td>
         </tr>
     </tbody>
 </table>

Ok that has worked but now the actual post is red and not the postbit? Maybe this was my wrong coding? Did i do something wrong? I would like the actual postbit read not really the whole thread.
OH. You want the side panel in red? or the upper panel where the user details are?
(2012-11-09, 05:00 PM)Leefish Wrote: [ -> ]OH. You want the side panel in red? or the upper panel where the user details are?

The bit up the top aha like this:

http://www.clansurreal.com/board/thread-5171.html
Right.................

CSS
.usergroup4 { 
background-color: #501A1D;
background-image: none;
color: white;
}

Postbit
{$ignore_bit}
 <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
 <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
      <tbody>
          <tr>
              <td class="tcat">
                  <div class="float_left smalltext">
                      {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
                  </div>
                  {$post['posturl']}
              </td>
          </tr>

          <tr>
              <td class="trow1 usergroup{$post['usergroup']} {$unapproved_shade}">
                  <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                      <tr>
                          <td class="post_avatar" width="1" style="{$post['avatar_padding']}">
                              {$post['useravatar']}
                          </td>
                          <td class="post_author">
                              <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
                              <span class="smalltext">
                                  {$post['usertitle']}<br />
                                  {$post['userstars']}
                                  {$post['groupimage']}
                              </span>
                          </td>
                          <td class="smalltext post_author_info" width="165">
                              {$post['user_details']}
                          </td>
                      </tr>
                  </table>
              </td>
          </tr>

          <tr>
              <td class="trow2 post_content {$unapproved_shade}">
                  <span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

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

                  <div class="post_meta" id="post_meta_{$post['pid']}">
                  {$post['iplogged']}
                  </div>
              </td>
          </tr>

          <tr>
              <td class="trow1 post_buttons {$unapproved_shade}">
                  <div class="author_buttons float_left">
                      {$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
                  </div>
                  <div class="post_management_buttons float_right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
                  </div>
              </td>
          </tr>
      </tbody>
 </table>
(2012-11-09, 05:08 PM)Leefish Wrote: [ -> ]Right.................

CSS
.usergroup4 { 
background-color: #501A1D;
background-image: none;
color: white;
}

Postbit
{$ignore_bit}
 <a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
 <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
      <tbody>
          <tr>
              <td class="tcat">
                  <div class="float_left smalltext">
                      {$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}">{$post['editedmsg']}</span>
                  </div>
                  {$post['posturl']}
              </td>
          </tr>

          <tr>
              <td class="trow1 usergroup{$post['usergroup']} {$unapproved_shade}">
                  <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                      <tr>
                          <td class="post_avatar" width="1" style="{$post['avatar_padding']}">
                              {$post['useravatar']}
                          </td>
                          <td class="post_author">
                              <strong><span class="largetext">{$post['profilelink']}</span></strong> {$post['onlinestatus']}<br />
                              <span class="smalltext">
                                  {$post['usertitle']}<br />
                                  {$post['userstars']}
                                  {$post['groupimage']}
                              </span>
                          </td>
                          <td class="smalltext post_author_info" width="165">
                              {$post['user_details']}
                          </td>
                      </tr>
                  </table>
              </td>
          </tr>

          <tr>
              <td class="trow2 post_content {$unapproved_shade}">
                  <span class="smalltext"><strong>{$post['icon']}{$post['subject']} {$post['subject_extra']}</strong></span>

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

                  <div class="post_meta" id="post_meta_{$post['pid']}">
                  {$post['iplogged']}
                  </div>
              </td>
          </tr>

          <tr>
              <td class="trow1 post_buttons {$unapproved_shade}">
                  <div class="author_buttons float_left">
                      {$post['button_email']}{$post['button_pm']}{$post['button_www']}{$post['button_find']}{$post['button_rep']}
                  </div>
                  <div class="post_management_buttons float_right">{$post['button_spam']}{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_multiquote']}{$post['button_report']}{$post['button_warn']}{$post['button_reply_pm']}{$post['button_replyall_pm']}{$post['button_forward_pm']}{$post['button_delete_pm']}
                  </div>
              </td>
          </tr>
      </tbody>
 </table>

Thank you so much! although i do have some questions if i wanted to add different colour backgrounds for other usergroups such as mods blue. How would that be done? And also if i wanted to use an image instead how would that be done?
It is exactly the same, look at the logic of it.

Say you have a usergroup of 6. Then you make a css called usergroup6. You don't need to change the html because it gets the usergroup dynamically.

In the css of usergroup 6 then you add the colors you want to use. If you want an image then take out the background-color and where it says background-image:none, put a link to the background image. For exact syntax look at how the thead and tcat get their images.
(2012-11-09, 05:22 PM)Leefish Wrote: [ -> ]It is exactly the same, look at the logic of it.

Say you have a usergroup of 6. Then you make a css called usergroup6. You don't need to change the html because it gets the usergroup dynamically.

In the css of usergroup 6 then you add the colors you want to use. If you want an image then take out the background-color and where it says background-image:none, put a link to the background image. For exact syntax look at how the thead and tcat get their images.

You my friend are a legend. Thanks so much for the help.
I know I'm kinda bumping this thread, but is there a way to make the color transparent?
So you see it, but it's like see threw.

I used the one that changes the thread color not the panels.
Thanks
Pages: 1 2