├── .gitignore ├── README.md ├── Screenshots ├── accounts.jpg ├── index.jpg ├── index2.jpg └── settings.jpg ├── config.php ├── docker ├── Dockerfile ├── README.md ├── fpm.conf ├── nginx.conf ├── raspbian-stretch │ ├── Dockerfile │ ├── README.md │ ├── fpm-photoshow.conf │ ├── photoshow.nginx │ ├── runPhotoshow.bash │ └── supervisor-photoshow.conf └── supervisor.conf ├── inc ├── bin.png ├── favico.ico ├── fileupload-ui.css ├── folder.png ├── fonts │ ├── CaviarDreams.ttf │ ├── FontAwesome.otf │ ├── GeosansLight.ttf │ ├── Roboto-Bold.ttf │ ├── Roboto-Medium.ttf │ ├── Roboto-Regular.ttf │ ├── RobotoCondensed-Bold.ttf │ ├── fontawesome-webfont.eot │ ├── fontawesome-webfont.svg │ ├── fontawesome-webfont.ttf │ └── fontawesome-webfont.woff ├── img.png ├── jquery-ui.js ├── jquery.fileupload-ui.js ├── jquery.fileupload.js ├── jquery.js ├── jquery.scrollTo.js ├── jquery.touchSwipe.min.js ├── js │ └── photosphere │ │ ├── sphere.js │ │ └── three.min.js ├── loc │ ├── default.ini │ ├── deutsch.ini │ ├── espanol.ini │ ├── francais.ini │ ├── greek.ini │ ├── italian.ini │ ├── japanese.ini │ └── russian.ini ├── me.jpg ├── mousewheel.js ├── pbar-ani.gif ├── photosphere_logo.png ├── rss.png ├── spiffygif.gif ├── stylesheets │ ├── font-awesome.min.css │ ├── pure-grid.css │ └── pure-min.css └── ui.js ├── index.php ├── src ├── XRL │ └── src │ │ ├── Autoload.php │ │ ├── Callable.php │ │ ├── CallableFactory.php │ │ ├── CallableFactoryInterface.php │ │ ├── CallableInterface.php │ │ ├── Client.php │ │ ├── CompactEncoderFactory.php │ │ ├── Decoder.php │ │ ├── DecoderFactoryInterface.php │ │ ├── DecoderInterface.php │ │ ├── Encoder.php │ │ ├── EncoderFactoryInterface.php │ │ ├── EncoderInterface.php │ │ ├── Exception.php │ │ ├── FactoryRegistry.php │ │ ├── Node.php │ │ ├── NonValidatingDecoderFactory.php │ │ ├── PrettyEncoderFactory.php │ │ ├── Request.php │ │ ├── RequestFactory.php │ │ ├── RequestFactoryInterface.php │ │ ├── RequestInterface.php │ │ ├── Response.php │ │ ├── ResponseFactory.php │ │ ├── ResponseFactoryInterface.php │ │ ├── ResponseInterface.php │ │ ├── Server.php │ │ └── ValidatingDecoderFactory.php ├── classes │ ├── API.php │ ├── Account.php │ ├── Admin.php │ ├── AdminAbout.php │ ├── AdminMenu.php │ ├── AdminPanel.php │ ├── AdminStats.php │ ├── AdminUpload.php │ ├── Board.php │ ├── BoardDir.php │ ├── BoardHeader.php │ ├── BoardItem.php │ ├── Cleaning.php │ ├── Comment.php │ ├── Comments.php │ ├── CurrentUser.php │ ├── Description.php │ ├── Exif.php │ ├── File.php │ ├── FileException.php │ ├── Group.php │ ├── GuestToken.php │ ├── HTMLObject.php │ ├── Image.php │ ├── ImageBar.php │ ├── ImagePanel.php │ ├── Index.php │ ├── Infos.php │ ├── JS.php │ ├── Judge.php │ ├── LoginPage.php │ ├── MainPage.php │ ├── Menu.php │ ├── MenuBar.php │ ├── Page.php │ ├── Provider.php │ ├── RSS.php │ ├── RegisterPage.php │ ├── Settings.php │ └── Video.php ├── js │ ├── admin.js │ ├── confirmation.js │ ├── image_panel.js │ ├── keyboard.js │ ├── menu.js │ ├── panel.js │ └── slideshow.js ├── phpthumb │ ├── .gitattributes │ ├── .gitignore │ ├── README.md │ ├── composer.json │ ├── demo │ │ ├── index.php │ │ ├── javascript_api.js │ │ ├── phpThumb.demo.check.php │ │ ├── phpThumb.demo.demo.php │ │ ├── phpThumb.demo.gallery.php │ │ ├── phpThumb.demo.object.php │ │ ├── phpThumb.demo.object.simple.php │ │ ├── phpThumb.demo.random.php │ │ ├── phpThumb.demo.showpic.php │ │ └── readme.demos.txt │ ├── docs │ │ ├── phpthumb.changelog.txt │ │ ├── phpthumb.faq.txt │ │ ├── phpthumb.license.commercial.txt │ │ ├── phpthumb.license.txt │ │ └── phpthumb.readme.txt │ ├── fonts │ │ └── readme.txt │ ├── images │ │ └── readme.txt │ ├── index.php │ ├── phpThumb.config.php.default │ ├── phpThumb.php │ ├── phpthumb.bmp.php │ ├── phpthumb.class.php │ ├── phpthumb.filters.php │ ├── phpthumb.functions.php │ ├── phpthumb.gif.php │ ├── phpthumb.ico.php │ └── phpthumb.unsharp.php ├── scripts │ └── clean.php ├── stylesheets │ ├── buttons.css │ ├── new.css │ ├── panels.css │ ├── side-menu.css │ ├── structure.css │ └── theme.css └── tests │ ├── CurrentUserTest.php │ ├── GuestTokenTest.php │ ├── SettingsTest.php │ ├── TestUnit.php │ ├── phpunit.xml │ └── test_config.php └── user └── themes ├── Default └── style.css ├── Demo └── style.css └── Vendredi ├── PhotoShow-Vendredi-theme.jpg └── style.css /.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | *~ 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PhotoShow 3.0 2 | 3 | ## Overview 4 | 5 | **PhotoShow**, *your* web gallery. **PhotoShow** is a *free* and *open source* web gallery, that you can very easily install on your web server. It doesn't even require a database ! 6 | 7 | ## Screenshots 8 | 9 | ![image](Screenshots/index.jpg) 10 | ![image](Screenshots/index2.jpg) 11 | ![image](Screenshots/settings.jpg) 12 | ![image](Screenshots/accounts.jpg) 13 | 14 | ## What's new ? 15 | 16 | Wow, well, loads. Here is a quick list. 17 | * "Material design" : applied most of the guidelines from Google's new design paradigm. And if you don't like it.... 18 | * ... Themes ! You can add your own themes in the user/themes/ folder, and select them in the Settings. 19 | * Responsive Layout : you can now access and manage your PhotoShow from your phone ! 20 | * PhotoSpheres support : put your photosheres in a folder named "PhotoSpheres" and... enjoy 21 | * RSS Feed : automatically adds items when generating a thumb for them (meaning they're new), only if they are publicly accessible. Also, if you change the access rights later on, they will apply to the feed. 22 | * Administration : removed most of the drag'n'drop stuff (clunky and unusable from a phone) : now, most of your modifications can be done from the Information panel (right menu) 23 | * Settings overhaul 24 | * Comments deleting : Now, you can. Sorry this took so long. 25 | * Thumbnails size can be edited in the admin section. 26 | * Loads of code removed for a faster, more reliable PhotoShow. Hopefully. 27 | * Uploaders have lost a load of rights. Basically, all they can do is upload. No file removing anymore. 28 | * Rights management SHOULD be the same as before. But, just in case, please check after updating 29 | * Updated phpThumb library 30 | * Added configuration values for `quality_small` and `quality_mini` thumbnails with default of `90` - change them through your own config.php, like `$config->quality_small = 90;` 31 | * Make usage of your imagick installation, as it will result in better thumbnail quality! If the convert tool isn't located at `/usr/local/bin/convert` define your convert tool location through config.php by adding: `$config->imagemagick_path = '/your/path/to/convert';` 32 | 33 | ## Installation 34 | 35 | ### Copy the repository 36 | 37 | First, you need to copy the repository into whatever you like (here, toto) 38 | 39 | `git clone https://github.com/thibaud-rohmer/PhotoShow.git toto` 40 | 41 | ### Create two directories 42 | 43 | Note : you may create those directories wherever you want, and give them the names you want. It is safer to have the Photos and Thumbs directories outside of your web path (this way, access can be restricted using the authentication & authorization mechanisms provided by PhotoShow). 44 | 45 | * **Photos** : Where your photos will be stored. 46 | * **Generated** : Where the thumbnails of your photos will be stored. 47 | 48 | ***Important*** : Make sure that the web server has the rights to read and write in those directories. 49 | 50 | ### Edit your settings 51 | 52 | Edit the file `config.php` that is inside your PhotoShow folder. It is advised to put absolute paths for each of the entries, although relative paths should work fine. 53 | 54 | ### Go to your website 55 | 56 | Now, use your favorite web browser to go to your PhotoShow website. You should be asked to create the main account. This account will be the admin of the website. 57 | 58 | > Your website is now ready. 59 | 60 | ## Run with Docker 61 | 62 | Docker **must be installed and available** on you system ! 63 | 64 | First, you need to copy the repository into whatever you like (here, toto) 65 | 66 | `git clone https://github.com/thibaud-rohmer/PhotoShow.git toto` 67 | 68 | Then build and run Photoshow Docker container: 69 | 70 | `cd toto/docker; ./runPhotoshow.sh` 71 | -------------------------------------------------------------------------------- /Screenshots/accounts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/Screenshots/accounts.jpg -------------------------------------------------------------------------------- /Screenshots/index.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/Screenshots/index.jpg -------------------------------------------------------------------------------- /Screenshots/index2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/Screenshots/index2.jpg -------------------------------------------------------------------------------- /Screenshots/settings.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/Screenshots/settings.jpg -------------------------------------------------------------------------------- /config.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | // Folder where your pictures are stored. 33 | // Must be at least readable by web server process 34 | $config->photos_dir = "path_to_your_photos_dir_goes_here"; 35 | 36 | // Folder where PhotoShow parameters and thumbnails are stored. 37 | // Must be writable by web server process 38 | $config->ps_generated = "path_where_photoshow_generates_files_goes_here"; 39 | 40 | // Local timezone. Default one is "Europe/Paris". 41 | #$config->timezone = "Europe/Paris"; 42 | 43 | // If you want to inject a tracking code (or anything really) in your pages , use this to refer to a file containing that: 44 | #$config->tracking_code_include = '/path/to/something.html'; 45 | 46 | ?> 47 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.10.1 2 | 3 | MAINTAINER CYOSP 4 | 5 | RUN apk upgrade \ 6 | && apk add \ 7 | ca-certificates \ 8 | git \ 9 | zip \ 10 | nginx \ 11 | php7-session \ 12 | php7-fpm \ 13 | php7-gd \ 14 | php7-xml \ 15 | php7-simplexml \ 16 | php7-exif \ 17 | gd-dev \ 18 | supervisor \ 19 | fbida-exiftran \ 20 | && git clone https://github.com/thibaud-rohmer/PhotoShow.git /var/www/PhotoShow \ 21 | && apk del ca-certificates git 22 | 23 | RUN deluser xfs 24 | RUN adduser -u 33 -D -S -G www-data www-data 25 | 26 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf 27 | RUN rm /etc/nginx/conf.d/default.conf 28 | ADD nginx.conf /etc/nginx/conf.d/photoshow.conf 29 | RUN mkdir -p /run/nginx /var/run/php 30 | 31 | RUN sed -i -e 's/^.\+daemonize.\+$/daemonize = no/' /etc/php7/php-fpm.conf 32 | RUN rm /etc/php7/php-fpm.d/www.conf 33 | ADD fpm.conf /etc/php7/php-fpm.d/photoshow.conf 34 | 35 | RUN mkdir -p /opt/PhotoShow/Photos /opt/PhotoShow/generated 36 | RUN chown -R www-data:www-data /opt/PhotoShow/Photos /opt/PhotoShow/generated 37 | RUN sed -i -e 's/$config->photos_dir.\+/$config->photos_dir = "\/opt\/PhotoShow\/Photos";/' /var/www/PhotoShow/config.php 38 | RUN sed -i -e 's/$config->ps_generated.\+/$config->ps_generated = "\/opt\/PhotoShow\/generated";/' /var/www/PhotoShow/config.php 39 | 40 | RUN sed -i -e 's/^\(\[supervisord\]\)$/\1\nnodaemon=true/' /etc/supervisord.conf 41 | ADD supervisor.conf /etc/supervisor.d/photoshow.ini 42 | RUN mkdir -p "/var/log/supervisor" 43 | 44 | VOLUME ["/opt/PhotoShow", "/var/log"] 45 | EXPOSE 80 46 | 47 | CMD /usr/bin/supervisord 48 | -------------------------------------------------------------------------------- /docker/README.md: -------------------------------------------------------------------------------- 1 | # PhotoShow and Docker 2 | 3 | To have PhotoShow running with Docker it's necessary to: 4 | * Build the PhotoShow image which will be used to run a container 5 | * Create a container based on image built 6 | 7 | More details about [Docker command line](https://docs.docker.com/engine/reference/commandline/cli/) 8 | 9 | ## Build 10 | 11 | Build PhotoShow image with the following command: 12 | 13 | ```bash 14 | sudo docker build -t photoshow . 15 | ``` 16 | 17 | ## Create and run a dedicated PhotoShow container 18 | 19 | When PhotoShow image has been built, the following command allows to create and run a dedicated PhotoShow container named `photoshow_1`: 20 | 21 | ```bash 22 | sudo docker run --name photoshow_1 -p 8080:80 -d -i -t photoshow 23 | ``` 24 | 25 | PhotoShow is now available on: http://localhost:8080 26 | 27 | ### Stop container 28 | 29 | Previous PhotoShow container can be stopped with: 30 | 31 | ```bash 32 | docker stop photoshow_1 33 | ``` 34 | 35 | ### Remove container 36 | 37 | Previous PhotoShow container can be removed with: 38 | 39 | ```bash 40 | docker rm photoshow_1 41 | ``` 42 | 43 | ## Run container with host directory mapping 44 | 45 | It's also possible to run the container with a host directory mapping of `/opt/PhotoShow` container directory. 46 | 47 | This allows to store photos and PhotoShow data outside docker. 48 | Host directory path example: `/home/data/photoshow`. 49 | 50 | The host directory must have the two following sub directories: 51 | * `Photos` 52 | * Where photos will be read by Photoshow. 53 | * Folder and sub folders must have read permission set for everyone.
54 | Example: `sudo chmod -R +r /home/data/photoshow/Photos`. 55 | * `generated` 56 | * Where Photoshow will store its internal data. 57 | * Folder and sub folders must be owned by UID `33` which is user: `www-data` in container and owner permissions set to: `rwx`.
58 | Example: 59 | ```bash 60 | sudo chown -R 33 /home/data/photoshow/generated 61 | sudo chmod -R u+rwx /home/data/photoshow/generated 62 | ``` 63 | 64 | Once host directory is configured run: 65 | 66 | ```bash 67 | sudo docker run --name photoshow_2 -v "/home/data/photoshow:/opt/PhotoShow" -p 8080:80 -d -i -t photoshow 68 | ``` 69 | 70 | ## Logs 71 | 72 | If you want access to logs, a volume can be map to container directory: `/var/log` 73 | -------------------------------------------------------------------------------- /docker/fpm.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = www-data 3 | group = www-data 4 | 5 | listen = /var/run/php/php7.0-fpm.sock 6 | listen.owner = www-data 7 | listen.group = www-data 8 | listen.mode = 0660 9 | 10 | pm = dynamic 11 | pm.start_servers = 1 12 | pm.max_children = 5 13 | pm.min_spare_servers = 1 14 | pm.max_spare_servers = 2 15 | 16 | php_value[upload_max_filesize] = 14M 17 | php_value[post_max_size] = 14M 18 | php_value[memory_limit] = 96M 19 | php_value[max_execution_time] = 45 20 | -------------------------------------------------------------------------------- /docker/nginx.conf: -------------------------------------------------------------------------------- 1 | upstream php7-fpm-sock { 2 | server unix:/var/run/php/php7.0-fpm.sock; 3 | } 4 | 5 | server { 6 | listen 80; 7 | 8 | error_log /var/log/nginx/photoshow.log info; 9 | 10 | location / { 11 | alias /var/www/PhotoShow/; 12 | index index.php; 13 | client_max_body_size 0; 14 | 15 | location ~* \.php$ { 16 | #try_files $uri =404; 17 | allow all; 18 | include fastcgi_params; 19 | fastcgi_index index.php; 20 | fastcgi_pass php7-fpm-sock; 21 | fastcgi_param SCRIPT_FILENAME /var/www/PhotoShow/$fastcgi_script_name; 22 | fastcgi_param QUERY_STRING $query_string; 23 | fastcgi_intercept_errors off; 24 | client_max_body_size 0; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM arm32v7/debian:stretch 2 | MAINTAINER astyonax 3 | # raspbian Dockerfile inspired from CYOSP's debian Dockerfile 4 | 5 | RUN apt-get update 6 | RUN DEBIAN_FRONTEND=noninteractive apt-get upgrade -yq 7 | 8 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -yq \ 9 | --no-install-recommends \ 10 | ca-certificates \ 11 | git-core \ 12 | vim \ 13 | openssh-server \ 14 | openssh-client \ 15 | less \ 16 | nginx \ 17 | php-fpm \ 18 | php-gd \ 19 | php-xml \ 20 | libgd-dev \ 21 | supervisor 22 | 23 | RUN git clone https://github.com/thibaud-rohmer/PhotoShow.git /var/www/PhotoShow 24 | RUN cd /var/www/PhotoShow && sed -i -e 's/$config->photos_dir.\+/$config->photos_dir = "\/opt\/PhotoShow\/Photos";/' config.php 25 | RUN cd /var/www/PhotoShow && sed -i -e 's/$config->ps_generated.\+/$config->ps_generated = "\/opt\/PhotoShow\/generated";/' config.php 26 | 27 | RUN sed -i -e 's/^\(\[supervisord\]\)$/\1\nnodaemon=true/' /etc/supervisor/supervisord.conf 28 | ADD supervisor-photoshow.conf /etc/supervisor/conf.d/photoshow.conf 29 | 30 | RUN mkdir -p /var/www/PhotoShow 31 | RUN mkdir -p /opt/PhotoShow/Photos 32 | RUN mkdir -p /opt/PhotoShow/generated 33 | RUN chown -R www-data:www-data /opt/PhotoShow/Photos /opt/PhotoShow/generated 34 | 35 | RUN mkdir -p /root/.ssh 36 | #ADD photoshow.key.pub /root/.ssh/authorized_keys 37 | 38 | RUN mkdir -p /etc/nginx/ssl 39 | ADD nginx.crt /etc/nginx/ssl/nginx.crt 40 | ADD nginx.key /etc/nginx/ssl/nginx.key 41 | 42 | 43 | ADD fpm-photoshow.conf /etc/php/7.0/fpm/pool.d/photoshow.conf 44 | RUN sed -i -e 's/^.\+daemonize.\+$/daemonize = no/' /etc/php/7.0/fpm/php-fpm.conf 45 | 46 | ADD photoshow.nginx /etc/nginx/sites-available/photoshow 47 | RUN rm -f /etc/nginx/sites-enabled/default 48 | RUN ln -s /etc/nginx/sites-available/photoshow /etc/nginx/sites-enabled/photoshow 49 | RUN echo "daemon off;" >> /etc/nginx/nginx.conf 50 | 51 | RUN mkdir -p /var/run/sshd /var/run/php 52 | 53 | VOLUME ["/opt/PhotoShow", "/var/log"] 54 | EXPOSE 443 22 55 | CMD /usr/bin/supervisord 56 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/README.md: -------------------------------------------------------------------------------- 1 | # Photoshow and Docker 2 | 3 | ## Build and Run 4 | 5 | Build and run Photoshow docker container running: 6 | 7 | ```bash 8 | sudo ./runPhotoshow.bash 9 | ``` 10 | 11 | ### Host directory mapping 12 | 13 | It's also possible to run the container with a host directory mapping of `/opt/PhotoShow` container directory. 14 | 15 | This allows to store photos and Photoshow data outside docker. 16 | 17 | Thus it's necessary to export the `PHOTOSHOW_HOST_DIRECTORY` variable with the absolute host directory path.
18 | Host directory path example: `/home/data/photoshow`. 19 | 20 | The host directory must have the two following sub directories: 21 | * `Photos` 22 | * Where photos will be read and written by Photoshow. 23 | * Folder and sub folders must have read permission set for everyone.
24 | Example: `sudo chmod -R +r /home/data/photoshow/Photos` + `sudo chown -R 33 /home/data/photoshow/Phots/` 25 | 26 | * `generated` 27 | * Where Photoshow will store its internal data. 28 | * Folder and sub folders must be owned by UID `33` which is user: `www-data` in container and owner permissions set to: `rwx`.
29 | Example: 30 | ```bash 31 | sudo chown -R 33 /home/data/photoshow/generated 32 | sudo chmod -R u+rwx /home/data/photoshow/generated 33 | ``` 34 | 35 | Once host directory is configured run: 36 | 37 | ```bash 38 | export PHOTOSHOW_HOST_DIRECTORY="/home/data/photoshow" 39 | sudo -E ./runPhotoshow.bash 40 | ``` 41 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/fpm-photoshow.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | php_value[upload_max_filesize] = 10M 3 | php_value[post_max_size] = 10M 4 | php_value[memory_limit] = 64M 5 | php_value[max_execution_time] = 15 6 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/photoshow.nginx: -------------------------------------------------------------------------------- 1 | upstream php7-fpm-sock { 2 | server unix:/var/run/php/php7.0-fpm.sock; 3 | } 4 | 5 | server { 6 | listen 443 ssl; 7 | ssl_certificate /etc/nginx/ssl/nginx.crt; 8 | ssl_certificate_key /etc/nginx/ssl/nginx.key; 9 | ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 10 | ssl_ciphers HIGH:!aNULL:!MD5; 11 | 12 | error_log /var/log/nginx/photoshow.log info; 13 | 14 | location / { 15 | alias /var/www/PhotoShow/; 16 | index index.php; 17 | client_max_body_size 0; 18 | 19 | location ~* \.php$ { 20 | #try_files $uri =404; 21 | allow all; 22 | include fastcgi_params; 23 | fastcgi_index index.php; 24 | fastcgi_pass php7-fpm-sock; 25 | fastcgi_param SCRIPT_FILENAME /var/www/PhotoShow/$fastcgi_script_name; 26 | fastcgi_param QUERY_STRING $query_string; 27 | fastcgi_intercept_errors off; 28 | client_max_body_size 0; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/runPhotoshow.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | which docker 4 | if [ $? -ne 0 ]; then 5 | echo 'You need to install docker !' 6 | exit 1 7 | fi 8 | 9 | help() { 10 | echo "$0 build and run a PhotoShow docker container" 11 | echo "Usage: $0 [forcebuild|help]" 12 | exit 0 13 | } 14 | 15 | readParam() { 16 | if [ $# -ne 1 ] || [ "$1" == 'help' ]; then 17 | help 18 | fi 19 | 20 | if [ "$1" == 'forcebuild' ]; then 21 | dockerOpt="--no-cache" 22 | fi 23 | } 24 | 25 | dockerImageName='photoshow' 26 | dockerContainerName='photoshow-demo' 27 | dockerOpt="" 28 | hostHttpPort=8080 29 | hostSshPort=2222 30 | 31 | if [ $# -ne 0 ]; then 32 | readParam $* 33 | fi 34 | 35 | dockerDir=`dirname $0` 36 | pushd ${dockerDir} 37 | 38 | if [ ! -e photoshow.key ] || [ ! -e photoshow.key.pub ]; then 39 | ssh-keygen -t rsa -b 4096 -P '' -f photoshow.key 40 | fi 41 | 42 | if [ ! -e nginx.crt ] || [ ! -e nginx.key ]; then 43 | sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx.key -out nginx.crt 44 | fi 45 | 46 | docker build ${dockerOpt} -t ${dockerImageName} . 47 | 48 | if [ $? -ne 0 ]; then 49 | echo 'Fail to build Photoshow container...' 50 | exit 1 51 | fi 52 | 53 | docker stop ${dockerContainerName} 54 | sleep 5 55 | docker rm ${dockerContainerName} 56 | 57 | if [ -n "$PHOTOSHOW_HOST_DIRECTORY" ] 58 | then 59 | volumeMapping=' -v "${PHOTOSHOW_HOST_DIRECTORY}:/opt/PhotoShow"' 60 | echo ${volumeMapping} 61 | fi 62 | 63 | eval docker run --name ${dockerContainerName} ${volumeMapping} -p $hostHttpPort:443 -p $hostSshPort:22 -d -i -t ${dockerImageName} 64 | if [ $# -eq 0 ]; then 65 | clear 66 | echo "PhotoShow is running ! To stop it run: sudo docker stop ${dockerContainerName}" 67 | echo "Connect to https://localhost:$hostHttpPort/" 68 | echo "SSH: sudo ssh -i ${dockerDir}/photoshow.key -p $hostSshPort root@localhost" 69 | else 70 | echo 'PhotoShow fail to start' 71 | fi 72 | -------------------------------------------------------------------------------- /docker/raspbian-stretch/supervisor-photoshow.conf: -------------------------------------------------------------------------------- 1 | [program:sshd] 2 | command=/usr/sbin/sshd -D 3 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 4 | stderr_logfile=/var/log/supervisor/%(program_name)s.log 5 | autorestart=true 6 | 7 | [program:httpd] 8 | command=/usr/sbin/nginx 9 | stdout_logfile=/var/log/supervisor/%(program_name)s.stdout 10 | stderr_logfile=/var/log/supervisor/%(program_name)s.stderr 11 | stopsignal=6 12 | autorestart=true 13 | 14 | [program:phpfpm] 15 | command=/usr/sbin/php-fpm7.0 16 | stdout_logfile=/var/log/supervisor/%(program_name)s.stdout 17 | stderr_logfile=/var/log/supervisor/%(program_name)s.stderr 18 | stopsignal=6 19 | autorestart=true 20 | -------------------------------------------------------------------------------- /docker/supervisor.conf: -------------------------------------------------------------------------------- 1 | [program:httpd] 2 | command=/usr/sbin/nginx 3 | stdout_logfile=/var/log/supervisor/%(program_name)s.stdout 4 | stderr_logfile=/var/log/supervisor/%(program_name)s.stderr 5 | stopsignal=6 6 | autorestart=true 7 | 8 | [program:phpfpm] 9 | command=/usr/sbin/php-fpm7 10 | stdout_logfile=/var/log/supervisor/%(program_name)s.stdout 11 | stderr_logfile=/var/log/supervisor/%(program_name)s.stderr 12 | stopsignal=6 13 | autorestart=true 14 | -------------------------------------------------------------------------------- /inc/bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/bin.png -------------------------------------------------------------------------------- /inc/favico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/favico.ico -------------------------------------------------------------------------------- /inc/fileupload-ui.css: -------------------------------------------------------------------------------- 1 | .file_upload, 2 | .file_upload_large, 3 | .file_upload_small { 4 | position: relative; 5 | overflow: hidden; 6 | cursor: pointer; 7 | border: 2px dashed white; 8 | border-radius: 7px; 9 | margin: auto; 10 | background: #888; 11 | color: white; 12 | box-shadow: inset 0px 0px 6px black; 13 | -moz-box-shadow:inset 0px 0px 6px black; 14 | text-shadow: 1px 1px 2px black; 15 | height: 50px; 16 | text-align: center; 17 | line-height: 50px; 18 | cursor: pointer; 19 | 20 | } 21 | 22 | .file_upload_highlight{ 23 | background: #333; 24 | } 25 | 26 | 27 | .file_upload input { 28 | position: absolute; 29 | top: 0; 30 | right: 0; 31 | margin: 0; 32 | border: 300px solid transparent; 33 | opacity: 0; 34 | -ms-filter: 'alpha(opacity=0)'; 35 | filter: alpha(opacity=0); 36 | -o-transform: translate(-300px, -300px) scale(10); 37 | -moz-transform: translate(-800px, 0) scale(10); 38 | cursor: pointer; 39 | } 40 | 41 | .file_upload iframe, .file_upload button { 42 | display: none; 43 | } 44 | 45 | .file_upload_preview img { 46 | width: 80px; 47 | } 48 | 49 | 50 | .file_upload_progress .ui-progressbar-value { 51 | background: grey; 52 | } 53 | 54 | .file_upload_progress div { 55 | width: 200px; 56 | height: 15px; 57 | } 58 | 59 | .file_upload_cancel button { 60 | display: none; 61 | } 62 | 63 | #files{ 64 | position: fixed; 65 | bottom: -4px; 66 | background: white; 67 | border: 1px solid #aaa; 68 | max-height: 300px; 69 | padding: 4px; 70 | } -------------------------------------------------------------------------------- /inc/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/folder.png -------------------------------------------------------------------------------- /inc/fonts/CaviarDreams.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/CaviarDreams.ttf -------------------------------------------------------------------------------- /inc/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /inc/fonts/GeosansLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/GeosansLight.ttf -------------------------------------------------------------------------------- /inc/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /inc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /inc/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /inc/fonts/RobotoCondensed-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/RobotoCondensed-Bold.ttf -------------------------------------------------------------------------------- /inc/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /inc/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /inc/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /inc/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/img.png -------------------------------------------------------------------------------- /inc/jquery.scrollTo.js: -------------------------------------------------------------------------------- 1 | /** 2 | * jQuery.ScrollTo - Easy element scrolling using jQuery. 3 | * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com 4 | * Dual licensed under MIT and GPL. 5 | * Date: 5/25/2009 6 | * @author Ariel Flesler 7 | * @version 1.4.2 8 | * 9 | * http://flesler.blogspot.com/2007/10/jqueryscrollto.html 10 | */ 11 | ;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); -------------------------------------------------------------------------------- /inc/loc/deutsch.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | settings = "Einstellungen" 3 | title = "Titel" 4 | site_address= "Wurzel URL" 5 | buttons = "Buttons" 6 | fb = "Facebook" 7 | facebook_appid = "Facebook Application ID" 8 | fbappid = "AppID" 9 | plusone = "Google +1" 10 | register = "Registrieren" 11 | noregister = "Block Registration" 12 | forcehttps = "Nur https für Registrierung und Login verwenden" 13 | comment = "Kommentare" 14 | nocomment = "Kommentarbereich entfernen" 15 | download = "Downloads" 16 | nodownload = "Download-Links entfernen" 17 | numcomments = "Anzahl Kommentare in den Admin Statistiken" 18 | numcomm = "Kommentare" 19 | sens = "Anzahl der angezeigten Bilder im Albumtitel" 20 | images = "Bilder" 21 | language = "Sprache" 22 | submit = "Senden" 23 | generate = "Vorschaubilder rekursiv erstellen" 24 | folder = "Ordner" 25 | all = "Alle" 26 | gener = "Erstellen" 27 | video_comment = "PhotoShow zeigt nur WebM Videos." 28 | encode_video = "Video kodieren aktivieren" 29 | ffmpeg_path = "Pfad ffmpeg" 30 | ffmpeg_option = "Kodieroptionen" 31 | 32 | [account] 33 | createaccount = "Konto Anlegen" 34 | account = "Benutzerkonto" 35 | editing = "Benutzerkonto bearbeiten: " 36 | name = "Name" 37 | email = "Email" 38 | password = "Passwort" 39 | oldpass = "altes Passwort" 40 | submit = "Speichern" 41 | or = "oder" 42 | cancel = "Abbrechen" 43 | 44 | [delete] 45 | delete = "Löschen" 46 | path = "Pfad" 47 | submit = "Löschen" 48 | 49 | [adminmenu] 50 | about = "About" 51 | stats = "Statistiken anzeigen" 52 | settings = "Einstellungen bearbeiten" 53 | groups = "Gruppen bearbeiten" 54 | account = "Konten bearbeiten" 55 | back = "Zurück zur Website" 56 | 57 | [jsaccounts] 58 | accounts = "Benutzerkonten" 59 | groups = "Gruppen" 60 | groupname = "Name" 61 | addgroup = "Gruppe erstellen" 62 | 63 | [login] 64 | logintitle = "Anmelden" 65 | login = "Benutzer" 66 | pass = "Passwort" 67 | or = "oder" 68 | register = "Registrieren" 69 | back = "Zurück zur Website" 70 | 71 | [register] 72 | mainacc = "Bitte das Hauptkonto erstellen" 73 | register = "Registrieren" 74 | logintxt = "Anmelden : nur Buchstaben und Zahlen" 75 | passtxt = "Passwort : mindestens 6 Zeichen" 76 | veriftxt = "Passwort nochmals eingeben" 77 | login = "Anmelden" 78 | pass = "Passwort" 79 | verif = "Passwort" 80 | submit = "Konto anlegen" 81 | or = "oder" 82 | back = "Zurück Website" 83 | 84 | [menubar] 85 | logged = "eingelogged als" 86 | login = "ANMELDEN" 87 | register = "REGISTRIEREN" 88 | logout = "ABMELDEN" 89 | admin = "ADMIN" 90 | powered = "Powered by" 91 | 92 | [bin] 93 | delete = "Löschen" 94 | 95 | [judge] 96 | public = "öffentliches Foto" 97 | gopriv = "privat machen" 98 | priv = "privates Foto" 99 | gopub = "öffentlich machen" 100 | accounts = "berechtigte Benutzer" 101 | groups = "berechtigte Gruppen" 102 | set = "Rechte setzen" 103 | 104 | [adminpanel] 105 | rename = "Umbenennen" 106 | new = "Neuer Ordner" 107 | create = "Anlegen" 108 | upload = "Bilder uploaden" 109 | 110 | [boardheader] 111 | download = "DOWNLOAD" 112 | 113 | [board] 114 | albums = "Alben" 115 | images = "Bilder" 116 | 117 | [comments] 118 | comments = "Kommentare" 119 | anonymous = "Anonym" 120 | submit = "Kommentar posten" 121 | -------------------------------------------------------------------------------- /inc/loc/espanol.ini: -------------------------------------------------------------------------------- 1 | ;created by matheo 2 | ;Error free, they are just features :D 3 | 4 | [settings] 5 | settings = "parámetros" 6 | title = "título" 7 | buttons = "[Boutons]" 8 | fb = "Facebook" 9 | plusone = "Google +1" 10 | register = "Registraciones" 11 | noregister = "Detener las registraciones" 12 | comment = "Commentarios" 13 | nocomment = "Desactivar los comentarios" 14 | download = "Descargas" 15 | nodownload = "Inhabilitar las descargas" 16 | numcomments = "El numéro de comentarios en la pàgina de statistic" 17 | numcomm = "Commentarios" 18 | sens = "Número máximo de imágenes que se muestran cuando se cierne de un álbum" 19 | images = "Imágenes" 20 | language = "Lengua" 21 | submit = "Enviar" 22 | generate = "Generar recursivamente las miniaturas" 23 | folder = "Carpetas" 24 | all = "Todos" 25 | gener = "Generar" 26 | 27 | [account] 28 | createaccount = "Crear Cuenta" 29 | account = "Cuenta" 30 | editing = "Editar la cuenta : " 31 | name = "Apellidos" 32 | email = "Correo electrónico" 33 | password = "Contraseña" 34 | oldpass = "Contraseña antigua" 35 | submit = "Ahorrar" 36 | or = "o" 37 | cancel = "Cancelar" 38 | 39 | [delete] 40 | delete = "suprimir" 41 | path = "Camino" 42 | submit = "suprimir" 43 | 44 | [adminmenu] 45 | about = "Sobre nosotros" 46 | stats = "Ver las estadísticas" 47 | settings = "Preferencias" 48 | groups = "Grupos" 49 | account = "Cuentas" 50 | back = "Volver al sitio" 51 | 52 | [jsaccounts] 53 | accounts = "Cuenta" 54 | groups = "Gropos" 55 | groupname = "Nombre" 56 | addgroup = "Crear el gropo" 57 | 58 | [login] 59 | logintitle = "Login" 60 | login = "Login" 61 | pass = "Contraseña" 62 | submit = "Validar" 63 | or = "o" 64 | register = "Registrar" 65 | back = "Volver al sitio" 66 | 67 | [register] 68 | mainacc = "Cree la cuenta principal por favor" 69 | register = "Registrar" 70 | logintxt = "Login : letras y números" 71 | passtxt = "Contraseña : 6 caracteres como mínimo" 72 | veriftxt = "Escriba la contraseña de nuevo :" 73 | login = "Login" 74 | pass = "Contraseña" 75 | verif = "Contraseña" 76 | submit = "Crear Cuenta" 77 | or = "o" 78 | back = "Volver al sitio" 79 | 80 | [menubar] 81 | logged = "registran como" 82 | login = "INICIAR SESION" 83 | register = "REGISTRAR" 84 | logout = "CERRAR SESION" 85 | admin = "PREFERENCIAS" 86 | powered = "Este sitio utiliza" 87 | 88 | [bin] 89 | delete = "Eliminar" 90 | 91 | [judge] 92 | public = "Este elemento es público" 93 | gopriv = "Cambiar en privado" 94 | priv = "Este elemento es privado" 95 | gopub = "Cambiar en publico" 96 | accounts = "Cuentas autorizadas" 97 | groups = "Grupos autorizadas" 98 | set = "Validar" 99 | 100 | [adminpanel] 101 | rename = "Cambier el nombre" 102 | new = "Nouva carpeta" 103 | create = "Crear" 104 | upload = "Añadir imágenes" 105 | 106 | [boardheader] 107 | download = "DESCARGAR" 108 | 109 | [board] 110 | albums = "Albumes" 111 | images = "Imagenes" 112 | 113 | [comments] 114 | anonymous = "anónimo" 115 | submit = "Enviar un comentario" 116 | -------------------------------------------------------------------------------- /inc/loc/greek.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | settings = "Ρυθμίσεις" 3 | title = "Τίτλος" 4 | buttons = "Κουμπιά" 5 | fb = "Facebook" 6 | plusone = "Google +1" 7 | register = "Εγγραφή" 8 | noregister = "Απενεργοποίηση εγγραφής" 9 | comment = "Σχόλια" 10 | nocomment = "Αφαίρεση του πίνακα σχολίων" 11 | download = "Λήψεις" 12 | nodownload = "Αφαίρεση των συνδέσμων των λήψεων" 13 | numcomments = "Αριθμός σχολίων στη σελίδα των στατιστικών" 14 | numcomm = "Σχόλια" 15 | sens = "Μέγιστος αριθμός εικόνων που εμφανίζονται όταν το ποντίκι πάει πάνω από το άλμπουμ" 16 | images = "Εικόνες" 17 | language = "Γλώσσα" 18 | submit = "Υποβολή" 19 | generate = "Δημιουργία προεπισκοπήσεων (thumbs) των εικόνων (αναδρομικά)" 20 | folder = "Φάκελος" 21 | all = "Όλα" 22 | gener = "Δημιουργία" 23 | 24 | [account] 25 | createaccount = "Δημιουργία λογαριασμού" 26 | account = "Λογαριασμός" 27 | editing = "Διόρθωση λογαριασμού : " 28 | name = "Όνομα" 29 | email = "Email" 30 | password = "Κωδικός" 31 | oldpass = "Παλιός κωδικός" 32 | submit = "Αποθήκευση" 33 | or = "ή" 34 | cancel = "Ακύρωση" 35 | 36 | [delete] 37 | delete = "Διαγραφή" 38 | path = "Μονοπάτι" 39 | submit = "Διαγραφή" 40 | 41 | [adminmenu] 42 | about = "Περί" 43 | stats = "Στατιστικά" 44 | settings = "Ρυθμίσεις" 45 | back = "Πίσω στη σελίδα" 46 | account = "Λογαριασμοί" 47 | groups = "Ομάδες" 48 | 49 | [jsaccounts] 50 | accounts = "Λογαριασμοί" 51 | groups = "Ομάδες" 52 | groupname = "Όνομα" 53 | addgroup = "Δημιουργία Ομάδας" 54 | 55 | [login] 56 | logintitle = "Είσοδος" 57 | login = "Είσοδος" 58 | pass = "Κωδικός" 59 | or = "ή" 60 | register = "Εγγραφή" 61 | back = "Πίσω στη σελίδα" 62 | 63 | [register] 64 | mainacc = "Παρακαλώ δημιουργήστε τον κύριο λογαριασμό" 65 | register = "Εγγραφή" 66 | logintxt = "Είσοδος : γράμματα και αριθμοί μόνο" 67 | passtxt = "Κωδικός : τουλάχιστον 6 χαρακτήρες" 68 | veriftxt = "Παρακαλώ εισάγετε τον κωδικό ξανά" 69 | login = "Είσοδος" 70 | pass = "Κωδικός" 71 | verif = "Κωδικός" 72 | submit = "Δημιουργία λογαριασμού" 73 | or = "ή" 74 | back = "Πίσω στη σελίδα" 75 | 76 | [menubar] 77 | logged = "συνδεδεμένος ως" 78 | login = "ΕΙΣΟΔΟΣ" 79 | register = "ΕΓΓΡΑΦΗ" 80 | logout = "ΕΞΟΔΟΣ" 81 | admin = "ΔΙΑΧΕΙΡΙΣΤΗΣ" 82 | powered = "Βασισμένο στο" 83 | 84 | [bin] 85 | delete = "Διαγραφή" 86 | 87 | [judge] 88 | public = "Αυτό το αντικείμενο είναι δημόσιο." 89 | gopriv = "Κάν' το Προσωπικό" 90 | priv = "Αυτό το αντικείμενο είναι προσωπικό." 91 | gopub = "Κάν' το Δημόσιο" 92 | accounts = "Επιτρεπόμενοι λογαρισμοί" 93 | groups = "Επιτρεπόμενες ομάδες" 94 | set = "Όρισε δικαιώματα" 95 | 96 | [adminpanel] 97 | rename = "Αλλαγή ονόματος" 98 | new = "Νέος Φάκελος" 99 | create = "Δημιουργία" 100 | upload = "Ανέβασε εικόνες εδώ" 101 | 102 | [boardheader] 103 | download = "ΛΗΨΗ" 104 | 105 | [board] 106 | albums = "Albums" 107 | images = "Εικόνες" 108 | 109 | [comments] 110 | comments = "Σχόλια" 111 | anonymous = "Ανώνυμος" 112 | submit = "Κοινοποίησε σχόλιο" 113 | -------------------------------------------------------------------------------- /inc/loc/italian.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | settings = "Impostazioni" 3 | title = "Titolo" 4 | site_address= "URL base sito web" 5 | buttons = "Pulsanti" 6 | fb = "Facebook" 7 | facebook_appid = "Facebook Application ID" 8 | fbappid = "AppID" 9 | plusone = "Google +1" 10 | register = "Registrazione" 11 | noregister = "Blocca Registrazione" 12 | forcehttps = "Forza https per accesso e registrazione" 13 | comment = "Commenti" 14 | nocomment = "Rimuovi pannello commenti" 15 | download = "Scarica" 16 | nodownload = "Rimuovi link scaricamento" 17 | numcomments = "Numero commenti in statistiche amministrazione" 18 | numcomm = "Commenti" 19 | sens = "Massimo numero immagini mostrate quando cursore sopra album" 20 | images = "Immagini" 21 | language = "Lingua" 22 | submit = "Invia" 23 | generate = "Genera ricorsivamente anteprime e immagini web" 24 | folder = "Cartelle" 25 | all = "Tutte" 26 | gener = "Genera" 27 | video_comment = "PhotoShow mostra solo video in WebM. Puoi impostare la codifica per convertire in altri formati." 28 | encode_video = "Codifica video attiva" 29 | ffmpeg_path = "Percorso FFmpeg" 30 | ffmpeg_option = "Opzioni codifica" 31 | 32 | [account] 33 | createaccount = "Crea Account" 34 | account = "Account" 35 | editing = "Modifica account: " 36 | name = "Nome" 37 | email = "Email" 38 | password = "Password" 39 | oldpass = "Vecchia password" 40 | submit = "Salva" 41 | or = "oppure" 42 | cancel = "Cancella" 43 | 44 | [delete] 45 | delete = "Rimuovi" 46 | path = "Percorso" 47 | submit = "Rimuovi" 48 | 49 | [adminmenu] 50 | about = "Informazioni" 51 | stats = "Visualizza statistiche" 52 | tokens = "Visualizza token ospiti" 53 | settings = "Modifica impostazioni" 54 | groups = "Modifica gruppi" 55 | account = "Modifica account" 56 | back = "Torna al sito web" 57 | 58 | [jsaccounts] 59 | accounts = "Accounts" 60 | groups = "Gruppi" 61 | groupname = "Nome" 62 | addgroup = "Crea gruppo" 63 | 64 | [login] 65 | logintitle = "Login" 66 | login = "Login" 67 | pass = "Password" 68 | or = "oppure" 69 | register = "Registrati" 70 | back = "Torna al sito web" 71 | 72 | [register] 73 | mainacc = "Per favore crea l'account principale" 74 | register = "Registrazione" 75 | logintxt = "Nome: solo lettere e numeri ammessi" 76 | passtxt = "Password: minimo 6 caratteri" 77 | veriftxt = "Per favore inserisci nuovamente la password" 78 | login = "Nome" 79 | pass = "Password" 80 | verif = "Password" 81 | submit = "Crea account" 82 | or = "oppure" 83 | back = "Torna al sito web" 84 | 85 | [menubar] 86 | logged = "entrato come" 87 | login = "ENTRA" 88 | register = "REGISTRATI" 89 | logout = "ESCI" 90 | admin = "AMMINISTRAZIONE" 91 | powered = "Powered by" 92 | 93 | [bin] 94 | delete = "Elimina" 95 | 96 | [judge] 97 | public = "Questo elemento è pubblico." 98 | gopriv = "Rendilo privato" 99 | priv = "Questo elemento è privato." 100 | gopub = "Rendilo pubblico" 101 | accounts = "Account ammessi" 102 | groups = "Gruppi ammessi" 103 | set = "Imposta permessi" 104 | 105 | [adminpanel] 106 | rename = "Rinomina" 107 | new = "Nuova cartella" 108 | create = "Creaa" 109 | upload = "Carica immagini qui" 110 | 111 | [boardheader] 112 | download = "SCARICA" 113 | 114 | [board] 115 | albums = "Album" 116 | images = "Immagini" 117 | 118 | [comments] 119 | comments = "Commenti" 120 | anonymous = "Anonimo" 121 | submit = "Invia commento" 122 | 123 | [token] 124 | token = "Token ospiti" 125 | tokens = "Token ospiti" 126 | deletetoken = "Rimuovi" 127 | createtoken = "Crea token ospiti" 128 | 129 | -------------------------------------------------------------------------------- /inc/loc/japanese.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | settings = "設定" 3 | global = "一般" 4 | title = "タイトル" 5 | site_address= "サイトのルートURL" 6 | buttons = "ボタン" 7 | s_networks = "ソーシャルネットワーク" 8 | fb = "Facebook" 9 | facebook_appid = "Facebook Application ID" 10 | fbappid = "AppID" 11 | plusone = "Google +1" 12 | register = "登録" 13 | options = "オプション" 14 | noregister = "登録を禁止する" 15 | forcehttps = "ログインと登録にhttpsを強制" 16 | comment = "コメント" 17 | nocomment = "コメントパネルを非表示" 18 | download = "ダウンロード" 19 | nocomments = "コメントを非表示" 20 | nodescription = "説明を非表示" 21 | nodownload = "ダウンロードリンクを非表示" 22 | reverse_menu = "メニューを逆順に" 23 | rss = "RSSフィード" 24 | button_title = "ボタンのタイトル" 25 | numcomments = "管理者用統計でのコメント数" 26 | numcomm = "コメント数" 27 | sens = "アルバム上でホバーした時の最大画像数" 28 | thumbs_size = "サムネイルのサイズ(px)" 29 | images = "画像" 30 | language = "言語" 31 | user_theme = "テーマ" 32 | submit = "設定" 33 | generate = "サムネイルと画像を再帰的に生成" 34 | folder = "フォルダ" 35 | all = "全て" 36 | gener = "生成" 37 | video = "ビデオ" 38 | video_comment = "PhotoShowはビデオをWebMでのみ表示。WebM以外のフォーマットにはエンコード方法を指定して変換。" 39 | encode_video = "ビデオをエンコードする" 40 | ffmpeg_path = "FFmpegのパス" 41 | ffmpeg_option = "エンコード設定" 42 | 43 | [account] 44 | createaccount = "アカウントを作る" 45 | account = "アカウント" 46 | editing = "アカウントを編集する: " 47 | name = "名前" 48 | email = "Email" 49 | password = "パスワード" 50 | oldpass = "前のパスワード" 51 | submit = "保存" 52 | or = "または" 53 | cancel = "キャンセル" 54 | key = "キー" 55 | 56 | [delete] 57 | delete = "削除" 58 | path = "パス" 59 | submit = "削除" 60 | 61 | [adminmenu] 62 | about = "情報" 63 | stats = "統計を見る" 64 | tokens = "ゲストトークンを見る" 65 | settings = "設定を編集" 66 | groups = "グループを編集" 67 | account = "アカウントを編集" 68 | back = "ウェブサイトに戻る" 69 | 70 | [statistics] 71 | heading = "統計" 72 | summary = "一覧" 73 | by_age = "(古い順)" 74 | items = "アイテム" 75 | gen_items = "生成したアイテム" 76 | 77 | [jsaccounts] 78 | accounts = "アカウント" 79 | groups = "グループ" 80 | groupname_label = "グループ名:" 81 | groupname = "グループ名" 82 | addgroup = "グループを作成" 83 | 84 | [login] 85 | logintitle = "アカウント" 86 | login = "アカウント" 87 | pass = "パスワード" 88 | submit = "ログイン" 89 | or = "または" 90 | register = "登録" 91 | back = "ウェブサイトに戻る" 92 | 93 | [register] 94 | mainacc = "メインのアカウントを作成して下さい" 95 | register = "登録" 96 | logintxt = "アカウント名 : アルファベットと数字のみ" 97 | passtxt = "パスワード : 6文字以上" 98 | veriftxt = "パスワード(確認)" 99 | login = "アカウント名" 100 | pass = "パスワード" 101 | verif = "パスワード" 102 | submit = "アカウントを作成" 103 | or = "または" 104 | back = "ウェブサイトに戻る" 105 | 106 | [menubar] 107 | logged = "ログイン中: " 108 | not_logged = "ログアウト中" 109 | login = "ログイン" 110 | register = "登録" 111 | logout = "ログアウト" 112 | admin = "管理" 113 | account = "アカウント" 114 | powered = "Powered by" 115 | 116 | [bin] 117 | delete = "削除" 118 | 119 | [judge] 120 | infos = "情報" 121 | access = "アクセス権" 122 | public = "公開アイテム" 123 | gopriv = "非公開にする" 124 | priv = "非公開アイテム" 125 | gopub = "公開にする" 126 | accounts = "許可されたアカウント" 127 | groups = "許可されたグループ" 128 | set = "権限を設定" 129 | exif = "Exif" 130 | 131 | [adminpanel] 132 | rename = "名前を変更" 133 | new = "新しいフォルダ" 134 | create = "作成" 135 | upload_heading = "アップロード" 136 | upload = "画像をドロップ" 137 | 138 | [boardheader] 139 | download = "ダウンロード" 140 | 141 | [board] 142 | albums = "アルバム" 143 | images = "画像" 144 | videos = "ビデオ" 145 | 146 | [comments] 147 | comment = "コメント" 148 | comments = "コメント" 149 | anonymous = "匿名" 150 | submit = "コメントを投稿" 151 | 152 | [description] 153 | description = "説明" 154 | submit = "説明を投稿" 155 | 156 | [token] 157 | token = "ゲストトークン" 158 | tokens = "ゲストトークン" 159 | deletetoken = "削除" 160 | createtoken = "ゲストトークンを作成" 161 | 162 | [buttons] 163 | prev = "前" 164 | back = "戻る" 165 | img = "見る" 166 | get = "ダウンロード" 167 | slideshow = "スライドショー" 168 | pshere = "フォトスフィア" 169 | next = "次" 170 | pause = "一時停止" 171 | play = "再生" 172 | stop = "停止" 173 | rss = "RSSフィード" 174 | menuright = "メニュー" 175 | -------------------------------------------------------------------------------- /inc/loc/russian.ini: -------------------------------------------------------------------------------- 1 | [settings] 2 | settings = "Настройки" 3 | title = "Заголовок" 4 | site_address= "URL сайта" 5 | buttons = "Кнопки" 6 | fb = "Facebook" 7 | facebook_appid = "Facebook Application ID" 8 | fbappid = "AppID" 9 | plusone = "Google +1" 10 | register = "Регистрация" 11 | noregister = "Запретить регистрацию" 12 | forcehttps = "Использовать защищенный доступ (https) для входа и регистрации" 13 | comment = "Комментарии" 14 | nocomment = "Удалить панель комментариев" 15 | download = "Загрузки" 16 | nodownload = "Удалить ссылки на загрузки" 17 | numcomments = "Количество комментариев в статистике администратора" 18 | numcomm = "Комментарии" 19 | sens = "Макс. количество отображаемых изображений в альбоме" 20 | images = "Изображения" 21 | language = "Язык" 22 | submit = "Отправить" 23 | generate = "Создать превью рекурсивно" 24 | folder = "Папка" 25 | all = "Все" 26 | gener = "Создать первью" 27 | video_comment = "PhotoShow показывает видео только в WebM. Вы можете установить кодировку для конвертации в другие форматы" 28 | encode_video = "Активировать кодировку видео" 29 | ffmpeg_path = "Путь к ffmpeg" 30 | ffmpeg_option = "Настройки кодирования" 31 | 32 | [account] 33 | createaccount = "Зарегистрироваться" 34 | account = "Учетная запись" 35 | editing = "Настройки аккаунта : " 36 | name = "Имя" 37 | email = "E-mail" 38 | password = "Новый пароль" 39 | oldpass = "Старый пароль" 40 | submit = "Сохранить" 41 | or = "или" 42 | cancel = "Отмена" 43 | 44 | [delete] 45 | delete = "Удалить" 46 | path = "Путь" 47 | submit = "Удалить" 48 | 49 | [adminmenu] 50 | about = "О PhotoShow" 51 | stats = "Статистика" 52 | settings = "Изменить настройки" 53 | back = "Вернуться на сайт" 54 | account = "Учетные записи" 55 | groups = "Группы" 56 | 57 | [jsaccounts] 58 | accounts = "Учетные записи" 59 | groups = "Группы" 60 | groupname = "Имя" 61 | addgroup = "Создать группу" 62 | 63 | [login] 64 | logintitle = "Вход" 65 | login = "Логин" 66 | pass = "Пароль" 67 | or = "или" 68 | register = "Регистрация" 69 | back = "Вернуться на сайт" 70 | 71 | [register] 72 | mainacc = "Создайте учетную запись администратора" 73 | register = "Регистрация" 74 | logintxt = "Логин: только буквы и цифры" 75 | passtxt = "Пароль: не менее 6 символов" 76 | veriftxt = "Пароль повторно" 77 | login = "Логин" 78 | pass = "Пароль" 79 | verif = "Пароль" 80 | submit = "Зарегистрироваться" 81 | or = "или" 82 | back = "Вернуться на сайт" 83 | 84 | [menubar] 85 | logged = "выполнен вход" 86 | login = "ВХОД" 87 | register = "РЕГИСТРАЦИЯ" 88 | logout = "ВЫХОД" 89 | admin = "АДМИНИСТРИРОВАНИЕ" 90 | powered = "Powered by" 91 | 92 | [bin] 93 | delete = "Удалить" 94 | 95 | [judge] 96 | public = "Публичный" 97 | gopriv = "Сделать личным" 98 | priv = "Личный" 99 | gopub = "Сделать публичным" 100 | accounts = "Допущенные пользователи" 101 | groups = "Допущенные группы" 102 | set = "Установить права" 103 | 104 | [adminpanel] 105 | rename = "Переименовать" 106 | new = "Новая папка" 107 | create = "Создать" 108 | upload = "Загрузить фото" 109 | 110 | [boardheader] 111 | download = "Скачать" 112 | 113 | [board] 114 | albums = "Альбомы" 115 | images = "Изображения" 116 | 117 | [comments] 118 | comments = "Комментарии" 119 | anonymous = "Гость" 120 | submit = "Отправить комментарий" 121 | -------------------------------------------------------------------------------- /inc/me.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/me.jpg -------------------------------------------------------------------------------- /inc/mousewheel.js: -------------------------------------------------------------------------------- 1 | /*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net) 2 | * Licensed under the MIT License (LICENSE.txt). 3 | * 4 | * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. 5 | * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. 6 | * Thanks to: Seamus Leahy for adding deltaX and deltaY 7 | * 8 | * Version: 3.0.6 9 | * 10 | * Requires: 1.2.2+ 11 | */ 12 | 13 | (function($) { 14 | 15 | var types = ['DOMMouseScroll', 'mousewheel']; 16 | 17 | if ($.event.fixHooks) { 18 | for ( var i=types.length; i; ) { 19 | $.event.fixHooks[ types[--i] ] = $.event.mouseHooks; 20 | } 21 | } 22 | 23 | $.event.special.mousewheel = { 24 | setup: function() { 25 | if ( this.addEventListener ) { 26 | for ( var i=types.length; i; ) { 27 | this.addEventListener( types[--i], handler, false ); 28 | } 29 | } else { 30 | this.onmousewheel = handler; 31 | } 32 | }, 33 | 34 | teardown: function() { 35 | if ( this.removeEventListener ) { 36 | for ( var i=types.length; i; ) { 37 | this.removeEventListener( types[--i], handler, false ); 38 | } 39 | } else { 40 | this.onmousewheel = null; 41 | } 42 | } 43 | }; 44 | 45 | $.fn.extend({ 46 | mousewheel: function(fn) { 47 | return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); 48 | }, 49 | 50 | unmousewheel: function(fn) { 51 | return this.unbind("mousewheel", fn); 52 | } 53 | }); 54 | 55 | 56 | function handler(event) { 57 | var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; 58 | event = $.event.fix(orgEvent); 59 | event.type = "mousewheel"; 60 | 61 | // Old school scrollwheel delta 62 | if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; } 63 | if ( orgEvent.detail ) { delta = -orgEvent.detail/3; } 64 | 65 | // New school multidimensional scroll (touchpads) deltas 66 | deltaY = delta; 67 | 68 | // Gecko 69 | if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { 70 | deltaY = 0; 71 | deltaX = -1*delta; 72 | } 73 | 74 | // Webkit 75 | if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } 76 | if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } 77 | 78 | // Add event and delta to the front of the arguments 79 | args.unshift(event, delta, deltaX, deltaY); 80 | 81 | return ($.event.dispatch || $.event.handle).apply(this, args); 82 | } 83 | 84 | })(jQuery); 85 | -------------------------------------------------------------------------------- /inc/pbar-ani.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/pbar-ani.gif -------------------------------------------------------------------------------- /inc/photosphere_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/photosphere_logo.png -------------------------------------------------------------------------------- /inc/rss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/rss.png -------------------------------------------------------------------------------- /inc/spiffygif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/inc/spiffygif.gif -------------------------------------------------------------------------------- /inc/ui.js: -------------------------------------------------------------------------------- 1 | 2 | $("#menuLink").click(function(){ 3 | $("#layout").toggleClass("active"); 4 | }); 5 | 6 | $(".menuright-link").click(function(){ 7 | $("#menuright,.menuright-link").toggleClass("active"); 8 | }); 9 | 10 | $(".buttongroup-vertical .pure-button").click(function(){ 11 | $(this).parent().children(".button-hidden").toggleClass("hidden"); 12 | }); 13 | 14 | 15 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow-v2 30 | */ 31 | 32 | /// Start session 33 | session_start(); 34 | 35 | /// Because we don't care about notices 36 | if(function_exists("error_reporting")){ 37 | error_reporting(E_ERROR | E_WARNING); 38 | } 39 | 40 | /// Autoload classes 41 | function my_autoload($class){ 42 | if(file_exists(dirname(__FILE__)."/src/classes/$class.php")){ 43 | require(dirname(__FILE__)."/src/classes/$class.php"); 44 | }else{ 45 | return FALSE; 46 | } 47 | } 48 | 49 | spl_autoload_register("my_autoload"); 50 | 51 | /// Take care of nasty exceptions 52 | function exception_handler($exception) { 53 | echo "
" , $exception->getMessage(), "
\n"; 54 | } 55 | set_exception_handler('exception_handler'); 56 | 57 | ini_set('upload_max_filesize','10M'); 58 | 59 | function protect_user_send_var($var){ 60 | if(is_array($var)) 61 | return array_map('protect_user_send_var', $var); 62 | else 63 | return addslashes($var); 64 | } 65 | 66 | /// workaround for splitting basename whith beginning utf8 multibyte char 67 | /// See https://bugs.php.net/bug.php?id=37268 68 | function mb_basename($filepath, $suffix = NULL) { 69 | $splited = preg_split ( '/\//', rtrim ( $filepath, '/ ' ) ); 70 | return substr ( basename ( 'X' . $splited [count ( $splited ) - 1], $suffix ), 1 ); 71 | } 72 | 73 | 74 | if (!get_magic_quotes_gpc()){ 75 | $_POST = protect_user_send_var($_POST); 76 | $_COOKIE = protect_user_send_var($_COOKIE); 77 | $_GET = protect_user_send_var($_GET); 78 | } 79 | 80 | if(isset($_SERVER['CONTENT_TYPE']) && $_SERVER['CONTENT_TYPE'] == 'text/xml'){ 81 | // Nope, definitely not ready yet. 82 | // new API(); 83 | }else{ 84 | new Index(); 85 | } 86 | ?> -------------------------------------------------------------------------------- /src/XRL/src/Autoload.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | function XRL_autoload($class) 21 | { 22 | if (strpos($class, ':') !== FALSE) 23 | throw new Exception('Possible remote execution attempt'); 24 | 25 | $class = ltrim($class, '\\'); 26 | if (strncasecmp($class, 'XRL_', 4)) 27 | return FALSE; 28 | 29 | $class = substr($class, 4); 30 | $class = str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $class); 31 | require(dirname(__FILE__) . DIRECTORY_SEPARATOR . $class . '.php'); 32 | } 33 | spl_autoload_register("XRL_autoload"); 34 | 35 | -------------------------------------------------------------------------------- /src/XRL/src/CallableFactory.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | class XRL_CallableFactory 21 | implements XRL_CallableFactoryInterface 22 | { 23 | public function fromPHP($callable) 24 | { 25 | return new XRL_Callable($callable); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/XRL/src/CallableFactoryInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_CallableFactoryInterface 20 | { 21 | /** 22 | * Constructs a new callable object from any 23 | * PHP representation of a callable. 24 | * 25 | * \param mixed $callable 26 | * A callable item. It must be compatible 27 | * with the PHP callback pseudo-type. 28 | * 29 | * \throw InvalidArgumentException 30 | * The given item is not compatible 31 | * with the PHP callback pseudo-type. 32 | * 33 | * \see 34 | * More information on the callback pseudo-type can be found here: 35 | * http://php.net/language.pseudo-types.php#language.types.callback 36 | */ 37 | public function fromPHP($callable); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /src/XRL/src/CallableInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | /** 20 | * \brief 21 | * Interface for something that can be called. 22 | * 23 | * This interface provides a generic way to define something that 24 | * can be invoked to execute some code, like a function, a method 25 | * (with the usual array representation used by PHP), a closure 26 | * (when using PHP >= 5.3.0), etc. 27 | */ 28 | interface XRL_CallableInterface 29 | { 30 | /** 31 | * Returns the callable object in its raw form 32 | * (as used by PHP). 33 | * 34 | * \retval string 35 | * The name of the function this callable represents, 36 | * which can be either a core function, a user-defined 37 | * function, or the result of a call to create_function(). 38 | * 39 | * \retval array 40 | * An array whose contents matches the definition 41 | * of a PHP callback, that is: 42 | * - The first element refers to either an object, 43 | * a class name or one of the reserved keywords 44 | * (self, parent, static, etc.). 45 | * - The second element is the name of a method 46 | * from that object/class. 47 | * 48 | * \retval object 49 | * Either a Closure object or an instance of a class 50 | * that implements the __invoke() magic method. 51 | * Both of these are only possible with PHP >= 5.3.0. 52 | */ 53 | public function getCallable(); 54 | 55 | /** 56 | * Returns a human representation of this callable. 57 | * For (anonymous) functions, this is a string containing 58 | * the name of that function. 59 | * For methods and classes that implement the __invoke() 60 | * magic method (including Closures), this is a string 61 | * of the form "ClassName::methodname". 62 | * 63 | * \retval string 64 | * Human representation of this callable. 65 | */ 66 | public function getRepresentation(); 67 | 68 | /** 69 | * Implementation of the __invoke() magic method. 70 | * 71 | * This method is present only for forward-compatibility 72 | * and because it turns instances of XRL_CallableInterface 73 | * into callables themselves (ain't that neat?). 74 | * 75 | * \deprecated 76 | * Use XRL_CallableInterface::invoke() 77 | * instead of calling this method directly 78 | * or relying on its magic with code such as: 79 | * \code 80 | * $c = new XRL_Callable("var_dump"); 81 | * $c(42); 82 | * \endcode 83 | */ 84 | public function __invoke(/* ... */); 85 | 86 | /** 87 | * Invokes the callable object represented by this 88 | * instance. 89 | * 90 | * \retval mixed 91 | * Value returned by the inner callable. 92 | * 93 | * \note 94 | * Any argument passed to this method will 95 | * be propagated to the inner callable. 96 | * 97 | * \note 98 | * This method is smart enough to preserve 99 | * references. 100 | */ 101 | public function invoke(/* ... */); 102 | 103 | /** 104 | * Invokes the callable object represented by this 105 | * instance, using the given array as a list of arguments. 106 | * 107 | * \param array $args 108 | * An array whose values will become the arguments 109 | * for the inner callable. 110 | * 111 | * \retval mixed 112 | * Value returned by the inner callable. 113 | * 114 | * \note 115 | * This method is smart enough to preserve 116 | * references. 117 | */ 118 | public function invokeArgs(array &$args); 119 | 120 | /** 121 | * Alias for XRL_CallableInterface::getRepresentation(). 122 | * 123 | * \retval string 124 | * Human representation of this callable. 125 | * 126 | * \see XRL_CallableInterface::getRepresentation() 127 | */ 128 | public function __toString(); 129 | } 130 | -------------------------------------------------------------------------------- /src/XRL/src/CompactEncoderFactory.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | class XRL_CompactEncoderFactory 20 | implements XRL_EncoderFactoryInterface 21 | { 22 | public function createEncoder() 23 | { 24 | return new XRL_Encoder(XRL_Encoder::OUTPUT_COMPACT); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/XRL/src/DecoderFactoryInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_DecoderFactoryInterface 20 | { 21 | public function createDecoder(); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/XRL/src/DecoderInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_DecoderInterface 20 | { 21 | public function decodeRequest($data); 22 | public function decodeResponse($data); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/XRL/src/EncoderFactoryInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_EncoderFactoryInterface 20 | { 21 | public function createEncoder(); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/XRL/src/EncoderInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_EncoderInterface 20 | { 21 | public function encodeRequest(XRL_Request $request); 22 | public function encodeError(Exception $error); 23 | public function encodeResponse($response); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/XRL/src/Exception.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | /** 21 | * \brief 22 | * An exception that is used to represent 23 | * XML-RPC errors. 24 | */ 25 | class XRL_Exception 26 | extends Exception 27 | { 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/XRL/src/FactoryRegistry.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | abstract class XRL_FactoryRegistry 20 | implements ArrayAccess 21 | { 22 | protected $_interfaces; 23 | 24 | public function offsetSet($interface, $obj) 25 | { 26 | if (!is_string($interface)) 27 | ; /// @TODO 28 | 29 | if (!is_object($obj)) 30 | ; /// @TODO 31 | 32 | $interface = strtolower($interface); 33 | if (!isset($this->_interfaces[$interface])) 34 | ; /// @TODO 35 | 36 | if (!($obj instanceof $interface)) 37 | ; /// @TODO 38 | 39 | $this->_interfaces[$interface] = $obj; 40 | } 41 | 42 | public function offsetGet($interface) 43 | { 44 | if (!is_string($interface)) 45 | ; /// @TODO 46 | 47 | $interface = strtolower($interface); 48 | return $this->_interfaces[$interface]; 49 | } 50 | 51 | public function offsetExists($interface) 52 | { 53 | if (!is_string($interface)) 54 | return FALSE; 55 | 56 | $interface = strtolower($interface); 57 | return isset($this->_interfaces[$interface]); 58 | } 59 | 60 | public function offsetUnset($interface) 61 | { 62 | /// @TODO 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/XRL/src/Node.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | class XRL_Node 21 | { 22 | protected $_properties; 23 | 24 | public function __construct(XMLReader $reader, $validate) 25 | { 26 | $skipNodes = array(XMLReader::SIGNIFICANT_WHITESPACE); 27 | do { 28 | if (!$reader->read()) { 29 | throw new InvalidArgumentException( 30 | 'Unexpected end of document' 31 | ); 32 | } 33 | if ($validate && !$reader->isValid()) 34 | throw new InvalidArgumentException('Invalid document'); 35 | } while (in_array($reader->nodeType, $skipNodes)); 36 | 37 | $fields = array( 38 | 'name', 39 | 'nodeType', 40 | 'value', 41 | 'isEmptyElement', 42 | ); 43 | 44 | $this->_properties = array(); 45 | foreach ($fields as $field) 46 | $this->_properties[$field] = $reader->$field; 47 | } 48 | 49 | public function __get($field) 50 | { 51 | if (!isset($this->_properties[$field])) 52 | throw new UnexpectedValueException("Unknown property '$field'"); 53 | 54 | return $this->_properties[$field]; 55 | } 56 | 57 | public function emptyNodeExpansionWorked() 58 | { 59 | if ($this->_properties['nodeType'] == XMLReader::ELEMENT && 60 | $this->_properties['isEmptyElement'] == TRUE) { 61 | $this->_properties['nodeType'] = XMLReader::END_ELEMENT; 62 | $this->_properties['isEmptyElement'] = FALSE; 63 | return TRUE; 64 | } 65 | return FALSE; 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /src/XRL/src/NonValidatingDecoderFactory.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | class XRL_NonValidatingDecoderFactory 20 | implements XRL_DecoderFactoryInterface 21 | { 22 | public function createDecoder() 23 | { 24 | return new XRL_Decoder(FALSE); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/XRL/src/PrettyEncoderFactory.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | class XRL_PrettyEncoderFactory 20 | implements XRL_EncoderFactoryInterface 21 | { 22 | public function createEncoder() 23 | { 24 | return new XRL_Encoder(XRL_Encoder::OUTPUT_PRETTY); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/XRL/src/Request.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | /** 21 | * \brief 22 | * A class that represents an XML-RPC request. 23 | */ 24 | class XRL_Request 25 | implements XRL_RequestInterface 26 | { 27 | /// Name of the remote procedure to call. 28 | protected $_procedure; 29 | 30 | /// Parameters to pass to the remote procedure. 31 | protected $_params; 32 | 33 | /** 34 | * Creates a new XML-RPC request. 35 | * 36 | * \param string $procedure 37 | * Name of the remote procedure to call. 38 | * 39 | * \param array $params 40 | * Parameters to pass to the remote procedure. 41 | * 42 | * \throw InvalidArgumentException 43 | * An invalid procedure name was given. 44 | */ 45 | public function __construct($procedure, array $params) 46 | { 47 | if (!is_string($procedure)) 48 | throw new InvalidArgumentException('Invalid procedure name'); 49 | 50 | $this->_procedure = $procedure; 51 | $this->_params = $params; 52 | } 53 | 54 | /** 55 | * Returns the remote procedure's name. 56 | * 57 | * \retval string 58 | * The name of the remote procedure this request 59 | * is meant to call. 60 | */ 61 | public function getProcedure() 62 | { 63 | return $this->_procedure; 64 | } 65 | 66 | /** 67 | * Returns the parameters to pass 68 | * to the remote procedure. 69 | * 70 | * \retval array 71 | * Parameters to pass to the 72 | * remote procedure. 73 | */ 74 | public function getParams() 75 | { 76 | return $this->_params; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/XRL/src/RequestFactory.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | class XRL_RequestFactory 21 | implements XRL_RequestFactoryInterface 22 | { 23 | public function createRequest($method, array $params) 24 | { 25 | return new XRL_Request($method, $params); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/XRL/src/RequestFactoryInterface.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | interface XRL_RequestFactoryInterface 21 | { 22 | public function createRequest($method, array $params); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /src/XRL/src/RequestInterface.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | interface XRL_RequestInterface 21 | { 22 | public function __construct($procedure, array $params); 23 | 24 | public function getProcedure(); 25 | 26 | public function getParams(); 27 | } 28 | -------------------------------------------------------------------------------- /src/XRL/src/Response.php: -------------------------------------------------------------------------------- 1 | . 18 | */ 19 | 20 | /** 21 | * \brief 22 | * This class represents the response 23 | * to an XML-RPC request. 24 | */ 25 | class XRL_Response 26 | implements XRL_ResponseInterface 27 | { 28 | /// The result of an XML-RPC request, as serialized XML. 29 | protected $_result; 30 | 31 | /** 32 | * Create the response to an XML-RPC request. 33 | * 34 | * \param mixed $xmlResult 35 | * The result of the request. This may be a scalar 36 | * (integer, boolean, float, string), an array, 37 | * an exception or a DateTime object. 38 | */ 39 | public function __construct($xmlResult) 40 | { 41 | $this->_result = $xmlResult; 42 | } 43 | 44 | /** 45 | * Returns the response for an XML-RPC request, 46 | * as serialized XML. 47 | * 48 | * \retval string 49 | * An XML-RPC response, as a string. 50 | */ 51 | public function __string() 52 | { 53 | return $this->_result; 54 | } 55 | 56 | /** 57 | * Send this XML-RPC response back to a browser. 58 | * 59 | * \warning 60 | * This method never returns. 61 | */ 62 | public function publish() 63 | { 64 | header('Content-Type: text/xml'); 65 | header('Content-Length: '.strlen($this->_result)); 66 | exit($this->_result); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/XRL/src/ResponseFactory.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | class XRL_ResponseFactory 20 | implements XRL_ResponseFactoryInterface 21 | { 22 | public function createResponse($response) 23 | { 24 | return new XRL_Response($response); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/XRL/src/ResponseFactoryInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_ResponseFactoryInterface 20 | { 21 | public function createResponse($response); 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/XRL/src/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | interface XRL_ResponseInterface 20 | { 21 | public function __string(); 22 | public function publish(); 23 | } 24 | -------------------------------------------------------------------------------- /src/XRL/src/ValidatingDecoderFactory.php: -------------------------------------------------------------------------------- 1 | . 17 | */ 18 | 19 | class XRL_ValidatingDecoderFactory 20 | implements XRL_DecoderFactoryInterface 21 | { 22 | public function createDecoder() 23 | { 24 | return new XRL_Decoder(TRUE); 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/classes/API.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * API 34 | * 35 | * 36 | * @category Website 37 | * @package Photoshow 38 | * @author Thibaud Rohmer 39 | * @copyright Thibaud Rohmer 40 | * @license http://www.gnu.org/licenses/ 41 | * @link http://github.com/thibaud-rohmer/PhotoShow 42 | */ 43 | 44 | class API 45 | { 46 | 47 | function __construct(){ 48 | require_once dirname(__FILE__).'/../XRL/src/Autoload.php'; 49 | 50 | /// Initialize variables 51 | Settings::init(); 52 | 53 | /// Initialize CurrentUser 54 | CurrentUser::init(); 55 | 56 | 57 | $this->server = new XRL_Server(); 58 | $this->server["XRL_DecoderFactoryInterface"] = new XRL_NonValidatingDecoderFactory(); 59 | 60 | foreach(get_class_methods('API') as $c){ 61 | if($c == '__construct') 62 | continue; 63 | $this->server->$c = array('API',$c); 64 | } 65 | 66 | $this->server->foo = array('API','foo'); 67 | $this->server->handle()->publish(); 68 | } 69 | 70 | 71 | /** 72 | * Basic test function 73 | */ 74 | public static function foo($bar){ 75 | return $bar + 42; 76 | } 77 | 78 | /** 79 | * Returns key associated to user 80 | */ 81 | public static function get_key($login,$pass){ 82 | if(CurrentUser::login($login,$pass)){ 83 | return CurrentUser::$account->get_key(); 84 | }else{ 85 | return false; 86 | } 87 | } 88 | 89 | /** 90 | * Returns account info associated to $key 91 | */ 92 | public static function whoami($key){ 93 | if(CurrentUser::keyin($key)){ 94 | return CurrentUser::$account->get_acc(); 95 | }else{ 96 | return false; 97 | } 98 | } 99 | 100 | /** 101 | * List directories contained in $dir 102 | */ 103 | public static function list_dirs($key,$dir,$rec=false){ 104 | CurrentUser::keyin($key); 105 | 106 | $res = array(); 107 | 108 | $m = Menu::list_dirs(File::r2a($dir),$rec); 109 | 110 | if(sizeof($m) == 0){ 111 | return $res; 112 | } 113 | 114 | foreach($m as $i){ 115 | if(Judge::view($i)){ 116 | $res[] = File::a2r($i); 117 | } 118 | } 119 | return $res; 120 | } 121 | 122 | /** 123 | * List files contained in $dir 124 | */ 125 | public static function list_files($key,$dir){ 126 | CurrentUser::keyin($key); 127 | 128 | $res = array(); 129 | 130 | $m = Menu::list_files(File::r2a($dir)); 131 | if(sizeof($m) == 0){ 132 | return $res; 133 | } 134 | 135 | foreach($m as $i){ 136 | if(Judge::view($i)){ 137 | $res[] = File::a2r($i); 138 | } 139 | } 140 | return $res; 141 | } 142 | 143 | /** 144 | * Return image(s) $img 145 | */ 146 | public static function get_img($key,$img,$t='large'){ 147 | if(is_array($img)){ 148 | $res = array(); 149 | foreach($img as $i){ 150 | $p = get_img($key,$i,$t); 151 | if(isset($p)){ 152 | $res[] = $p; 153 | } 154 | } 155 | return $res; 156 | }else{ 157 | $i=File::r2a($img); 158 | if(Judge::view($i)){ 159 | switch($t){ 160 | case("thumb"): return file_get_contents(Provider::thumb($i)); 161 | case("small"): return file_get_contents(Provider::small($i)); 162 | case("large"): 163 | default: 164 | return file_get_contents($i); 165 | } 166 | } 167 | } 168 | } 169 | } 170 | 171 | ?> 172 | -------------------------------------------------------------------------------- /src/classes/AdminAbout.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * AdminAbout 34 | * 35 | * About page 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class AdminAbout 45 | { 46 | 47 | /** 48 | * Create about page 49 | * 50 | * @author Thibaud Rohmer 51 | */ 52 | public function __construct(){ 53 | 54 | } 55 | 56 | /** 57 | * Display upload page on website 58 | * 59 | * @author Thibaud Rohmer 60 | */ 61 | public function toHTML(){ 62 | 63 | echo "
"; 64 | echo "

".Settings::_("adminmenu","about")."

"; 65 | echo "
"; 66 | 67 | echo "

PhotoShow

"; 68 | echo "
"; 69 | echo "
\n"; 74 | 75 | echo "

Me

"; 76 | echo "
"; 77 | 78 | echo "
\n"; 84 | 85 | echo "

If you like PhotoShow ...

"; 86 | 87 | echo "
"; 88 | echo "
    "; 89 | echo "Spread the word ! Tell it to your friends :)
    \n"; 90 | echo "Make sure to go to PhotoShow-Gallery and like/+1/tweet the page.
    "; 91 | echo "
    "; 92 | echo '
    93 | 94 | 95 | 96 | 97 |
    '; 98 | echo "
\n"; 99 | echo "
"; 100 | echo "
"; 101 | } 102 | 103 | } 104 | ?> -------------------------------------------------------------------------------- /src/classes/AdminMenu.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * AdminMenu 34 | * 35 | * Menu for the admin. Just for the admin. U no admin ? U no menu. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class AdminMenu 45 | { 46 | /// Menu options 47 | public $options=array(); 48 | 49 | /** 50 | * Build AdminMenu 51 | * 52 | * @author Thibaud Rohmer 53 | */ 54 | public function __construct(){ 55 | $this->options['Abo'] = Settings::_("adminmenu","about"); 56 | $this->options['Sta'] = Settings::_("adminmenu","stats"); 57 | $this->options['VTk'] = Settings::_("adminmenu","tokens"); 58 | $this->options['Set'] = Settings::_("adminmenu","settings"); 59 | $this->options['Acc'] = Settings::_("adminmenu","account"); 60 | $this->options['EdA'] = Settings::_("adminmenu","groups"); 61 | } 62 | 63 | /** 64 | * Display AdminMenu on website 65 | * 66 | * @author Thibaud Rohmer 67 | */ 68 | public function toHTML(){ 69 | echo "\n"; 85 | } 86 | 87 | } 88 | ?> 89 | -------------------------------------------------------------------------------- /src/classes/AdminPanel.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Admin Panel 34 | * 35 | * @category Website 36 | * @package Photoshow 37 | * @author Thibaud Rohmer 38 | * @copyright Thibaud Rohmer 39 | * @license http://www.gnu.org/licenses/ 40 | * @link http://github.com/thibaud-rohmer/PhotoShow 41 | */ 42 | class AdminPanel 43 | { 44 | 45 | private $j; 46 | 47 | private $isfile = false; 48 | 49 | public function __construct(){ 50 | 51 | $file = CurrentUser::$path; 52 | if(!is_array($file) && is_file($file)){ 53 | $this->isfile = true; 54 | } 55 | 56 | $this->j = new Judge($file); 57 | } 58 | 59 | public function toHTML(){ 60 | 61 | 62 | 63 | if(CurrentUser::$admin){ 64 | echo $this->j->toHTML(); 65 | } 66 | 67 | } 68 | } 69 | 70 | 71 | ?> 72 | -------------------------------------------------------------------------------- /src/classes/AdminUpload.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * AdminUpload 34 | * 35 | * Upload page 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class AdminUpload 45 | { 46 | 47 | /** 48 | * Upload files on the server 49 | * 50 | * @author Thibaud Rohmer 51 | */ 52 | public function upload(){ 53 | 54 | $allowedExtensions = array("tiff","jpg","jpeg","gif","png"); 55 | 56 | /// Just to be really sure ffmpeg is enabled - necessary to generate thumbnail jpg and webm 57 | if (Settings::$encode_video) { 58 | array_push($allowedExtensions,"flv","mov","mpg","mp4","ogv","mts","3gp","webm"); 59 | } 60 | 61 | $already_set_rights = false; 62 | 63 | /// Just to be really sure... 64 | if( !(CurrentUser::$admin || CurrentUser::$uploader) ){ 65 | return; 66 | } 67 | 68 | /// Set upload path 69 | $path = stripslashes(File::r2a($_POST['path'])); 70 | 71 | /// Create dir and update upload path if required 72 | if(strlen(stripslashes($_POST['newdir']))>0 && !strpos(stripslashes($_POST['newdir']),'..')){ 73 | 74 | $path = $path."/".stripslashes($_POST['newdir']); 75 | if(!file_exists($path)){ 76 | @mkdir($path,0750,true); 77 | @mkdir(File::r2a(File::a2r($path),Settings::$thumbs_dir),0750,true); 78 | } 79 | 80 | /// Setup rights 81 | if(!isset($_POST['inherit'])){ 82 | if(isset($_POST['public'])){ 83 | Judge::edit($path); 84 | }else{ 85 | Judge::edit($path,$_POST['users'],$_POST['groups']); 86 | } 87 | } 88 | $already_set_rights = true; 89 | } 90 | if(!isset($_FILES["images"])) return; 91 | /// Treat uploaded files 92 | foreach ($_FILES["images"]["error"] as $key => $error) { 93 | 94 | // Check that file is uploaded 95 | if ($error == UPLOAD_ERR_OK) { 96 | 97 | // Name of the stored file 98 | $tmp_name = $_FILES["images"]["tmp_name"][$key]; 99 | 100 | // Name on the website 101 | $name = $_FILES["images"]["name"][$key]; 102 | 103 | $info = pathinfo($name); 104 | $base_name = mb_basename($name,'.'.$info['extension']); 105 | 106 | // Check filetype 107 | if(!in_array(strtolower($info['extension']),$allowedExtensions)){ 108 | continue; 109 | } 110 | 111 | // Rename until this name isn't taken 112 | if (!Settings::$overwriteonupload){ 113 | $i=1; 114 | while(file_exists("$path/$name")){ 115 | $name=$base_name."-".$i.".".$info['extension']; 116 | $i++; 117 | } 118 | } 119 | // Save the files 120 | if(move_uploaded_file($tmp_name, "$path/$name")){ 121 | // $done .= "Successfully uploaded $name"; 122 | Video::FastEncodeVideo("$path/$name"); 123 | Image::AutoRotateImage("$path/$name"); 124 | } 125 | 126 | 127 | /// Setup rights 128 | if(!$already_set_rights && !isset($_POST['inherit'])){ 129 | if(isset($_POST['public'])){ 130 | Judge::edit("$path/$name"); 131 | }else{ 132 | Judge::edit("$path/$name",$_POST['users'],$_POST['groups']); 133 | } 134 | } 135 | } 136 | } 137 | } 138 | 139 | } 140 | ?> 141 | -------------------------------------------------------------------------------- /src/classes/BoardDir.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * BoardDir 34 | * 35 | * Implements the displaying of directory on the grid of 36 | * the Website. 37 | * 38 | * @category Website 39 | * @package Photoshow 40 | * @author Thibaud Rohmer 41 | * @copyright Thibaud Rohmer 42 | * @license http://www.gnu.org/licenses/ 43 | * @link http://github.com/thibaud-rohmer/PhotoShow 44 | */ 45 | class BoardDir implements HTMLObject 46 | { 47 | /// URL-encoded relative path to dir 48 | public $url; 49 | 50 | /// Path to dir 51 | public $path; 52 | 53 | /// Images representing the dir 54 | public $images; 55 | 56 | /// URL for loading the image 57 | private $img; 58 | 59 | /** 60 | * Construct BoardItem 61 | * 62 | * @param string $file 63 | * @param string $ratio 64 | * @author Thibaud Rohmer 65 | */ 66 | public function __construct($dir,$img){ 67 | $this->path = $dir; 68 | $this->url = urlencode(File::a2r($dir)); 69 | if($img == NULL){ 70 | $this->img='inc/folder.png'; 71 | }else{ 72 | $this->img = "?t=Thb&f=".urlencode(File::a2r($img)); 73 | 74 | } 75 | } 76 | 77 | /** 78 | * Display BoardItem on Website 79 | * 80 | * @return void 81 | * @author Thibaud Rohmer 82 | */ 83 | public function toHTML(){ 84 | echo ""; 95 | 96 | } 97 | } 98 | 99 | ?> 100 | -------------------------------------------------------------------------------- /src/classes/BoardHeader.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * BoardHeader 34 | * 35 | * Well... It contains the title and some buttons. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class BoardHeader{ 45 | 46 | /// Name of the directory listed in parent Board 47 | public $title; 48 | 49 | /// Path of the directory listed in parent Board 50 | public $path; 51 | 52 | /// Current Working Directory 53 | private $w; 54 | 55 | /** 56 | * Create BoardHeader 57 | * 58 | * @param string $title 59 | * @author Thibaud Rohmer 60 | */ 61 | public function __construct(){ 62 | $this->path = urlencode(File::a2r(CurrentUser::$path)); 63 | $this->title = is_dir(CurrentUser::$path)?mb_basename(CurrentUser::$path):mb_basename(dirname(CurrentUser::$path)); 64 | $this->w = File::a2r(CurrentUser::$path); 65 | } 66 | 67 | /** 68 | * Display BoardHeader on Website 69 | * 70 | * @return void 71 | * @author Thibaud Rohmer 72 | */ 73 | public function toHTML(){ 74 | echo "
"; 75 | 76 | // Menu left 77 | echo ""; 78 | 79 | 80 | echo "

".htmlentities($this->title, ENT_QUOTES ,'UTF-8')."

"; 81 | 82 | echo "
\n"; 83 | } 84 | } 85 | 86 | ?> 87 | -------------------------------------------------------------------------------- /src/classes/BoardItem.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * BoardItem 34 | * 35 | * Implements the displaying of an item of the grid on 36 | * the Website. 37 | * 38 | * @category Website 39 | * @package Photoshow 40 | * @author Thibaud Rohmer 41 | * @copyright Thibaud Rohmer 42 | * @license http://www.gnu.org/licenses/ 43 | * @link http://github.com/thibaud-rohmer/PhotoShow 44 | */ 45 | class BoardItem implements HTMLObject 46 | { 47 | /// URL-encoded relative path to file 48 | public $file; 49 | 50 | /// Path to file 51 | public $path; 52 | 53 | /// Ratio of the file 54 | public $ratio; 55 | 56 | /// Item width 57 | public $width; 58 | 59 | /** 60 | * Construct BoardItem 61 | * 62 | * @param string $file 63 | * @param string $ratio 64 | * @author Thibaud Rohmer 65 | */ 66 | public function __construct($file,$ratio=0){ 67 | $this->path = $file; 68 | $this->file = urlencode(File::a2r($file)); 69 | $this->ratio = $ratio; 70 | } 71 | 72 | /** 73 | * Display BoardItem on Website 74 | * 75 | * @return void 76 | * @author Thibaud Rohmer 77 | */ 78 | public function toHTML(){ 79 | 80 | $getfile = "t=Thb&f=$this->file"; 81 | 82 | echo "
"; 83 | echo ""; 84 | echo "\"\""; 85 | echo "\n"; 86 | echo "
\n"; 87 | 88 | } 89 | 90 | 91 | 92 | /** 93 | * Calculate width (in percent) of the item : 94 | * 90 * item_ratio / line_ratio 95 | * 96 | * @param string $r 97 | * @return void 98 | * @author Thibaud Rohmer 99 | */ 100 | public function set_width($line_ratio){ 101 | $this->width = 90 * $this->ratio / $line_ratio; 102 | } 103 | } 104 | 105 | ?> -------------------------------------------------------------------------------- /src/classes/Cleaning.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Franck Royer 27 | * @copyright 2012 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Cleaning 34 | * 35 | * Clean any useless files (old job, old thumbs) from thumbs_dir 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Franck Royer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | 45 | class Cleaning 46 | { 47 | 48 | /** 49 | * Constructor 50 | */ 51 | public function __construct(){ 52 | } 53 | 54 | /** 55 | * Perform the cleaning 56 | * 57 | * @return void 58 | * @author Franck Royer 59 | */ 60 | static public function PerformClean(){ 61 | if (!isset(Settings::$photos_dir) || !isset(Settings::$thumbs_dir)) { 62 | Settings::init(); 63 | } 64 | 65 | if ( !is_dir(Settings::$photos_dir) || !is_dir(Settings::$thumbs_dir) ) { 66 | error_log("ERROR/Cleaning::PerformClean: ".$photos_dir." or ".$thumbs_dir." do not exit, cannot proceed."); 67 | return; 68 | } 69 | 70 | //TODO Windows 71 | // Clean Old thumbnails 72 | exec("cd ".Settings::$thumbs_dir." && find . -type f -iregex '.*[^\(xml\)\(job\)]$' 2>&1", $output, $ret_var); 73 | 74 | if ($ret_var != 0) { 75 | error_log("ERROR/Cleaning::PerformClean: Execution failed: ".print_r($output)); 76 | } 77 | 78 | foreach ($output as $file) { 79 | if (!file_exists(Settings::$photos_dir.'/'.$file) ){ 80 | error_log('DEBUG/Cleaning::PerformClean: erase '.Settings::$thumbs_dir.'/'.$file."\n"); 81 | unlink(Settings::$thumbs_dir.'/'.$file); 82 | } 83 | } 84 | 85 | // Now cleaning Pending jobs 86 | unset($output); unset($ret_var); 87 | exec("cd ".Settings::$thumbs_dir." && find . -type f -name '*job' 2>&1", $output, $ret_var); 88 | if ($ret_var != 0) { 89 | error_log("ERROR/Cleaning::PerformClean: Execution failed: ".print_r($output)); 90 | return; 91 | } 92 | 93 | foreach ($output as $jobfilename) { 94 | // need the absolute path of the video file 95 | //error_log('DEBUG/Cleaning::PerformClean: processing job '.$jobfilename."\n"); 96 | $jobfile = new File(Settings::$thumbs_dir.'/'.$jobfilename); 97 | $filename_no_ext = Settings::$photos_dir.'/'.dirname($jobfilename).'/'.$jobfile->name; 98 | $files = glob($filename_no_ext.'.*'); 99 | 100 | if (empty($files)){ 101 | error_log("ERROR/Cleaning::PerformClean: no file found for job ".$jobfilename.", deleting\n"); 102 | unlink(Settings::$thumbs_dir.'/'.$jobfilename); 103 | continue; 104 | } 105 | 106 | //error_log('DEBUG/Cleaning::PerformClean: calling NoJob with '.$files[0]."\n"); 107 | Video::NoJob($files[0]); 108 | } 109 | 110 | // Finally clean empty files 111 | unset($output); unset($ret_var); 112 | exec("cd ".Settings::$thumbs_dir." && find . -size 0b 2>&1", $output, $ret_var); 113 | if ($ret_var != 0) { 114 | error_log("ERROR/Cleaning::PerformClean: Execution failed: ".print_r($output)); 115 | return; 116 | } 117 | foreach ($output as $emptyfile) { 118 | unlink(Settings::$thumbs_dir.'/'.$emptyfile); 119 | } 120 | } 121 | } 122 | ?> 123 | -------------------------------------------------------------------------------- /src/classes/Comment.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Comment 34 | * 35 | * Specifies what is a comment. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class Comment implements HTMLObject 45 | { 46 | /// Login of the poster 47 | public $login; 48 | 49 | /// Date when the comment wat posted 50 | public $date; 51 | 52 | /// Content of the comment 53 | public $content; 54 | 55 | /// File 56 | public $file; 57 | 58 | /** 59 | * Create comment 60 | * 61 | * @param string $login 62 | * @param string $content 63 | * @param string $date 64 | * @author Thibaud Rohmer 65 | */ 66 | public function __construct($login,$content,$date,$file=null){ 67 | $this->login = $login; 68 | $this->content = $content; 69 | $this->date = $date; 70 | $this->file = $file; 71 | } 72 | 73 | /** 74 | * Display comment on website 75 | * 76 | * @return void 77 | * @author Thibaud Rohmer 78 | */ 79 | public function toHTML($id=0){ 80 | $login = stripslashes(htmlentities( $this->login , ENT_QUOTES ,'UTF-8')); 81 | $content = stripslashes(htmlentities( $this->content , ENT_QUOTES ,'UTF-8')); 82 | $date = $this->date; 83 | 84 | echo "
\n"; 85 | 86 | echo "
$login
\n"; 87 | echo "
$content\n"; 88 | if(CurrentUser::$admin){ 89 | echo "
90 | 91 | 92 | 93 |
"; 94 | } 95 | echo "
\n"; 96 | 97 | echo "
\n"; 98 | } 99 | } 100 | ?> 101 | -------------------------------------------------------------------------------- /src/classes/File.php: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thibaud-rohmer/PhotoShow/3c3819f6555c1c7819ee31f6c090da44d0ce2428/src/classes/File.php -------------------------------------------------------------------------------- /src/classes/FileException.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * FileException 34 | * 35 | * Raised when a file is missing. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | 45 | class FileException 46 | extends Exception 47 | { 48 | /// Path to missing file 49 | public $file; 50 | } 51 | 52 | ?> -------------------------------------------------------------------------------- /src/classes/HTMLObject.php: -------------------------------------------------------------------------------- 1 | . 24 | * 25 | * @category Website 26 | * @package Photoshow 27 | * @author Thibaud Rohmer 28 | * @copyright 2011 Thibaud Rohmer 29 | * @license http://www.gnu.org/licenses/ 30 | * @link http://github.com/thibaud-rohmer/PhotoShow 31 | */ 32 | 33 | /** 34 | * HTMLObject 35 | * 36 | * This interface represents any object that can output 37 | * HTML. 38 | * 39 | * @category Website 40 | * @package Photoshow 41 | * @author Thibaud Rohmer 42 | * @copyright Thibaud Rohmer 43 | * @license http://www.gnu.org/licenses/ 44 | * @link http://github.com/thibaud-rohmer/PhotoShow 45 | */ 46 | interface HTMLObject 47 | { 48 | public function toHTML(); 49 | } 50 | 51 | ?> -------------------------------------------------------------------------------- /src/classes/ImageBar.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * ImageBar 34 | * 35 | * The ImageBar contains some buttons insanely awesome 36 | * buttons, incredibly useful. Yeah, it rocks. 37 | * 38 | * 39 | * @category Website 40 | * @package Photoshow 41 | * @author Thibaud Rohmer 42 | * @copyright Thibaud Rohmer 43 | * @license http://www.gnu.org/licenses/ 44 | * @link http://github.com/thibaud-rohmer/PhotoShow 45 | */ 46 | class ImageBar 47 | { 48 | 49 | /// Buttons to display 50 | private $buttons = array(); 51 | 52 | private $awesome = array(); 53 | 54 | /// True if photosphere 55 | private $photosphere = false; 56 | 57 | /** 58 | * Create the ImageBar 59 | * 60 | * @author Thibaud Rohmer 61 | */ 62 | public function __construct($fs=false){ 63 | 64 | $file = urlencode(File::a2r(CurrentUser::$path)); 65 | 66 | $this->photosphere = (mb_basename(dirname(CurrentUser::$path)) == "PhotoSpheres"); 67 | 68 | $this->buttons['prev'] = "?p=p&f=".$file; 69 | $this->awesome['prev'] = ""; 70 | 71 | $this->buttons['back'] = "?f=".urlencode(File::a2r(dirname(CurrentUser::$path))); 72 | $this->awesome['back'] = ""; 73 | 74 | if(!Settings::$nodownload){ 75 | $this->buttons['img'] = "?t=Big&f=".$file; 76 | $this->awesome['img'] = ""; 77 | 78 | $this->buttons['get'] = "?t=BDl&f=".$file; 79 | $this->awesome['get'] = ""; 80 | } 81 | 82 | $this->buttons['slideshow'] = "?f=".$file; 83 | $this->awesome['slideshow'] = ""; 84 | 85 | if($this->photosphere){ 86 | $this->buttons['pshere'] = "#' id='photosphere"; 87 | $this->awesome['pshere'] = ""; 88 | } 89 | 90 | $this->buttons['next'] = "?p=n&f=".$file; 91 | $this->awesome['next'] = ""; 92 | 93 | $this->buttons['pause'] = "?f=".$file; 94 | $this->awesome['pause'] = ""; 95 | 96 | $this->buttons['play'] = "?f=".$file; 97 | $this->awesome['play'] = ""; 98 | 99 | $this->buttons['stop'] = "?f=".$file; 100 | $this->awesome['stop'] = ""; 101 | 102 | 103 | 104 | } 105 | 106 | /** 107 | * Display ImageBar on Website 108 | * 109 | * @author Thibaud Rohmer 110 | */ 111 | public function toHTML(){ 112 | foreach($this->buttons as $name=>$url){ 113 | echo "".$this->awesome[$name].""; 114 | } 115 | } 116 | 117 | } 118 | 119 | ?> -------------------------------------------------------------------------------- /src/classes/ImagePanel.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * ImagePanel 34 | * 35 | * The ImagePanel contains one image and the navigation buttons. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | 45 | class ImagePanel implements HTMLObject 46 | { 47 | 48 | /// Header of the html page 49 | public $page_header; 50 | 51 | /// Image object 52 | private $image; 53 | 54 | /// Video object 55 | private $video; 56 | 57 | /// Description object 58 | private $description; 59 | 60 | /// Judge object 61 | private $judge; 62 | 63 | /** 64 | * Create ImagePanel 65 | * 66 | * @param string $file 67 | * @author Thibaud Rohmer 68 | */ 69 | public function __construct($file=NULL){ 70 | 71 | if(!isset($file)){ 72 | return; 73 | } 74 | 75 | $file_type = File::Type($file); 76 | 77 | if($file_type == "Image"){ 78 | /// Create Image object 79 | $this->image = new Image($file); 80 | } 81 | elseif($file_type == "Video"){ 82 | /// Create Video object 83 | $this->video = new Video($file); 84 | } 85 | 86 | if(!Settings::$nodescription){ 87 | /// Create Description object 88 | $this->description = new Description($file); 89 | } 90 | 91 | /// Create Image object 92 | $this->imagebar = new ImageBar($file); 93 | 94 | $pageURL = Settings::$site_address."/?f=".urlencode(File::a2r($file)); 95 | 96 | // generate the header - opengraph metatags for facebook 97 | $this->page_header = "\n" 98 | ."\n" 99 | ."\n" 100 | ."\n" 101 | ."\n"; 102 | if (Settings::$fbappid){ 103 | $this->page_header .= "\n"; 104 | } 105 | 106 | /// Set the Judge 107 | $this->judge = new Judge($file); 108 | } 109 | 110 | /** 111 | * Display ImagePanel on website 112 | * 113 | * @return void 114 | * @author Thibaud Rohmer 115 | */ 116 | public function toHTML(){ 117 | if (!isset($this->image) && !isset($this->video)){ 118 | return; 119 | } 120 | 121 | echo "
\n"; 122 | 123 | if(isset($this->image)){ 124 | echo "
\n"; 125 | 126 | $this->image->toHTML(); 127 | echo "
\n"; 128 | } 129 | elseif(isset($this->video)){ 130 | 131 | echo "
\n"; 132 | $this->video->toHTML(); 133 | echo "
\n"; 134 | } 135 | 136 | if(!Settings::$nodescription){ 137 | echo "
"; 138 | $this->description->toHTML(); 139 | echo "
"; 140 | } 141 | 142 | echo "
\n"; 143 | $this->imagebar->toHTML(); 144 | echo "
\n"; 145 | 146 | echo "
\n"; 147 | } 148 | 149 | } 150 | ?> 151 | -------------------------------------------------------------------------------- /src/classes/Index.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Index 34 | * 35 | * Now, what could this possibly be ? Oh, right... It's the 36 | * Index. Who would've guessed, eh ? 37 | * 38 | * @category Website 39 | * @package Photoshow 40 | * @author Thibaud Rohmer 41 | * @copyright Thibaud Rohmer 42 | * @license http://www.gnu.org/licenses/ 43 | * @link http://github.com/thibaud-rohmer/PhotoShow 44 | */ 45 | 46 | class Index 47 | { 48 | function __construct(){ 49 | /// Initialize variables 50 | Settings::init(); 51 | 52 | 53 | /// Initialize CurrentUser 54 | try{ 55 | CurrentUser::init(); 56 | }catch(Exception $e){ 57 | $page = new RegisterPage(true); 58 | $page->toHTML(); 59 | return; 60 | } 61 | 62 | /// Check what to do 63 | switch (CurrentUser::$action){ 64 | 65 | case "Rss": $r = new RSS(Settings::$conf_dir."/photos_feed.txt"); 66 | $r->toXML(); 67 | break; 68 | 69 | case "Judge": // Same as page 70 | case "Page": $page = new MainPage(); 71 | $page->toHTML(); 72 | break; 73 | 74 | case "Logout": 75 | case "Login": 76 | case "Log": $page = new LoginPage(); 77 | $page->toHTML(); 78 | break; 79 | 80 | case "Reg": $page = new RegisterPage(); 81 | $page->toHTML(); 82 | break; 83 | 84 | case "JS": $page = new JS(); 85 | break; 86 | 87 | case "Img": Provider::Image(CurrentUser::$path); 88 | break; 89 | 90 | case "BDl": Provider::Image(CurrentUser::$path,false,true,true,true); 91 | break; 92 | 93 | case "Big": Provider::Image(CurrentUser::$path,false,true); 94 | break; 95 | 96 | case "Thb": Provider::Image(CurrentUser::$path,true); 97 | break; 98 | 99 | case "Vid": Provider::Video(CurrentUser::$path); 100 | break; 101 | 102 | case "Zip": Provider::Zip(CurrentUser::$path); 103 | break; 104 | 105 | case "Acc": if(CurrentUser::$admin && isset($_POST['login'])){ 106 | $acc = new Account($_POST['login']); 107 | }else{ 108 | $acc = CurrentUser::$account; 109 | } 110 | $acc->toHTML(); 111 | break; 112 | 113 | case "Adm": $page = new Admin(); 114 | $page->toHTML(); 115 | break; 116 | } 117 | } 118 | } 119 | 120 | ?> 121 | -------------------------------------------------------------------------------- /src/classes/JS.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * JS 34 | * 35 | * JS Support. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | class JS extends Page 45 | { 46 | private $toPrint; 47 | 48 | private $j; 49 | 50 | public function __construct(){ 51 | 52 | /// Execute stuff automagically 53 | new Admin(); 54 | 55 | if(isset($_GET['j'])){ 56 | switch($_GET['j']){ 57 | 58 | case "Pag": $m = new Menu(); 59 | $p = new Board(); 60 | $ap = new AdminPanel(); 61 | 62 | echo "\n"; 67 | echo "
\n"; 68 | $p->toHTML(); 69 | echo "
\n"; 70 | 71 | echo "\n"; 73 | 74 | if(CurrentUser::$admin){ 75 | echo "
\n"; 76 | $ap->toHTML(); 77 | echo "
\n"; 78 | } 79 | break; 80 | 81 | case "Log": $p = new LoginPage(); 82 | $p->toHTML(); 83 | break; 84 | 85 | case "Reg": $p = new RegisterPage(); 86 | $p->toHTML(); 87 | break; 88 | 89 | case "Pan": if(is_file(CurrentUser::$path)){ 90 | $b = new ImagePanel(CurrentUser::$path); 91 | $b->toHTML(); 92 | }else{ 93 | $b = new Board(CurrentUser::$path); 94 | $b->toHTML(); 95 | } 96 | break; 97 | 98 | case "Men": $m = new Menu(); 99 | $m->toHTML(); 100 | break; 101 | 102 | 103 | case "Pan": $f = new AdminPanel(); 104 | $f->toHTML(); 105 | break; 106 | 107 | case "Inf": $f = new Infos(); 108 | $f->toHTML(); 109 | break; 110 | 111 | case "Jud": $j = new Judge(CurrentUser::$path); 112 | $j->toHTML(); 113 | break; 114 | 115 | case "Acc": $f = new Group(); 116 | $f->toHTML(); 117 | break; 118 | 119 | case "Comm": $f = new Comments(CurrentUser::$path); 120 | $f->toHTML(); 121 | break; 122 | 123 | case "Desc": $f = new Description(CurrentUser::$path); 124 | $f->toHTML(); 125 | break; 126 | 127 | default: break; 128 | } 129 | } 130 | } 131 | 132 | public function toHTML(){ 133 | 134 | } 135 | } 136 | 137 | 138 | ?> -------------------------------------------------------------------------------- /src/classes/LoginPage.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * LoginPage 34 | * 35 | * Lets a user log in. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | 45 | class LoginPage extends Page 46 | { 47 | 48 | /** 49 | * Create Login Page 50 | * 51 | * @author Thibaud Rohmer 52 | */ 53 | public function __construct(){ 54 | 55 | } 56 | 57 | /** 58 | * Display Login Page on website 59 | * 60 | * @return void 61 | * @author Thibaud Rohmer 62 | */ 63 | public function toHTML(){ 64 | 65 | if (Settings::$forcehttps && !$_SERVER["HTTPS"]){ 66 | header("HTTP/1.1 301 Moved Permanently"); 67 | header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); 68 | exit(); 69 | }else{ 70 | $this->header(); 71 | echo "
"; 72 | echo "

".Settings::_("login","logintitle")."

"; 73 | echo "
"; 74 | 75 | echo "
\n"; 76 | echo "
\n"; 77 | echo "
78 |
79 | 80 | 81 |
82 |
83 | 84 | 85 |
86 |
87 | 88 | "; 89 | 90 | if (!Settings::$noregister){ 91 | echo " ".Settings::_("login","or")." ".Settings::_("login","register")." "; 92 | } 93 | 94 | echo "
\n
\n
\n
\n"; 95 | } 96 | } 97 | } 98 | ?> 99 | -------------------------------------------------------------------------------- /src/classes/MenuBar.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Menubar 34 | * 35 | * The menubar holds some information, depending on the user. 36 | * 37 | * @category Website 38 | * @package Photoshow 39 | * @author Thibaud Rohmer 40 | * @copyright Thibaud Rohmer 41 | * @license http://www.gnu.org/licenses/ 42 | * @link http://github.com/thibaud-rohmer/PhotoShow 43 | */ 44 | 45 | class MenuBar implements HTMLObject{ 46 | 47 | /// True if user is logged in 48 | private $logged_in = false; 49 | 50 | /// True if user is admin 51 | private $admin = false; 52 | 53 | 54 | 55 | /** 56 | * Create menubar 57 | * 58 | * @return void 59 | * @author Thibaud Rohmer 60 | */ 61 | public function __construct(){ 62 | } 63 | 64 | /** 65 | * Display Menubar on website 66 | * 67 | * @return void 68 | * @author Thibaud Rohmer 69 | */ 70 | public function toHTML(){ 71 | echo "\n"; 94 | } 95 | } 96 | ?> -------------------------------------------------------------------------------- /src/classes/Page.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * Page 34 | * 35 | * The page holds all of the data. This class build the entire 36 | * structure of the website, as it is viewed by the user. 37 | * 38 | * @category Website 39 | * @package Photoshow 40 | * @author Thibaud Rohmer 41 | * @copyright Thibaud Rohmer 42 | * @license http://www.gnu.org/licenses/ 43 | * @link http://github.com/thibaud-rohmer/PhotoShow 44 | */ 45 | 46 | abstract class Page implements HTMLObject 47 | { 48 | /** 49 | * Generate an insanely beautiful header. 50 | * TODO: Title 51 | * 52 | * @return void 53 | * @author Thibaud Rohmer 54 | */ 55 | public function header($head_content=NULL){ 56 | echo ""; 57 | echo ""; 58 | echo "\n"; 59 | echo "\n"; 60 | echo "\n"; 61 | echo "".Settings::$name."\n"; 62 | echo "\n"; 63 | echo ""; 64 | 65 | /// CSS 66 | echo "\n"; 67 | echo "\n"; 68 | echo "\n"; 69 | 70 | echo "\n"; 71 | echo "\n"; 72 | echo "\n"; 73 | echo "\n"; 74 | 75 | echo "\n"; 76 | 77 | /// Trick to hide "only-script" parts 78 | echo ""; 79 | 80 | /// JS 81 | echo "\n"; 82 | echo "\n"; 83 | echo "\n"; 84 | echo "\n"; 85 | echo "\n"; 86 | echo "\n"; 87 | echo "\n"; 88 | 89 | 90 | echo "\n"; 91 | echo "\n"; 92 | echo "\n"; 93 | echo "\n"; 94 | echo "\n"; 95 | echo "\n"; 96 | 97 | 98 | 99 | if(CurrentUser::$admin || CurrentUser::$uploader){ 100 | echo "\n"; 101 | echo "\n"; 102 | echo "\n"; 103 | } 104 | 105 | // Add specific head content if needed 106 | if ($head_content) 107 | { 108 | echo $head_content; 109 | } 110 | 111 | if (!empty(Settings::$tracking_code_include)) { 112 | readfile(Settings::$tracking_code_include); 113 | } 114 | 115 | echo ""; 116 | 117 | } 118 | } 119 | ?> 120 | -------------------------------------------------------------------------------- /src/classes/RSS.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @package PhotoShow 25 | * @category Website 26 | * @author Franck Royer 27 | * @copyright 2012 Franck Royer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * RSS 34 | * 35 | * Implements functions to work with a Guest Token (or key) 36 | * Read the account from the Guest Token XML file, 37 | * edit it, and save it. 38 | * 39 | * 40 | * @package PhotoShow 41 | * @category Website 42 | * @author Thibaud Rohmer 43 | * @copyright Thibaud Rohmer 44 | * @license http://www.gnu.org/licenses/ 45 | * @link http://github.com/thibaud-rohmer/PhotoShow 46 | */ 47 | class RSS 48 | { 49 | 50 | private $feed = ""; 51 | 52 | public function __construct($feed){ 53 | $this->feed = $feed; 54 | } 55 | 56 | 57 | public function item($n,$p,$d){ 58 | return "$n$p\n"; 59 | } 60 | 61 | public function add($name,$path,$desc){ 62 | $item = $this->item($name,$path,$desc); 63 | $current = file_get_contents($this->feed); 64 | file_put_contents($this->feed,$item.$current, LOCK_EX); 65 | } 66 | 67 | public function clean(){ 68 | // read the file in an array. 69 | $file = file($this->feed); 70 | 71 | // slice first 20 elements. 72 | $file = array_slice($file,0,20); 73 | 74 | // write back to file after joining. 75 | file_put_contents($this->feed,implode("",$file)); 76 | } 77 | 78 | public function toXML(){ 79 | if(!Settings::$rss) 80 | return; 81 | 82 | $this->clean(); 83 | header("Content-type: text/xml"); 84 | echo " 85 | 86 | 87 | ".Settings::$name." 88 | ".Settings::$site_address." 89 | Photos Feed 90 | en-us"; 91 | readfile($this->feed); 92 | echo ""; 93 | } 94 | } -------------------------------------------------------------------------------- /src/classes/RegisterPage.php: -------------------------------------------------------------------------------- 1 | . 23 | * 24 | * @category Website 25 | * @package Photoshow 26 | * @author Thibaud Rohmer 27 | * @copyright 2011 Thibaud Rohmer 28 | * @license http://www.gnu.org/licenses/ 29 | * @link http://github.com/thibaud-rohmer/PhotoShow 30 | */ 31 | 32 | /** 33 | * RegisterPage 34 | * 35 | * This is the page that lets the user create an account. 36 | * If there is no account created yet, the acount created 37 | * here will be the admin. 38 | * 39 | * @category Website 40 | * @package Photoshow 41 | * @author Thibaud Rohmer 42 | * @copyright Thibaud Rohmer 43 | * @license http://www.gnu.org/licenses/ 44 | * @link http://github.com/thibaud-rohmer/PhotoShow 45 | */ 46 | 47 | 48 | class RegisterPage extends Page 49 | { 50 | 51 | private $admin_account; 52 | 53 | private $included; 54 | 55 | /** 56 | * Create Register Page 57 | * 58 | * @author Thibaud Rohmer 59 | */ 60 | public function __construct($admin_account = false, $included = false){ 61 | $this->admin_account = $admin_account; 62 | $this->included = $included; 63 | } 64 | 65 | /** 66 | * Display Register Page on website 67 | * 68 | * @return void 69 | * @author Thibaud Rohmer 70 | */ 71 | public function toHTML(){ 72 | 73 | if (!$this->included && Settings::$noregister) { 74 | header("Location: /?t=Login"); 75 | exit(); 76 | }elseif (Settings::$forcehttps && !$_SERVER["HTTPS"]){ 77 | header("HTTP/1.1 301 Moved Permanently"); 78 | header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); 79 | exit(); 80 | }else{ 81 | 82 | if(!$this->included){ 83 | 84 | $this->header(); 85 | 86 | echo "
\n"; 87 | echo "
"; 88 | 89 | if($this->admin_account){ 90 | echo "

".Settings::_("register","mainacc")."

"; 91 | }else{ 92 | echo "

".Settings::_("register","register")."

"; 93 | } 94 | echo "
"; 95 | echo "
\n"; 96 | 97 | }else{ 98 | echo "\n"; 99 | } 100 | 101 | echo "
102 |

".Settings::_("account","createaccount")."

103 |
104 | 105 | 106 |
107 | "; 108 | 109 | 110 | /// Password 111 | echo "
112 | 113 | 114 |
"; 115 | 116 | /// Verif 117 | echo "
118 | 119 | 120 |
"; 121 | 122 | 123 | echo "
"; 124 | echo "
\n"; 125 | 126 | if(!$this->included){ 127 | echo " ".Settings::_("register","back").""; 128 | } 129 | 130 | } 131 | } 132 | } 133 | ?> 134 | -------------------------------------------------------------------------------- /src/js/admin.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file implements admin. 3 | * 4 | * Javascript 5 | * 6 | * LICENSE: 7 | * 8 | * This file is part of PhotoShow. 9 | * 10 | * PhotoShow is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * PhotoShow is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with PhotoShow. If not, see . 22 | * 23 | * @package PhotoShow 24 | * @category Website 25 | * @author Thibaud Rohmer 26 | * @copyright 2011 Thibaud Rohmer 27 | * @license http://www.gnu.org/licenses/ 28 | * @link http://github.com/thibaud-rohmer/PhotoShow 29 | */ 30 | 31 | 32 | function init_dropzone(){ 33 | $('.dropzone:not(.fileUploadInitialized)').addClass('fileUploadInitialized').fileUploadUI({ 34 | uploadTable: $('#files'), 35 | downloadTable: $('#files'), 36 | buildUploadRow: function (files, index) { 37 | return $('' + files[index].name + '<\/td>' + 38 | '
<\/div><\/td>' + 39 | '' + 40 | '