PDA

View Full Version : Help fix this conditional (easy for coders)


mathforum
10-02-2009, 07:46 PM
Hi,

I want to have an ad only display on a certain forum so I am using this format.

In the SHOWTHREAD template, right below my Google ads I put:

<if condition="$forumid == 6">
<a href="www.calculus7.com" target="_blank">
<img src="http://www.mathhelpforum.com/math-help/images/possad2.jpg" border="0" ></a>

Nothing is showing up. Why?

Speysider
10-02-2009, 08:25 PM
You did not complete the code.

It should read this:


<if condition="$forumid == 6">
<a href="www.calculus7.com" target="_blank">
<img src="http://www.mathhelpforum.com/math-help/images/possad2
.jpg" border="0" ></a></img>
</if>

Lynne
10-02-2009, 09:25 PM
Do not add an </img> tag as there is not such thing as an </img> tag. You image tag, however, should be changed to look like this:
<img src="http://www.mathhelpforum.com/math-help/images/possad2.jpg" border="0" alt='' />

mathforum
10-03-2009, 03:18 AM
Thanks you two! It works now :)

Speysider
10-03-2009, 10:04 AM
Do not add an </img> tag as there is not such thing as an </img> tag. You image tag, however, should be changed to look like this:
<img src="http://www.mathhelpforum.com/math-help/images/possad2.jpg" border="0" alt='' />
Yes there is. Don't state such things that are true.

Lynne
10-03-2009, 02:33 PM
Yes there is. Don't state such things that are true.
Really? And how well does your site validate when using an </img>?

World Wide Web Consortium (W3C) standards (http://www.html-kit.com/e/go.cgi?u=http%3A%2F%2Fwww%2Ew3%2Eorg%2FTR%2Fhtml40 1%2Fstruct%2Fobjects%2Ehtml%23edef-IMG)
13.2 Including an image: the IMG element

......
Start tag: required, End tag: forbidden

Forbidden is a pretty strong word, I think.

Speysider
10-03-2009, 03:08 PM
Really? And how well does your site validate when using an </img>?

World Wide Web Consortium (W3C) standards (http://www.html-kit.com/e/go.cgi?u=http%3A%2F%2Fwww%2Ew3%2Eorg%2FTR%2Fhtml40 1%2Fstruct%2Fobjects%2Ehtml%23edef-IMG)

Forbidden is a pretty strong word, I think.

Just exactly like the img BBCode, it displays the image.

HMBeaty
10-03-2009, 03:11 PM
BB Code and HTML are 2 totally different types of code. Yes, there is a closing img tag for bb code, but there isn't for html. If you have a closing img tag in html, your code is not valid. Any html image tag should look like:
<img src="http://www.yoursite.com/image.gif" border="0" alt="" />
and where the /> is, is where it closes the image tag for html

Speysider
10-03-2009, 03:49 PM
So why does the code work when I use </img>? It's always worked for me.

HMBeaty
10-03-2009, 03:52 PM
It will still work, but if you try and validate it through something like this (http://validator.w3.org/), it will probably come out as forbidden or not closed properly