| The Arcive of vBulletin Modifications Site. | |
| 
			 
			#1  
			
			
			
			
			
		 | |||
| 
 | |||
|  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 | 
| 
			 
			#2  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			And what is the if statement you have been trying to use?
		 | 
| 
			 
			#3  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			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> | 
| 
			 
			#4  
			
			
			
			
			
		 | ||||
| 
 | ||||
|   
			
			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.
		 | 
| 
			 
			#5  
			
			
			
			
			
		 | |||
| 
 | |||
|   Quote: 
 --------------- 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>Code: <vb:if condition="!$post['userid'] == $bbuserinfo['userid']"> Result was double posts in every single thread! Pretty funny, but not what I was aiming for. | 
| 
			 
			#6  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			To change the background, simply edit the postbit_background style variable.
		 | 
| 
			 
			#7  
			
			
			
			
			
		 | |||
| 
 | |||
|   
			
			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.
		 | 
|  | 
| 
 | 
 | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
| 
 | |
|  More Information | |
| Template Usage: 
 Phrase Groups Available: 
 | Included Files: 
 Hooks Called: 
 |