require_once("config.php");
require_once("libs.php");
// Загрузка файла на сервер
$file = isset($_FILES['userfile']) ? $_FILES['userfile'] : "";
if ($file != "")
{
try
{
$fileName = validateAndUploadFile($file);
createSmallImage($fileName);
}
catch(Exception $e)
{
echo "<p style='color:red'>". $e->getMessage() . "</p>";
}
}
// Получение имён изображений
try
{
$images = getImages();
}
catch(Exception $e)
{
echo "<p style='color:blue'>". $e->getMessage() . "</p>";
}
PHP Галерея фотографий. Не требует MySQL базы данных.
Несмотря на небольшой размер имеет широкие возможности:
A simple, file based photo gallery
My first project "Gallery", an online, file based photo gallery for any webserver with PHP. It is easy to install and has a simple, responsive design.
The setup is automatically called, when opening the gallery for the first time. You will be prompted to enter a username and a password for your gallery
Login by clicking on the "Login" button on the left down corner on the home screen or on the top right corner in an album and enter your username and password → You are now logged in.
Logout by clicking on the "Logout" button on the left down corner on the home screen or on the top right corner in an album → You are now logged out.
You need to be signed in to create a new album.
You have now a new, empty album
You need to be signed in to create an album.
You have now deleted an album
You need to be signed in to add pictures.
The new pictures will appear in your album
You need to be signed in to download pictures.
The pictures will be downloaded.
You need to be signed in to delete pictures.
The pictures will be deleted.
create a simple image gallery with a single php file
Features
How to use?
A Simple PHP Photo Gallery Script. Scan a image folder and display imges. No database needed.
An image gallery script in one single PHP file.
It makes use of
Have a look at the wiki if you need more detailed documentation.
Copy or link the index.php file to the directory where your images are included.
Thats all!
By default you can copy or link the following files to the directory where the gallery script is included (the "original meaning" can be ignored, but it is useful because of the order the files are loaded):
------------ | ------------ | -------------
1 | sgConfig.json
| Global config
2 | sgUsers.json
| List of users
3 | sgCustom.json
| Other custom
All existing values are overwritten by the data of the current file.
If a file of the list was not found, it is ignored.
By default you can copy or link a file called sgInclude.php
to the directory where the gallery script is stored / linked.
These files are included BEFORE app class is initialized and AFTER config files were loaded.
If the file was not found, it is ignored.
By default you can copy or link a file called sgScript.js
to the directory where the gallery script is stored / linked.
The content of the file is included at the end of the output document AFTER custom style sheet was included.
If the file was not found, it is ignored.
By default you can copy or link a file called sgStyle.css
to the directory where the gallery script is stored / linked.
The content of the file is included at the end of the output document BEFORE custom script was included.
If the file was not found, it is ignored.