PDA

View Full Version : Default color in posts


Ellendway
01-21-2011, 02:27 PM
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...


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!!!