Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
Free

Personal License

1 site, unlimited servers No source distribution
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Feb 20, 2011
    Last Update: Feb 18, 2011
  • Language: PHP
  • Category: Audio / Video / Images
  • Time / costs savings: 6h / $360 *

PHP Simple Gallery

PHP Simple Gallery
Developed by Cristian Radu, Released Feb 20, 2011

PHP SimpleGallery is a free script used to create SEO friendly browsable galleries on the fly.

PHP

Tags: contest2011 , gallery , image , resize

Images are resized automatically (configurable) and thumbnails are created on-the-fly only once, after that all requests are made directlyto the saved images, minimizing the server load and page load speed.

Features

  • Easy to install and use
  • Very fast - the number of requests to PHP scripts is very limited to support many visitors
  • Very low memory usage - the script uses under 1MB of memory for most requests
  • Valid XHTML
  • SEO optimized
  • Image resize on-the-fly - you can upload the images at any resolution and have them resized automatically
  • Image thumbnails generated on-the-fly - no need to worry about thumbnails, they are created when needed
  • Supports multiple galleries and sub-galleries
Back to top

Installation

Requirements

  • PHP 5.1+
  • GD support for PHP
  • Apache with mod_rewrite

Installation

  1. Unzip the package contents to temporary location.
  2. Put the content of public/ directory to the image gallery in a public location on your server and the content of library/ outside the public folder.

    Example:

    /home/SimpleGallery/library/
                                       SimpleGallery/
    /home/public_html/YourGallery/
                                       ImagesFolder1/
                                       ImagesFolder2/
                                       index.php
                                       config.php
                                       style.css
                                       .htaccess
    

    Please note that although you can have as many image galleries as you want, they need to be stored in a public location (accesible through the browser). Don't worry, direct browsing of the folders is disabled using the provided .htaccess file.

  3. Upload images in the public directory using FTP (or other method of your choice).

  4. Edit config.php (see Configuration).
  5. Test the installation by opening the gallery location in your browser.
Back to top

Configuration

To configure PHP SimpleGallery you just need to edit the provided config.php file.

The source directory is the path to the image gallery. If you copied the config.php directly to the image gallery root there is no need to change this. You can however alter this value if you have a custom setup (not recommended).

/**
     * Full path to the images source directory
     */
    'source_directory' => dirname(__FILE__),

The public url value must point to the public http location of your gallery.

/**
     * Public url for the gallery
     */
    'public_url' => 'http://localhost/TestGallery/',

Image thumbnails will be created in a directory, the name of this directory can be customized (usually you can leave this value default).

/**
     * Thumbnails directory name
     */
    'thumbnail_directory' => 'thumbnails',

Customize your gallery name.

/**
     * The gallery name
     */
    'gallery_name' => 'SimpleGallery',

The script supports automatic image resize. Please be careful with this value since the operation will resize the images WITHOUT ANY BACKUP! If you do not want your images altered just set this parameter to false.

/**
     * Automaticaly resize images
     *
     * WARNING! This will resize ORIGINAL images, no backup is made!
     */
    'auto_resize' => true,

    /**
     * Maximum image width
     *
     * NOTE: Only used when auto_resize is set to true
     */
    'max_width' => 800,

    /**
     * Maximum image height
     *
     * NOTE: Only used when auto_resize is set to true
     */
    'max_height' => 600,

You can customize the width and height of the thumbnails (normally you can leave these default).

/**
     * Thumbnail width
     */
    'thumbnail_width' => 100,

    /**
     * Thumbnail height
     */
    'thumbnail_height' => 100,

If you want you can customize the values of accepted file extensions (separated by comma).

/**
     * The accepted file extensions
     */
    'file_extensions' => 'jpeg,jpg,gif,png',

By default an image count for each gallery is displayed. You can turn this off for a small performance improvement or if you don't want to display the number of images in each gallery.

/**
     * Display image count for each gallery
     */
    'count_images' => true,

When each image is viewed a number of thumbnails are displayed in the navigation bar before and after the current one. You can customize this value if you want (usually you can leave this default).

/**
     * Maximum number of images to show before and after the current one
     */
    'max_nav_images_around' => 2
Back to top

Documentation

API documentation

To view all of the available class methods take a look at the API reference.

If you are looking for a demo of the PHP Simple Gallery script you can find here a fully working gallery.

User Reviews

No reviews have been submitted yet.

Questions & Comments


Or enter your name and Email
No comments have been posted yet.
You must be logged-in to vote. Log-in to your account or register now.