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 | |
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
-rw-r--r-- | phpfspot.class.php | 37 | ||||
-rw-r--r-- | templates/single_photo.tpl | 19 |
2 files changed, 50 insertions, 6 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() + } ?> diff --git a/templates/single_photo.tpl b/templates/single_photo.tpl index d2d47c6..adeb9f8 100644 --- a/templates/single_photo.tpl +++ b/templates/single_photo.tpl @@ -2,7 +2,8 @@ <table> <tr> <td class="index_header" style="text-align: left;"> - <b>Photo {$image_name}</b>, {$c_date}, {$madewith}<br /> + <b>Photo {$image_name}</b><br /> + {$description}<br /> </td> <td class="index_header" style="text-align: right;"> <a href="{$image_url_full}" target="_blank" onclick="click(this);"> @@ -54,6 +55,22 @@ </table> </div> </td> + <td style="white-space: nowrap;"> + { if $ExifMadeWith } + With: {$ExifMadeWith}<br /> + { /if } + { if $ExifMadeOn } + On: {$ExifMadeOn}<br /> + { /if } + { if $ExifOrigResolution } + Res: {$ExifOrigResolution}<br /> + { /if } + Size: {$ExifFileSize}kbyte<br /> + Tagged:<br /> + { foreach from=$tags key=id item=name } + <a href="javascript:Tags('add', '{$id}');" onclick="click(this);">{$name}</a><br /> + { /foreach } + </td> </tr> </table> <!-- /Single photo --> |