Browse Source

Show takedate in photo-overlay when available

Tobias Reich 10 years ago
parent
commit
386a0c2b8e
6 changed files with 17 additions and 3 deletions
  1. 3 0
      assets/css/content.css
  2. 7 1
      assets/js/build.js
  3. 0 0
      assets/min/main.css
  4. 0 0
      assets/min/main.js
  5. 0 0
      assets/min/view.js
  6. 7 2
      php/modules/Album.php

+ 3 - 0
assets/css/content.css

@@ -148,6 +148,9 @@
 	.photo .overlay a {
 		margin: 155px 0px 5px 15px;
 	}
+		.photo .overlay a span {
+			margin: 0px 5px 0px 0px;
+		}
 
 	/* Badges ------------------------------------------------*/
 	.album .badge,

+ 7 - 1
assets/js/build.js

@@ -81,7 +81,13 @@ build = {
 		photo +=	"<img src='" + photoJSON.thumbUrl + "' width='200' height='200' alt='thumb'>";
 		photo +=	"<div class='overlay'>";
 		photo +=		"<h1 title='" + longTitle + "'>" + title + "</h1>";
-		photo +=		"<a>" + photoJSON.sysdate + "</a>";
+
+		if (photoJSON.cameraDate==1) {
+			photo += "<a><span class='icon-camera' title='Photo Date'></span>" + photoJSON.sysdate + "</a>";
+		} else {
+			photo += "<a>" + photoJSON.sysdate + "</a>";
+		}
+
 		photo +=	"</div>";
 
 		if (photoJSON.star==1) photo += "<a class='badge red icon-star'></a>";

File diff suppressed because it is too large
+ 0 - 0
assets/min/main.css


File diff suppressed because it is too large
+ 0 - 0
assets/min/main.js


File diff suppressed because it is too large
+ 0 - 0
assets/min/view.js


+ 7 - 2
php/modules/Album.php

@@ -79,7 +79,7 @@ class Album extends Module {
 						$return = $albums->fetch_assoc();
 						$return['sysdate']		= date('d M. Y', $return['sysstamp']);
 						$return['password']		= ($return['password']=='' ? false : true);
-						$query = "SELECT id, title, tags, public, star, album, thumbUrl FROM lychee_photos WHERE album = '$this->albumIDs' " . $this->settings['sorting'];
+						$query = "SELECT id, title, tags, public, star, album, thumbUrl, takestamp FROM lychee_photos WHERE album = '$this->albumIDs' " . $this->settings['sorting'];
 						break;
 
 		}
@@ -92,7 +92,12 @@ class Album extends Module {
 			# Parse
 			$photo['sysdate']			= date('d F Y', substr($photo['id'], 0, -4));
 			$photo['previousPhoto']		= $previousPhotoID;
-			$photo['nextPhoto']		= '';
+			$photo['nextPhoto']			= '';
+
+			if ($photo['takestamp']!=='0') {
+				$photo['cameraDate']	= 1;
+				$photo['sysdate']		= date('d F Y', $photo['takestamp']);
+			}
 
 			if ($previousPhotoID!=='') $return['content'][$previousPhotoID]['nextPhoto'] = $photo['id'];
 			$previousPhotoID = $photo['id'];

Some files were not shown because too many files changed in this diff