Since we are on this topic. I created a random photo block (since I can't make the current RandomPhoto v1.2 to work with the new Gallery 1.4.3 final) using iframe and js and the block-random.php optained from
here. The code was written for stand alone Gallery, but it works fine with GL-Gallery integration.
The js was supposed to go to the header, but I put it in the block and it works. My question would be, is there any stupidity in so doing?
The following is the codes I put in the block:
Text Formatted Code
<script language="JavaScript" type="text/javascript">
// document.domain='yourdomain.com'; // Uncomment and edit if "Access is Denied" runtime JavaScript error occurs
function iFrameHeight(obj) {
aID = obj.id; // if contentDocument exists, W3C compliant (Mozilla)
if (document.getElementById(aID).contentDocument){
obj.style.height = document.getElementById(aID).contentDocument.body.scrollHeight;
} else {
// IE
obj.style.height = document.frames(aID).document.body.scrollHeight;
}
}</script>
<table align="center"><tr><td align="center">
<iframe src="/gallery/block-random.php?size=150&target=_top" width="150" height="200"
onLoad="iFrameHeight(this);"
align=top scrolling=no frameborder=0 id="blockrandom1">
[This feature requires IFRAME.]
</iframe></td></tr></table>
Note: it works without the js, but having the js in it makes the block resize according to the picture's height.