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)
-   -   Help changing post background of currently logged in user (https://vborg.vbsupport.ru/showthread.php?t=299503)

Azum 06-25-2013 07:11 PM

Help changing post background of currently logged in user
 
In vB 4.2.0:

Can anyone tell me how I can change the background of any posts made by the currently logged in user? I think I need to do it in postbit.css, as I can get the desired outcome there... but the vb:if statement I'm using isn't working. I'm sure it's something trivial that I don't know about.

I've been trying various conditionals in the:
.postbitlegacy .postbody, .eventbit .eventdetails .eventbody

Lynne 06-25-2013 11:17 PM

And what is the if statement you have been trying to use?

Azum 06-26-2013 12:00 AM

Quote:

Originally Posted by Lynne (Post 2430538)
And what is the if statement you have been trying to use?

Various ones such as

Code:

<vb:if condition="$threadinfo['postuserid'] == $bbuserinfo['userid']">stuff here</vb:if>
Code:

<vb:if condition="$userinfo['userid'] == $bbuserinfo['userid']">stuff here</vb:if>

Lynne 06-26-2013 12:49 AM

Those aren't variables available in the .css templates. You'll need to do something in the postbit template to give the <div> another class if the post userid is the same as the viewer userid ($post['userid'] == $bbuserinfo['userid']) and then you can add some CSS to the additional.css template to set that class background to a certain color.

Azum 06-26-2013 02:15 AM

Quote:

Originally Posted by Lynne (Post 2430550)
Those aren't variables available in the .css templates. You'll need to do something in the postbit template to give the <div> another class if the post userid is the same as the viewer userid ($post['userid'] == $bbuserinfo['userid']) and then you can add some CSS to the additional.css template to set that class background to a certain color.

Could you possibly elaborate a little more on the "give the <div> another class" part?

--------------- Added [DATE]1372223285[/DATE] at [TIME]1372223285[/TIME] ---------------

Okay so I tried adding a div class to postbit_legacy

Code:

<vb:if condition="$post['userid'] == $bbuserinfo['userid']"><div class="postme"></vb:if>
<div class="postrow<vb:if condition="$show['postedited'] || $post['signature']"> has_after_content</vb:if>">
{vb:raw template_hook.postbit_messagearea_start}
<vb:if condition="$post['title'] OR $show['messageicon']">
<h2 class="title icon">
<vb:if condition="$show['messageicon']"><img src="{vb:raw post.iconpath}" alt="{vb:raw post.icontitle}" /> </vb:if>{vb:raw post.title}
</h2>
</vb:if>

<vb:if condition="$post['isfirstshown']">
{vb:raw ad_location.ad_showthread_firstpost_start}
{vb:raw ad_location.thread_first_post_content}
</vb:if>
<vb:if condition="$post['islastshown']">
{vb:raw ad_location.thread_last_post_content}
</vb:if>
<div class="content<vb:if condition="$show['first_ad'] OR $show['last_ad']"> hasad</vb:if>">
<div id="post_message_{vb:raw post.postid}">
<blockquote class="postcontent restore ">
{vb:raw post.message}
</blockquote>
</div>

and the opposite condition for div class="postbody"

Code:

<vb:if condition="!$post['userid'] == $bbuserinfo['userid']">
Then I added the postme to the postbit.css

Result was double posts in every single thread! Pretty funny, but not what I was aiming for.

Amaury 06-26-2013 02:27 PM

To change the background, simply edit the postbit_background style variable.

Azum 06-26-2013 06:08 PM

Quote:

Originally Posted by Amaury25 (Post 2430618)
To change the background, simply edit the postbit_background style variable.

Right, but what I'm trying to do is when John Doe logs in and views a thread, only the background of his posts in that thread are a different color. I'll keep at it as time permits. My lack of web/programming background is killing me.


All times are GMT. The time now is 11:40 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.03309 seconds
  • Memory Usage 1,729KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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