PDA

View Full Version : PHP Photo Album Script



flipmoore
07-18-2008, 07:45 PM
1) Script Title: PHP Photo Album Script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/photoalbum.htm
3) Describe problem: Having problems viewing the images on this site. any help greatly appreciated.

http://www.midianroofing.net/images/sample_work/thumbnail/getpics.php

ddadmin
07-18-2008, 10:50 PM
It seems your web host is dynamically adding to all PHP files served extra code for ads:


</object></layer></span></div></table></body></html><!-- adsok -->
<script language='javascript' src='https://a12.alphagodaddy.com/hosting_ads/gd01.js'></script>

This is corrupting the script. You'll need to host the PHP file for the script on a host that doesn't do this.

jscheuer1
07-19-2008, 03:22 AM
It's just possible that adding an opening script comment block at the end of the getpics.php file will take care of the problem. It's worth a try:


<?
Header("content-type: application/x-javascript");

function returnimages($dirname=".") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
$filedate=date ("M d, Y H:i:s", filemtime($file));
echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";
$curimage++;
}
}

closedir($handle);
}
return($files);
}

echo "var galleryarray=new Array();" . "\n";
returnimages();
?>

/*