MyBB Community Forums

Full Version: Echo Image in PostBit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

I have in {$post['fid4']} something called LFS License. This all works, as you can see in the attachment.

What i want to do, is use the value of $lfsusername to echo an image of [Image: isonline.RacerAsh3.gif] (http://www.lfsworld.net/isonline.RacerAsh3.gif) so RacerAsh3 would be substituted for $Lfsusername. Ie http://www.lfsworld.net/isonline.{$lfsusername}.gif

So if the field is empty, the image will not show. Ie Echoing. What is the php code for this?

Can someone tell me how to get around this.

Many Thanks!

Ash
I'm not sure what you mean, but do you mean something like this?

http://www.lfsworld.net/isonline.{$post['fid4']}.gif
?

Do you want the text of the field to be displayed on top of an image, or as part of an image URL?


Or are you requesting something different - ie not to show the field when it's not filled out?
I would like it not to show, if the profile field is empty. Im presuming i do this something like Echo using PHP? If so, how?

Many thanks!
You can't do PHP inside templates and you can't do conditionals inside templates without a mod. I can't remember the name of the mod though.

(OT: Ooo, Zinga, new Avatar)
Aaa right, so theres nothing in functions_post.php which is editable to do it?
Well if you're editing the actual PHP code then quite likely, I thought you were just trying to put PHP in a template from the ACP (which does not work).
Ahh ok, many thanks for all the help everyone, much appriciated!

Ash