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)
-   -   Default color in posts (https://vborg.vbsupport.ru/showthread.php?t=257531)

Ellendway 01-21-2011 02:27 PM

Default color in posts
 
Hello,

is there any chance to change default color text in posts for usergroup?

(Admin - red, moderator - green, user - black)

Thanks.

Sarteck 01-21-2011 06:17 PM

Yeah, but you'd have to modify the code a bit.

One way to do it is on postbit_display_complete, you could have something like...

PHP Code:

if (is_member_of($post,6)) {$post['message'] = '<div style="color:red;">'.$post['message'].'</div>';}
elseif (
is_member_of($post,5)) {$post['message'] = '<div style="color:green;">'.$post['message'].'</div>';} 

And so on.


(At least I think that would work. >.> Haven't tried it myself.)

Ellendway 01-21-2011 07:04 PM

Ok, may I ask you where is postbit_display_complete?

Sarteck 01-21-2011 08:03 PM

Oh, if you load up your AdminCP, then go to "Products & Plugins", and go to "Add New Plugin," the postbit_display_complete is the "hook_location" you select. (That's the location in the vBulletin code that your plugin will execute at.)

The code, well, is that example I posted up there. Just use similar lines for whichever other usergroups you wanted.

Now, with this code, they can still override the default colour with BB Codes and whatnot. :> Just letting ya know.

Ellendway 01-21-2011 08:12 PM

Awesome, it's working.

Thanks so much!!!


All times are GMT. The time now is 08:06 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.01079 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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