From 4b2e8a48c845d02f9e30d2ec47bff475fb8107bf Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Sat, 7 Jan 2017 20:51:29 -0500 Subject: [PATCH 01/44] Hide RSS button if RSS is disabled in settings --- src/classes/MainPage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/MainPage.php b/src/classes/MainPage.php index 62307ac..3c84fd8 100644 --- a/src/classes/MainPage.php +++ b/src/classes/MainPage.php @@ -131,7 +131,9 @@ public function toHTML(){ // Menu left echo "\n"; + echo "\n\n\n\n"; } } } From e0ad038469b9959b1e1cae8dde211c6ff78fe319 Mon Sep 17 00:00:00 2001 From: Vladimir Panteleev Date: Wed, 27 Jul 2016 14:16:18 +0000 Subject: [PATCH 10/44] - Provider::get_orientation_degrees returns 90, 180 or -90. Do not ignore -90 and rotate image. - Fix and enable thumbnail rotation Fixes #307 Fixes #312 --- src/classes/Provider.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/classes/Provider.php b/src/classes/Provider.php index e632ee4..0f5aa7e 100755 --- a/src/classes/Provider.php +++ b/src/classes/Provider.php @@ -66,7 +66,7 @@ public static function get_orientation_degrees ($filename) break; case 5: case 6: - $degrees = -90; + $degrees = 270; break; case 7: case 8: @@ -90,7 +90,7 @@ private static function autorotate_jpeg ($filename) { $raw_image = imagecreatefromjpeg($filename); $degrees = Provider::get_orientation_degrees ($filename); - if($degrees > 0){ + if($degrees != 0){ $rotated_image = imagerotate($raw_image, $degrees, 0); if($rotated_image == NULL){ return $raw_image; @@ -243,7 +243,7 @@ public static function thumb($file) if (File::Type($file) == 'Image' && Provider::get_orientation_degrees($file) != 0) { $thumb->SourceImageToGD(); - //$thumb->ra = Provider::get_orientation_degrees($file); + $thumb->ra = 360 - Provider::get_orientation_degrees($file); $thumb->Rotate(); } @@ -293,7 +293,7 @@ public static function small($file) if (File::Type($file) == 'Image' && Provider::get_orientation_degrees($file) != 0) { $thumb->SourceImageToGD(); - //$thumb->ra = Provider::get_orientation_degrees($file); + $thumb->ra = 360 - Provider::get_orientation_degrees($file); $thumb->Rotate(); } From 24f6dacbe24061b0ec675923258d21a6b3db5e6b Mon Sep 17 00:00:00 2001 From: Christophe CHAUVET Date: Sun, 5 Apr 2015 16:25:15 +0200 Subject: [PATCH 11/44] W3C validation fixes - Changed DOCTYPE to HTML 5 - The charset attribute on the link element is obsolete. Use an HTTP Content-Type header on the linked resource instead. - Element ul not allowed as child of element ul in this context. - Stray end tag span. - An img element must have an alt attribute, except under certain conditions. Fixes #278 --- src/classes/BoardDir.php | 2 +- src/classes/BoardItem.php | 2 +- src/classes/Image.php | 2 +- src/classes/ImageBar.php | 2 +- src/classes/Infos.php | 8 +------- src/classes/Menu.php | 4 ++-- src/classes/Page.php | 14 +++++++------- src/stylesheets/structure.css | 6 +++--- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/src/classes/BoardDir.php b/src/classes/BoardDir.php index 0f2d15c..847c77e 100644 --- a/src/classes/BoardDir.php +++ b/src/classes/BoardDir.php @@ -84,7 +84,7 @@ public function toHTML(){ echo "
"; echo "
"; echo "url\">"; - echo "img\"/ >"; + echo "img\" alt=\"\"/ >"; echo ""; } diff --git a/src/classes/ImageBar.php b/src/classes/ImageBar.php index 7cf885f..8e95430 100644 --- a/src/classes/ImageBar.php +++ b/src/classes/ImageBar.php @@ -116,4 +116,4 @@ public function toHTML(){ } -?> \ No newline at end of file +?> \ No newline at end of file diff --git a/src/classes/Infos.php b/src/classes/Infos.php index 1c0df99..0f43956 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -87,7 +87,7 @@ public function __construct(){ $this->thumb =""; $this->dl = "?t=BDl&f=$this->path"; }else{ - $this->thumb =""; + $this->thumb ="Folder"; $this->dl = "?t=Zip&f=$this->path"; } @@ -146,7 +146,6 @@ public function toHTML(){ echo "
"; - // Outputting Facebook Like Button if(Settings::$like){ $rootURL = Settings::$site_address; @@ -154,13 +153,8 @@ public function toHTML(){ echo ''; } - echo "
"; - - - echo "\n"; - echo "
"; } diff --git a/src/classes/Menu.php b/src/classes/Menu.php index 86ef658..158707c 100644 --- a/src/classes/Menu.php +++ b/src/classes/Menu.php @@ -138,12 +138,12 @@ public function toHTML(){ echo ""; echo ""; - echo "".htmlentities($this->title, ENT_QUOTES ,'UTF-8').""; - echo "\n"; + echo "".htmlentities($this->title, ENT_QUOTES ,'UTF-8').""; foreach($this->items as $item) $item->toHTML(); + echo "\n"; echo "\n"; } } diff --git a/src/classes/Page.php b/src/classes/Page.php index 5313110..6f8b321 100644 --- a/src/classes/Page.php +++ b/src/classes/Page.php @@ -53,7 +53,7 @@ abstract class Page implements HTMLObject * @author Thibaud Rohmer */ public function header($head_content=NULL){ - echo "\n"; + echo ""; echo ""; echo "\n"; echo "\n"; @@ -67,12 +67,12 @@ public function header($head_content=NULL){ echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; /// Trick to hide "only-script" parts echo ""; @@ -96,7 +96,7 @@ public function header($head_content=NULL){ if(CurrentUser::$admin || CurrentUser::$uploader){ - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; } diff --git a/src/stylesheets/structure.css b/src/stylesheets/structure.css index ad7c92c..1e0fbee 100644 --- a/src/stylesheets/structure.css +++ b/src/stylesheets/structure.css @@ -325,7 +325,7 @@ div.commentdelete { padding-bottom: 20px; } -ul.selected > ul{ +ul.selected > li > ul{ position: relative; visibility: visible; left: auto; @@ -343,7 +343,7 @@ li { padding: 0; } -.pure-menu li a{ +.pure-menu a{ font-family: 'Roboto-Bold',sans-serif; font-size: 13px; color: black; @@ -353,7 +353,7 @@ li.currentSelected{ } -li.currentSelected a{ +li.currentSelected > a{ color: #0085be !important; } From 2df386deec14d78732816d72030b3ec65fca12a1 Mon Sep 17 00:00:00 2001 From: welshy136 Date: Thu, 16 Apr 2015 12:13:14 +0100 Subject: [PATCH 12/44] Fix upload group permissions Allow users in upload group but not in root to be able to upload Fixes #278 --- src/classes/Infos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Infos.php b/src/classes/Infos.php index 0f43956..be934f0 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -115,7 +115,7 @@ public function toHTML(){ } echo "
"; - if(CurrentUser::$admin && is_dir(CurrentUser::$path)){ + if((CurrentUser::$admin || CurrentUser::$uploader) && is_dir(CurrentUser::$path)){ /// Upload Images form echo "

Upload

"; echo "
"; From 873bfd563112a46744c447a12c065187773a218d Mon Sep 17 00:00:00 2001 From: welshy136 Date: Thu, 16 Apr 2015 14:49:12 +0100 Subject: [PATCH 13/44] Add: Delete confirmation dialog Added Delete confirmation dialog instead of deleting straight away Fixes #278 --- src/classes/Infos.php | 7 ++++--- src/classes/Page.php | 1 + src/js/confirmation.js | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 src/js/confirmation.js diff --git a/src/classes/Infos.php b/src/classes/Infos.php index be934f0..68c8598 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -43,6 +43,8 @@ * @license http://www.gnu.org/licenses/ * @link http://github.com/thibaud-rohmer/PhotoShow */ + + class Infos implements HTMLObject { @@ -74,7 +76,6 @@ public function __construct(){ $this->exif = new Exif(CurrentUser::$path); - if(!Settings::$nocomments){ $this->comments = new Comments(CurrentUser::$path); } @@ -93,11 +94,11 @@ public function __construct(){ if(CurrentUser::$admin){ - $this->deleteform = "
+ $this->deleteform = "
w, ENT_QUOTES ,'UTF-8')."\"> -
"; +
"; } } diff --git a/src/classes/Page.php b/src/classes/Page.php index 6f8b321..1a82731 100644 --- a/src/classes/Page.php +++ b/src/classes/Page.php @@ -92,6 +92,7 @@ public function header($head_content=NULL){ echo "\n"; echo "\n"; echo "\n"; + echo "\n"; diff --git a/src/js/confirmation.js b/src/js/confirmation.js new file mode 100644 index 0000000..d9d1138 --- /dev/null +++ b/src/js/confirmation.js @@ -0,0 +1,38 @@ +/** + * This file implements a confirmation dialog. + * + * Javascript + * + * LICENSE: + * + * This file is part of PhotoShow. + * + * PhotoShow is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PhotoShow is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with PhotoShow. If not, see . + * + * @package PhotoShow + * @category Website + * @author Thibaud Rohmer + * @copyright 2011 Thibaud Rohmer + * @license http://www.gnu.org/licenses/ + * @link http://github.com/thibaud-rohmer/PhotoShow + */ + +function executeOnSubmit(button) +{ + var res = confirm("Do you really wish to "+button+" this item?"); + if(res) + return true; + else + return false; +} \ No newline at end of file From 750630be0d2eeafedbff67a14b417186e3857115 Mon Sep 17 00:00:00 2001 From: welshy136 Date: Fri, 17 Apr 2015 12:57:58 +0100 Subject: [PATCH 14/44] Add: More confirmations Added confirmation dialogs for rename, create, download, permissions and tokens buttons Fixes #278 --- src/classes/GuestToken.php | 2 +- src/classes/Infos.php | 2 +- src/classes/Judge.php | 12 ++++++------ src/js/confirmation.js | 18 +++++++++++++++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/classes/GuestToken.php b/src/classes/GuestToken.php index 688a4ca..f1ec4e2 100644 --- a/src/classes/GuestToken.php +++ b/src/classes/GuestToken.php @@ -358,7 +358,7 @@ public function toHTML(){ foreach(self::findAll() as $t){ echo ""; echo ""; - echo "
\n"; + echo "\n"; echo ""; echo ""; echo "
"; diff --git a/src/classes/Infos.php b/src/classes/Infos.php index 68c8598..32f7919 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -112,7 +112,7 @@ public function toHTML(){ echo "
".htmlentities($this->title, ENT_QUOTES ,'UTF-8')."
"; if(!Settings::$nodownload){ /// Zip button - echo "\n"; + echo "\n"; } echo ""; diff --git a/src/classes/Judge.php b/src/classes/Judge.php index 1943ead..e77a4af 100644 --- a/src/classes/Judge.php +++ b/src/classes/Judge.php @@ -376,7 +376,7 @@ public function infodirtoHTML($dir){ $ret = ""; if(strlen($w)>1){ - $ret .= "
+ $ret .= "
@@ -392,7 +392,7 @@ public function infodirtoHTML($dir){ /// Folder name if(is_dir($dir)){ - $ret .= " + $ret .= "
@@ -428,15 +428,15 @@ public function toHTML(){ echo "

Access

"; if($this->public){ echo "
"; - echo "
"; + echo "
"; echo "
".Settings::_("judge","public")."
"; }else{ echo "
"; - echo "
"; + echo "
"; echo "
".Settings::_("judge","priv")."
"; } - echo ""; + echo ""; if(! $this->public){ echo "

".Settings::_("judge","accounts")."

"; echo "
    "; @@ -481,7 +481,7 @@ public function toHTML(){ } echo "
"; } - echo ""; + echo ""; } } echo "
\n"; diff --git a/src/js/confirmation.js b/src/js/confirmation.js index d9d1138..383f0e7 100644 --- a/src/js/confirmation.js +++ b/src/js/confirmation.js @@ -30,7 +30,23 @@ function executeOnSubmit(button) { - var res = confirm("Do you really wish to "+button+" this item?"); + switch(button){ + case 'rename': + case 'create': + case 'download': + case 'delete': + var res = confirm("Do you really wish to "+button+" this item?") + break; + case 'permissions': + var res = confirm("Do you want to change Permissions?") + break; + case 'token': + var res = confirm("Do you want to create a guest token?") + break; + case 'tokenDelete': + var res = confirm("Do you want to delete this guest token?") + break; + }; if(res) return true; else From e3c5851e532fde0fea507c442eaa7856c2a8be64 Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Sun, 8 Jan 2017 09:30:25 -0500 Subject: [PATCH 15/44] Bugfix: completely disable registration, don't just hide the page Fixes #207 --- src/classes/RegisterPage.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/classes/RegisterPage.php b/src/classes/RegisterPage.php index 08c8d8c..10190b8 100644 --- a/src/classes/RegisterPage.php +++ b/src/classes/RegisterPage.php @@ -70,7 +70,10 @@ public function __construct($admin_account = false, $included = false){ */ public function toHTML(){ - if (Settings::$forcehttps && !$_SERVER["HTTPS"]){ + if (!$this->included && Settings::$noregister) { + header("Location: /?t=Login"); + exit(); + }elseif (Settings::$forcehttps && !$_SERVER["HTTPS"]){ header("HTTP/1.1 301 Moved Permanently"); header("Location: https://".$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); exit(); From b6ae43f8bf656d7451a09cdd182f27bd994eb990 Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Sun, 8 Jan 2017 09:33:59 -0500 Subject: [PATCH 16/44] W3C validation fix: A slash was not immediately followed by >. --- src/classes/BoardDir.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/BoardDir.php b/src/classes/BoardDir.php index 847c77e..4d01664 100644 --- a/src/classes/BoardDir.php +++ b/src/classes/BoardDir.php @@ -84,7 +84,7 @@ public function toHTML(){ echo "
"; echo "
"; echo "url\">"; - echo "img\" alt=\"\"/ >"; + echo "img\" alt=\"\" />"; echo "
"; (array)$name = explode('/', $this->path); echo htmlentities(end($name), ENT_QUOTES ,'UTF-8'); From 953becfef603038e13a528d47bfae6d7bf2254a8 Mon Sep 17 00:00:00 2001 From: Guillaume Boudreau Date: Sun, 8 Jan 2017 09:43:22 -0500 Subject: [PATCH 17/44] Bugfix: textfields in Info panel were too long (overlapping their buttons) --- src/stylesheets/structure.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stylesheets/structure.css b/src/stylesheets/structure.css index 1e0fbee..8f320fc 100644 --- a/src/stylesheets/structure.css +++ b/src/stylesheets/structure.css @@ -412,3 +412,6 @@ div#deleteform{ top: 20px; } +.infos .pure-g > .pure-u-1-2 > input[type=text] { + width: 100%; +} From 932e58d9a67680ee7dd796b55c404bb123be5032 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 11 May 2015 00:49:18 +0200 Subject: [PATCH 18/44] Revert "Fix first accented character of folders stripped out" This reverts commit 13d10be2a914c51f059215d2774f100f4a2d55ac. --- src/classes/BoardHeader.php | 2 +- src/classes/Menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/BoardHeader.php b/src/classes/BoardHeader.php index 16b3179..ddaf4f3 100644 --- a/src/classes/BoardHeader.php +++ b/src/classes/BoardHeader.php @@ -60,7 +60,7 @@ class BoardHeader{ */ public function __construct(){ $this->path = urlencode(File::a2r(CurrentUser::$path)); - $this->title = is_dir(CurrentUser::$path)?end(explode('/', CurrentUser::$path)):end(explode('/', dirname(CurrentUser::$path))); + $this->title = is_dir(CurrentUser::$path)?basename(CurrentUser::$path):basename(dirname(CurrentUser::$path)); $this->w = File::a2r(CurrentUser::$path); } diff --git a/src/classes/Menu.php b/src/classes/Menu.php index 158707c..49e2bf8 100644 --- a/src/classes/Menu.php +++ b/src/classes/Menu.php @@ -82,7 +82,7 @@ public function __construct($dir=null,$level=0){ } /// Set variables - $this->title = end(explode('/', $dir)); + $this->title = basename($dir); $this->webdir= urlencode(File::a2r($dir)); $this->path = File::a2r($dir); From edcadcef08e41412e7fc516d7e882d6ebaef59ea Mon Sep 17 00:00:00 2001 From: Anarky Date: Sat, 9 May 2015 21:15:21 +0200 Subject: [PATCH 19/44] Remove all dead code that was using basename --- src/classes/Admin.php | 7 ------ src/classes/AdminPanel.php | 50 -------------------------------------- src/classes/Board.php | 6 +---- src/classes/Exif.php | 4 --- src/classes/Judge.php | 13 ---------- 5 files changed, 1 insertion(+), 79 deletions(-) diff --git a/src/classes/Admin.php b/src/classes/Admin.php index ddee9bb..6d6f85b 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -230,13 +230,6 @@ public static function move(){ return; } - if(is_file($from) || $type=="directory"){ - @rename($from,$to."/".basename($from)); - return; - } - - - /// We are moving multiple files $files = scandir($from); foreach($files as $file){ diff --git a/src/classes/AdminPanel.php b/src/classes/AdminPanel.php index e8fd141..6cebe2f 100644 --- a/src/classes/AdminPanel.php +++ b/src/classes/AdminPanel.php @@ -42,8 +42,6 @@ class AdminPanel { - private $infos; - private $j; private $isfile = false; @@ -56,54 +54,6 @@ public function __construct(){ } $this->j = new Judge($file); - if(is_array($file)){ - $this->infos = ""; - - }else{ - $this->infos = $this->infodirtoHTML($file); - } - } - - - public function infodirtoHTML($dir){ - $w = File::a2r($dir); - $ret = ""; - -// $ret .= ""; - - - /// Folder name - if(strlen($w)>1 && $this->isfile){ - $ret .= "
- - - - -
"; - }else{ - $ret .= "
- - - -
"; - - /// Upload Images form - - - /*$ret .= "
"; - $w=File::a2r(CurrentUser::$path); - $ret .= "
- - - - -
".Settings::_("adminpanel","upload")."
-
"; - */ - } - return $ret; - } public function toHTML(){ diff --git a/src/classes/Board.php b/src/classes/Board.php index e66b3ff..7f38c39 100644 --- a/src/classes/Board.php +++ b/src/classes/Board.php @@ -46,9 +46,6 @@ */ class Board implements HTMLObject { - /// Board title : name of the directory listed - private $title; - /// Header public $header_content; @@ -90,8 +87,7 @@ public function __construct($path=NULL){ $this->path = dirname($path); } - $this->title = basename($this->path); - $this->header = new BoardHeader($this->title,$this->path); + $this->header = new BoardHeader(); $this->files = Menu::list_files($this->path); $this->dirs = Menu::list_dirs($this->path); diff --git a/src/classes/Exif.php b/src/classes/Exif.php index 32a822d..4344740 100644 --- a/src/classes/Exif.php +++ b/src/classes/Exif.php @@ -51,9 +51,6 @@ class Exif implements HTMLObject /// Exif values, nice and clean private $exif=array(); - /// Name of the file - private $filename; - /** * Create Exif class * @@ -94,7 +91,6 @@ public function __construct($file=null){ } } } - $this->filename = basename($file); } /** diff --git a/src/classes/Judge.php b/src/classes/Judge.php index e77a4af..7f5aca6 100644 --- a/src/classes/Judge.php +++ b/src/classes/Judge.php @@ -181,19 +181,6 @@ private function set_rights(){ } } - /** - * Returns path to associated file - */ - public static function associated_file($rf){ - $associated_dir = File::r2a(File::a2r(dirname($rf),Settings::$thumbs_dir),Settings::$photos_dir); - if(basename($rf) == ".rights.xml"){ - return $associated_dir; - }else{ - return $associated_dir."/".substr(basename($rf),1,-11); - } - } - - /** * Check recursively if a file is viewable in a folder, and returns path to that file. */ From cfc70082704fc52a5d4305ab569192777e008f63 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 11 May 2015 01:30:41 +0200 Subject: [PATCH 20/44] Fix all problematic basename calls in classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit basename will strip the first character if it is accented. This commit add the mb_basename function, taken from https://bugs.php.net/bug.php?id=37268 This fixes: - file renaming on upload when a file with the same name already exists - comments and permissions ("éa.jpg" and "a.jpg" used the same file for comments/permissions) - photospheres folder ("éPhotoSpheres" was matching "PhotoSpheres") - file and folder name on the right menu - file and folder name in the rename textbox - filename in the left menu, the header and the RSS file - filename when downloading a picture or a zip The only remaining problem is with the exif infos on the right menu, but it is an external call to exif_read_data(). --- index.php | 7 +++++++ src/classes/AdminUpload.php | 2 +- src/classes/BoardHeader.php | 2 +- src/classes/Comments.php | 2 +- src/classes/File.php | 4 ++-- src/classes/ImageBar.php | 2 +- src/classes/Infos.php | 2 +- src/classes/Judge.php | 4 ++-- src/classes/Menu.php | 2 +- src/classes/Provider.php | 6 +++--- src/classes/Settings.php | 2 +- 11 files changed, 21 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index aea7e84..d1c4b74 100644 --- a/index.php +++ b/index.php @@ -63,6 +63,13 @@ function protect_user_send_var($var){ return addslashes($var); } +/// workaround for splitting basename whith beginning utf8 multibyte char +/// See https://bugs.php.net/bug.php?id=37268 +function mb_basename($filepath, $suffix = NULL) { + $splited = preg_split ( '/\//', rtrim ( $filepath, '/ ' ) ); + return substr ( basename ( 'X' . $splited [count ( $splited ) - 1], $suffix ), 1 ); +} + if (!get_magic_quotes_gpc()){ $_POST = protect_user_send_var($_POST); diff --git a/src/classes/AdminUpload.php b/src/classes/AdminUpload.php index d28e113..784a1c6 100644 --- a/src/classes/AdminUpload.php +++ b/src/classes/AdminUpload.php @@ -129,7 +129,7 @@ public function upload(){ $name = $_FILES["images"]["name"][$key]; $info = pathinfo($name); - $base_name = basename($name,'.'.$info['extension']); + $base_name = mb_basename($name,'.'.$info['extension']); // Check filetype if(!in_array(strtolower($info['extension']),$allowedExtensions)){ diff --git a/src/classes/BoardHeader.php b/src/classes/BoardHeader.php index ddaf4f3..fd6d17c 100644 --- a/src/classes/BoardHeader.php +++ b/src/classes/BoardHeader.php @@ -60,7 +60,7 @@ class BoardHeader{ */ public function __construct(){ $this->path = urlencode(File::a2r(CurrentUser::$path)); - $this->title = is_dir(CurrentUser::$path)?basename(CurrentUser::$path):basename(dirname(CurrentUser::$path)); + $this->title = is_dir(CurrentUser::$path)?mb_basename(CurrentUser::$path):mb_basename(dirname(CurrentUser::$path)); $this->w = File::a2r(CurrentUser::$path); } diff --git a/src/classes/Comments.php b/src/classes/Comments.php index 09b5cce..4d61d4f 100644 --- a/src/classes/Comments.php +++ b/src/classes/Comments.php @@ -86,7 +86,7 @@ public function __construct($file=null){ /// Build relative path to comments file if(is_file($file)){ - $comments = dirname($basepath)."/.".basename($file)."_comments.xml"; + $comments = dirname($basepath)."/.".mb_basename($file)."_comments.xml"; }else{ $comments = $basepath."/.comments.xml"; } diff --git a/src/classes/File.php b/src/classes/File.php index c5ceaf4..d14a9d8 100644 --- a/src/classes/File.php +++ b/src/classes/File.php @@ -107,9 +107,9 @@ public static function Extension($file){ public static function Name($file){ $info = pathinfo($file); if(isset($info['extension'])){ - return basename($file,'.'.$info['extension']); + return mb_basename($file,'.'.$info['extension']); }else{ - return basename($file); + return mb_basename($file); } } diff --git a/src/classes/ImageBar.php b/src/classes/ImageBar.php index 8e95430..9c8c3c2 100644 --- a/src/classes/ImageBar.php +++ b/src/classes/ImageBar.php @@ -63,7 +63,7 @@ public function __construct($fs=false){ $file = urlencode(File::a2r(CurrentUser::$path)); - $this->photosphere = (basename(dirname(CurrentUser::$path)) == "PhotoSpheres"); + $this->photosphere = (mb_basename(dirname(CurrentUser::$path)) == "PhotoSpheres"); $this->buttons['prev'] = "?p=p&f=".$file; $this->awesome['prev'] = ""; diff --git a/src/classes/Infos.php b/src/classes/Infos.php index 32f7919..8df8380 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -81,7 +81,7 @@ public function __construct(){ } $this->path = urlencode(File::a2r(CurrentUser::$path)); - $this->title = basename(CurrentUser::$path); + $this->title = mb_basename(CurrentUser::$path); $this->w = File::a2r(CurrentUser::$path); if(is_file(CurrentUser::$path)){ diff --git a/src/classes/Judge.php b/src/classes/Judge.php index 7f5aca6..8a8246d 100644 --- a/src/classes/Judge.php +++ b/src/classes/Judge.php @@ -128,7 +128,7 @@ private function set_path($f){ $this->webpath = "&f=".urlencode($basepath); if(is_file($f)){ - $rightsfile = dirname($basepath)."/.".basename($f)."_rights.xml"; + $rightsfile = dirname($basepath)."/.".mb_basename($f)."_rights.xml"; }else{ $rightsfile = $basepath."/.rights.xml"; } @@ -368,7 +368,7 @@ public function infodirtoHTML($dir){
- +
diff --git a/src/classes/Menu.php b/src/classes/Menu.php index 49e2bf8..52fd9dd 100644 --- a/src/classes/Menu.php +++ b/src/classes/Menu.php @@ -82,7 +82,7 @@ public function __construct($dir=null,$level=0){ } /// Set variables - $this->title = basename($dir); + $this->title = mb_basename($dir); $this->webdir= urlencode(File::a2r($dir)); $this->path = File::a2r($dir); diff --git a/src/classes/Provider.php b/src/classes/Provider.php index 0f5aa7e..2920c26 100755 --- a/src/classes/Provider.php +++ b/src/classes/Provider.php @@ -221,7 +221,7 @@ public static function thumb($file) if (Judge::is_public($file)) { $r = new RSS(Settings::$conf_dir."/photos_feed.txt"); $webpath = Settings::$site_address."?f=".urlencode(File::a2r($file)); - $r->add(basename($file),$webpath, ""); + $r->add(mb_basename($file),$webpath, ""); } /// Create directories @@ -362,7 +362,7 @@ public static function Image($file,$thumb=false,$large=false,$output=true,$dl=fa if($output){ if($dl){ - header('Content-Disposition: attachment; filename="'.basename($file).'"'); + header('Content-Disposition: attachment; filename="'.mb_basename($file).'"'); }else{ $expires = 60*60*24*14; $last_modified_time = filemtime($path); @@ -483,7 +483,7 @@ public static function Zip($dir){ // Close and send to user header('Content-Type: application/zip'); - header("Content-Disposition: attachment; filename=\"".htmlentities(basename($dir), ENT_QUOTES ,'UTF-8').".zip\""); + header("Content-Disposition: attachment; filename=\"".htmlentities(mb_basename($dir), ENT_QUOTES ,'UTF-8').".zip\""); // Store the current working directory and change to the albums directory $cwd = getcwd(); diff --git a/src/classes/Settings.php b/src/classes/Settings.php index 7b8c7d4..1aa907a 100644 --- a/src/classes/Settings.php +++ b/src/classes/Settings.php @@ -543,7 +543,7 @@ public function toHTML(){ echo ""; foreach($this->folders as $f){ $p = htmlentities(File::a2r($f), ENT_QUOTES ,'UTF-8'); - echo ""; + echo ""; } echo ""; echo "\n"; From 423a2c1899e01e775968451bfaac3a83a6ced38f Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 10 May 2015 00:57:05 +0200 Subject: [PATCH 21/44] Add title for buttons, with an option to deactivate it This add title for buttons on the ImageBar, RSS and right menubar. --- inc/loc/default.ini | 14 ++++++++++++++ src/classes/ImageBar.php | 2 +- src/classes/Infos.php | 4 ++-- src/classes/Judge.php | 4 ++-- src/classes/MainPage.php | 6 +++--- src/classes/Settings.php | 9 +++++++-- 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/inc/loc/default.ini b/inc/loc/default.ini index 6addf33..64f0173 100644 --- a/inc/loc/default.ini +++ b/inc/loc/default.ini @@ -14,6 +14,7 @@ comment = "Comments" nocomment = "Remove Comments Panel" download = "Downloads" nodownload = "Remove downloading links" +button_title = "Title for buttons" numcomments = "Number of comments in Admin Stats" numcomm = "Comments" sens = "Max number of images displayed when hovering an album" @@ -126,3 +127,16 @@ tokens = "Guest Tokens" deletetoken = "Delete" createtoken = "Create Guest Token" +[buttons] +prev = "Previous" +back = "Back" +img = "View" +get = "Download" +slideshow = "Start slideshow" +pshere = "Photo Sphere" +next = "Next" +pause = "Pause slideshow" +play = "Play slideshow" +stop = "Stop slideshow" +rss = "RSS feed" +menuright = "Menu" diff --git a/src/classes/ImageBar.php b/src/classes/ImageBar.php index 9c8c3c2..0baaf99 100644 --- a/src/classes/ImageBar.php +++ b/src/classes/ImageBar.php @@ -110,7 +110,7 @@ public function __construct($fs=false){ */ public function toHTML(){ foreach($this->buttons as $name=>$url){ - echo "".$this->awesome[$name].""; + echo "".$this->awesome[$name].""; } } diff --git a/src/classes/Infos.php b/src/classes/Infos.php index 8df8380..dfae773 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -96,7 +96,7 @@ public function __construct(){ $this->deleteform = "
w, ENT_QUOTES ,'UTF-8')."\"> - +
"; } @@ -112,7 +112,7 @@ public function toHTML(){ echo "
".htmlentities($this->title, ENT_QUOTES ,'UTF-8')."
"; if(!Settings::$nodownload){ /// Zip button - echo "\n"; + echo "\n"; } echo "
"; diff --git a/src/classes/Judge.php b/src/classes/Judge.php index 8a8246d..178bc24 100644 --- a/src/classes/Judge.php +++ b/src/classes/Judge.php @@ -415,11 +415,11 @@ public function toHTML(){ echo "

Access

"; if($this->public){ echo "
"; - echo "
"; + echo "
"; echo "
".Settings::_("judge","public")."
"; }else{ echo "
"; - echo "
"; + echo "
"; echo "
".Settings::_("judge","priv")."
"; } diff --git a/src/classes/MainPage.php b/src/classes/MainPage.php index 12e9eab..8e4c145 100644 --- a/src/classes/MainPage.php +++ b/src/classes/MainPage.php @@ -131,15 +131,15 @@ public function toHTML(){ // Menu left echo "\n"; - echo ""; + echo ""; // Menu right echo ""; echo "

Options

"; - $options = array("noregister","forcehttps","nocomments","nodownload","reverse_menu","l33t","rss"); + $options = array("noregister","forcehttps","nocomments","nodownload","reverse_menu","l33t","rss","button_title"); foreach($options as $val){ $c = (Settings::$$val)?"checked":""; echo "
\n"; From 8acf30f84901fde67c3759774eedf71aaeb3d66e Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 10 May 2015 02:16:56 +0200 Subject: [PATCH 22/44] Display a spinner when loading a Photo Sphere The spinnger was generated on http://spiffygif.com/ with the following parameters: - 8 lines - corners 1.0 - trail 50 - rotate 0 - no shadow, halo - black foreground, white background - length 0 - width 10 - radius 18 Their license (at the bottom on the "Docs" tab) permits to use it on this project. --- inc/js/photosphere/sphere.js | 2 +- inc/spiffygif.gif | Bin 0 -> 28617 bytes src/stylesheets/structure.css | 7 +++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 inc/spiffygif.gif diff --git a/inc/js/photosphere/sphere.js b/inc/js/photosphere/sphere.js index 742b0a9..2305c01 100644 --- a/inc/js/photosphere/sphere.js +++ b/inc/js/photosphere/sphere.js @@ -13,7 +13,7 @@ function Photosphere(image){ } Photosphere.prototype.loadPhotosphere = function(holder){ - holder.innerHTML = "wait..."; + holder.innerHTML = "
Loading...
"; this.holder = holder; diff --git a/inc/spiffygif.gif b/inc/spiffygif.gif new file mode 100644 index 0000000000000000000000000000000000000000..1872d1f79897946a29658de9f2913252c987fccd GIT binary patch literal 28617 zcmeI*dsvM5|3C11j?Jk|HJy{0&Sz69NtmW4Ib^4rl7uNqB^iVeW~OtJ(ow>c4$}b> zNi23sl7zBp(_$;3oHoS9(*9m{cKhyrc7NZ0exL8}dtLkCkNs<}+PN?Dcs=ju>wVul ze}Sj-tPoek75NGI{AXff;?${AG#c&W$B)g;%`%xxE|))l{ya7|_V(@DH*el-X=%A| z;X-3$V|{(Shlj_G9XoV&b+>Na>gDBCR#sM2RFs>Wo0XNdd-v|RxVY-->iqot0|yQW zg~CmnHmzK_lE>qnIC0{`hYt@PJm~D~Y-?*9A0L1B?%nIxuSZ8mU%q_F<#Ky_dmlf3 z+}_?kHa6DL(b3)A-PhN5@7}$kp`pRS!QtWI{{H@+o}Q;qpZ@xv{N*2CuE4+N3NYSd zQ8;8a!uW-}gv0Z5cjI#GZJ8Jp{B-Njzv1)O1R+cy+X(tzGD*`^l$vF58&lqtLNzjo zmSzb#dudY_-ZQs5){L9#5YZ?T3g>5cA zBTiY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10 May 2015 07:57:02 +0200 Subject: [PATCH 23/44] Fix thumbnails size option not saved --- src/classes/Settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Settings.php b/src/classes/Settings.php index 3663c0d..a189e6c 100644 --- a/src/classes/Settings.php +++ b/src/classes/Settings.php @@ -493,7 +493,7 @@ public function toHTML(){ /// Thumbs size echo "
- +
\n"; echo "

Social Networks

"; From 3077db2076300730d795d6d5f636dd6bf14eb026 Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 10 May 2015 08:14:27 +0200 Subject: [PATCH 24/44] Fix visually two elements on the settings page --- src/classes/Settings.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Settings.php b/src/classes/Settings.php index a189e6c..015e8b5 100644 --- a/src/classes/Settings.php +++ b/src/classes/Settings.php @@ -501,7 +501,7 @@ public function toHTML(){ /// Facebook Button $c = (Settings::$like)?"checked":""; echo "
- +
\n"; @@ -517,7 +517,7 @@ public function toHTML(){ echo "".Settings::_("settings","video_comment").""; echo "
"; $c = (Settings::$encode_video)?"checked":""; - echo "\n"; + echo "\n"; echo "
"; From 30cd4ae4ed507cef273afceaaf5068856c6db741 Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 10 May 2015 23:12:25 +0200 Subject: [PATCH 25/44] AdminUpload: remove dead code --- src/classes/AdminUpload.php | 71 ------------------------------------- 1 file changed, 71 deletions(-) diff --git a/src/classes/AdminUpload.php b/src/classes/AdminUpload.php index 784a1c6..c09e179 100644 --- a/src/classes/AdminUpload.php +++ b/src/classes/AdminUpload.php @@ -43,34 +43,6 @@ */ class AdminUpload { - /// Directories where we can upload - public $dirs = array(); - - /// What have we done ? - public $done; - - /// Currently selected dir - private $selected_dir; - - /** - * Create upload page - * - * @author Thibaud Rohmer - */ - public function __construct(){ - - /// Get all subdirs - $list_dirs = Menu::list_dirs(Settings::$photos_dir,true); - - foreach ($list_dirs as $dir){ - $this->dirs[] = File::a2r($dir); - } - - if(isset(CurrentUser::$path)){ - $this->selected_dir = File::a2r(CurrentUser::$path); - } - - } /** * Upload files on the server @@ -161,48 +133,5 @@ public function upload(){ } } - /** - * Display upload page on website - * - * @author Thibaud Rohmer - */ - public function toHTML(){ - echo "

Upload

"; - - echo "
"; - echo "
Images
"; - echo "
Location
"; - echo "
New Dir
"; - echo "
Rights
"; - echo "
Public
"; - echo "
Groups
"; - foreach(Group::findAll() as $group){ - echo ""; - } - echo "
"; - - echo "
Users
"; - foreach(Account::findAll() as $account){ - echo ""; - } - echo "
"; - echo "
"; - - echo "
"; - - } - } ?> \ No newline at end of file From 5a84fe6db4820b3f51f075c63d80cc2e0b6db879 Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 10 May 2015 23:54:45 +0200 Subject: [PATCH 26/44] Make more elements translatable --- inc/loc/default.ini | 30 ++++++++++++++++++++++++++++-- src/classes/Account.php | 6 +++--- src/classes/AdminAbout.php | 2 +- src/classes/AdminStats.php | 27 ++++++++++++++++++++++----- src/classes/Comments.php | 2 +- src/classes/Exif.php | 2 +- src/classes/Group.php | 4 ++-- src/classes/Infos.php | 2 +- src/classes/Judge.php | 8 ++++---- src/classes/MenuBar.php | 4 ++-- src/classes/Settings.php | 12 ++++++------ 11 files changed, 71 insertions(+), 28 deletions(-) diff --git a/inc/loc/default.ini b/inc/loc/default.ini index 64f0173..6888a4e 100644 --- a/inc/loc/default.ini +++ b/inc/loc/default.ini @@ -1,32 +1,41 @@ [settings] settings = "Settings" +global = "Global" title = "Title" site_address= "Site root URL" buttons = "Buttons" +s_networks = "Social Networks" fb = "Facebook" facebook_appid = "Facebook Application ID" fbappid = "AppID" plusone = "Google +1" register = "Register" +options = "Options" noregister = "Block Registration" forcehttps = "Force https for login and registration" comment = "Comments" nocomment = "Remove Comments Panel" download = "Downloads" +nocomments = "Remove comments" nodownload = "Remove downloading links" +reverse_menu = "Reverse menu order" +rss = "RSS feed" button_title = "Title for buttons" numcomments = "Number of comments in Admin Stats" numcomm = "Comments" sens = "Max number of images displayed when hovering an album" +thumbs_size = "Thumbnails size (px)" images = "Images" language = "Language" +user_theme = "Theme" submit = "Submit" generate = "Generate recursively thumbs and web images" folder = "Folder" all = "All" gener = "Generate" -video_comment = "PhotoShow only displays videos in WebM. You can set the encoding to convert to other formats than webm" -encode_video = "Encode Video Activate" +video = "Video" +video_comment = "PhotoShow only displays videos in WebM. You can set the encoding to convert to other formats than webm." +encode_video = "Encode Video" ffmpeg_path = "FFmpeg path" ffmpeg_option = "Encoding option" @@ -41,6 +50,7 @@ oldpass = "Old Pass" submit = "Save" or = "or" cancel = "Cancel" +key = "Key" [delete] delete = "Delete" @@ -56,9 +66,17 @@ groups = "Edit Groups" account = "Edit Accounts" back = "Back to Website" +[statistics] +heading = "Statistics" +summary = "Summary" +by_age = "(by age)" +items = "Items" +gen_items = "Generated items" + [jsaccounts] accounts = "Accounts" groups = "Groups" +groupname_label = "Group name:" groupname = "Name" addgroup = "Create Group" @@ -66,6 +84,7 @@ addgroup = "Create Group" logintitle = "Login" login = "Login" pass = "Password" +submit = "Submit" or = "or" register = "Register" back = "Back to Website" @@ -85,16 +104,20 @@ back = "Back to Website" [menubar] logged = "logged as" +not_logged = "Not logged in!" login = "LOGIN" register = "REGISTER" logout = "LOGOUT" admin = "ADMIN" +account = "ACCOUNT" powered = "Powered by" [bin] delete = "Delete" [judge] +infos = "Infos" +access = "Access" public = "This item is public." gopriv = "Go Private" priv = "This item is private." @@ -102,11 +125,13 @@ gopub = "Go Public" accounts = "Allowed accounts" groups = "Allowed groups" set = "Set Rights" +exif = "Exif" [adminpanel] rename = "Rename" new = "New Folder" create = "Create" +upload_heading = "Upload" upload = "Upload images here" [boardheader] @@ -117,6 +142,7 @@ albums = "Albums" images = "Images" [comments] +comment = "Comment" comments = "Comments" anonymous = "Anonymous" submit = "Post Comment" diff --git a/src/classes/Account.php b/src/classes/Account.php index ba76cf0..b424ef6 100644 --- a/src/classes/Account.php +++ b/src/classes/Account.php @@ -444,7 +444,7 @@ public function toHTML(){ $this->header(); echo "
"; - echo "

Account

"; + echo "

".Settings::_("jsaccounts","accounts")."

"; echo "
"; if(CurrentUser::$admin){ @@ -509,9 +509,9 @@ public function toHTML(){ } echo "\n"; - /// Login + /// Key echo "
- + get_key(), ENT_QUOTES ,'UTF-8')."\">
"; diff --git a/src/classes/AdminAbout.php b/src/classes/AdminAbout.php index 0cff3a0..766d1e8 100644 --- a/src/classes/AdminAbout.php +++ b/src/classes/AdminAbout.php @@ -61,7 +61,7 @@ public function __construct(){ public function toHTML(){ echo "
"; - echo "

About

"; + echo "

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

"; echo "
"; echo "

PhotoShow

"; diff --git a/src/classes/AdminStats.php b/src/classes/AdminStats.php index 44484f4..2b4f98f 100644 --- a/src/classes/AdminStats.php +++ b/src/classes/AdminStats.php @@ -87,26 +87,43 @@ public function Calculate() { } + private function _getRealName($name) { + switch ($name) { + case "Users": + return Settings::_("jsaccounts","accounts"); + case "Groups": + return Settings::_("jsaccounts","groups"); + case "Items": + return Settings::_("statistics","items"); + case "Generated items": + return Settings::_("statistics","gen_items"); + case "Albums": + return Settings::_("board","albums"); + default: + return $name; + } + } + public function toHTML(){ self::Calculate() ; echo "
"; - echo "

Statistics

"; + echo "

".Settings::_("statistics","heading")."

"; echo "
"; - echo "

Stats

"; + echo "

".Settings::_("statistics","summary")."

"; echo "
    "; echo ""; echo ""; foreach($this->stats as $name=>$val){ - echo ""; + echo ""; } echo ""; echo "
    ".htmlentities($name, ENT_QUOTES ,'UTF-8')."".htmlentities($val, ENT_QUOTES ,'UTF-8')."
    ".AdminStats::_getRealName($name)."".htmlentities($val, ENT_QUOTES ,'UTF-8')."
    "; echo "
"; - echo "

Accounts (by age)

"; + echo "

".Settings::_("jsaccounts","accounts")." ".Settings::_("statistics","by_age")."

"; echo "
    "; echo ""; echo ""; @@ -118,7 +135,7 @@ public function toHTML(){ echo ""; - echo "

    Comments (by age)

    "; + echo "

    ".Settings::_("comments","comments")." ".Settings::_("statistics","by_age")."

    "; echo "
      "; echo "
    "; echo ""; diff --git a/src/classes/Comments.php b/src/classes/Comments.php index 4d61d4f..575145b 100644 --- a/src/classes/Comments.php +++ b/src/classes/Comments.php @@ -233,7 +233,7 @@ public function toHTML(){ if(isset(CurrentUser::$account)){ echo "
    \n"; echo ""; - echo "\n"; + echo "\n"; echo "
    \n"; echo "\n"; } diff --git a/src/classes/Exif.php b/src/classes/Exif.php index 4344740..ff35dc6 100644 --- a/src/classes/Exif.php +++ b/src/classes/Exif.php @@ -118,7 +118,7 @@ private function init_wanted(){ */ public function toHTML(){ if($this->exif){ - echo '

    Exif

    '; + echo '

    '.Settings::_("judge","exif").'

    '; echo "
    "; foreach($this->exif as $name=>$value){ echo ""; diff --git a/src/classes/Group.php b/src/classes/Group.php index 8732b6f..176029f 100644 --- a/src/classes/Group.php +++ b/src/classes/Group.php @@ -280,12 +280,12 @@ public function toHTML(){ $groupaccounts = array(); - echo "

    Groups

    "; + echo "

    ".Settings::_("jsaccounts","groups")."

    "; echo "

    ".Settings::_("jsaccounts","addgroup")."

    - +
    diff --git a/src/classes/Infos.php b/src/classes/Infos.php index dfae773..e360d30 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -118,7 +118,7 @@ public function toHTML(){ if((CurrentUser::$admin || CurrentUser::$uploader) && is_dir(CurrentUser::$path)){ /// Upload Images form - echo "

    Upload

    "; + echo "

    ".Settings::_("adminpanel","upload_heading")."

    "; echo "
    "; echo "w, ENT_QUOTES ,'UTF-8')."\" action='?a=Upl' method='POST' enctype='multipart/form-data'> diff --git a/src/classes/Judge.php b/src/classes/Judge.php index 178bc24..3c88aad 100644 --- a/src/classes/Judge.php +++ b/src/classes/Judge.php @@ -408,11 +408,11 @@ public function toHTML(){ - echo "

    Infos

    "; + echo "

    ".Settings::_("judge","infos")."

    "; echo $this->infos; - echo "

    Access

    "; + echo "

    ".Settings::_("judge","access")."

    "; if($this->public){ echo "
    "; echo "
    "; @@ -455,7 +455,7 @@ public function toHTML(){ echo "\n"; echo ""; - echo "

    Guest Tokens

    "; + echo "

    ".Settings::_("token","tokens")."

    "; if(!$this->multi){ // Token creation $tokens = GuestToken::find_for_path($this->file); @@ -464,7 +464,7 @@ public function toHTML(){ $i=0; foreach($tokens as $token){ $i++; - echo "Guest Token $i
    \n"; + echo "".Settings::_("token","token")." $i
    \n"; } echo ""; } diff --git a/src/classes/MenuBar.php b/src/classes/MenuBar.php index bde1f8a..d21cac3 100644 --- a/src/classes/MenuBar.php +++ b/src/classes/MenuBar.php @@ -77,11 +77,11 @@ public function toHTML(){ if(CurrentUser::$admin){ echo ""; } - echo ""; + echo ""; echo "\n"; }else{ - echo " Not logged in !
    "; + echo "".Settings::_("menubar","not_logged")."
    "; // User not logged in echo ""; diff --git a/src/classes/Settings.php b/src/classes/Settings.php index 015e8b5..7a65db2 100644 --- a/src/classes/Settings.php +++ b/src/classes/Settings.php @@ -429,12 +429,12 @@ public static function gener_all($folder){ public function toHTML(){ echo "
    "; - echo "

    Settings

    "; + echo "

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

    "; echo "
    "; /// Site Title echo "\n"; - echo "

    Global

    + echo "

    ".Settings::_("settings","global")."

    @@ -476,7 +476,7 @@ public function toHTML(){ echo ""; echo "
    "; - echo "

    Options

    "; + echo "

    ".Settings::_("settings","options")."

    "; $options = array("noregister","forcehttps","nocomments","nodownload","reverse_menu","l33t","rss","button_title"); foreach($options as $val){ $c = (Settings::$$val)?"checked":""; @@ -496,7 +496,7 @@ public function toHTML(){
    \n"; - echo "

    Social Networks

    "; + echo "

    ".Settings::_("settings","s_networks")."

    "; /// Facebook Button $c = (Settings::$like)?"checked":""; @@ -510,14 +510,14 @@ public function toHTML(){
    "; - echo "

    Video

    "; + echo "

    ".Settings::_("settings","video")."

    "; /// Encode Video echo "".Settings::_("settings","video_comment").""; echo "
    "; $c = (Settings::$encode_video)?"checked":""; - echo "\n"; + echo "\n"; echo "
    "; From b28fca4d80dd2eac41c1acc102605b75cfa6e3e3 Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 17 May 2015 09:21:26 +0200 Subject: [PATCH 27/44] Javascript: disable hotkeys inside input and textarea tags Some keys (left, right, up, space, escape) are always listened, making writing or moving inside the rename input or comment textarea difficult. This fixes #248. --- src/js/keyboard.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/js/keyboard.js b/src/js/keyboard.js index 29dc82c..56aded7 100644 --- a/src/js/keyboard.js +++ b/src/js/keyboard.js @@ -30,6 +30,10 @@ $("document").ready(function(){ $("body").keyup(function(event){ var keyCode = event.which; + + if ($(event.target).is("input") || $(event.target).is("textarea")) + return; + if (keyCode == 0 && event.keyCode != undefined) keyCode = event.keyCode; From 4269f6b6cb6e6e08905dfbd9cd63b2075322de8e Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 19 May 2015 06:52:44 +0200 Subject: [PATCH 28/44] Fix zip name when downloading a directory with accents --- src/classes/Provider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Provider.php b/src/classes/Provider.php index 2920c26..6a9e875 100755 --- a/src/classes/Provider.php +++ b/src/classes/Provider.php @@ -483,7 +483,7 @@ public static function Zip($dir){ // Close and send to user header('Content-Type: application/zip'); - header("Content-Disposition: attachment; filename=\"".htmlentities(mb_basename($dir), ENT_QUOTES ,'UTF-8').".zip\""); + header("Content-Disposition: attachment; filename=\"".mb_basename($dir).".zip\""); // Store the current working directory and change to the albums directory $cwd = getcwd(); From d749631c41723c04216ea1fb19df63cab9fed318 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 19 May 2015 07:09:30 +0200 Subject: [PATCH 29/44] Comments: remove dead code --- src/classes/Comments.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/classes/Comments.php b/src/classes/Comments.php index 575145b..fa4a277 100644 --- a/src/classes/Comments.php +++ b/src/classes/Comments.php @@ -77,8 +77,6 @@ public function __construct($file=null){ /// Set variables $this->file = $file; - $settings = new Settings(); - $basefile = new File($file); $basepath = File::a2r($file); /// Urlencode basepath From 5e5393262c4a94c2bcb08d572bcc6af197213a69 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 19 May 2015 07:18:48 +0200 Subject: [PATCH 30/44] ImagePanel: remove dead code --- src/classes/ImagePanel.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/classes/ImagePanel.php b/src/classes/ImagePanel.php index 32dec59..7568462 100644 --- a/src/classes/ImagePanel.php +++ b/src/classes/ImagePanel.php @@ -32,9 +32,7 @@ /** * ImagePanel * - * The ImagePanel contains one image, and the infos - * about that image (such as EXIF, Comments). - * If the user is logged, it contains even more stuff. + * The ImagePanel contains one image and the navigation buttons. * * @category Website * @package Photoshow @@ -56,12 +54,6 @@ class ImagePanel implements HTMLObject /// Video object private $video; - /// Exif object - private $exif; - - /// Comments object - private $comments; - /// Judge object private $judge; @@ -91,14 +83,6 @@ public function __construct($file=NULL){ /// Create Image object $this->imagebar = new ImageBar($file); - /// Create EXIF object - $this->exif = new Exif($file); - - if(!Settings::$nocomments){ - /// Create Comments object - $this->comments = new Comments($file); - } - $pageURL = Settings::$site_address."/?f=".urlencode(File::a2r($file)); // generate the header - opengraph metatags for facebook @@ -125,10 +109,6 @@ public function toHTML(){ if (!isset($this->image) && !isset($this->video)){ return; } - /* - echo "
    \n"; - $this->exif->toHTML(); - */ if(isset($this->image)){ echo "
    \n"; From 908c936e21607c24805567ded87a6cbaac0b8c10 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 19 May 2015 21:45:43 +0200 Subject: [PATCH 31/44] Fix file comparison when renaming --- src/classes/Admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Admin.php b/src/classes/Admin.php index 6d6f85b..4db7de3 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -216,7 +216,7 @@ public static function move(){ } $from = File::r2a(stripslashes($_POST['pathFrom'])); - $to = File::r2a(stripslashes($_POST['pathTo'])); + $to = dirname($from)."/".stripslashes($_POST['pathTo']); $type = $_POST['move']; if($from == $to){ @@ -225,7 +225,7 @@ public static function move(){ if($type == "rename"){ $thumbsDir = Settings::$thumbs_dir."/".stripslashes($_POST['pathFrom']); - @rename($from,dirname($from)."/".stripslashes($_POST['pathTo'])); + @rename($from,$to); @rename($thumbsDir,dirname($thumbsDir)."/".stripslashes($_POST['pathTo'])); return; } From 947742760532f9d0e525cd828c7dba5185902654 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 13 Jul 2015 09:13:24 +0200 Subject: [PATCH 32/44] Menu::list_files(): fix the search with an option to list all the files Before this commit, Menu::list_files() was returning only files considered to be an image or a video, even with $hidden set to true. Now we can get all the files a directory contains with a new option, in case some code expects the previous behaviour. --- src/classes/Menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Menu.php b/src/classes/Menu.php index 52fd9dd..2c67e81 100644 --- a/src/classes/Menu.php +++ b/src/classes/Menu.php @@ -200,7 +200,7 @@ public static function list_dirs($dir,$rec=false, $hidden=false){ * @return void * @author Thibaud Rohmer */ - public static function list_files($dir,$rec = false, $hidden = false, $stopatfirst = false){ + public static function list_files($dir,$rec = false, $hidden = false, $stopatfirst = false, $all_file_type = false){ /// Directories list $list=array(); @@ -222,7 +222,7 @@ public static function list_files($dir,$rec = false, $hidden = false, $stopatfir /// Content isn't hidden and is a file if($content[0] != '.' || $hidden){ if(is_file($path=$dir."/".$content)){ - if(File::Type($path) && (File::Type($path) == "Image" || File::Type($path)=="Video")){ + if((File::Type($path) && (File::Type($path) == "Image" || File::Type($path)=="Video")) || $all_file_type){ /// Add content to list $list[]=$path; From 41db864d6d2be338b381862ab4179f29ce49d2eb Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 13 Jul 2015 09:13:48 +0200 Subject: [PATCH 33/44] Admin::rec_del(): use the new Menu::list_files() option to delete *everything* Now that Menu::list_files() is fixed, we can use it to effectively delete everything, e.g. a thumbnail folder containing xml metadatas among others files. --- src/classes/Admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Admin.php b/src/classes/Admin.php index 4db7de3..c52abb5 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -281,7 +281,7 @@ public function rec_del($dir){ } $dirs = Menu::list_dirs($dir); - $files = Menu::list_files($dir,false,true); + $files = Menu::list_files($dir,false,true,false,true); foreach($dirs as $d){ Admin::rec_del($d); From 40c5c981ad402d25ae3c37a55e29917003a14c9c Mon Sep 17 00:00:00 2001 From: Anarky Date: Thu, 21 May 2015 09:00:52 +0200 Subject: [PATCH 34/44] Abort renaming if there is already a file with the same new name --- src/classes/Admin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/classes/Admin.php b/src/classes/Admin.php index c52abb5..871ab26 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -223,6 +223,11 @@ public static function move(){ return; } + if(file_exists($to)){ + /// We don't want to overwrite existing data + return; + } + if($type == "rename"){ $thumbsDir = Settings::$thumbs_dir."/".stripslashes($_POST['pathFrom']); @rename($from,$to); From 42bbf8da85a03249a057f8a51663c104a65d94f8 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 26 May 2015 03:58:50 +0200 Subject: [PATCH 35/44] File::Type(): fix the return parameter when using a folder The return of self::Extension($file) was incorrectly checked, thus returning the 0 at the end of the function. This can cause problems, because `"foo" == 0` is true in PHP... --- src/classes/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/File.php b/src/classes/File.php index d14a9d8..8ee42bd 100644 --- a/src/classes/File.php +++ b/src/classes/File.php @@ -127,7 +127,7 @@ public static function Type($file){ } $ext = self::Extension($file); - if(!isset($ext)){ + if(empty($ext)){ return "folder"; } From 860e4b3986a3cfe58e3c988735988096d92f7397 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 26 May 2015 05:10:53 +0200 Subject: [PATCH 36/44] Rename/delete metadatas on file or folder renaming/deletion When a file or folder was renamed or deleted, its metadatas (tokens, xml and thumbnail) were kept. This commit will keep the Thumbs directory consistent with the picture directory. --- src/classes/Admin.php | 84 +++++++++++++++++++++++++++++++++++--- src/classes/GuestToken.php | 11 +++++ 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/src/classes/Admin.php b/src/classes/Admin.php index 871ab26..5a20b18 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -229,9 +229,10 @@ public static function move(){ } if($type == "rename"){ - $thumbsDir = Settings::$thumbs_dir."/".stripslashes($_POST['pathFrom']); + /// Metadatas need to be done first: once moved/deleted, + /// we won't be able to compute from the original file + Admin::manage_metadatas(stripslashes($_POST['pathFrom']), stripslashes($_POST['pathTo'])); @rename($from,$to); - @rename($thumbsDir,dirname($thumbsDir)."/".stripslashes($_POST['pathTo'])); return; } @@ -239,6 +240,8 @@ public static function move(){ $files = scandir($from); foreach($files as $file){ if($file != "." && $file!=".."){ + Admin::manage_metadatas(stripslashes($_POST['pathFrom'])."/".$file, + stripslashes($_POST['pathTo'])."/".$file); @rename($from."/".$file,$to."/".$file); } } @@ -260,12 +263,16 @@ public function delete(){ } if(!is_array($_POST['del'])){ - $del = File::r2a(stripslashes($_POST['del'])); - return Admin::rec_del($del); + $rela_del = stripslashes($_POST['del']); + $del = File::r2a($rela_del); + Admin::manage_metadatas($rela_del); + Admin::rec_del($del); }else{ foreach($_POST['del'] as $todel){ - $del = File::r2a(stripslashes($todel)); - Admin::rec_del($del); + $rela_del = stripslashes($todel); + $del = File::r2a($rela_del); + Admin::manage_metadatas($rela_del); + Admin::rec_del($del); } } } @@ -299,6 +306,71 @@ public function rec_del($dir){ return rmdir($dir); } + /** + * Manage all metadatas (tokens, _*.xml, thumbnails) + * associated to a file or folder + * + * @param string $file + * @param string $to optional parameter for a rename + */ + public function manage_metadatas($file, $to = null){ + $originalFile = File::r2a($file); + $thumbFile = Settings::$thumbs_dir.$file; + $thumbFile_dirname = dirname($thumbFile); + $isVideo = File::Type($originalFile) == "Video"; + + /// Tokens + /// It doesn't make any sense to rename a token: its link might + /// have been already shared, which is now broken because of the + /// file deletion/renaming, so delete them in all case + GuestToken::delete_file_tokens($file); + + /// XML + if(is_file($originalFile)){ + /// XML of folders are inside them, so they will be moved/deleted with the thumbnails + $xml_metadatas = array("comments","rights"); + foreach($xml_metadatas as $xml_metadata){ + $xml_metadata = "_".$xml_metadata.".xml"; + $xml_file = $thumbFile_dirname."/.".mb_basename($file).$xml_metadata; + if (file_exists($xml_file)){ + if (isset($to)) + rename($xml_file, $thumbFile_dirname."/.".mb_basename($to).$xml_metadata); + else + unlink($xml_file); + } + } + } + + /// Thumbnails + $originalFile_obj = new File($originalFile); + if ($isVideo){ + /// A thumbnail of a picture has the same filename of the original file, but it's a jpg for a video + $thumbFile = $thumbFile_dirname."/".$originalFile_obj->name.".jpg"; + $thumbFileTo = $thumbFile_dirname."/".mb_basename($to, $originalFile_obj->extension)."jpg"; + $webFile = $thumbFile_dirname."/".$originalFile_obj->name.".webm"; + $webFileTo = $thumbFile_dirname."/".mb_basename($to, $originalFile_obj->extension)."webm"; + } + else{ + $thumbFileTo = $thumbFile_dirname."/".$to; + $webFile = $thumbFile_dirname."/".$originalFile_obj->name."_small.".$originalFile_obj->extension; + $webFileTo = $thumbFile_dirname."/".mb_basename($to, '.'.$originalFile_obj->extension)."_small.".$originalFile_obj->extension; + } + + if (!file_exists($thumbFile)) + return; + if (isset($to)){ + rename($thumbFile, $thumbFileTo); + // The webfile might not have been created yet, or $file is < 1200px, or $file is a folder: + if (file_exists($webFile)) + rename($webFile, $webFileTo); + } + else{ + Admin::rec_del($thumbFile); + if (file_exists($webFile)) + // Only files can have a webFile, so we don't need rec_del() + unlink($webFile); + } + } /** * Display admin page diff --git a/src/classes/GuestToken.php b/src/classes/GuestToken.php index f1ec4e2..3ee3532 100644 --- a/src/classes/GuestToken.php +++ b/src/classes/GuestToken.php @@ -156,6 +156,17 @@ public static function delete($key){ } } + /** + * Delete all tokens linked to a file + * + * @param string $file (relative path) + */ + public static function delete_file_tokens($file){ + foreach( self::find_for_path($file, true) as $token ) { + self::delete($token['key']); + } + } + /** * Check if a token already exists * From 6aef0eaf3f87d473ab98480817820ab195fdf8d4 Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 26 May 2015 05:18:57 +0200 Subject: [PATCH 37/44] Add a missing string in the default language file --- inc/loc/default.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/loc/default.ini b/inc/loc/default.ini index 6888a4e..449ace4 100644 --- a/inc/loc/default.ini +++ b/inc/loc/default.ini @@ -140,6 +140,7 @@ download = "DOWNLOAD" [board] albums = "Albums" images = "Images" +videos = "Videos" [comments] comment = "Comment" From 681adccfd2ffa2b5eda969746408881588a59ada Mon Sep 17 00:00:00 2001 From: Anarky Date: Tue, 26 May 2015 08:04:10 +0200 Subject: [PATCH 38/44] RSS: don't create or add elements to the file when it is deactived --- src/classes/Provider.php | 2 +- src/classes/RSS.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/classes/Provider.php b/src/classes/Provider.php index 6a9e875..cc3fad9 100755 --- a/src/classes/Provider.php +++ b/src/classes/Provider.php @@ -218,7 +218,7 @@ public static function thumb($file) /// If we need to create a thumb, then this is a new picture if (!$goodThumb) { - if (Judge::is_public($file)) { + if (Judge::is_public($file) && Settings::$rss) { $r = new RSS(Settings::$conf_dir."/photos_feed.txt"); $webpath = Settings::$site_address."?f=".urlencode(File::a2r($file)); $r->add(mb_basename($file),$webpath, ""); diff --git a/src/classes/RSS.php b/src/classes/RSS.php index b790aa0..ec97595 100644 --- a/src/classes/RSS.php +++ b/src/classes/RSS.php @@ -76,8 +76,10 @@ public function clean(){ } public function toXML(){ + if(!Settings::$rss) + return; + $this->clean(); - if(Settings::$rss); header("Content-type: text/xml"); echo " From 86c915f4915e3c47b44f88ce276952bed45a17bb Mon Sep 17 00:00:00 2001 From: Anarky Date: Sun, 12 Jul 2015 23:01:09 +0200 Subject: [PATCH 39/44] Comments: don't show them when we don't have the right --- src/classes/Comments.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/classes/Comments.php b/src/classes/Comments.php index fa4a277..4326249 100644 --- a/src/classes/Comments.php +++ b/src/classes/Comments.php @@ -74,6 +74,10 @@ public function __construct($file=null){ /// No item, no comment ! if(!isset($file) || is_array($file)) return; + + /// No right to view + if(!Judge::view($file)) + return; /// Set variables $this->file = $file; @@ -217,6 +221,9 @@ private function toMainCommentsFile($comment){ * @author Thibaud Rohmer */ public function toHTML(){ + if(!$this->file) + return; + echo '

    '.Settings::_("comments","comments").'

    '; echo "
    "; From 9322872df8fd36b75e7c06b7a709875c1c953051 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 13 Jul 2015 00:17:50 +0200 Subject: [PATCH 40/44] CSS: display #image_panel elements as table-rows There is now a new div (#image_panel_table) inside #image_panel, encompassing #bigimage and #image_bar. This change was made to have dynamic resizing inside #image_panel, which will help to display description (see next commit) with a variable height. It should not change the page rendering, with the exception of a picture displayed with a page height under 300px. Instead of reducing more and more #image_panel, now a scrollbar appears. --- src/classes/Image.php | 2 +- src/classes/ImagePanel.php | 4 ++++ src/stylesheets/structure.css | 23 +++++++++++++---------- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/classes/Image.php b/src/classes/Image.php index fdbba54..d656cfa 100644 --- a/src/classes/Image.php +++ b/src/classes/Image.php @@ -116,7 +116,7 @@ public function toHTML(){ echo ""; echo ""; - echo "\"\""; + echo "\"\""; echo ""; echo "
    "; } diff --git a/src/classes/ImagePanel.php b/src/classes/ImagePanel.php index 7568462..48a170e 100644 --- a/src/classes/ImagePanel.php +++ b/src/classes/ImagePanel.php @@ -110,6 +110,8 @@ public function toHTML(){ return; } + echo "
    \n"; + if(isset($this->image)){ echo "
    \n"; @@ -126,6 +128,8 @@ public function toHTML(){ echo "
    \n"; $this->imagebar->toHTML(); echo "
    \n"; + + echo "
    \n"; } } diff --git a/src/stylesheets/structure.css b/src/stylesheets/structure.css index a6d0b79..d343bff 100644 --- a/src/stylesheets/structure.css +++ b/src/stylesheets/structure.css @@ -256,6 +256,7 @@ left:0; right:0; z-index:10; box-shadow: 0 2px 5px rgba(0,0,0,.35); +overflow: auto; } div.image_panel * a, @@ -268,21 +269,23 @@ padding: 20px 5px 0px 5px; font-size: 10pt; } +div#image_panel_table { + display: table; + width: 100%; + height: 100%; + border-spacing: 5px; + margin-top: -5px; +} + div#bigimage{ - position:absolute; - top:0; - right:0; - bottom:35px; - left:0; + display: table-row; + width: 100%; + height: 100%; } div#image_bar { -position: absolute; -left: 0; -right: 0; -height: 30px; -bottom: 0; +display: table-row; font-size: 15px; text-align: center; } From 73f6a128421a72264fe809acf53ebaf4509e29e8 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 13 Jul 2015 01:16:35 +0200 Subject: [PATCH 41/44] New feature: add a description to a folder or a picture This new feature is optional (but activated by default). A new option added to the right menu permits to write a description, displayed between the image/video and the navigation buttons, or under the header for a folder. When a description is empty, it is hidden using CSS to remove its padding. The Description class is based on the Comments class. --- inc/loc/default.ini | 5 + src/classes/Admin.php | 2 +- src/classes/Board.php | 12 +++ src/classes/CurrentUser.php | 3 + src/classes/Description.php | 194 ++++++++++++++++++++++++++++++++++ src/classes/ImagePanel.php | 14 +++ src/classes/Infos.php | 12 +++ src/classes/JS.php | 4 + src/classes/Settings.php | 7 +- src/js/image_panel.js | 10 ++ src/stylesheets/structure.css | 20 +++- 11 files changed, 280 insertions(+), 3 deletions(-) create mode 100644 src/classes/Description.php diff --git a/inc/loc/default.ini b/inc/loc/default.ini index 449ace4..2563e98 100644 --- a/inc/loc/default.ini +++ b/inc/loc/default.ini @@ -17,6 +17,7 @@ comment = "Comments" nocomment = "Remove Comments Panel" download = "Downloads" nocomments = "Remove comments" +nodescription = "Remove descriptions" nodownload = "Remove downloading links" reverse_menu = "Reverse menu order" rss = "RSS feed" @@ -148,6 +149,10 @@ comments = "Comments" anonymous = "Anonymous" submit = "Post Comment" +[description] +description = "Description" +submit = "Post Description" + [token] token = "Guest Token" tokens = "Guest Tokens" diff --git a/src/classes/Admin.php b/src/classes/Admin.php index 5a20b18..7b8e812 100644 --- a/src/classes/Admin.php +++ b/src/classes/Admin.php @@ -328,7 +328,7 @@ public function manage_metadatas($file, $to = null){ /// XML if(is_file($originalFile)){ /// XML of folders are inside them, so they will be moved/deleted with the thumbnails - $xml_metadatas = array("comments","rights"); + $xml_metadatas = array("comments","rights","description"); foreach($xml_metadatas as $xml_metadata){ $xml_metadata = "_".$xml_metadata.".xml"; $xml_file = $thumbFile_dirname."/.".mb_basename($file).$xml_metadata; diff --git a/src/classes/Board.php b/src/classes/Board.php index 7f38c39..3e0116c 100644 --- a/src/classes/Board.php +++ b/src/classes/Board.php @@ -61,6 +61,9 @@ class Board implements HTMLObject /// Board header, containing the title and some buttons private $header; + /// Description object, containing the description for the folder + private $description; + /// Array of each line of the grid private $boarditems=array(); @@ -133,6 +136,9 @@ public function __construct($path=NULL){ } $this->foldergrid(); + + if(!Settings::$nodescription) + $this->description = new Description($this->path); } @@ -200,6 +206,12 @@ public function toHTML(){ // Output header $this->header->toHTML(); + if(!Settings::$nodescription){ + echo "
    "; + $this->description->toHTML(); + echo "
    "; + } + if(sizeof($this->boardfolders)>0){ echo "
    "; echo "

    ".Settings::_("board","albums")."

    "; diff --git a/src/classes/CurrentUser.php b/src/classes/CurrentUser.php index ddfccf1..77530d3 100755 --- a/src/classes/CurrentUser.php +++ b/src/classes/CurrentUser.php @@ -240,6 +240,9 @@ static public function init(){ case "Com" : Comments::add(CurrentUser::$path,$_POST['content'],$_POST['login']); break; + case "Des" : Description::add(CurrentUser::$path,$_POST['content'],$_POST['login']); + break; + case "Rig" : Judge::edit(CurrentUser::$path,$_POST['users'],isset($_POST['groups'])?$_POST['groups']:null,true); CurrentUser::$action = "Judge"; break; diff --git a/src/classes/Description.php b/src/classes/Description.php new file mode 100644 index 0000000..fa7eece --- /dev/null +++ b/src/classes/Description.php @@ -0,0 +1,194 @@ +. + * + * @category Website + * @package Photoshow + * @author Thibaud Rohmer + * @copyright 2011 Thibaud Rohmer + * @license http://www.gnu.org/licenses/ + * @link http://github.com/thibaud-rohmer/PhotoShow + */ + +/** + * Description + * + * Implements the creating, reading, editing, and + * displaying of the description, from and to an xml + * file. + * The file is stored in + * [Thumbs]/[imagepath]/.[image]_description.xml + * Description Structure: + * - Login + * - Date + * - Content + * + * @category Website + * @package Photoshow + * @author Thibaud Rohmer + * @copyright Thibaud Rohmer + * @license http://www.gnu.org/licenses/ + * @link http://github.com/thibaud-rohmer/PhotoShow + */ +class Description implements HTMLObject +{ + /// Array of the description infos + private $description=array(); + + /// Path to item + private $file; + + /// Path to description file + private $descriptionfile; + + /// Urlencoded version of relative path to item + private $webfile; + + /** + * Read description for item $file + * + * @param string $file + */ + public function __construct($file=null){ + + /// No item, no description ! + if(!isset($file) || is_array($file)) return; + + /// No right to view + if(!Judge::view($file)) + return; + + /// Set variables + $this->file = $file; + $basepath = File::a2r($file); + + /// Urlencode basepath + $this->webfile = urlencode(File::a2r($file)); + + /// Build relative path to description file + if(is_file($file)){ + $description = dirname($basepath)."/.".mb_basename($file)."_description.xml"; + }else{ + $description = $basepath."/.description.xml"; + } + + /// Set absolute path to description file + $this->descriptionfile = File::r2a($description,Settings::$thumbs_dir); + + /// Check that description file exists + if(file_exists($this->descriptionfile)){ + $this->parse_description_file(); + } + } + + /** + * Add a description for item $file + * + * @param string $file + * @param string $login + * @param string $description + */ + public static function add($file,$content,$login=""){ + + /// Just to be really sure... + if( !(CurrentUser::$admin || CurrentUser::$uploader) ){ + return; + } + + /// Get context + $description = new Description($file); + + if(empty($content)){ + /// Description is empty, might as well delete the file + if(file_exists($description->descriptionfile)) + unlink($description->descriptionfile); + return; + } + + /// Store the description + $description->description['login'] = $login; + $description->description['content'] = $content; + $description->description['date'] = date('j-m-y, h-i-s'); + + /// And save it + $description->save(); + } + + + public function save(){ + + $xml = new SimpleXMLElement(''); + + $xml->addChild("login" , $this->description['login']); + $xml->addChild("date" , $this->description['date']); + $xml->addChild("content", $this->description['content']); + + if(!file_exists(dirname($this->descriptionfile))){ + @mkdir(dirname($this->descriptionfile),0750,true); + } + /// Write xml + $xml->asXML($this->descriptionfile); + } + + + /** + * Read content of description file, and + * store it in variables + * + * @return void + */ + private function parse_description_file(){ + $xml = simplexml_load_file($this->descriptionfile); + $this->description['login'] = $xml->login; + $this->description['date'] = $xml->date; + $this->description['content'] = $xml->content; + } + + + /** + * Display description on website + * + * @return void + */ + public function toHTML($forInfosMenu=false){ + if(!$this->file) + return; + + $desc = stripslashes(htmlentities($this->description['content'], ENT_QUOTES ,'UTF-8')); + + if (!$forInfosMenu) + echo nl2br($desc); + else if(CurrentUser::$admin || CurrentUser::$uploader){ + // It's for the Infos menu, but only the admin or an uploader can write a description + echo '

    '.Settings::_("description","description").'

    '; + + echo "
    \n"; + echo ""; + echo "\n"; + echo "
    \n"; + echo "\n"; + } + + } +} + +?> \ No newline at end of file diff --git a/src/classes/ImagePanel.php b/src/classes/ImagePanel.php index 48a170e..9da0a47 100644 --- a/src/classes/ImagePanel.php +++ b/src/classes/ImagePanel.php @@ -54,6 +54,9 @@ class ImagePanel implements HTMLObject /// Video object private $video; + /// Description object + private $description; + /// Judge object private $judge; @@ -80,6 +83,11 @@ public function __construct($file=NULL){ $this->video = new Video($file); } + if(!Settings::$nodescription){ + /// Create Description object + $this->description = new Description($file); + } + /// Create Image object $this->imagebar = new ImageBar($file); @@ -125,6 +133,12 @@ public function toHTML(){ echo "
    \n"; } + if(!Settings::$nodescription){ + echo "
    "; + $this->description->toHTML(); + echo "
    "; + } + echo "
    \n"; $this->imagebar->toHTML(); echo "
    \n"; diff --git a/src/classes/Infos.php b/src/classes/Infos.php index e360d30..627cf3c 100644 --- a/src/classes/Infos.php +++ b/src/classes/Infos.php @@ -56,6 +56,8 @@ class Infos implements HTMLObject private $comments; + private $description; + private $path; private $w; @@ -80,6 +82,10 @@ public function __construct(){ $this->comments = new Comments(CurrentUser::$path); } + if(!Settings::$nodescription){ + $this->description = new Description(CurrentUser::$path); + } + $this->path = urlencode(File::a2r(CurrentUser::$path)); $this->title = mb_basename(CurrentUser::$path); $this->w = File::a2r(CurrentUser::$path); @@ -142,6 +148,12 @@ public function toHTML(){ } echo "
    \n"; + echo "
    \n"; + if(!Settings::$nodescription){ + $this->description->toHTML(true); + } + echo "
    \n"; + echo "
    \n"; echo ""; diff --git a/src/classes/JS.php b/src/classes/JS.php index 5f4ab0c..1f53939 100644 --- a/src/classes/JS.php +++ b/src/classes/JS.php @@ -120,6 +120,10 @@ public function __construct(){ $f->toHTML(); break; + case "Desc": $f = new Description(CurrentUser::$path); + $f->toHTML(); + break; + default: break; } } diff --git a/src/classes/Settings.php b/src/classes/Settings.php index 7a65db2..3dec514 100644 --- a/src/classes/Settings.php +++ b/src/classes/Settings.php @@ -90,6 +90,9 @@ class Settings extends Page /// Remove comments button static public $nocomments = false; + /// Remove description option + static public $nodescription = false; + /// Remove registering options static public $noregister = false; @@ -257,6 +260,7 @@ static public function init($forced = false, $config_file = NULL){ Settings::$noregister = isset($admin_settings['noregister']); Settings::$forcehttps = isset($admin_settings['forcehttps']); Settings::$nocomments = isset($admin_settings['nocomments']); + Settings::$nodescription = isset($admin_settings['nodescription']); Settings::$nodownload = isset($admin_settings['nodownload']); Settings::$l33t = isset($admin_settings['l33t']); Settings::$reverse_menu = isset($admin_settings['reverse_menu']); @@ -378,6 +382,7 @@ public static function set(){ "noregister", "forcehttps", "nocomments", + "nodescription", "nodownload", "loc", "l33t", @@ -477,7 +482,7 @@ public function toHTML(){ echo "
    "; echo "

    ".Settings::_("settings","options")."

    "; - $options = array("noregister","forcehttps","nocomments","nodownload","reverse_menu","l33t","rss","button_title"); + $options = array("noregister","forcehttps","nocomments","nodescription","nodownload","reverse_menu","l33t","rss","button_title"); foreach($options as $val){ $c = (Settings::$$val)?"checked":""; echo "
    \n"; diff --git a/src/js/image_panel.js b/src/js/image_panel.js index 2b23009..1fc5a37 100644 --- a/src/js/image_panel.js +++ b/src/js/image_panel.js @@ -170,6 +170,7 @@ function init_image_panel(){ $(".linear_panel").scrollTo($(".linear_panel .selected")).scrollTo("-="+$(".linear_panel").width()/2); init_comments(); + init_description(); init_slideshow_panel(); } @@ -183,6 +184,15 @@ function init_comments(){ }); } +function init_description(){ + $("#description_form form").submit(function(){ + $.post($(this).attr('action') + "&j=Desc",$(this).serialize(),function(data){ + $('.description').html(data); + }); + return false; + }); +} + $("document").ready(function(){ init_image_panel(); }); \ No newline at end of file diff --git a/src/stylesheets/structure.css b/src/stylesheets/structure.css index d343bff..b3dd1d2 100644 --- a/src/stylesheets/structure.css +++ b/src/stylesheets/structure.css @@ -198,7 +198,8 @@ div.linear_panel { .linear_panel h1, .linear_panel h2, .linear_panel > .sectionvid, -.linear_panel > .sectiondir +.linear_panel > .sectiondir, +.linear_panel > .description { display: none !important; } @@ -425,3 +426,20 @@ div#deleteform{ .infos .pure-g > .pure-u-1-2 > input[type=text] { width: 100%; } + +/* Description */ + +.panel > .description{ + padding-left: 40px; + padding-top: 20px; + font-size: 22px; +} + +#image_panel_table > .description{ + display: table-row; + text-align: center; +} + +.description:empty{ + display: none !important; +} From 0fa6a660dd78d2c72b32f1be880d131fffa74562 Mon Sep 17 00:00:00 2001 From: Anarky Date: Mon, 13 Jul 2015 02:43:10 +0200 Subject: [PATCH 42/44] Update French translation --- inc/loc/francais.ini | 71 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/inc/loc/francais.ini b/inc/loc/francais.ini index 9271da6..78995c8 100644 --- a/inc/loc/francais.ini +++ b/inc/loc/francais.ini @@ -1,27 +1,41 @@ [settings] -settings = "Param&eagrave;tres" +settings = "Paramètres" +global = "Général" title = "Titre" +site_address= "URL de la racine du site" buttons = "Boutons" +s_networks = "Réseaux sociaux" fb = "Facebook" +facebook_appid = "Facebook Application ID" +fbappid = "AppID" plusone = "Google +1" register = "Inscriptions" +options = "Options" noregister = "Bloquer les inscriptions" forcehttps = "Forcer HTTPS pour les inscriptions et identifications" comment = "Comms" nocomment = "Supprimer le panneau de commentaires" download = "Archives" +nocomments = "Bloquer les commentaires" +nodescription = "Bloquer les descriptions" nodownload = "Bloquer le téléchargement de fichiers" +reverse_menu = "Inverser l'ordre du menu" +rss = "Flux RSS" +button_title = "Titre pour les boutons" numcomments = "Nombre de commentaires sur la page de stats" numcomm = "Comms" sens = "Nombre maximal d'images affichées au survol d'album" +thumbs_size = "Taille des miniatures (px)" images = "Images" language = "Langue" +user_theme = "Thème" submit = "Valider" -generate = "Générer les vignettes et images 800x600 (récursif)" +generate = "Générer les vignettes et images (récursif)" folder = "Dossier" all = "Tout" gener = "Générer" -video_comment = "PhotoShow affiche uniquement les vidéos au format Webm. Tu peux activer l'encodage pour les autres formats" +video = "Vidéo" +video_comment = "PhotoShow affiche uniquement les vidéos au format WebM. Vous pouvez définir l'encodage pour les autres formats." encode_video = "Encodage vidéo" ffmpeg_path = "Chemin ffmpeg" ffmpeg_option = "Options ffmpeg" @@ -29,7 +43,7 @@ ffmpeg_option = "Options ffmpeg" [account] createaccount = "Créer un compte" account = "Compte" -editing = "Edition du compte : " +editing = "Édition du compte : " name = "Nom" email = "Courriel" password = "Mot de passe" @@ -37,6 +51,7 @@ oldpass = "Ancien mdp" submit = "Sauver" or = "ou" cancel = "Annuler" +key = "Clef" [delete] delete = "Supprimer" @@ -44,16 +59,25 @@ path = "Chemin" submit = "Supprimer" [adminmenu] -about = "À propos..." -stats = "Afficher statistiques" -settings = "Préférences" +about = "À propos" +stats = "Statistiques" +tokens = "Jetons d'authentification" +settings = "Paramètres" account = "Comptes" groups = "Groupes" back = "Retour au site" +[statistics] +heading = "Statistiques" +summary = "Résumé" +by_age = "(par âge)" +items = "Objets" +gen_items = "Objets générés" + [jsaccounts] accounts = "Comptes" groups = "Groupes" +groupname_label = "Nom du groupe :" groupname = "Nom" addgroup = "Créer le groupe" @@ -81,16 +105,20 @@ back = "Retourner au site" [menubar] logged = "connecté en tant que" +not_logged = "Non connecté(e)" login = "CONNEXION" register = "INSCRIPTION" logout = "DÉCONNEXION" admin = "PRÉFÉRENCES" +account = "COMPTE" powered = "Ce site utilise" [bin] delete = "Supprimer" [judge] +infos = "Infos" +access = "Accès" public = "Cet élément est public." gopriv = "Passer privé" priv = "Cet élément est privé." @@ -98,11 +126,13 @@ gopub = "Passer public" accounts = "Comptes autorisés" groups = "Groupes autorisés" set = "Valider" +exif = "Exif" [adminpanel] rename = "Renommer" new = "Nouveau dossier" create = "Créer" +upload_heading = "Ajout" upload = "Ajouter des images" [boardheader] @@ -111,7 +141,34 @@ download = "TÉLÉCHARGER" [board] albums = "Albums" images = "Images" +videos = "Vidéos" [comments] +comment = "Commentaire" +comments = "Commentaires" anonymous = "Anonyme" submit = "Commenter" + +[description] +description = "Description" +submit = "Enregistrer" + +[token] +token = "Jeton invité" +tokens = "Jetons d'authentification" +deletetoken = "Supprimer" +createtoken = "Créer un jeton" + +[buttons] +prev = "Précédent" +back = "Retour" +img = "Afficher" +get = "Télécharger" +slideshow = "Démarrer le diaporama" +pshere = "Photo Sphere" +next = "Suivant" +pause = "Mettre en pause le diaporama" +play = "Reprendre le diaporama" +stop = "Quitter le diaporama" +rss = "Flux RSS" +menuright = "Menu" From c1e002498736621a43f55af8cfe2a0ee3fbeef6d Mon Sep 17 00:00:00 2001 From: Anarky Date: Thu, 30 Jul 2015 20:44:59 +0200 Subject: [PATCH 43/44] Fix comments and description saving when they contain an ampersand When a comment or a description contained an ampersand, their saving was throwing a warning: "PHP Warning: SimpleXMLElement::addChild(): unterminated entity reference" An XML with an empty content ("") was created. This fixes this problem; a thorough explanation can be read here: http://stackoverflow.com/a/555039 --- src/classes/Comments.php | 2 +- src/classes/Description.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Comments.php b/src/classes/Comments.php index 4326249..c541e1f 100644 --- a/src/classes/Comments.php +++ b/src/classes/Comments.php @@ -163,7 +163,7 @@ public function save(){ $c = $xml->addChild("comment"); $c->addChild("login" , $comment->login); $c->addChild("date" , $comment->date); - $c->addChild("content" , $comment->content); + $c->content = $comment->content; } if(!file_exists(dirname($this->commentsfile))){ diff --git a/src/classes/Description.php b/src/classes/Description.php index fa7eece..365dfe0 100644 --- a/src/classes/Description.php +++ b/src/classes/Description.php @@ -140,7 +140,7 @@ public function save(){ $xml->addChild("login" , $this->description['login']); $xml->addChild("date" , $this->description['date']); - $xml->addChild("content", $this->description['content']); + $xml->content = $this->description['content']; if(!file_exists(dirname($this->descriptionfile))){ @mkdir(dirname($this->descriptionfile),0750,true); From 99aa9fdb087e0b2a4e8d35690ea80c442a90dc3e Mon Sep 17 00:00:00 2001 From: Anarky Date: Thu, 30 Jul 2015 23:56:19 +0200 Subject: [PATCH 44/44] Videos: take all available space, like images The change in Video.php to set a width was mandatory for 4:3 screens, otherwise the video stretched outside the screen. --- src/classes/Video.php | 36 +++++++++++++++++------------------ src/stylesheets/structure.css | 8 +++++++- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/classes/Video.php b/src/classes/Video.php index b523eb1..944cc7b 100644 --- a/src/classes/Video.php +++ b/src/classes/Video.php @@ -50,7 +50,7 @@ class Video implements HTMLObject * Create Video * * @param string $file - * @author Cédric Levasseur + * @author C�dric Levasseur */ public function __construct($file=NULL,$forcebig = false){ @@ -77,7 +77,7 @@ public function __construct($file=NULL,$forcebig = false){ * * @param string $file * @return pid of the executed command (only linux) - * @author Cédric Levasseur/Franck Royer + * @author C�dric Levasseur/Franck Royer */ public function ExecInBackground($cmd) { error_log('DEBUG/Video: Background Execution : '.$cmd,0); @@ -129,8 +129,8 @@ public function GetScaledDimension($file, $x = 0, $y = 0){ exec(Settings::$ffmpeg_path." -i ".escapeshellarg($file)." 2>&1|grep 'Stream #...([^)]*): Video:'", $output); $line = $output[0]; preg_match('/, ([0-9]+)x([0-9]+), /', $line, $matches); - $orig_x = intval($matches[1]); - $orig_y = intval($matches[2]); + $orig_x = intval($matches[1]); + $orig_y = intval($matches[2]); //error_log('DEBUG/Video: dimension of '.$file.' is '.$orig_x.'x'.$orig_y); @@ -161,11 +161,11 @@ public function GetScaledDimension($file, $x = 0, $y = 0){ /** - * Asynchronous Convert all Video format to video/mp4 + * Asynchronous Convert all Video format to video/mp4 * * Use ffmpeg for conversion * @return void - * @author Cédric Levasseur + * @author C�dric Levasseur */ public static function FastEncodeVideo($file) { @@ -176,13 +176,13 @@ public static function FastEncodeVideo($file) { $file_file = new File($file); $thumb_path_no_ext = Settings::$thumbs_dir.dirname(File::a2r($file))."/".$file_file->name; - $thumb_path_mp4 = $thumb_path_no_ext.'.mp4'; + $thumb_path_mp4 = $thumb_path_no_ext.'.mp4'; $thumb_path_jpg = $thumb_path_no_ext.'.jpg'; // Check if thumb folder exist - if(!file_exists(dirname($thumb_path_mp4))){ - @mkdir(dirname($thumb_path_mp4),0755,true); + if(!file_exists(dirname($thumb_path_mp4))){ + @mkdir(dirname($thumb_path_mp4),0755,true); } @@ -199,17 +199,17 @@ public static function FastEncodeVideo($file) { if (self::NoJob($file))// We check that first to allow the clean of old job files { - if (!file_exists($thumb_path_mp4) || filectime($file) > filectime($thumb_path_mp4)){ - if ($file_file->extension !="mp4") { - ///Convert video to mp4 format in Thumbs folder + if (!file_exists($thumb_path_mp4) || filectime($file) > filectime($thumb_path_mp4)){ + if ($file_file->extension !="mp4") { + ///Convert video to mp4 format in Thumbs folder //TODO: Max job limit - $u = Settings::$ffmpeg_path.' -i '.escapeshellarg($file).' '.Settings::$ffmpeg_option.' -y '.escapeshellarg($thumb_path_mp4); + $u = Settings::$ffmpeg_path.' -i '.escapeshellarg($file).' '.Settings::$ffmpeg_option.' -y '.escapeshellarg($thumb_path_mp4); $pid = self::ExecInBackground($u); self::CreateJob($file, $pid); } else { - ///Copy original mp4 video to Thumbs folder - copy($file,$thumb_path_mp4); + ///Copy original mp4 video to Thumbs folder + copy($file,$thumb_path_mp4); } } } @@ -297,7 +297,7 @@ public function VideoDiv($width='100%',$height='100%',$control=false){ if ($control) { $c = ' controls="controls"'; } - echo ''; + echo ''; echo 'Your browser does not support the video tag.
    '; echo 'Please upgrade your brower or Download the codec Download'; echo ''; @@ -308,10 +308,10 @@ public function VideoDiv($width='100%',$height='100%',$control=false){ * Display the video on the website * * @return void - * @author Cédric Levasseur + * @author C�dric Levasseur */ public function toHTML(){ - self::VideoDiv(320,'',true); + self::VideoDiv(400,400,true); } } diff --git a/src/stylesheets/structure.css b/src/stylesheets/structure.css index b3dd1d2..c4ad9eb 100644 --- a/src/stylesheets/structure.css +++ b/src/stylesheets/structure.css @@ -279,7 +279,8 @@ div#image_panel_table { } -div#bigimage{ +div#bigimage, +div#bigvideo{ display: table-row; width: 100%; height: 100%; @@ -303,6 +304,11 @@ top: 50%; transform: translateY(-50%); } +div#bigvideo > video { +min-width: 100%; +min-height: 100%; +} + /* Comments */
    ".htmlentities($name, ENT_QUOTES ,'UTF-8')."