1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. To combat forum spam, new accounts will need to make at least one (valid) post.
    Otherwise, we will periodically purge all users without posts or that haven't confirmed their account.

XHTML validation. 44 errors I don't understand

Discussion in 'Wordpress' started by Tore, Feb 15, 2008.

Thread Status:
Not open for further replies.
  1. Tore

    Tore New Member

    http://www.pohildre.com/?cat=1

    My calendar is behaving quite well now, but the page has some kind of world record in validation errors. Before the calendar it was nice and green and error free.

    Granted I have probably screwed up a few things in the sidebar but I think the problem area is somewhere else.

    "The most common cause of this error is unencoded ampersands in URLs"

    What does that mean? I don't get any of this. Could somebody please take a quick look and see if they can tell where the code referred to is located? (There is a validation link at the bottom of the sidebar)

    I don't understand anything. :sad:
     
  2. ve9gra

    ve9gra Support Team

    All of this is pretty much for the navigation table. You can fix some of it without changing any code, but not all of it. You'd have to disable the navigation (using $noNav=1) and then provide some modified code to recreate the navigation area.

    What you can fix right now is the << and >> for previous and next month. Change those from the Setup Manager - Navigation. They should be &lt;&lt; and &gt;&gt;

    For the table itself, first, put $noNav=1; somewhere before the require that shows your calendar. Then right below the require, paste the following
    PHP:
    <table class="navTable" cellspacing="0" cellpadding="0">
      <tr> 
        <td align="left" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mb&amp;yr=$yb$anchorTag".$returnString2?>" class="navTableText"><?php echo $navLeft?></a></td>
        <td align="center" width="34%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$cmo&amp;yr=$cyr$anchorTag".$returnString2?>" class="navTableText"><?php echo $navMiddle ?></a></td>
        <td align="right" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mf&amp;yr=$yf$anchorTag".$returnString2?>" class="navTableText"><?php echo $navRight?></a></td>
      </tr>
    </table>
     
    Last edited: Feb 16, 2008
  3. Tore

    Tore New Member

    Thank you. But I'm afraid this didn't work very well for me.

    Replacing the arrows got rid of 2 validation errors only. Which is better than nothing of course.

    With the added code the error number sank from 42 to 35 but the arrows then displays as &lt;&lt; and &gt;&gt; and not as arrows.
     
  4. ve9gra

    ve9gra Support Team

    Try it with this code
    PHP:
    <table class="navTable" cellspacing="0" cellpadding="0">
      <tr> 
        <td align="left" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mb&amp;yr=$yb$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navLeft); ?></a></td>
        <td align="center" width="34%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$cmo&amp;yr=$cyr$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navMiddle); ?></a></td>
        <td align="right" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mf&amp;yr=$yf$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navRight); ?></a></td>
      </tr>
    </table>
     
  5. Tore

    Tore New Member

    Hmmm. No. That made the arrows display correctly, but now they don't do anything when I click them, except reload the same month.

    Seeing how the next 35 errors are related to calendar entries that must be due to the fact that the calendar doesn't blend perfectly with WordPress anyway, I may as well live with 2 little errors related to
    the buttons themselves.

    But thank you!
     
  6. ve9gra

    ve9gra Support Team

    Sorry about that... I forgot a key piece of code.. Here's the full code

    PHP:
    <?php
      $yb
    =$yr;
      
    $yf=$yr;
      
    $mb=$mo-1;
      if (
    $mb<1) {$mb=12$yb=$yr-1;}
      
    $mf=$mo+1;
      if (
    $mf>12) {$mf=1$yf=$yr+1;}

      
    $cmo date("m");
      
    $cyr date("Y");
    ?>
    <table class="navTable" cellspacing="0" cellpadding="0">
      <tr> 
        <td align="left" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mb&amp;yr=$yb$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navLeft); ?></a></td>
        <td align="center" width="34%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$cmo&amp;yr=$cyr$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navMiddle); ?></a></td>
        <td align="right" width="33%"><a href="<?php echo "$thisFile?".$returnString.($returnString==""?"":"&amp;")."mo=$mf&amp;yr=$yf$anchorTag".$returnString2?>" class="navTableText"><?php echo html_entity_decode($navRight); ?></a></td>
      </tr>
    </table>
    And this one I tested to make sure it worked.
     
  7. Tore

    Tore New Member

    Perfect! That did the trick.
    Thanks a lot, you've been a great help to me!
     
Thread Status:
Not open for further replies.

Share This Page