Jump to content

Recommended Posts

Hi everyone, first post here. I am in the process of designing my photography/design portfolio page, and have hit a problem. I know it CAN be resolved, but I'm just struggling to know HOW to resolve it. I am new to coding in PHP, although I can fairly easily find my way around existing code. I am fluent in HTML/CSS, and becoming confident in JavaScript (if that will help?).

 

First of all, here is the link to my test page: http://www.jacobshultz.com.au/test/photography.php

 

I have it set up so that using PHP it reads image files in the directory /test/photos/[categoryname], and then it finds thumbnails for those images from the directory /test/thumbs. The script then displays the thumbs and links them to the full sized image.

 

What I would like to do is this:

- Upon clicking the image thumbnail, a new page is loaded (using some sort of a query? I'm really not sure), with the full sized image displayed in the page (in the same position where the image slider is placed on the photography.php page linked above).

 

- Under the image will be the image name, and possibly some EXIF data? (date taken, location, description, etc.)

 

- Finally I want PayPal buttons set up on this page as well. Obviously they need to be customised for the image (This will require simply using the same variable as the image name, I'm guessing)

 

I think that's it. I know it's a lot to request help for, but at the moment I'm at a loss as to how to do what I need to do. I know it can be done in some way/shape/form, as I've seen it on other sites, however I simply don't have the knowledge in PHP to get me started. Can anyone help?

 

Thanks so much in advance,

Jacob :)

Link to comment
https://forums.phpfreaks.com/topic/242695-portfolio-gallery-help/
Share on other sites

1) I would use ajax to retrieve the image.

2) You'll have to interpret the exif information and output it how you want using exif_read_data http://php.net/manual/en/function.exif-read-data.php (You'll have to make sure this module is enabled.)

3) If you want to assign different prices to each image, you might as well set up a database and begin handling it that way. Or you could create matching file names for each image with the price, but I think a database would be easier.

That is asking a lot, try to post one question at a time and relevant code along with it to get better assistance.

 

First off you should not display so many images on a single page.

You should use a database to store image locations,titles,description or any other data.

 

You should break down each section of the images into categories versus all the same page.

Each category being it's own page, or the category is displayed with a single php file using a query for the category. Use navigation links or a dropdown in a form to pick a category.

On this page try to paginate the displayed images.

http://www.phpfreaks.com/tutorial/basic-pagination

 

You could just include seperate php files with if/else statments if only have a few categories.

 

Now we get to the single display of the images.

create a php page tailored to the single image

Use $_GET to get the image id from the multi-display page

$id = $_GET['id'];//sanitize this

http://www.tizag.com/phpT/postget.php

http://www.w3schools.com/php/php_get.asp

 

So where you have your page with all the images and id's, upon clicking make the target href link go to the single page for images

Get familiar with doing a mysql select query

http://php.net/manual/en/function.mysql-query.php

http://www.tizag.com/mysqlTutorial/mysqlselect.php

 

Just showing an example how to link to the single page

$id = $row['id'];
$image_location = $row['image_location'];

echo "<a href='http://www.jacobshultz.com.au/test/view.php?id=$id'><img src='$image_location' border='0'></a>";

 

Let's stop there for now until get something going, feel free to ask more.

Thanks for that. I think it's clear I need to start with creating a database. How is the best way to set up the database? I.e. In terms of what categories to use, how to actually input data - do I need to also create a separate backend? or can it automatically set up a new row for every new image I upload to my site? (I expect to be putting new photos on fairly regularly, so it needs to be a smooth and effective process).

 

I think the best way to go about this (As long as you're happy to stick with me!), is to just go through this one step at a time. Set up the database, then work on the individual pages for different categories, then the individual images.

 

Thanks!

Shultzy, no one is going to hold your hand the entire way through. We can offer suggestions and you can take them or leave them. If you have a specific problem, post a new message specific to it and we'd be happy to help.

 

As for what you are trying to do, I would hire someone or follow a tutorial.

 

Id reference a tutorial, but I'm on my phone.

 

Edit: suppose that came off a bit rude. Not intended that way. (Takes longer to type on my phone.) :/

Sorry teynon, that's fair enough. I am happy to take the suggestions given and work with them. If I have any further problems I'll ask. Thanks again

 

edit: No worries mate. I do understand where you are coming from. I at least have something to go on now, and I'll see how I go.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.