Présentation
UberGallery permet d'afficher une galerie de photo.
Écrit en PHP, sans utilisation de bases de données et supporte les images JPEG, GIF et PNG.
UberGallery on GitHub
Installation
GD
|
sudo pacman -S php-gd
|
/etc/php/php.ini
|
extension=gd.so
|
UberGallery
Copiez le dossier UberGallery à la racine du site. (Au besoin le masquez en préfixant son nom d'un point)
Renommez le fichier sample.galleryConfig en galleryConfig
Supprimez le dossier gallery-images
Copiez le fichier index.php dans chaque dossiers contenant des images à afficher en galerie.
index.php
|
require($_SERVER['DOCUMENT_ROOT'].'/.UberGallery/resources/UberGallery.php');
$galleryArray = $gallery->readImageDirectory('.');
|
Cache
|
chmod 777 UberGallery/resources/cache
|
Modifications
UberGallery/resources/themes/uber-responsive/css/styles.css
|
.credit {
display: none;
}
.brand {
float: none !important;
margin-left: auto !important;
margin-right: auto !important;
text-align: center !important;
}
|
UberGallery/resources/themes/uber-blue/css/styles.css
|
#credit {
display: none;
}
#galleryWrapper>h1 {
text-align: center;
}
|
Titre
UberGallery/resources/UberGallery.php
|
public function readImageDirectory($directory) {
$this->setRelativeImageDirectory($directory);
if (empty($this->name)) {
$this->name = basename($this->_imgDir);
}
|
UberGallery/resources/themes/uber-blue/index.php
|
<head>
<title><?php echo $gallery->name; ?></title>
<!-- ... -->
<div id="galleryWrapper">
<h1><?php echo $gallery->name; ?></h1>
|
MonDossierPhotos/index.php
|
$gallery = new UberGallery();
$gallery->name = 'Mon Titre';
|
Gestion des liens symboliques
La méthode _getRelativePath ne gère pas les liens symboliques.
UberGallery/resources/UberGallery.php
|
private function _getRelativePath($fromPath, $toPath) {
$fromPath = str_replace("/media/freebox", "/srv/http/dossier_web", $fromPath);
|