diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-06-15 19:12:01 +0000 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-06-15 19:12:01 +0000 |
commit | 64aff8eab7dca9b848149d9061a33af0d44f24b9 (patch) | |
tree | 9807769061082e091ffb10338782567c6e65036d /phpfspot.class.php | |
parent | f679541f88a70088ed06dd751da8dc5eda5c2c74 (diff) |
display additional infos like Exif data, additional tags, ...
in the single photo view
git-svn-id: file:///var/lib/svn/phpfspot/trunk@97 fa6a889d-dae6-447d-9e79-4ba9a3039384
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index af51752..b044024 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -121,15 +121,22 @@ class PHPFSPOT { $details = $this->get_photo_details($photo); $meta = $this->get_meta_informations($this->translate_path($details['directory_path']) ."/". $details['name']); $info = getimagesize($this->translate_path($details['directory_path']) ."/thumbs/". $this->cfg->photo_width ."_". $details['name']); - + + $this->tmpl->assign('description', $details['description']); + $this->tmpl->assign('image_name', $details['name']); + $this->tmpl->assign('width', $info[0]); $this->tmpl->assign('height', $info[1]); - $this->tmpl->assign('c_date', $meta['DateTime']); - $this->tmpl->assign('madewith', $meta['Make'] ." ". $meta['Model']); - $this->tmpl->assign('image_name', $details['name']); + $this->tmpl->assign('ExifMadeOn', strftime("%a %x %X", $meta['FileDateTime'])); + $this->tmpl->assign('ExifMadeWith', $meta['Make'] ." ". $meta['Model']); + $this->tmpl->assign('ExifOrigResolution', $meta['ExifImageWidth'] ."x". $meta['ExifImageLength']); + $this->tmpl->assign('ExifFileSize', round($meta['FileSize']/1024, 1)); + $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&width=". $this->cfg->photo_width); $this->tmpl->assign('image_url_full', 'phpfspot_img.php?idx='. $photo); + $this->tmpl->assign('tags', $this->get_photo_tags($photo)); + if($previous_img) { $this->tmpl->assign('previous_url', "javascript:showImage(". $previous_img .");"); } @@ -213,7 +220,8 @@ class PHPFSPOT { if(!isset($_SESSION['selected_tags'])) $_SESSION['selected_tags'] = Array(); - array_push($_SESSION['selected_tags'], $tag); + if(!in_array($tag, $_SESSION['selected_tags'])) + array_push($_SESSION['selected_tags'], $tag); } // addTag() @@ -680,6 +688,25 @@ class PHPFSPOT { } // rotateImage() + private function get_photo_tags($idx) + { + $result = $this->db->db_query(" + SELECT t.id, t.name + FROM tags t + INNER JOIN photo_tags pt + ON t.id=pt.tag_id + WHERE pt.photo_id='". $idx ."' + "); + + $tags = Array(); + + while($row = $this->db->db_fetch_object($result)) + $tags[$row['id']] = $row['name']; + + return $tags; + + } // get_photo_tags() + } ?> |