PDA

View Full Version : If condition help


Wilfred1
10-01-2009, 07:57 AM
I have an img being used in a template and I am trying to create an if statement to display a defined image if one doesn't exist. Currently if an image doesn't exist the img alt is displayed. I want to be able to display a preset image if one doesn't exist instead of the alt text.

What I need is the condition part of the if statement if anyone can help me on the following:
<if condition=???????>
<img src="$vboptions[bburl]/quiz.php?quizid=$quiz[quizid]&image=1" alt="$quiz[title]" hspace="10" />
<else />
<img src="../forum/images/no_image.jpg" hspace="10" />
</if>

BSMedia
10-01-2009, 05:38 PM
You'll need a way to create/check if the image is there with PHP code. The simple HTML conditionals won't do it without having the php code check for the image first.

Brandon Sheley
10-01-2009, 06:50 PM
I agree a simple <if condition (https://vborg.vbsupport.ru/showthread.php?t=215032)> isn't going to work, but if you ever want a few more, check out this link.

Wilfred1
10-01-2009, 10:10 PM
Thanks Guys, I thought that may be the case but have limited knowledge