Log in

View Full Version : PHP Photo Album - Problem -



abominable
03-31-2010, 05:08 PM
To begin I am completely new to PHP etc. Really my skills only reach HTML/CSS.

Honestly all of this is out of my league.
I started this to learn how to make a photo gallery where I can add photos without having to recreate the entire gallery each time. I was going to use something like Jalbum, but then realized I couldn't update it easily. So instead of settling for something easier I chose this brain-fry of a technique ;)

So far I have gotten the gallery to display the framework of the layout just as they show up in the DEMO's here: http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm

Problem is the images show up as "?" I believe it knows the file names, but it cant display the images, only the question mark symbol. The files are jpg's so I'm not sure what the problem is.

This is also the first time I have used a MAMP. So I was a little confused on the location of files, etc. I believe I have it right, i.e. "http://localhost:8888/myimages/salmon/getalbumpics.php?id=salmon"

Heres part of my code:


<script type="text/javascript" src="http://localhost:8888/myimages/salmon/getalbumpics.php?id=salmon"></script>
<script type="text/javascript">

//Optional, manual description for particular pictures inside album
//Syntax: albumid.desc[index]="Picture description here"
//eg: myvacation.desc[2]="This is description for the 3rd picture in the album"
//eg: myvacation.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" />





<div id="float_left">



<script type="text/javascript">

new phpimagealbum({
albumvar: salmon, //ID of photo album to display (based on getpics.php?id=xxx)
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>

</div>


Thanks
A.

Emland
03-31-2010, 06:57 PM
I congratulate you for at least getting the "?"

All I am getting is a blank page. I am also using the instructions found here
http://www.dynamicdrive.com/dynamicindex4/php-photoalbum.htm

I hope someone in the know will come along. I'm using GoDaddy, FWIW.

E

abominable
03-31-2010, 07:18 PM
Emland.

What worked for me was placing those various files in the proper locations and then making sure the links to them in the code are referenced the right way.

I had to fiddle with the src. links to get the framework in the demo to show up. Otherwise all you get is a blank spot. The actual images...I'm not sure. :)

You also need to replace the "myvacation" term (folder example) with the "folder" name where your pictures are, inside the code provided. For me my folder name where my (getalbumpics.php) resides is called "salmon" Inside the salmon folder are my images. However that to me doesn't make sense because why does the (getalbumpics.php) have to be INSIDE the salmon folder. What if I want each folder to be a separate gallery division. Do I make another copy of (getalbumpics.php) and then place that inside another folder called "trout" etc.

Of course you may already know that. Being new to this, it took me a while to understand what the directions were telling me to do.

Note: Everything I outlined above may not be 100% right.

A.

abominable
03-31-2010, 07:21 PM
If this helps, in my activity viewer for Safari, the error messages for the photos are:


http://localhost/myimages/salmon/IMG_7130.jpg cant connect to host

Meanwhile the other parts of the page that work show these activity messages:

http://localhost:8888/myimages/salmon/getalbumpics.php?id=salmon 0.3kb
file:///Applications/MAMP/htdocs/ddphpalbum.js 10.3kb

Why are my images with the error messages in the activity window showing(see bold):
http://localhost/myimages/salmon/IMG_7130.jpg

Shouldn't it be "localhost:8888" like in the working links: http://localhost:8888/myimages/salmon/getalbumpics.php?id=salmon 0.3kb