vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Usergroup Post Color (https://vborg.vbsupport.ru/showthread.php?t=76483)

KBV 02-17-2005 09:13 AM

Usergroup Post Color
 
Hey, I was wondering if anyone could make a hack that makes all posts made by the admin usergroup show up in a different color. Like on the Blizzard forums where all blizzard staff posts are shown in blue and now white.

Thank you.

Deaths 02-17-2005 09:40 AM

It would't be a hack, I guess it would be more of a template mod ;).

I think this would work, but I cant check :

In your postbit template, find:

PHP Code:

$post[message

Now, replace with:

PHP Code:

<if condition="$post[usergroupid]=6">
<
font color="#XXXXXX">
$post[message]
</
font>
</if> 

Good luck, and let me know if it worked :)

Marco van Herwaarden 02-17-2005 09:45 AM

i would suggest you try:
PHP Code:

<if condition="$post[usergroupid]=6"
<
font color="#XXXXXX"
</if>
$post[message
<if 
condition="$post[usergroupid]=6"
</
font
</if> 

Ot post would never show up anymore if not usergroup = 6 :D

KBV 02-17-2005 11:16 AM

It works, but everyone gets that color. :P

PHP Code:

<!-- message -->
<
div>
<if 
condition="$post[usergroupid]==6">
<
div style="color: #CC0000">
</if>
$post[message]
<if 
condition="$post[usergroupid]==6">
</
div>
</if> 
</
div>
<!-- / 
message --> 

This worked like a charm, it lacked a second = I also changed the font tag to style so that it's XHTML compatible.

If you want to exclude forums use
PHP Code:

<!-- message -->
<
div>
<if 
condition="$post[usergroupid]==6 AND $forum[forumid]!=XX">
<
div style="color: #CC0000">
</if>
$post[message]
<if 
condition="$post[usergroupid]==6 AND $forum[forumid]!=XX">
</
div>
</if> 
</
div>
<!-- / 
message --> 

https://vborg.vbsupport.ru/showthrea...189#post613189

Deaths 02-17-2005 03:15 PM

Quote:

Originally Posted by MarcoH64
i would suggest you try:
PHP Code:

<if condition="$post[usergroupid]=6"
<
font color="#XXXXXX"
</if>
$post[message
<if 
condition="$post[usergroupid]=6"
</
font
</if> 

Ot post would never show up anymore if not usergroup = 6 :D

Ah, yes, I completely forgot about that!

Heh, sleepy me :)

beduino 06-17-2008 10:46 AM

tks for this thread

joao barroca
aka beduino

zero_ZX 06-17-2008 02:22 PM

Can any one help me, if i want to put a background image on it (like a water mark)?
And i last, is it possible to add a image next to a post title if an admin posted in it?
Thanks in advanced guys/girls!

Mastergumble 09-06-2008 04:51 AM

I didn't got this working for me :/

What i want to change is the background color of the post for admin/moderators

Any help on how to do it ?

DataHero 12-31-2009 04:23 PM

Pardon me for the major bump.

This didn't work here either. The top code that KBV posted ("=" instead of "==") results in the case where all users have this specified colour when posting. I tried the one Marco posted, but that one did not work in terms of colour (nor individually, I think).

It'd be greatly appreciated if I could get some assistance on this matter. :)

EDIT - nevermind, figured it out. Thanks anyway, nontheless.

r00028304 11-07-2010 04:57 PM

anyone know how o make this work for vb 4.0.8 - can't find "$post[message] "

BirdOPrey5 11-07-2010 05:41 PM

Quote:

Originally Posted by r00028304 (Post 2119111)
anyone know how o make this work for vb 4.0.8 - can't find "$post[message] "

in vb4 it's {vb:raw post.message}. Also if's in vb 4 are different... it's <vb:if condition ="..."> and </vb:if>

r00028304 11-07-2010 07:46 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2119133)
in vb4 it's {vb:raw post.message}. Also if's in vb 4 are different... it's <vb:if condition ="..."> and </vb:if>

thanks for that;

I have this but doesnt seem to work

Code:

<!-- message -->
<div>
<vb:if condition ="$post[usergroupid]==10">
<div style="color: #0000FF">
</vb:if>
{vb:raw post.message}
<vb:if condition ="$post[usergroupid]==10">
</div>
</vb:if>
</div>
<!-- / message -->

I think its the $post[usergroupid] no?

BirdOPrey5 11-07-2010 09:00 PM

It's working for me... get rid of all that extra / useless code, simply replace:

Code:

{vb:raw post.message}
with:

Code:

<vb:if condition ="$post[usergroupid]==10">
<span style="color: #0000FF">
</vb:if>
{vb:raw post.message}
<vb:if condition ="$post[usergroupid]==10">
</span>
</vb:if>

It has to be <span> tags too... div doesn't work the same way.

Elder 02-15-2011 05:37 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2119219)
It's working for me... get rid of all that extra / useless code, simply replace:

Code:

{vb:raw post.message}
with:

Code:

<vb:if condition ="$post[usergroupid]==10">
<span style="color: #0000FF">
</vb:if>
{vb:raw post.message}
<vb:if condition ="$post[usergroupid]==10">
</span>
</vb:if>

It has to be <span> tags too... div doesn't work the same way.

Didnt work for me...

BirdOPrey5 02-16-2011 01:10 PM

Quote:

Originally Posted by Elder (Post 2162889)
Didnt work for me...

Are you using vBulletin 4.x? If so what version exactly?

Ellendway 01-22-2012 09:02 PM

Can I somehow add this thing to postbit_display_complete hook with forum ID? It's just a bit annoying to add code to every template..

Anyway can I somehow short whole code?

Code:

<vb:if condition ="$post[usergroupid]==6">
<span style="color: #0000FF">
</vb:if>
<vb:if condition ="$post[usergroupid]==2">
<span style="color: #CC0000">
</vb:if>
{vb:raw post.message}
<vb:if condition ="$post[usergroupid]==2">
</span>
</vb:if>
<vb:if condition ="$post[usergroupid]==6">
</span>
</vb:if>



All times are GMT. The time now is 04:46 PM.

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.01200 seconds
  • Memory Usage 1,774KB
  • 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
  • (6)bbcode_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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