Home    About    Quote    Contact    T: 818-ASK-1150

Free PHP Photo Gallery With No Database

PHP photo gallery scripts that are lightweight and do not need a database. I created these gallery scripts because I needed something lightweight and speedy for some of my projects. There are many php gallery scripts out there that are fantastic, however they are either bloated for my needs or have limited commercial licensing, so I came up with these lightweight galleries. Feel free to use them for personal or commercial use.

I have created 2 versions of this gallery:

1) Photo Gallery with Albums:

  • Automatic thumbnail creation (jpg only ).
  • Displays a random thumbnail for each album.
  • Paginates the results automatically.
  • Supports "jpg", "gif", "png" files.
  • Album names are same as album folders.
  • Integrated is lightbox clone FancyBox.
 

 
2) One File Photo Gallery:
 
  • Automatic thumbnail creation (jpg only ).
  • Paginates the results automatically.
  • Supports "jpg", "gif", "png" files.
  • Single file and lightweight.
 
Just drop the file into your folder containing pictures and point to the folder with your browser.
35 comments
  kevon   05.16.2011
thank you so much for this, but i get an error when i run the code. the error is as follows:

Notice: Undefined offset: 2 in C:\wamp\www\LuxuRay\album.php on line 127

what is wrong??

  Harry   05.16.2011
Kevon, there is no album.php file in the archive. Can you please explain what this file is?

When you unzip the archive, it will create a folder called "folio-gallery". Inside this folder you need to create a folder and name it "album". Then create a subfolder in "album" for each of your albums and copy your pictures in them. If you haven't created these folders you will get error. I haven't had time to correct this but I will when I get a change.

After you do the above, there is a demo.php file in the archive, which is the one you should point to with your browser to view your albums.

I don't have wamp installed but tried it with xampp and it works for me.

  Tavares Hanks   06.13.2011
Hello. I did everything that I was supposed to, but I got this message:

Fatal error: Call to undefined function: scandir() in /usr/local/pem/vhosts/255776/webspace/httpdocs/folio-gallery/folio-gallery.php on line 66

Am I suppose to change anything else? Anything on the demo.php file? Here is the link also:

http://www.aikenhorsepower.com/folio-gallery/demo.php

I hope you can help me. I love the gallery setup and can't wait to use it.

  harry   06.13.2011
Hello Tavares, scandir function is specific to php 5, so if your server is running php4 or lower, you will get this error.


  Tavares Hanks   06.17.2011
What can I do to fix it because I really need it to work.

  harry   06.17.2011
Tavares, as I mentioned, this photo gallery needs php 5 to work.

  Tavares Hanks   06.17.2011
I actually have PHP 4 and 5 support. PHP4 support says run as a Apache module and PHP5 support says run as a CGI application. That is the only option besides off on both. What do I need to do now?

  Tavares Hanks   06.17.2011
Harry,

It is me again. Sorry to bother you, but I got the PHP 5 issue straighten out, but now it comes up blank and there is a folder in albums with photos in it.

http://www.aikenhorsepower.com/folio-gallery/demo.php

  harry   06.17.2011
Tavares, this seems to be a path issue. Make sure your "albums" folder path is correct. You can edit the folio-gallery.php file and change a few settings in the first few lines.

Try "./albums" or "/albums" to see if it will work.


  Tavares Hanks   06.19.2011
Harry,

I promise this will be my last time bothering you, but this is the message that is showing up:

There are currently no albums.

And there is a folder in there with one photo in it as a test, but its not showing up. What do you suggest I have not set correct?

  harry   06.19.2011
Tavares, there's no bother.

The script automatically creates a "thumbs" sub-folder inside each album directory and counts photos from there. My guess is that your php is not compiled properly with GD library which is needed for automatic thumbnail creation.

So, manually create a sub-folder in each of your albums folders and name it "thumbs", then make thumbnails of you photos and copy them in the thumbs sub-folder.

Post back if you have problems.

  Tavares Hanks   06.20.2011
Harry,

Unfortunately it still says There are currently no albums. I have a folder created with a subfolder called thumbs inside. There is a thumbnail inside the thumbs folder and a full size image in the main folder. I also checked and saw the the GD Library is enabled as well. I am ready to throw my hands up. I need help.

  Tavares Hanks   06.20.2011
Harry,

Question, should the folder be named album or albums? I had it as albums but renamed it album, but still no change.

  harry   06.20.2011
Tavares, the main gallery folder should be albums.

I don't know why your images don't show. If you want, email me your ftp login info and i will take a look when i get a chance.

  harry   06.20.2011
Ok Tavares, it's working now.

You had the main album path wrong. Also missing were fancybox files and their path were incorrect.

All paths are relative to folio-gallery folder, so if you download and expand files in folio-gallery folder, everything should work out of the box.

  Tavares Hanks   06.21.2011
Harry,

SWEET! You are a genius. One more thing and I will stop bothering you. If I have a page that is named gallery.php and I want to embed the gallery inside that page, what do I need to do?

  harry   06.21.2011
You have to use php include. Look at demo.php page for an example.

  Tavares Hanks   06.21.2011
Harry,

Oh ok. Wherever I want the gallery to appear, I just do a php include and the name of the file which would be demo.php or foliogallery.php and the gallery will show in that location. Correct?

  harry   06.21.2011
You must include folio-gallery.php, look at demo.php as an example.

  Tavares Hanks   06.24.2011
Harry,

Guess who? This is Tavares again. Everything is working good, but I have one question. I have been altering the css to match the current website. For the text that is below the thumbnail, for example I have the first gallery titles Spring Fling 2011, I only see Spring Fling below that thumbnail and you only see half the word and it is big that you don't see 2011. Which one do I alter to reduce that size?

  harry   06.24.2011
That's because only the first 20 characters of caption is displayed.

If you want to display more characters open folio-gallery.php and find this line: substr($album,0,20) and change 20 to whatever number of characters you want displayed.

  Tavares Hanks   06.26.2011
SWEET ! Thanks again. I promise this is it this time. :)

  Tavares Hanks   07.11.2011
I just have one quick question, when I set my galleries up, is there a limit number of photos that can be put in? The reason I asked, is I have a folder on there that had 475 photos and it showed blank until I deleted them down to 100 and now they show. Just was wondering that's all. Other than that its working great.

  harry   07.11.2011
There is no limitation as far as i can tell, but servers usually limit the number of files can be displayed in a folder.

In any case I don't think 475 photos in one gallery is a good idea.

  ferino   09.12.2011
I can't download this gallery
link
http://www.foliopages.com/downloads/folio-gallery/folio-gallery.zip is not working :(

  harry   09.12.2011
Sorry ferino, the website was redesigned and i forgot to update the folder. Please try again.

  Amy   01.10.2012
I'am getting this error I really don't know what I'am doing wrong please help!


Warning: scandir(/albums) [function.scandir]: failed to open dir: No such file or directory in /homepages/12/d284769722/htdocs/folio-gallery/folio-gallery.php on line 66

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /homepages/12/d284769722/htdocs/folio-gallery/folio-gallery.php on line 66

Warning: Invalid argument supplied for foreach() in /homepages/12/d284769722/htdocs/folio-gallery/folio-gallery.php on line 73
There are currently no albums.

  Amy   01.10.2012
Already found a solution,thank you so much for sharing this very useful script :) cheers! take care,thanks again!

  harry   01.10.2012
You're welcome.

  Amy   01.18.2012
Hi Harry this is Amy again, I'am sorry if I might be bothering you,the case is I tested it exactly as you explained it and it worked out great! But the thing is that I want to insert this album inside a div in a page of my website,what I did so far was convert the website into a php file and put the same script codes just like the file "images.php" but when I upload it on the server the the function works fine (opening images and going back to albums,etc) but the layout completely changed,the thumbnails of the album lost the white frame effect and the title is out of place.Then inside the albums, again the thumbnails are without the white frame and hover effect and are ordered vertically in one column instead of being neatly ordered horizontal and vertical like your example of images php,apart from the thumbnails set into one vertical line they are so stuck to eachother no space between them. I've been trying to figure out why the layout has completely changed but as iam not experienced in php, I'am pretty lost.Please can you help me, ive been trying for many days and i really need to get this finished for a presentation by tommorow afternoon, I'am pretty desperate!!

  harry   01.18.2012
Amy, that sounds like css issue. Make sure folio-gallery.css is properly referenced in your files. Please check that and post a link to your gallery here if you are still having problems.

  Amy   01.18.2012
what do you mean properly referenced do you mean inside the foliogallery i need to modify something? I used the script codes that where located in the "demo.php" inside the div of my website and converted it into a php.does it usually have issues :( i really don't know what to do i really need your help

  harry   01.18.2012
I don't know exactly what you did but according to your description, it sounds like a css issue. The photo gallery css is probably not being read by your scripts.

If you have a link to your gallery i will take a look at it.

  Amy   01.19.2012
Hi Harry, finally after looking at the codes carefully i found out why i had this problem, it seems that the css p element didn't have the "gallery" on it.thank you so much for your time,iam sorry i couldn't reply earlier.Thank you so much for everything.
come to think about it, as you are a programmer ,the case is i made a bar like a horizontal social bar for my website and it works fine appearing at end of the browser screen visible (where it fits ) and following any time i would scroll the page (works in chrome and firefox) but inany internet explorer the bar doesen't appear the same way,it appears at the end of the page and i don't know what to do,is something to do with internet explorer not acepting css is there an extra script i should add?,what happens is that it leaves it at the end of the page.i would appreciate if you can help me please. also regarding php contact form do you know any form php popup form from a click of a button with captucha ,i had one but when at some point the error for not filling details disappeared and when i uploaded it a big error would appear. please help me

  harry   01.19.2012
Amy, i'm glad your issue is solved.

Regarding the horizontal bar, check for errors in your html or css. I can't say what could be wrong before seeing it, so if you're still having trouble post a link here to your live web page.

For a popup contact form you can use many of the modal lighbox clones. My preferred ones are colorbox and fancybox. Here's one of my most recent projects that has a popup contact form using colorbox. www.postyourlease.com

For captcha you can check out "recaptcha" or there are many other ones. I personally do not use captcha on contact forms. My preffered method for reducing spam from contact forms is to create a hidden field in your contact form and tell your php script not to submit the contact form if this hidden field is not empty. Most robots cannot tell the difference between hidden or text field, therefore will fill out this hidden field.

I will post a contact form used in a modal window when i get some time.

Post Comment

Name
Email
Email will not be revealed
Comment