Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-07-2009, 02:33 AM
SiK GambleR SiK GambleR is offline
 
Join Date: Oct 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Force usergroups to post in a different font color by default

For one, I'm wondering if this is possible?

Two, where would I place code for something like this?

Three, can someone help me make/find a code that would work for this.

An example would be something like the staff on Blizzard forums; they post in blue for every post, indicating that they are the staff. I want to do something to that effect.
Reply With Quote
  #2  
Old 01-07-2009, 02:43 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I already posted this in the other thread for changing the background color inline, but here is it for changing the color and with the conditions. You will need to find which td tag you are interested in changing and then just add the color part. If you have problems, post the code you tried and tell us the outcome.

HTML Code:
<if condition="is_member_of($post, X)">
<td class="alt2" id="td_post_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, Y)">
<td class="alt2" id="td_post_$post[postid]" style="color: red;">
<else />
<td class="alt2" id="td_post_$post[postid]" style="color: blue;">
</if>
</if>
Reply With Quote
  #3  
Old 01-07-2009, 02:51 AM
SiK GambleR SiK GambleR is offline
 
Join Date: Oct 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm confused.
I don't know what a td tag is.
I know nearly nothing about this coding.

I'm trying to learn, but I know what I want done.

With this statement:
Code:
<if condition="is_member_of($post, X)">
Do I edit the "X" with the user, or the usergroup, or do I leave it as "X?"

In the statement:
Code:
<td class="alt2" id="td_post_$post[postid]" style="color: yellow;">
Is "alt2" the td tag that you told me to find?
Reply With Quote
  #4  
Old 01-07-2009, 03:04 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

X is the usergroupid - you would not leave it as X, but change it to the userid you want.


Lets say you want to change the font in the main post area. You would need to find that area. You will find it by looking for <!-- message --> in the postbit, or postbit_legacy depending on which you use, template. Let's assume you don't care about the post title and instead only the color of the post itself. In that case, we will just use the div tag right below the <!-- message --> (it's in red and it's for a 3.8 template - yours may be different):
Code:
        <!-- message -->
        <div id="post_message_$post[postid]">
            $ad_location[ad_showthread_firstpost_start]
            $post[message]
        </div>
        <!-- / message -->
Now you would use the conditions I posted above. Let's say you only care about administrators, groupid 6, supermods, groupid 5, and then the rest of the posters. You want admins in yellow, supermods in red, and everyone else in blue. So, you'd do this *in place of* the stuff in red above:

HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, 5)">
<div id="post_message_$post[postid]"  style="color: red;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>
</if>
Reply With Quote
  #5  
Old 01-07-2009, 03:09 AM
SiK GambleR SiK GambleR is offline
 
Join Date: Oct 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
X is the usergroupid - you would not leave it as X, but change it to the userid you want.


Lets say you want to change the font in the main post area. You would need to find that area. You will find it by looking for <!-- message --> in the postbit, or postbit_legacy depending on which you use, template. Let's assume you don't care about the post title and instead only the color of the post itself. In that case, we will just use the div tag right below the <!-- message --> (it's in red and it's for a 3.8 template - yours may be different):
Code:
        <!-- message -->
        <div id="post_message_$post[postid]">
            $ad_location[ad_showthread_firstpost_start]
            $post[message]
        </div>
        <!-- / message -->
Now you would use the conditions I posted above. Let's say you only care about administrators, groupid 6, supermods, groupid 5, and then the rest of the posters. You want admins in yellow, supermods in red, and everyone else in blue. So, you'd do this *in place of* the stuff in red above:

HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<if condition="is_member_of($post, 5)">
<div id="post_message_$post[postid]"  style="color: red;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>
</if>
Could I add in the following, without removing what is in red of your post?
HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
</if>
I can do it the way you want, but I think it would be easier to just have it override for admins only, and leave the rest of the usergroups as default
Reply With Quote
  #6  
Old 01-07-2009, 03:11 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you only want it for admins, then replace my second box of code with:

HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]" style="color: blue;">
</if>
or

HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]">
</if>
Reply With Quote
  #7  
Old 01-07-2009, 03:21 AM
SiK GambleR SiK GambleR is offline
 
Join Date: Oct 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: yellow;">
<else />
<div id="post_message_$post[postid]">
</if>
That forced my text to be yellow, but for some reason, all of my post content was removed, from every post. It came back when I put the original code back, though.
Reply With Quote
  #8  
Old 01-07-2009, 03:26 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It was yellow because it says "color: yellow" Post exactly what that part of your template looked like after you changed it if you want help fixing it. I can't tell what you did wrong if you don't show me exactly what you did.
Reply With Quote
  #9  
Old 01-07-2009, 03:30 AM
SiK GambleR SiK GambleR is offline
 
Join Date: Oct 2007
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is my code:

HTML Code:
		<!-- message -->
		<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: #60fffd;">
<else />
<div id="post_message_$post[postid]">
</if>
		<!-- / message -->
Reply With Quote
  #10  
Old 01-07-2009, 03:40 AM
Bellardia Bellardia is offline
 
Join Date: Jul 2007
Location: Hamilton, Ontario
Posts: 378
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SiK GambleR View Post
Here is my code:

HTML Code:
		<!-- message -->
		<if condition="is_member_of($post, 6)">
<div id="post_message_$post[postid]" style="color: #60fffd;">
<else />
<div id="post_message_$post[postid]">
</if>
		<!-- / message -->
HTML Code:
<!-- message -->
<if condition="is_member_of($post, 6)">
	<div id="post_message_$post[postid]" style="color: #60fffd;">
<else />
	<div id="post_message_$post[postid]">
</if>
	$ad_location[ad_showthread_firstpost_start]
   	$post[message]
</div>
<!-- / message -->
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:17 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06793 seconds
  • Memory Usage 2,281KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (10)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete