source: trunk/include/picture_metadata.inc.php @ 1092

Last change on this file since 1092 was 1092, checked in by rvelices, 18 years ago

URL rewriting: capable of fully working with urls without ?

URL rewriting: works with image file instead of image id (change
make_picture_url to generate urls with file name instead of image id)

URL rewriting: completely works with category/best_rated and
picture/best_rated/534 (change 'category.php?' to 'category' in make_index_url
and 'picture.php?' to 'picture' in make_picture_url to see it)

fix: picture category display in upper bar

fix: function rate_picture variables and use of the new user type

fix: caddie icon appears now on category page

fix: admin element_set sql query was using storage_category_id column
(column has moved to #image_categories)

fix: replaced some old $_GET[xxx] with $page[xxx]

fix: pictures have metadata url (use ? parameter - might change later)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.9 KB
Line 
1<?php
2// +-----------------------------------------------------------------------+
3// | PhpWebGallery - a PHP based picture gallery                           |
4// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
5// | Copyright (C) 2003-2005 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | branch        : BSF (Best So Far)
8// | file          : $RCSfile$
9// | last update   : $Date: 2006-03-22 01:01:47 +0000 (Wed, 22 Mar 2006) $
10// | last modifier : $Author: rvelices $
11// | revision      : $Revision: 1092 $
12// +-----------------------------------------------------------------------+
13// | This program is free software; you can redistribute it and/or modify  |
14// | it under the terms of the GNU General Public License as published by  |
15// | the Free Software Foundation                                          |
16// |                                                                       |
17// | This program is distributed in the hope that it will be useful, but   |
18// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
19// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
20// | General Public License for more details.                              |
21// |                                                                       |
22// | You should have received a copy of the GNU General Public License     |
23// | along with this program; if not, write to the Free Software           |
24// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
25// | USA.                                                                  |
26// +-----------------------------------------------------------------------+
27
28/**
29 * This file is included by the picture page to manage picture metadata
30 *
31 */
32
33if ($metadata_showable and isset($_GET['metadata']))
34{
35  include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
36  $template->assign_block_vars('metadata', array());
37  if ($conf['show_exif'])
38  {
39    if (!function_exists('read_exif_data'))
40    {
41      die('Exif extension not available, admin should disable exif display');
42    }
43
44    if ($exif = @read_exif_data($picture['current']['src_file_system']))
45    {
46      $template->assign_block_vars(
47        'metadata.headline',
48        array('TITLE' => 'EXIF Metadata')
49        );
50
51      foreach ($conf['show_exif_fields'] as $field)
52      {
53        if (strpos($field, ';') === false)
54        {
55          if (isset($exif[$field]))
56          {
57            $key = $field;
58            if (isset($lang['exif_field_'.$field]))
59            {
60              $key = $lang['exif_field_'.$field];
61            }
62
63            $template->assign_block_vars(
64              'metadata.line',
65              array(
66                'KEY' => $key,
67                'VALUE' => $exif[$field]
68                )
69              );
70          }
71        }
72        else
73        {
74          $tokens = explode(';', $field);
75          if (isset($exif[$tokens[0]][$tokens[1]]))
76          {
77            $key = $tokens[1];
78            if (isset($lang['exif_field_'.$tokens[1]]))
79            {
80              $key = $lang['exif_field_'.$tokens[1]];
81            }
82
83            $template->assign_block_vars(
84              'metadata.line',
85              array(
86                'KEY' => $key,
87                'VALUE' => $exif[$tokens[0]][$tokens[1]]
88                )
89              );
90          }
91        }
92      }
93    }
94  }
95  if ($conf['show_iptc'])
96  {
97    $iptc = get_iptc_data($picture['current']['src'],
98                          $conf['show_iptc_mapping']);
99
100    if (count($iptc) > 0)
101    {
102      $template->assign_block_vars(
103        'metadata.headline',
104        array('TITLE' => 'IPTC Metadata')
105        );
106    }
107
108    foreach ($iptc as $field => $value)
109    {
110      $key = $field;
111      if (isset($lang[$field]))
112      {
113        $key = $lang[$field];
114      }
115
116      $template->assign_block_vars(
117        'metadata.line',
118        array(
119          'KEY' => $key,
120          'VALUE' => $value
121          )
122        );
123    }
124  }
125}
126
127?>
Note: See TracBrowser for help on using the repository browser.