Share

Simple Gallery Script

File Release Notes and Changelog

Release Name: Simple Gallery Script 0.5

Notes:
This is the readme for simple gallery script (copyright (c) 2002 osmo).
It will guide you through install and configuration of the script.

For more information goto:
www:   http://sgs.sourceforge.net
email: osmo@pandora.be
icq:   122717545

Requirements:
-PHP4

Features:
-Specify a different skin for each gallery
-Unlimited subgallery creation
-Specify a mod file for each gallery
-Allows hotlinked images
-Custom name and description for each gallery

Installation:
Upload all the files in the zip to your webspace
Chmod all files if necessary (777)
Run sgs.php

Configuration:
You can config your script as you like, to do so open sgs with an editor.
Find this code (on top of the script)
// variables for config
// start config here
$gal_by_default = "gallery/";
 this is the default gallery
$thumb_per_page = 8;
 this is the number of thumbnails that are displayed per page
$thumb_per_row = 4;
 this is the number of thumbnails that are displayed per row
$sub_per_row = 3;
 this is the number of subgallery descriptions you want displayed per page
$link_per_page = 10;
 this is the number of page links you want per page
$tmpl_by_default = "templates/orion/";
 this is the default template that is used
$tmpl_ext = ".tmpl";
 this is the template extension, you can change it if your host doesnt allow .tmpl files
// stop config here

How it works:
SGS scans your gallery directory and shows the output.

How to make a gallery (rules):
You have to make thumbnails of your images
Your thumbnails have the same name as the full images but start with '_thb_' (without the quotes)
Drop all images and thumbnails in a map
Make a new 'gallery_nfo.php' file and drop it in the map
Upload that map to your host and put it in the gallery dir
Run sgs.php

How to make a new 'gallery_nfo.php':
Take a look at the example file, you can set the following vars:
$gallery_name : this is the name of the gallery
 eg: $gallery_name = "Dogs";
$gallery_description: this is the description of the gallery
 eg: $gallery_description = "Pictures of my favorite dogs!!";
$gallery_hotlink: this is the path to your hotlinked images (eg http://user.webspace.com/images/)
 if no path is set it will use the gallery directory
 eg: $gallery_hotlink = "http://user.webspace.com/images/";
$gallery_template: this is the path to the template you want to use (eg templates/)
 if no path is set it will use the default template
 eg: $gallery_template = "templates/";
$gallery_mod: this is the path to the gallery_mod.php file (eg gallery/pics1/)
 if no path is set the mod file will not be included before execution of the script
 eg: $gallery_mod = "gallery/pics1/";

Remark: -The directory structure starts at the location of sgs.php
        -if you do not want to set a value for a variable just leave it
         eg: $gallery_hotlink;

How to make a new 'gallery_mod.php':
This is basically a php file where you can put your own script in
It will be executed before sgs prints the gallery
eg: You can use it to implement a login system
if(!user_logged_in) {
 print "Please <a href="../members/login.php" target="_new">Login</a>";
 print "After logging in you can <a href="to_the_next_page">Continue</a>";
 exit();
}
eg: you can use it to display a banner
eg: you can use it to count hits
eg: you can use it to track the movement of your members
..
You can print the return value of a function in your mod in a template by editing the template and using the %% tags
eg. %%return_banner_code();%%

How to make a hotlinked gallery:
You create a normal gallery as above, but you upload the full images to another host
The thumbnails must be uploaded on the host with the script on
Then you set $gallery_hotlink to the path of the full images
eg: $gallery_hotlink = "http://user.webspace.com/images/";

How to make your own template/skin:
Look at the example in the templates directory
The %value% variables will be replaced by the php script, but the rest is all html
You can execute php code like this %%phpcode%%

If you like this script please tell me where you installed it :)
And if you made a skin please let me know!

Changes: simple gallery script (20-aug-2002) -modified some templates -added few checks -modified links per page (11-aug-2002) -rearranged/modified some code (09-aug-2002) -added gallery mod check and include (08-aug-2002) -modified templates -added $tmpl_by_default -added $tmpl_ext -added image info -added active page -added previous gallery -modified subcategory's -added name and description image class (06-aug-2002) -added $image_name -converted $image_size from bytes to kilobytes -added is_image -added is_thumb -added get_image_name -added get_image_ext gallery class changelog: (09-aug-2002) -modified $galery_mod (08-aug-2002) -modified $gallery_name -added $gallery_template -added $gallery_mod (07-aug-2002) -added $gallery_sub -added $gallery_sub_count -added get_gallery_nfo -added $gallery_description -added $gallery_hotlink template class (11-aug-2002) -added eval of phpcode in a template -added $template_dir -added constructor