vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Design and Graphics Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=253)
-   -   Need Help Changing Post Color for Administrators! (https://vborg.vbsupport.ru/showthread.php?t=281331)

Aleks 04-09-2012 07:51 PM

Need Help Changing Post Color for Administrators!
 
Can anyone please tell me how to change the whole background color for when administrators post on vB 4.1? I'm not talking about text background, I mean the whole entire background of the post. Thanks a lot in advanced!

ForceHSS 04-09-2012 08:21 PM

only way would be to code it or a custom plugin

SEOvB 04-09-2012 08:55 PM

Hey There,

This is a quick & dirty fix.

Add this plugin to your postbit_display_start hook:

PHP Code:

if($this->post->usergroupid == 6) {
        
$this->post['is_admin'] = true;


Find the div in your postbit template with the postrow class, and edit it.

Before:
HTML Code:

<div class="postrow">
After:
HTML Code:

<div class="postrow" <vb:if condition="$post['is_admin']">style="background-color: #ddd"</vb:if>>
Change the #ddd to whatever color you want.

No guarantees, but that should work :).

-Nick, SEOvB Developer

Aleks 04-09-2012 09:14 PM

Quote:

Originally Posted by SEOvB (Post 2318472)
Hey There,

This is a quick & dirty fix.

Add this plugin to your postbit_display_start hook:

PHP Code:

if($this->post->usergroupid == 6) {
        
$this->post['is_admin'] = true;


Find the div in your postbit template with the postrow class, and edit it.

Before:
HTML Code:

<div class="postrow">
After:
HTML Code:

<div class="postrow" <vb:if condition="$post['is_admin']">style="background-color: #ddd"</vb:if>>
Change the #ddd to whatever color you want.

No guarantees, but that should work :).

-Nick, SEOvB Developer

Thanks for your reply Nick. Nooby question, but what is the div with the postrow class called? Also, if I were to do this same thing for another usergroup, what would I do with;
Code:


        $this->post['is_admin'] = true;
}


SEOvB 04-09-2012 09:31 PM

Quote:

Originally Posted by Aleks (Post 2318477)
Thanks for your reply Nick. Nooby question, but what is the div with the postrow class called? Also, if I were to do this same thing for another usergroup, what would I do with;
Code:


        $this->post['is_admin'] = true;
}


I'm not sure what you mean with what the div is called... If you go to AdminCP->Styles & Templates->Search Templates->(enter 'postbit' and check 'titles only')->(click the postbit template in your active style), you can Ctrl+F 'postrow' to find the div.

If you want to add more usergroups, you can do so by adding more to the if condition. Like:

PHP Code:

if($this->post->usergroupid == OR $this->post->usergroup == OR $this->post->usergroup == 3

You can find out which usergroup has which id in the Usergroup Manager.

-Nick, SEOvB Developer

Aleks 04-09-2012 09:46 PM

Quote:

Originally Posted by SEOvB (Post 2318486)
I'm not sure what you mean with what the div is called... If you go to AdminCP->Styles & Templates->Search Templates->(enter 'postbit' and check 'titles only')->(click the postbit template in your active style), you can Ctrl+F 'postrow' to find the div.

If you want to add more usergroups, you can do so by adding more to the if condition. Like:

PHP Code:

if($this->post->usergroupid == OR $this->post->usergroup == OR $this->post->usergroup == 3

You can find out which usergroup has which id in the Usergroup Manager.

-Nick, SEOvB Developer

I really appreciate you're help, but I'm going to be honest; I'm confused. Sorry if I'm annoying you, but could you please go over step by step what to do? If you don't feel like it don't even bother, but it would be helpful. Also, where is the postbit_display_start hook located?


All times are GMT. The time now is 04:15 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01799 seconds
  • Memory Usage 1,745KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_html_printable
  • (4)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete