PDA

View Full Version : Help me please for Photo Album script v2.11



ricki22
08-26-2010, 07:47 PM
Hello! sorry for my English I took a translator for me to understand that I speak french, its doing a little bit that I come on your site and I install scripts and code with the copyright has the inside, and it is all market but it has one there that I can not make a market and do a little bit that I am trying a lot of misery to understand how it works.

I made tests with Photo Album script v2.0 http://www.dynamicdrive.com/dynamicindex4/photoalbum.htm on this page and it works correctly.

I download the PHP Photo Album Script V2.11 john forum
and I install on this server free [SNIP . . .] for testing here are the files that I edit to see if it works here they


[SNIP . . .]


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="album/pics/getalbumpics.php?id=pics"></script>

<script type="text/javascript">

//Optional, manual description for particular pictures inside album
//Syntax: albumid.desc[index]="Picture description here"
//eg: jaguar.desc[2]="This is description for the 3rd picture in the album"
//eg: jaguar.desc[6]="This is description for the 7th picture in the album"

</script>

<script type="text/javascript" src="ddphpalbum.js">

/***********************************************
* PHP Photo Album script v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

</script>

<link rel="stylesheet" type="text/css" href="ddphpalbum.css">
</head>
<body>
<script type="text/javascript">

new phpimagealbum({
albumvar: album, //ID of photo album to display (based on getpics.php?id=pics)
dimensions: [3,2],
sortby: ["file", "asc"], //["file" or "date", "asc" or "desc"]
autodesc: "Photo %i", //Auto add a description beneath each picture? (use keyword %i for image position, %d for image date)
showsourceorder: true, //Show source order of each picture? (helpful during set up stage)
onphotoclick:function(thumbref, thumbindex, thumbfilename){
thumbnailviewer.loadimage(thumbref.src, "fit2screen")
}
})

</script>
</body>
</html>


album/pics/getalbumpics.php
album/pics/jag1.jpg


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

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

$photovar=$_GET['id'];
if (!preg_match('/^[a-z0-9_]+$/i', $photovar)){
echo "alert(\"Photo Album ID must contain only letters, numbers, or underscore, and cannot start with a number\")";
die();
}
echo "var album={
echo " baseurl: \"http://membres.multimania.fr/citasyamigos/album/" . $_SERVER["SERVER_NAME"] . dirname($_SERVER['PHP_SELF']) . "/\",\n";
echo " images: [
[0, "jag1.jpg", "May 03, 2010 01:05:04"],



returnimages();
echo " desc: []\n";
echo "}\n";
die();
?>


I wonder if someone could help me with this problem thank you in advance.

jscheuer1
08-28-2010, 04:02 PM
You probably cannot run this on that free host. They put too much additional code on the pages as they are served. This is sort of OK for a single page, annoying but can usually be worked with. However, the host is adding code both top and bottom to getalbumpics.php. That probably will never work.

For testing this script try a host without ads. Even without ads, if they put extra code at the top of all pages, it still will not be workable. Or get your own local PHP host such as WAMP or equivalent.

ricki22
08-29-2010, 09:01 PM
thank you verry much jscheuer1 for assitance.