Hi everyone… I am a total newbie to this. I am a designer not a programmer. But the idea of a PHP gallery is awesome. I came across the tutorial here.
Build An Automated PHP Gallery System In Minutes By Mayank Gandhi (sorry this is my fist post and cannot post a link)
But it seems so hard can anyone help to break it down a bit? Or may be direct me to a simpler tutorial?
One the first page it says "Before we can upload the images, we require a directory in which to store them. Therefore, let’s make a new directory, and name it “photos” " what does this mean? Create a folder for pictures in the root folder?
Can I download the files from tutorial and add pictures to the folder and upload it to a server and see this gallery? what changes should I make? And where should I make the changes?
I know these are the very basic question…any help will be appreciated…
Well, if you don’t know PHP and SQL (like me!), that tute is going to be a steep learning curve! I would recommend looking at a jQuery alternative.
Yes.
Can I download the files from tutorial and add pictures to the folder and upload it to a server and see this gallery? what changes should I make? And where should I make the changes?
I haven’t looked closely at the tutorial, but I’d say not, as it seems to require setting up a database too.
ralph.m, thank you very much. jQuery galleries do not somehow appeal to me. I also heard that they slow down the websites with large amount of pictures. I am a photographer and I promise you I will have hundreds of pics :goof: Is there anywhere I can get some assistance just for this tutorial? That may mean assistance for step by step… Or are there any php galleries that are suitable for large galleries that we can buy? Thank you for your help…
I don’t think it’s worth learning PHP (which takes several years) just to put up a gallery, which is best handled by JavaScript anyhow.
I did a simple gallery recently that had lots of pictures. BUT, each picture just downloads when you click on a thumbnail, not when the page loads, so there is no page load problem.
I guess it depends on the number of pictures you want to load that you may want to go the JavaScript route or not… If you’re going to have hundreds of pictures, you’re going to have to learn this stuff because it is the only to handle that many pictures… If you’re going to have 50 or so, then Javascript is good option.
Now, answering your question:
"Before we can upload the images, we require a directory in which to store them. Therefore, let’s make a new directory, and name it “photos” " what does this mean? Create a folder for pictures in the root folder?
When you have a website, you want to keep your files tidy and organized so they’re easy to find if you need to do any update. Therefore, it makes sense to create a folder under root folder to keep the photos separate from the main web pages (in a Apache server, the root folder is htpdocs)
The problem with your question is that it is too wide… If I have to go through the tutorial itself and explain it to you… it would take me at least the same 8 pages (if no more) that the tutorial has…
A better tutorial? I think that is a hell of a tutorial and right now I can’t think of anything better… but I look through my links and if I find it, I’ll make sure to post it here.
Thank you Molona… looks like I have to learn PHP…thank you for your patience with me. The scripts we use do they make any difference in how they are able to handle the number of pictures? or any php based gallery can handle many pics? Because I recently found many php galleries online for purchase?
There are loads of free galleries around take a look at Hotscripts. Try some out and see how they work.
Most should be commented and you can find explanations of the functions on the web.
The gallery part is the easy part - allowing uploads from others is the hard bit !
I always seperate my pictures into different folders as it is easier to keep track of them. I also tend to put thumbnails into seperate folders and do not use a database unless I want a search function.
Very simple photo display - no styling - could build into a table or use css:
<?php
// Photos in folder called pics in root folder and this file in root folder
// Folder to select photos from
$dir = 'pics/';
// Find all jpg images in the pics folder and display
foreach (glob($dir."{*.jpg}", GLOB_BRACE) as $filename)
{
// Get photo size for use in the image tag
$size = getimagesize($filename);
// Display the photos
echo "<img src=\\"".$filename."\\" ".$size[3]." />\
";
}
?>