MyBB Hacks

Full Version: How to switch images with this code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
<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:
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

Wrap the img tag inside the conditional.
(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
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)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....
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.

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
(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.
Reference URL's