From 4a7643b3ec532a211ec284dc1c57b0686403730d Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Fri, 6 Aug 2010 17:16:52 -0700 Subject: [PATCH] allow 640 image to display directly, add album name to photo --- mod/photos.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 6894483ae2..5598de4341 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -316,7 +316,7 @@ function photos_content(&$a) { $r = q("SELECT `resource-id`, max(`scale`) AS `scale` FROM `photo` WHERE `uid` = %d AND `album` = '%s' - $sql_extra GROUP BY `resource-id` LIMIT %d , %d", + $sql_extra GROUP BY `resource-id` ORDER BY `created` DESC LIMIT %d , %d", intval($a->data['user']['uid']), dbesc($album), intval($a->pager['start']), @@ -364,10 +364,19 @@ function photos_content(&$a) { if(count($ph) == 1) $hires = $lores = $ph[0]; if(count($ph) > 1) { + if($ph[1]['scale'] == 2) { + // original is 640 or less, we can display it directly + $hires = $lores = $ph[0]; + } + else { $hires = $ph[0]; $lores = $ph[1]; + } } + + $o .= '

' . '' . $ph[0]['album'] . '

'; + $o .= '