vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Admins and mods have different post backgrounds when posting. (https://vborg.vbsupport.ru/showthread.php?t=200727)

DR AUTONAMUS 01-05-2009 02:30 AM

Admins and mods have different post backgrounds when posting.
 
When making a post is it possible to have the admins and mods have different post backgrounds when posting... so you can see what level they are(Usergroup)

If you would like pictures to explain what I mean just ask.

Kirk Y 01-05-2009 02:46 PM

Find the class tag of that td cell in your postbit and use a conditional statement to switch it around depending on usergroup.

HTML Code:

<td class="<if condition="is_member_of($post, X)">alt1</else>alt2</if>">...</td>

DR AUTONAMUS 01-06-2009 08:29 AM

So this would allow me to have the post bits like these:

I know these are phpBB but this is were I got the Idea from.
Admin:
http://www.freeimageups.com/files/1/Misc/admin.jpg
Mod:
http://www.freeimageups.com/files/1/Misc/mod.jpg
User:
http://www.freeimageups.com/files/1/Misc/user.jpg

So I need to make 3 different colors for the post bit dependent on there user group... Maybe more for future groups.

Lynne 01-06-2009 02:52 PM

Kirby's code is a bit off... it should be <else />, not </else>. But you can use a condition around any of the table column classes you want to change. It may be easier to 'read' if you do it this way:

HTML Code:

<if condition="is_member_of($post, X)">
<td class="whatever">
<else />
<if condition="is_member_of($post, Y)">
<td class="whatever2">
<else />
<td class="alt1">
</if>
</if>

You'll need to do that for every td tag you want changed.

TimberFloorAu 01-06-2009 03:08 PM

Can we alternate colour background on each subsequent post, within same usergroup?

Lynne 01-06-2009 03:19 PM

I would guess so, but I think you would have to get a plugin involved then.

DR AUTONAMUS 01-06-2009 03:26 PM

So this would be before every td tag in the postbit template ?

$post, X and $post, y would be the user groups?

and How would I make another alt# so I could have it on different styles

Lynne 01-06-2009 03:41 PM

You would do that for every td tag that you wish to change. I've seen some users only want to change the post background and that would be here in red:
Code:

    <if condition="$show['moderated']">
    <td class="alt2" id="td_post_$post[postid]">
    <else />
    <td class="alt1" id="td_post_$post[postid]">
    </if>

Make sure when you change it that all your <if> tags have a closing </if> tag.

x and y would be the usergroups.

To add another alt class, you would put it in the Main CSS for the style - at the bottom of that page.

SiK GambleR 01-06-2009 03:54 PM

now, as a secondary question to this, what if instead of changing the postbit BG I wanted to change just the admin or mod's font color, is that possible?

Lynne 01-06-2009 04:04 PM

Sure, you can either just change the class or add the css for the color inline there.

If you just want to change the background inline, instead of adding a new class, just go:
Code:

<td class="alt2" id="td_post_$post[postid]" style="background: #00ff00 url('smiley.gif') no-repeat fixed center;">
(All just a thrown together example - don't use that code cuz I have no idea what you would produce!) Doing so for the font color would be similar.


All times are GMT. The time now is 02:16 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.02609 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete