Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to switch images with this code
Matt-One Offline
Junior Member
**
Posts: 4
Joined: Jul 2012
Post: #1
How to switch images with this code
Hello i would like to use the orange/blu baloon like in mybb-es.com site
Example here : http://www.mybb-es.com/Hilo-como-puedo-cambiar-estoo

i found this code to add in the postbit :

PHP Code:
1
2
3
4
5
6
7
8
<div id="1" style="float:left; z-index: 1; position: Absolute;">
<br><img src="images/globito01.png">
</div>
<div id="2" style="z-index: 0; padding: 5px;">
<fieldset class="<if $thread['uid'] == $post['uid'] then>post_op<else>post_otro</if> "">
{$post['message']}
</div>
</div> 


and this code in the global.css

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fieldset.post_op { 
background: #ffffff; 
border:2px solid #bde1fd; 
-moz-border-radius:8px; 
box-shadow: 0 0 1em #b6b6b6;
-webkit-border-radius:8px; 
position: relative; 
} 
fieldset.post_otro { 
background: #ffffff; 
border:2px solid #f4c98c; 
-moz-border-radius:8px; 
box-shadow: 0 0 1em #b6b6b6;
-webkit-border-radius:8px; 
position: relative; 
}


But the problem is this : the color of the line changes between orange and blu depending on who answered but the globito01.png doesn't switch to the globito02.png because i don't know how and where to put it in the code

globito01.png is for the blu line and globito02.png is for the orange line

Thank you so much Smile

(This post was last modified: 07-28-2012 02:38 AM by Matt-One.)
07-28-2012 02:22 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: How to switch images with this code
Wrap the img tag inside the conditional.

07-28-2012 02:38 AM
Find all posts by this user Quote this message in a reply
Matt-One Offline
Junior Member
**
Posts: 4
Joined: Jul 2012
Post: #3
RE: How to switch images with this code
(07-28-2012 02:38 AM)RateU Wrote:  Wrap the img tag inside the conditional.

Hey thank you for the answer, can u explain me more please? this is not my code and i don't know how to do it.... Thank you Smile
07-28-2012 02:40 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: How to switch images with this code
You already wrapped the fieldset class inside a conditional. You need to do that to the img tag too (to switch the globito01 and globito02).

07-28-2012 02:47 AM
Find all posts by this user Quote this message in a reply
Matt-One Offline
Junior Member
**
Posts: 4
Joined: Jul 2012
Post: #5
RE: How to switch images with this code
(07-28-2012 02:47 AM)RateU Wrote:  You already wrapped the fieldset class inside a conditional. You need to do that to the img tag too (to switch the globito01 and globito02).

thank you again but i'm not a coder so i don't know how to do this....Could u do it for me if it's not a problem for you?? Thank you so much....
07-28-2012 02:56 AM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #6
RE: How to switch images with this code
Do this conditional
(07-28-2012 02:22 AM)Matt-One Wrote:  

PHP Code:
<if $thread['uid'] == $post['uid'] then>post_op<else>post_otro</if>

to the img tag here:
(07-28-2012 02:22 AM)Matt-One Wrote:  

PHP Code:
<img src="images/globito01.png">


Code:
<img src="images/<if $post['uid'] == $GLOBALS['thread']['uid'] then>image1<else>image2</if>.png" alt="" />

Maybe you need to modify it if guests are allowed to post in your forum.
And maybe you need to re-check the HTML structures and variables involved in your template.


07-28-2012 03:19 AM
Find all posts by this user Quote this message in a reply
Matt-One Offline
Junior Member
**
Posts: 4
Joined: Jul 2012
Post: #7
RE: How to switch images with this code
thank you for your time you have been very kind...so with this conditionals if i would like to also change the color for admin i could do that??

obviously it worked Smile and i don't need to modify it for guests because they can't write Smile
(This post was last modified: 07-28-2012 08:29 AM by Matt-One.)
07-28-2012 08:18 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #8
RE: How to switch images with this code
(07-28-2012 02:56 AM)Matt-One Wrote:  but i'm not a coder
It doesn't matter.  Everyone has intuition and it's sometimes (or should I say, always) a good idea to use it.
Try things out - you'll learn what and why things work and don't work.  We aren't here to spoonfeed you.

PS, please read up on HTML and CSS if you don't know either.  We're not here to teach you those either.

My Blog
(This post was last modified: 07-28-2012 09:32 AM by ZiNgA BuRgA.)
07-28-2012 09:30 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: