PDA

View Full Version : XHTML validation. 44 errors I don't understand


Tore
02-15-2008, 10:21 PM
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:

ve9gra
02-16-2008, 08:55 AM
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
<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>

Tore
02-16-2008, 01:02 PM
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.

ve9gra
02-16-2008, 02:55 PM
Try it with this code
<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>

Tore
02-17-2008, 12:16 PM
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!

ve9gra
02-17-2008, 01:02 PM
Sorry about that... I forgot a key piece of code.. Here's the full code

<?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.

Tore
02-17-2008, 01:44 PM
Perfect! That did the trick.
Thanks a lot, you've been a great help to me!