ZenphotoCMS Forum
Random image code not W3C valid ! - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Random image code not W3C valid ! (/thread-4352.html)



Random image code not W3C valid ! - splitsch - 2008-12-30

Hello !
I manage to show random image on an external page.
See: http://www.groupedestilleuls.be on the bottom-right.
My concern is that it's not W3C valid:
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.groupedestilleuls.be%2F&charset=(detect+automatically)&doctype=Inline&group=0&accept=text%2Fhtml%2Capplication%2Fxhtml%2Bxml%2Capplication%2Fxml%3Bq%3D0.9%2C*%2F*%3Bq%3D0.8&accept-language=fr%2Cfr-fr%3Bq%3D0.8%2Cen-us%3Bq%3D0.5%2Cen%3Bq%3D0.3&accept-charset=UTF-8%2C*&user-agent=W3C_Validator%2F1.606

The problème is linked to "&" and "&" in the "scr" parameter of the picture shown.

I checked the templates-function.php and change all the & with & where it was needed, but I can't see wich function biuld the link.
Here is the code I use to show the image:
echo 'getTitle() . '">' .

    '



Random image code not W3C valid ! - acrylian - 2008-12-30

Why don't you just use printRandomImages()? The nightly build version has parameters for image size now, too. But if you can't uses htmlspecialchars() around the url. No need to hack anything.