Closed Thread
Results 1 to 8 of 8

Thread: Ad Code Problems

  1. #1
    DizzyTechnology's Avatar
    DizzyTechnology is offline x10 Lieutenant DizzyTechnology is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    250

    Talking Ad Code Problems

    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='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='_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'><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&n=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&n=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&n=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&n=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. ErrorLine 37 column 160: reference to entity "n" for which no system identifier could be generated.
    Code:
    ...ng.com/advert/adview.php?what=zone:1&n=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. ErrorLine 37 column 178: there is no attribute "border".
    Code:
    ...w.php?what=zone:1&n=a7fb3e9d' border='0' alt=''></a></noscript>
    11. ErrorLine 37 column 192: end tag for "img" omitted, but OMITTAG NO was specified.
    Code:
    ...e:1&n=a7fb3e9d' border='0' alt=''></a></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. ErrorLine 37 column 203: end tag for "noscript" which is not finished.
    Code:
    ...e9d' border='0' alt=''></a></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 ">".

    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 by DizzyTechnology; 07-27-2006 at 11:14 AM.
    Zachary Waldowski
    Dizzy Technology

  2. #2
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: Ad Code Problems

    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

  3. #3
    noerrorsfound is offline x10 Elder noerrorsfound is an unknown quantity at this point
    Join Date
    Mar 2006
    Posts
    868

    Re: Ad Code Problems

    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:
    Quote Originally Posted by Bryon
    It looks alright to me. What needed to be changed in order to get it compliant?
    Last edited by noerrorsfound; 07-27-2006 at 01:53 PM.
    EOF

  4. #4
    DizzyTechnology's Avatar
    DizzyTechnology is offline x10 Lieutenant DizzyTechnology is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    250

    Re: Ad Code Problems

    Alright, thanks.

    EDIT: Validates flawlessly (minus my own problems)!

    Thanks, Koshimi!
    Zachary Waldowski
    Dizzy Technology

  5. #5
    DizzyTechnology's Avatar
    DizzyTechnology is offline x10 Lieutenant DizzyTechnology is an unknown quantity at this point
    Join Date
    Dec 2005
    Posts
    250

    Re: Ad Code Problems

    I can't believe my final problem was that the underline text attribute <u> is not browser interoperatable.
    Zachary Waldowski
    Dizzy Technology

  6. #6
    djcrash's Avatar
    djcrash is offline x10Hosting Member djcrash is an unknown quantity at this point
    Join Date
    Jul 2006
    Location
    Singapore
    Posts
    39

    Re: Ad Code Problems

    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 :laugh:, 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 by djcrash; 07-28-2006 at 10:50 AM.

  7. #7
    Cynical's Avatar
    Cynical is offline Lord Of The Keys Cynical is an unknown quantity at this point
    Join Date
    Sep 2005
    Location
    Massachusetts, USA
    Posts
    1,746

    Re: Ad Code Problems

    Just put <center> in front of it and </center> at the end . Or, if you are using CSS, you can align it that way.
    Seven: This rule is so underrated, keep your family and business completely separated.

  8. #8
    noerrorsfound is offline x10 Elder noerrorsfound is an unknown quantity at this point
    Join Date
    Mar 2006
    Posts
    868

    Re: Ad Code Problems

    Quote Originally Posted by Cynical
    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 by noerrorsfound; 07-28-2006 at 11:08 AM.
    EOF

Closed Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. My code lib! Uploading Problems!
    By randomize in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 04-24-2006, 01:51 PM
  3. Ad Code Problems
    By DryIce in forum Free Hosting
    Replies: 3
    Last Post: 04-15-2006, 03:03 PM
  4. Ad Code Problems Solution
    By Jim in forum Free Hosting
    Replies: 48
    Last Post: 05-14-2005, 12:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers