Ad Code Problems

Status
Not open for further replies.

DizzyTechnology

New Member
Messages
500
Reaction score
0
Points
0
Hi, I am running e107 on my site and all of its themes are W3C Valid, and I have made an effort to keep theme that way. Using the default code, here are the errors that come up (VALIDATOR XHTML 1.1) caused by the ads:

1. Error Line 23 column 161: there is no attribute "language".

Code:
...iv><div id='banner'><script language=[U][B][COLOR=Red][B]'[/B][/COLOR][/B][/U]JavaScript' type='text/javascript'>
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.



2. Error Line 37 column 88: there is no attribute "target".

Code:
...dvert/adclick.php?n=a7fb3e9d' target=[COLOR=Red][B][U][B]'[/B][/U][/B][/COLOR]_blank'><img src='http://x10hosting.com

3. Error Line 37 column 96: document type does not allow element "a" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "pre", "address", "fieldset" start-tag.
Code:
...click.php?n=a7fb3e9d' target='_blank'[COLOR=Red][U][B][B]>[/B][/B][/U][/COLOR]<img src='http://x10hosting.com/advert/

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


4. Warning Line 37 column 159: cannot generate system identifier for general entity "n".
Code:
...ng.com/advert/adview.php?what=zone:1&[COLOR=Red][U][B][B]n[/B][/B][/U][/COLOR]=a7fb3e9d' border='0' alt=''></a></nosc

An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".
Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&amp;" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and &aelig; are different characters.
If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.
Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.



5. Error Line 37 column 159: general entity "n" not defined and no default entity.
Code:
...ng.com/advert/adview.php?what=zone:1&[COLOR=Red][U][B][B]n[/B][/B][/U][/COLOR]=a7fb3e9d' border='0' alt=''></a></nosc

This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

6. Warning Line 37 column 160: reference not terminated by REFC delimiter.
Code:
...ng.com/advert/adview.php?what=zone:1&[COLOR=Red][COLOR=Black][B]n[/B][/COLOR][U][B]=[/B][/U][/COLOR]a7fb3e9d' border='0' alt=''></a></nosc

If you meant to include an entity that starts with "&", then you should terminate it with ";". Another reason for this error message is that you inadvertently created an entity by failing to escape an "&" character just before this text.

7. Warning Line 37 column 160: reference to external entity in attribute value.
Code:
...ng.com/advert/adview.php?what=zone:1&[COLOR=Red][COLOR=Black][B]n[/B][/COLOR][U][B]=[/B][/U][/COLOR]a7fb3e9d' border='0' alt=''></a></nosc

This is generally the sign of an ampersand that was not properly escaped for inclusion in an attribute, in a href for example. You will need to escape all instances of '&' into '&amp;'.

8. Error Line 37 column 160: reference to entity "n" for which no system identifier could be generated.
Code:
...ng.com/advert/adview.php?what=zone:1&[COLOR=Red][COLOR=Black][B]n[/B][/COLOR][U][B]=[/B][/U][/COLOR]a7fb3e9d' border='0' alt=''></a></nosc

This is usually a cascading error caused by a an undefined entity reference or use of an unencoded ampersand (&) in an URL or body text. See the previous message for further details.

10. Error Line 37 column 178: there is no attribute "border".
Code:
...w.php?what=zone:1&n=a7fb3e9d' [COLOR=Red][U][B]border=[B]'[/B]0'[/B][/U][/COLOR] alt=''></a></noscript>

11. Error Line 37 column 192: end tag for "img" omitted, but OMITTAG NO was specified.
Code:
...e:1&n=a7fb3e9d' border='0' alt=''>[COLOR=Red][U][B]</a[B]>[/B][/B][/U][/COLOR]</noscript>

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

13. Error Line 37 column 203: end tag for "noscript" which is not finished.
Code:
...e9d' border='0' alt=''></a>[U][B][COLOR=Red]</noscript[B]>[/B][/COLOR][/B][/U]

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Now, I know we can't edit the ad code, but is there any way admins can optimize the code? I mean, I tried it on my test portion of my side, and I removed the noscript, target, language, fixed the img, and removed border, and it had that many less.

Can you guys optimize it? Or change around the code so it propogates better in XHTML?
 
Last edited:

Torch

New Member
Messages
634
Reaction score
0
Points
0
It is known (and stated on their site) that validator has issues with JavaScirpt and that is not 100% accurate when validating.
So, you shouldn't concern yourself with errors you're getting, especially because they will in not interfere with compatibility of your site :)
 

noerrorsfound

New Member
Messages
1,736
Reaction score
1
Points
0
Not to long ago I modified the Advanced ad code to comply with XHTML 1.0 Strict standards. It validates without errors.
Code:
<script type="text/javascript">
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random);
   document.write ("&what=zone:3&target=_blank");
   document.write ("&exclude=" + document.phpAds_used);
   if (document.referrer)
      document.write ("&referer=" + escape(document.referrer));
   document.write ("'><" + "/script>");
//-->

</script><a href="http://x10hosting.com/advert/adclick.php?n=a915c788"><img src="http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788" alt="" /></a>
I created a thread to see if it was acceptable, and got this response:
Bryon said:
It looks alright to me. :) What needed to be changed in order to get it compliant?
 
Last edited:

DizzyTechnology

New Member
Messages
500
Reaction score
0
Points
0
I can't believe my final problem was that the underline text attribute <u> is not browser interoperatable.
 

djcrash

New Member
Messages
39
Reaction score
0
Points
0
Hi guys,

Although, i'm not using the corporate plan. I don't mind having advertisement or banners on my site, but just need to know how i get the php ads code to be the on the centre of my forum when insert to my index.php :lol:, sorry i'm newbie at php coding can anyone post the codes for the ads to be in the centre.

<?php

echo "Large Banner (Corporate)<br><br>\n";

echo "<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>\n";
echo "<script language='JavaScript' type='text/javascript'>\n";
echo "<!--\n";
echo "if (!document.phpAds_used) document.phpAds_used = ',';\n";
echo "phpAds_random = new String (Math.random());\n";
echo "phpAds_random = phpAds_random.substring(2,11);\n";
echo "document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");\n";
echo "document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);\n";
echo "document.write (\"&amp;what=zone:1&amp;target=_blank\");\n";
echo "document.write (\"&amp;exclude=\" + document.phpAds_used);\n";
echo "if (document.referrer)\n";
echo "document.write (\"&amp;referer=\" + escape(document.referrer));\n";
echo "document.write (\"'><\" + \"/script>\");\n";
echo "//-->\n";
echo "</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>\n";

echo "<br><br><br><br>\n";

Thanks
 
Last edited:

Cynical

Active Member
Messages
3,492
Reaction score
0
Points
36
Just put <center> in front of it and </center> at the end :). Or, if you are using CSS, you can align it that way.
 

noerrorsfound

New Member
Messages
1,736
Reaction score
1
Points
0
Cynical said:
Just put <center> in front of it and </center> at the end :). Or, if you are using CSS, you can align it that way.
The center tag is deprecated. Do not use it. You can use <div align="center"> and </div>, or CSS like Cynical said.
 
Last edited:
Status
Not open for further replies.
Top