PDA

View Full Version : Online Photo Album Problems


Tombo
04-18-2003, 05:32 PM
Hullo,

I've posted a few times on this by now, so some may be familiar with my problems. :P

Anyways, here's the original post (http://www.codingforums.com/showthread.php?s=&threadid=17290).

Here's the completed page (http://members.shaw.ca/ttc/photos.htm) w/ script.

It works locally.. half the time. I *know* it works... yet, it doesn't... :P

Kind of hard to explain it exactly. Here's the script:

<script language="javascript" type="text/javascript">
<!--
function photoAlbum(album, photos){
leftPosition=(screen.width)?(screen.width-630)/2:100;
topPosition=(screen.height)?(screen.height-530)/2:100;

settings='width=630, height=530, top='+topPosition+', left='+leftPosition+', scrollbars=yes, location=no, directories=no, status=yes, menubar=no, toolbar=no, resizable=no';
var openAlbum = window.open('album.htm','PhotoAlbumPage',settings);

openAlbum.parent.thumb.document.open();
openAlbum.parent.thumb.document.write('<html><head>\n\n<title>The Tombo Combo</title>\n\n');
openAlbum.parent.thumb.document.write('<script>\n');
openAlbum.parent.thumb.document.write('<!--\n');
openAlbum.parent.thumb.document.write('function showimage(imagesrc){\n');
openAlbum.parent.thumb.document.write(' parent.photo.document.open();\n');
openAlbum.parent.thumb.document.write(' parent.photo.document.write(\'<html><head><title>The Tombo Combo</title></head><body style="background-color: #000000; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px;">\');\n');
openAlbum.parent.thumb.document.write(' parent.photo.document.write(\'<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%"><tr><td valign="middle" align="center" width="100%" height="100%">\');\n');
openAlbum.parent.thumb.document.write(' parent.photo.document.write(\'<img src="\'+imagesrc+\'"></td></tr></table></body></html>\');\n');
openAlbum.parent.thumb.document.write(' parent.photo.document.close()\n');
openAlbum.parent.thumb.document.write('}\n');
openAlbum.parent.thumb.document.write('//-->\n<\/script>\n\n');
openAlbum.parent.thumb.document.write('</head><body style="background-color: #000000; margin: 5px 0px 0px 0px; padding: 0px 0px 0px 0px;">\n\n<center>\n\n');

for (var i = 1; i < photos + 1; i++)
{
if (i < 10 && i > 0) {
openAlbum.parent.thumb.document.write('<a href="" onClick="showimage(\'http://members.shaw.ca/ttc'+album+'/0'+i+'.jpg\');return false"><img src="http://members.shaw.ca/ttc'+album+'/t/0'+i+'.jpg" width="80" height="60" border="0"></a>\n')
}
else {
openAlbum.parent.thumb.document.write('<a href="" onClick="showimage(\'http://members.shaw.ca/ttc'+album+'/'+i+'.jpg\');return false"><img src="http://members.shaw.ca/ttc'+album+'/t/'+i+'.jpg" width="80" height="60" border="0"></a>\n')
}
}

openAlbum.parent.thumb.document.write('\n</center>\n\n</body></html>');
openAlbum.parent.thumb.document.close()
}
// -->
</script>

Is there an easier way to do this? Some help please. :S

beetle
04-18-2003, 05:43 PM
Oog. Honestly, I'd want to use PHP to do this.