The random block script isn't XHTML valid. I made a few changes:
echo ""
. '<center><a href="' . makeAlbumUrl($album->fields['name'], $id) . '"/>'
. $album->getThumbnailTag($index)
. '</a></center>';
$caption = $album->getCaption($index);
if ($caption) {
echo '<br /><center>' . $caption . '</center>';
}
echo '<br /><center>From: '
. '<a href="' .makeAlbumUrl($album->fields['name']) .'" />'
. $album->fields['title']
. '</a></center>';
The img tag needs a /> for it to validate how can I change this?
Posts: 40
have you figured out how to validate the img tags?
Posts: 2
It's rather easy, and frankly I'm suprised it isn't done in the stock code... I hunted it down in about 3 minutes, go fig for striving for main page validation ;)...
Anyhow, open gallery/classes/Image.php
Find:
if ($this->resizedName && $size == 0) { if ($full) { return "<img src=\"$dir/$fullImage\" ". "width=\"$this->raw_width\" height=\"$this->raw_height\" . $attrs alt=\"$alttext\" title=\"$alttext\">"; } else { return "<img src=\"$dir/$resizedImage\" ". "width=\"$this->width\" height=\"$this->height\" " . "$attrs alt=\"$alttext\" title=\"$alttext\">"; } } else { return "<img src=\"$dir/$fullImage\" $size_val $attrs alt=\"$alttext\" title=\"$alttext\" name=\"photo_j\">"; } }Replace:
if ($this->resizedName && $size == 0) { if ($full) { return "<img src=\"$dir/$fullImage\" ". "width=\"$this->raw_width\" height=\"$this->raw_height\" . $attrs alt=\"$alttext\" title=\"$alttext\" />"; } else { return "<img src=\"$dir/$resizedImage\" ". "width=\"$this->width\" height=\"$this->height\" " . "$attrs alt=\"$alttext\" title=\"$alttext\" />"; } } else { return "<img src=\"$dir/$fullImage\" $size_val $attrs alt=\"$alttext\" title=\"$alttext\" name=\"photo_j\" />"; } }I'd like to request that this be added in the stock code of G1 so that the random block be *valid* xhtml!