PHP Image Gallery Documentation v1.0
Table of Contents
Description
Create absolutely new dimension of user and community interaction on your web site with PHP Image Gallery. It is a feature-packed photo gallery system that lets users upload and discuss photos in your galleries as well as in public and private albums. It can be seamlessly integrated into your current site design and even use your existing forum login system (if you have one) to keep your users from having to register twice.
Features
- Hierarchal albums structure. Neither number of albums nor maximum depth of structure are limited.
- Flexible role based security system. Permissions can be independently assigned on per album basis
- Integrated maintenance free easy to use albums navigation
- Albums support title, description, cover image and thumbnail view of contents
- Pictures support descriptions, rating, discussions and view statistics
- Customized interface: each visitor can adjust layout of the pages according to personal preferences
- Slide show with preload feature for best experience even on slow connections
- Thumbnails and normalized picture are automatically created. No processing is required to post the image
- Intuitive administrative panel
- Easy images management (add, edit, move, delete)
- Uploaded images approvement - keep your gallery free of the pictures that don't match it
- Search engine optimized HTML code and layout
- Private albums support
- Keyword based images search and recent uploads listing
- Best viewed with all popular browsers
- Seamless user base integration with other site components such as forum
- Interactive installer to simplify installation process
- Template driven implementation and skins support. Make gallery perfectly match your design idea
- Affordable price includes free setup support
System Requirements
- Windows: IIS v.4; v.5 or PWS (PHP 4.01 module with GD2 support)
- Unix based systems: Apache (PHP 4.01 module with GD2 support)
Installation
Preparations
Before beginning installation process collect the following information:
- user name and password under which your Web server is running
- access permission to upload image path
- database connection properties: database host name or IP address, database user name, database user password, database name for your gallery.
Your host master or administrator may help you to obtain this kind of information.
Installation Steps
- Download the install package. File name is php_image_gallery.zip.
- Unzip the install package to the directory which is appointed for the image gallery.
- Open config.php file in your preferred text editor.
- Correct the file with your values of the database connection properties.
Example
$GLOBAL_CONF['db_host'] = 'localhost';
$GLOBAL_CONF['db_user'] = 'dbuser';
$GLOBAL_CONF['db_passwd'] = '123456';
$GLOBAL_CONF['db_name'] = 'gallery1';
- Open your preferred web-browser and browse install.php in your new gallery. The "PHP Image Gallery v1.0 - Installation Page" gives you information about installation process. Successfull installation looks like on the picture below:
Section "Create Admin account" informs that the installation is successfully completed.
- Enter an admin account login name, enter an admin account password.
- Click on "Add" button.
Installation is completed.
- We strongly recommend to permanently delete install.php from your gallery as anyone can accidentally call the file and as a result all data in database will be lost.
Now you can log in to the gallery with admin account and manage your gallery directory.
Site Setup
To call Site Settings page click on "Site Settings" link on Main Menu. You should have Administration authorization to do this. The following picture represents the Site Settings form.
The following table describes each setting.
| Setting | Description |
| Site settings |
| Site index path | A full path to site root on the server |
| Site WEB path | URL to the site with the gallery |
| Classes dir path | A full path to the php classes of the gallery |
| Skins |
Appearance of the gallery. By default gallery is shipped with only "standard" skin |
| Global page title |
This line is shown on root folder of the gallery |
| Upload image settings |
| Upload image path | A full path where all images are stored |
| Upload image WEB path |
URL to direct access to the gallery images |
| Small images path | For informational purpose only |
| Large images path | For informational purpose only |
| Small album icons path | For informational purpose only |
| Large album icons path | For informational purpose only |
| Small album default icon path | A full path with icon file name |
| Large album default icon path | A full path with icon file name |
| Thumbnail images height |
After setting this parameter all new uploaded images will appear in "Approve images" section with new size. After images approvement they will be shown in "Preview" section also with new size. Notice that old images don't resize. |
| Thumbnail images width |
After setting this parameter all new uploaded images will appear in "Approve images" section with new size. After images approvement they will be shown in "Preview" section also with new size. Notice that old images don't resize. |
| Normal images height |
After setting this parameter all new uploaded and approved images will appear in "Slide show" and "View" sections with new size. Notice that old images don't resize. |
| Normal images width |
After setting this parameter all new uploaded and approved images will appear in "Slide show" and "View" sections with new size. Notice that old images don't resize. |
| Listings settings |
| Thumbnails on page |
Amount of thumbnails images in preview section. |
| Comments on page |
Amount of comments shown in "Comment" section |
| Users on page |
Amount of user accounts or registered groups shown on one page. It affects "Manage Users" and "Manage Groups" pages. |
| Page per scroll |
Amount of page ranges shown on page selector area. |
| Slide next |
Amount of images loaded into temporary buffer before and during slide show |
Users settings |
| Default group |
This is one of your registered groups to which the new registered user account is added by default. |
| Admin group |
Admin group is a one of registered groups which allow user acconts that are members of this group to have Administration authorization |
| Admin email |
This is the sender email address sent to the user in the post with forgotten password. |
|
Control Elements Overview
Main Menu
Main Menu under Unauthorized authorization looks like
| Home | Search |
| Option | Description |
| Home |
Starting browsing the gallery |
| Search |
Opening a search form for the image searching |
|
Main Menu under Authorization authorization looks like
| Home | Edit Profile | Search |
| Icon | Description |
| Home | Starting browsing the gallery |
| Search |
Opening a search form for the image searching |
| Edit Profile |
Opening a "Profile" form for editing current user profile |
|
Main Menu under Administration authorization looks like
| Home | Search | Site Settings |
| Manage Users | Manage Groups | Edit Profile |
| Manage Albums | Approve Images | Add User | |
| Option | Description |
| Home | Starting browsing the gallery |
| Search | Opening a search form for the image searching |
| Manage Users |
Opening user's table for user management procedures |
| Manage Groups |
Opening group's table for User Group Management procedures |
| Edit Profile |
Opening a "Profile" form for editing current user profile |
| Manage Albums |
Opening a gallery structure browser to manage it |
| Approve Images |
Opening an "Approve Image" form to censor images posted to gallery |
| Add User |
Opening "Add user" form to add a new user account |
|
Login Options
Not logged in: [ Login | Register ]
| Icon | Description |
| Login | Opening a "Login" form for logging in |
| Register |
Opening "Add user" form to register a new user account |
|
Logged in as tester: [ logoff ]
| Icon | Description |
| logoff | A current user logging off |
|
Actions Album Buttons

Actions Image Buttons

If you don't see some of these icons that means you don't have access permissions for the selected album.
User Authorization Modes
There are three user authorization modes in PHP Image Gallery. The following table describes each of them, their abilities and differences.
| Authorization mode | Description | Main Menu / Login Options |
| Unauthorized |
This is minimal authorization assigned to a user who is not restricted in access to the site containing the gallery at all. The categories of visitors are the following: all visitors who don't have any user account; all visitors who have user account but still have not logged in; all visitors who have performed logoff process. Typically this mode is used for public access. |
| Home | Search |
Not logged in: [ Login | Register ] |
| Authorized |
This authorization mode is for ordinary users of PHP Image Gallery. The categories of visitors are the following: all visitors who have logged in and belong to one of the registered groups with the exception of visitors with Administration authorization. This is general authorization mode and it very useful when you as gallery administrator need to allow or to restrict access for some users to part of the gallery. Permission management in Authorization mode is more flexible than in Unauthorized |
| Home | Edit Profile | Search |
Logged in as tester: [ logoff ]
|
| Administration |
This authorization mode can have users who belong to one specific group only. Normally, these users have exclusive (administrative) privileges to perform maintenance tasks within PHP Image Gallery. The group is one of the registered groups. The categories of visitors are the following: all users that have an account and have successfully performed login process and the user account belongs to a group which is assigned as Admin group in Site settings. How to configure this group will be discussed in Site Setup section. |
| Home | Search | Site Settings |
| Manage Users | Manage Groups | Edit Profile |
| Manage Albums | Approve Images | Add User |
Logged in as admin: [ logoff ] |
|
Based on the authorization mode the appearance of control elements is slightly different.
User Management
This section describes management procedures over an user account. You must be under Administration authorization mode to perform all these procedures.
Creating a New User Account
Click on "Add user" in Main Menu. The "Profile" dialog appears
Fill in the following fields:
- Full Name with full user name.
- E-Mail with valid e-mail address.
- Login with login account name.
- Password with desired password.
- Confirm password with the same password as in Password field.
Optional. Fill Info field with additional information and choose user group. By default Group field is set to value which is defined in Site Setup.
Click on "Add" button.
Remember, it's impossible to add two different users with the same e-mail address or login name.
Edit an Existing User Account
Click on "Manage Users" in Main Menu. The users table appears.
If you don't see a particular user adjust your view with the following options:
- You can adjust amount of rows to be shown by combo-box
in the right lower corner.
- Also switch to another page by page control 1 - 5 | 6 - 7 | in the left lower corner.
- You can choose a particular group from all registered groups to show its members only by group selection combo-box
.
To edit a particular user account click on "edit" link opposite the user account name. The "Profile" dialog appears. The fields are filled with information about particular user account. Edit desired properties. To apply changes click on "Update" button. To cancel the edition click on any Main Menu link.
Delete an Existing User Account
Click on "Manage Users" in Main Menu. The users table appears.
If you don't see a particular user adjust your view with the following options:
- You can adjust amount of rows to be shown by combo-box
in the right lower corner.
- Also switch to another page by page control 1 - 5 | 6 - 7 | in the left lower corner.
- You can choose a particular group from all registered groups to show its members only by group selection combo-box
.
To delete a user account click on "delete" link opposite the user account name. The confirmation message box appears.
Click on "Ok" button. The user account has been deleted. Remember, you can't delete user account by which you have been logged in. A red text "You can't delete yourself" at top of user table indicates this condition.
Note: When you decide to delete an user account remember that all images posted by the user will be removed from gallery without confirmation!
User Group Management
This section describes management procedures over user's group. Group is the main unit for permissions control process through a gallery structure (albums). A user account always resides to one and only one group.
You must be under Administration authorization mode to perform all these procedures.
Creating a New User Group
Click on "Manage Groups" at Main Menu. Table of registered groups appears.
If you don't see a particular user adjust your view with the following options:
- You can adjust amount of rows to be shown by combo-box
in the right lower corner.
- Also switch to another page by page control 1 - 5 | 6 - 7 | in the left lower corner.
Click on "Add new group" link. A "Group" form appears.
Enter a desired group name. Click on "Add" button. A new group has been added.
Rename an Existing User Group
Click on "Manage Groups" in Main Menu. Table of registered groups appears.
Group field is filled with particular group name. Enter a desired new group name. Click on "Update" button.
Change a User Group Membership
A user account can reside to one group at the same time. You can change user account membership for many reasons. Perform the following sequence
Click on "Manage Users". The users table appears.
Click on "edit" link opposite the user account name. The "Profile" dialog appears
The fields are filled with information about particular user account. Select a required group by group combo-box.
Click on "Update" button.
Make a Default Group for New Created Accounts
Visitor of gallery can register an user account itself using "Register" link on Login status row. New user account automatically becomes a member of one of the registered groups specified on "Site Settings" page in "User Settings" section. As administration of gallery you should decide and assign a group for new created accounts to bring down your adminstrative efforts. "Newbie" group is default group for a new account registered by visitors. The following actions change a default group.
Click on "Site Settings". The "Site Settings" page appears
Locate "User settings" section
Select a desired default group by "Default group" combo-box 
Click on "Update" button.
Now every new created user account will reside to group which you select in combo-box.
Make an Administrative Group
Click on "Site Settings". The "Site Settings" page appears
Locate "User settings" section
Select a desired administration group by "Admin group" combo-box 
Click on "Update" button.
Now every user account resided to group which you select in combo-box will have Administration authorization privilegies. User accounts resided to old administration group have lost their administrative privilegies. They can have Authorized or Unauthorized authorizaton privilegies.
Album Management
You can organize your images in gallery by categories or topics. Well organized gallery structure helps visitors to locate interesting images but for administrators, it helps to manage access permissions. You have two ways to organize your gallery structure. Both of them give the same result.
Click on "Manage Album" from Menu options. You will see gallery album structure as on the picture below.

You can create, rename, delete albums.
Creating a New Album
Click on "insert" link near the album to which you want to add a new album. The "Add Album" form appears.
Enter a desired album name in the "Name" field. Optional. You can enter description in the "Description" field.
Click on "Add" button.
The gallery structure appears.
The next way is to use Action Album Buttons when you browse the gallery. But this method has disadvantage that you can't add new album to the root of gallery.
Deleting an Album
Click on "Manage Album" from Menu options. You will see gallery album structure as on the picture below.

Click on "edit" link near the album which you want to delete. The "Edit Album" form appears.
Click on "Delete" button to delete the album.
Note: You can't delete album that contains images.
Rename an Album
Click on "Manage Album" from Menu options. You will see gallery album structure as on the picture below.

Click on "edit" link near the album you want to rename. The "Edit Album" form appears.
Enter new name in "Name" field. Click on "Update" button.
Access Restriction System
Access restriction system bases on the following key features.
- Authorization mode
- Access permission rights
- Primary group
- Access categories
- Access permission rights inheritance
There are three access permission rights to an album. The following table describes each of them.
| Access permission right | Description |
| Read |
Visitors belonging to access category which has access permission "Read" are allowed: to show images in the album, to post a comment to an image, to start slide show |
| Write |
Visitors belonging to access category which has access permission "Write" are allowed: to post images in the album. |
| Owner |
This is special access permission rights. Only one of registered user accounts can be owner of the album at the same time. When user account is set as owner of particular album it has "Read", "Write" access permission rights and is allowed to control access permission rights to the access categories but not allowed to control "Owner" right and "Primary Group". "Owner" access permission right and "Primary Group" is controled by visitor or visitors with Administration authorization only |
|
Note: To allow an user account to post images to an album the user account must have "Read" and "Write" access permission rights to the album.
The Read and Write access rights can be applied to three Access categories.
| Access category | Description |
| Group |
All visitors which user accounts are members of the "Primary Group" and fulfil conditions of Authorized authorization belong to this access category. |
| Other |
All visitors which user accounts are not members of the "Primary Group" and fulfil conditions of Authorized authorization belong to this access category. |
| Unregistered |
All visitors who fulfil conditions of Unauthorized authorization belong to this access category. |
|
The "Primary Group" setting appoints that the registered group acts as Group access category. On "Edit Album" form it is represented by
combo box
You can pass access permissions down through the album structure by access permission rights inheritance:
Check out examples for better understanding of access restriction system. All examples assume the following album structure.

All examples assume three user group CIV, EGR and MIL.
Example 1
Everyone may view and post images in this album.
Example 2
Everyone who has logged in can view and post images in this album with the exception of logged in user who is member of CIV group.
Example 3
Everyone who is member of group MIL can view and post images in this album. Users who have logged in but aren't members of MIL group can only view images in this album.
Miscellaneous Tasks
Image Approval
This feature of the PHP Image Gallery helps to censor images posted to gallery. You must have Administration authorization to do censoring.
Click on "Approve Images" link on menu options. The following form appears.
You may adjust amount of images in form by the "Image per page" control 
In the form above only one image is represented but amount of the images awaiting your approvement may differ. You always work with all images seen in the form simultaneously. This means that you must set "Approve" or "Delete" option for the each image seen. Then click on "Apply changes" button. Notice if you have set "Delete" option for an image by mistake and then clicked on "Apply changes" button this image is deleted permanently.
Skin customization
PHP Image Gallery is shipped with only one "skin" - standard. All skins lie under directory skins in your gallery installation. A skin is a set of template files which help you customaze the appearance of the gallery for your need. Make a new directory under skins directory. The easy way to begin your own skin is to copy standard skin to you directory.
The following tables helps you to identify purpose of the each template file.
| Template file name |
Description |
| add_comm_form.tpl | Template for Add/Edit comments form |
| add_group_form.tpl | Template for Add/Edit User group form |
| add_item_form.tpl | Template for Add/Edit images form |
| add_node_form.tpl | Template for Add/Edit category form |
| add_user_form.tpl | Template for Add/Edit user form |
| admin_groups_list.tpl | Template for user group table |
| admin_main.tpl | Template for Site Settings form(Main configuration) |
| admin_node_list.tpl | Template for Category list |
| admin_photo.tpl | Template for Approve Images form |
| admin_user_list.tpl | Template for user list(user table) |
| first.tpl | Template for first page |
| footer.tpl | Template for bottom part of page |
| head_header.tpl | HTML header ends with open <body> tag |
| header.tpl | Template for upper part of page with Search form and Main Menu |
| list.tpl | Template for image preview and category |
| login_form.tpl | Template for Login form |
| main.tpl | Template for page with opened left and bottom panels |
| main_WOB.tpl | Template for page with opened left panel and closed bottom panel |
| main_WOBR.tpl | Template for page with closed left and bottom panels |
| main_WOR.tpl | Template for page with closed left panel and opened bottom panel |
| menu.tpl | Template for Main Menu |
| menu_admin.tpl | Template for Admnistration authorization mode Main Menu |
| menu_logged.tpl | Template for Authorized authorization mode Main Menu |
| menu_unlogged.tpl | Template for Unauthorized authorization mode Main Menu |
| move_item.tpl | Template for Move Image form |
| paging.tpl | Template for paging selector in preview and category page |
| permissions_denied.tpl | Template for Access permission denied message |
| search_form.tpl | Template for Search form |
| search_res.tpl | Template for search result |
| self_close.tpl | Template for page after successed action |
| show_by_day.tpl | Template for an image preview by day |
| show_by_user.tpl | Template for an image preview by user |
| show_comment.tpl | Template for comments |
| show_large_item.tpl | Template for full size image show with comments |
| show_large_item_WOCOMM.tpl | Template for full size image show without comments |
| show_large_node.tpl | Template for category page |
| show_small_item.tpl | Template for an image preview |
| show_small_node.tpl | Template for an image preview by category |
| slide_next.tpl | Template for loaging new data(No design needed) |
| slide_show.tpl | Template for Slide show |
| tree.tpl | Template for tree structure |
| tree_item.tpl | Template for images in a tree structure |
| tree_node.tpl | Template for accessable categories in a tree |
| tree_node_hide.tpl | Template for unaccessable categories in a tree |
|
Under you skin directory create admin directory. Copy or create the following files in the admin directiry:
| Template file name |
Description |
| tree.tpl |
Template for a tree |
| tree_item.tpl |
Template for images in a tree |
| tree_node.tpl |
Template for categories in a tree |
|
To switch a new skin see Site Setup and change "Skins" options under "Site Settings" option group.
Terms and Conditions
Regular License
One PHP Image Gallery script license gives the right to use one copy of the script within single domain boundaries.
| Demo of Licensing Cases: |
| First Site URL |
Second Site URL |
Number of Licenses Required |
| http://www.domain.com/site_1/ |
http://www.domain.com/site_2/ |
one |
| http://www.domain1.com/ |
http://www.domain2.com/ |
two |
| http://subdomain1.domain.com/ |
http://subdomain2.domain.com/ |
two |
|
|
To finalize registration process owner of the script license should provide SoftComplex Inc. with domain name which license is associated with.
Developer License
Developer license gives the right to include unlimited number of PHP Image Gallery instances in the products of license owner. Such kind of license is obtained automatically by those who have 9 or more regular licenses.
Discounts
We offer 50% discount for the script starting from second license. To take advantage of this discount use the link sent with every order confirmation message.
Same discount initially applies to educational and religious organizations.
Usage
As owner of the PHP Image Gallery license You are allowed to configure the script in any possible way for use in Internet (public), Intranet (corporate) or offline application, however You are strictly NOT allowed (unless specifically authorized by SoftComplex.com) to:
- Redistribute original or modified code of the product
- Claim authorship of the code
Technical Support
You are entitled to free product upgrades and technical support for at least one year from the date of purchase. Technical support includes answers to script related questions via e-mail and/or Internet instant messaging services. Full customization services are provided on customer's request at additional charge.
Violations of Terms and Conditions
Should you violate these Terms and Conditions or any other rights of SoftComplex Inc., SoftComplex Inc. reserves the right to pursue any and all legal and equitable remedies against you without limitation.
Refunds Policy
We issue no refunds for this product. Please make sure PHP Image Gallery meets your requirements before purchasing the license.
Glossary
- Album - This is a container where the posted images are stored. Album is like a folder or directory on ordinary file system with the difference that album stores only image files. An album like a folder on file system plays role in security system.
- Authorization mode - This is element of PHP Image Gallery security system that defines what visitor can do and what can't do.
- User Account - The element of PHP Image Gallery security system that identifies and authenticates a visitor.
- User Group - The element of PHP Image Gallery security system that unites user accounts to assign them equal access permissions.
Links and references