A Dropbox gallery for your website.
- Host your own your pictures on your own site
- Rocket fast, local caching.
- Custom templates
- Automatic, realtime updates using Delta API.
-
Due to Dropbox restrictions I'm not allowed to share my application key. Create a new Dropbox app with the settings in the screenshot and put the keys into
config_sample.php
. Afterwards renameconfig_sample.php
toconfig.php
to activate it. -
If you don't have it already, install composer. After that run
composer install
inside the unicorn folder to install all dependencies. -
Upload the whole unicorn directory to your webserver.
-
Open your browser, type
www.example.com/path/to/unicorn
and follow the instructions. -
Put some pictures into
Dropbox/Apps/<your_app_name>
. Each directory is a gallery. Now go ahead and enjoy your gallery.
Pro tip: You can also enable pretty URLs. See the [Slim documentation] on how to enable them for your server.
The gallery uses Twig and is fully customizable via html and css.
Look into templates
for inspiration.
By default, the gallery is updated every five minutes. This is a tradeoff between Dropbox API restrictions and keeping the gallery up-to-date. You can set the gallery to update more frequently in the config file, but this is discouraged.
After uploading unicorn to the server, make sure that all directories are writeable by unicorn. Otherwise the pictures can not be cached and won't show up.
Some hosters don't allow long running background processes (longer than 30 seconds or so). If your pictures don't show up in the gallery, the update process might have been terminated by the server. Try adding only a few albums at a time to work around this issue.
Copyright (C) Matthias Endler http://www.matthias-endler.de
GNU General Public License version 3. See LICENSE.txt for details.
- @drobee for porting the project to the Dropbox v2 API
Unicorn makes use of the following projects.
- Slim-Framework - A PHP micro framework
- Slim-MVC - A skeleton MVC schema for slim.
- Dropbox - An alternative PHP 5.3 SDK for the Dropbox REST API
- Twig - The flexible, fast, and secure template engine for PHP
- Responsive Layout - A fine tutorial on responsive design
- Composer - The PHP package manager