micro galleries generator for PHP CLI
Simple php static gallery generator (less than 5kb)
*Needd PHP >= 5.3
* 1 * * * php /path/to/the/script/generate.php
$galleryBase = '//your.domain.com/pics/';
/path/to/the/script/gallery
A config.php can be created to changing options of the script.
Availables vars are :
<?php
$imagePattern = '/([^.]+)\.(jpg|png|gif)/u'; // A pattern PCRE of specific pics (like png or gif format or your imagination of script use)
$galleryDir = 'gallery'; // If you want rename default gallery dirname
$templateDir = 'template'; // If you want rename default template dirname
$thumbsDir = '_thumbs'; // If you want rename default thumbs dirname (don't forger undescore)
$thumbsPath = $galleryDir . '/' . $thumbsDir; // ... Never change it, if you don't know what you do
$thumbWidth = 200; // Width of thumbs
$thumbRatio = array('4','3'); // Ratio of thumbs
$publicBase = ''; // In the case of using the script in sub directory, you must specify the entire url to access him here like /access/to/my/gallery
?>
You just need to create a dir named _template
in your gallery dir,
This dir need this 5 files :
<noscript>
sectionFor display elements, you must use tags syntax : {mytag}
in this files.
Availables tags are :
The command line to launch is : php generate.php /path/to/another/path (if needed: /my/sub/dir/gallery)
Commande lines examples :
Script dir is on /var/www
and users galleries are in /home/{user1,userX}/~public/
and the url to access them are like : user1.website.com
, userX.website.com
:
php /var/www/piclist/generate.php /home/user1/~public/
php /var/www/piclist/generate.php /home/userX/~public/
Now, users have galleries on differents sub dirs. User1 in ~public/pictures , user2 ~/public/42/misc/perfect/images url to access them are user1.mywebsite.com/pictures
user2.mywebsite.com/42/misc/perfect/images
:
#User 1:
php /var/www/piclist/generate.php /home/user1/~public/pictures /pictures
#user2:
php /var/www/piclist/generate.php /home/user2/~public/42/misc/perfect/images /42/misc/perfect/images
Users can theming galleries with _template dir in galleries root.
Just create sub directories and upload your pictures.