Quote by zewt: And if you are actually using Gallery2, then this will work.
function phpblock_RandomPhoto() {
$buffer=file_get_contents("http://www.domain.name/gallery/main.php?g2_view=imageblock:External&g2_blocks=randomImage&g2_show=title");
return $buffer;
}
That works a treat, much better then the @readfile suggested in the external block command.