source: branches/branch-1_7/picture.php @ 2406

Last change on this file since 2406 was 2406, checked in by mathiasm, 16 years ago

Bug 817 (metadata display persistency) fixed for branch_1.7

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 22.3 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-2007 PhpWebGallery Team - http://phpwebgallery.net |
6// +-----------------------------------------------------------------------+
7// | file          : $Id: picture.php 2406 2008-06-28 13:58:35Z mathiasm $
8// | last update   : $Date: 2008-06-28 13:58:35 +0000 (Sat, 28 Jun 2008) $
9// | last modifier : $Author: mathiasm $
10// | revision      : $Revision: 2406 $
11// +-----------------------------------------------------------------------+
12// | This program is free software; you can redistribute it and/or modify  |
13// | it under the terms of the GNU General Public License as published by  |
14// | the Free Software Foundation                                          |
15// |                                                                       |
16// | This program is distributed in the hope that it will be useful, but   |
17// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
18// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
19// | General Public License for more details.                              |
20// |                                                                       |
21// | You should have received a copy of the GNU General Public License     |
22// | along with this program; if not, write to the Free Software           |
23// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
24// | USA.                                                                  |
25// +-----------------------------------------------------------------------+
26
27define('PHPWG_ROOT_PATH','./');
28include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
29include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
30include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
31include_once(PHPWG_ROOT_PATH.'include/functions_session.inc.php');
32
33// Check Access and exit when user status is not ok
34check_status(ACCESS_GUEST);
35
36// access authorization check
37if (isset($page['category']))
38{
39  check_restrictions($page['category']['id']);
40}
41
42$page['rank_of'] = array_flip($page['items']);
43
44// if this image_id doesn't correspond to this category, an error message is
45// displayed, and execution is stopped
46if ( !isset($page['rank_of'][$page['image_id']]) )
47{
48  page_not_found(
49    'The requested image does not belong to this image set',
50    duplicate_index_url()
51    );
52}
53
54// There is cookie, so we must handle it at the beginning
55if ( isset($_GET['metadata']) )
56{
57  if ( pwg_get_session_var('show_metadata') == null )
58        {
59                pwg_set_session_var('show_metadata', 1, 86400, cookie_path());
60        } else {
61        pwg_unset_session_var('show_metadata');
62
63        }
64
65}
66
67// add default event handler for rendering element content
68add_event_handler(
69  'render_element_content',
70  'default_picture_content',
71  EVENT_HANDLER_PRIORITY_NEUTRAL,
72  2
73  );
74// add default event handler for rendering element description
75add_event_handler('render_element_description', 'nl2br');
76
77trigger_action('loc_begin_picture');
78
79// this is the default handler that generates the display for the element
80function default_picture_content($content, $element_info)
81{
82  if ( !empty($content) )
83  {// someone hooked us - so we skip;
84    return $content;
85  }
86  if (!isset($element_info['image_url']))
87  { // nothing to do
88    return $content;
89  }
90
91  global $user, $page, $template;
92
93  $template->set_filenames(
94    array('default_content'=>'picture_content.tpl')
95    );
96
97  if ( !isset($page['slideshow']) and isset($element_info['high_url']) )
98  {
99    $uuid = uniqid(rand());
100    $template->assign_block_vars(
101      'high',
102      array(
103        'U_HIGH' => $element_info['high_url'],
104        'UUID'   => $uuid,
105        )
106      );
107  }
108  $template->assign_vars( array(
109      'SRC_IMG' => $element_info['image_url'],
110      'ALT_IMG' => $element_info['file'],
111      'WIDTH_IMG' => @$element_info['scaled_width'],
112      'HEIGHT_IMG' => @$element_info['scaled_height'],
113      )
114    );
115  return $template->parse( 'default_content', true);
116}
117
118// +-----------------------------------------------------------------------+
119// |                            initialization                             |
120// +-----------------------------------------------------------------------+
121
122// caching first_rank, last_rank, current_rank in the displayed
123// section. This should also help in readability.
124$page['first_rank']   = 0;
125$page['last_rank']    = count($page['items']) - 1;
126$page['current_rank'] = $page['rank_of'][ $page['image_id'] ];
127
128// caching current item : readability purpose
129$page['current_item'] = $page['image_id'];
130
131if ($page['current_rank'] != $page['first_rank'])
132{
133  // caching first & previous item : readability purpose
134  $page['previous_item'] = $page['items'][ $page['current_rank'] - 1 ];
135  $page['first_item'] = $page['items'][ $page['first_rank'] ];
136}
137
138if ($page['current_rank'] != $page['last_rank'])
139{
140  // caching next & last item : readability purpose
141  $page['next_item'] = $page['items'][ $page['current_rank'] + 1 ];
142  $page['last_item'] = $page['items'][ $page['last_rank'] ];
143}
144
145$url_up = duplicate_index_url(
146  array(
147    'start' =>
148      floor($page['current_rank'] / $user['nb_image_page'])
149      * $user['nb_image_page']
150    ),
151  array(
152    'start',
153    )
154  );
155
156$url_self = duplicate_picture_url();
157
158// +-----------------------------------------------------------------------+
159// |                                actions                                |
160// +-----------------------------------------------------------------------+
161
162/**
163 * Actions are favorite adding, user comment deletion, setting the picture
164 * as representative of the current category...
165 *
166 * Actions finish by a redirection
167 */
168
169if (isset($_GET['action']))
170{
171  switch ($_GET['action'])
172  {
173    case 'add_to_favorites' :
174    {
175      $query = '
176INSERT INTO '.FAVORITES_TABLE.'
177  (image_id,user_id)
178  VALUES
179  ('.$page['image_id'].','.$user['id'].')
180;';
181      pwg_query($query);
182
183      redirect($url_self);
184
185      break;
186    }
187    case 'remove_from_favorites' :
188    {
189      $query = '
190DELETE FROM '.FAVORITES_TABLE.'
191  WHERE user_id = '.$user['id'].'
192    AND image_id = '.$page['image_id'].'
193;';
194      pwg_query($query);
195
196      if ('favorites' == $page['section'])
197      {
198        redirect($url_up);
199      }
200      else
201      {
202        redirect($url_self);
203      }
204
205      break;
206    }
207    case 'set_as_representative' :
208    {
209      if (is_admin() and !is_adviser() and isset($page['category']))
210      {
211        $query = '
212UPDATE '.CATEGORIES_TABLE.'
213  SET representative_picture_id = '.$page['image_id'].'
214  WHERE id = '.$page['category']['id'].'
215;';
216        pwg_query($query);
217      }
218
219      redirect($url_self);
220
221      break;
222    }
223    case 'toggle_metadata' :
224    {
225      break;
226    }
227    case 'add_to_caddie' :
228    {
229      fill_caddie(array($page['image_id']));
230      redirect($url_self);
231      break;
232    }
233    case 'rate' :
234    {
235      include_once(PHPWG_ROOT_PATH.'include/functions_rate.inc.php');
236      rate_picture(
237        $page['image_id'],
238        isset($_POST['rate']) ? $_POST['rate'] : $_GET['rate']
239        );
240      redirect($url_self);
241    }
242    case 'delete_comment' :
243    {
244      if (isset($_GET['comment_to_delete'])
245          and is_numeric($_GET['comment_to_delete'])
246          and is_admin() and !is_adviser() )
247      {
248        $query = '
249DELETE FROM '.COMMENTS_TABLE.'
250  WHERE id = '.$_GET['comment_to_delete'].'
251;';
252        pwg_query( $query );
253      }
254
255      redirect($url_self);
256    }
257  }
258}
259
260// incrementation of the number of hits, we do this only if no action
261if (trigger_event('allow_increment_element_hit_count', !isset($_POST['content']) ) )
262{
263  $query = '
264UPDATE
265  '.IMAGES_TABLE.'
266  SET hit = hit+1
267  WHERE id = '.$page['image_id'].'
268;';
269  pwg_query($query);
270}
271
272//---------------------------------------------------------- related categories
273$query = '
274SELECT category_id,uppercats,commentable,global_rank
275  FROM '.IMAGE_CATEGORY_TABLE.'
276    INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
277  WHERE image_id = '.$page['image_id'].'
278'.get_sql_condition_FandF
279  (
280    array
281      (
282        'forbidden_categories' => 'category_id',
283        'visible_categories' => 'category_id'
284      ),
285    'AND'
286  ).'
287;';
288$result = pwg_query($query);
289$related_categories = array();
290while ($row = mysql_fetch_array($result))
291{
292  array_push($related_categories, $row);
293}
294usort($related_categories, 'global_rank_compare');
295//-------------------------first, prev, current, next & last picture management
296$picture = array();
297
298$ids = array($page['image_id']);
299if (isset($page['previous_item']))
300{
301  array_push($ids, $page['previous_item']);
302  array_push($ids, $page['first_item']);
303}
304if (isset($page['next_item']))
305{
306  array_push($ids, $page['next_item']);
307  array_push($ids, $page['last_item']);
308}
309
310$query = '
311SELECT *
312  FROM '.IMAGES_TABLE.'
313  WHERE id IN ('.implode(',', $ids).')
314;';
315
316$result = pwg_query($query);
317
318while ($row = mysql_fetch_assoc($result))
319{
320  if (isset($page['previous_item']) and $row['id'] == $page['previous_item'])
321  {
322    $i = 'previous';
323  }
324  else if (isset($page['next_item']) and $row['id'] == $page['next_item'])
325  {
326    $i = 'next';
327  }
328  else if (isset($page['first_item']) and $row['id'] == $page['first_item'])
329  {
330    $i = 'first';
331  }
332  else if (isset($page['last_item']) and $row['id'] == $page['last_item'])
333  {
334    $i = 'last';
335  }
336  else
337  {
338    $i = 'current';
339  }
340
341  $picture[$i] = $row;
342
343  $picture[$i]['is_picture'] = false;
344  if (in_array(get_extension($row['file']), $conf['picture_ext']))
345  {
346    $picture[$i]['is_picture'] = true;
347  }
348
349  // ------ build element_path and element_url
350  $picture[$i]['element_path'] = get_element_path($picture[$i]);
351  $picture[$i]['element_url'] = get_element_url($picture[$i]);
352
353  // ------ build image_path and image_url
354  if ($i=='current' or $i=='next')
355  {
356    $picture[$i]['image_path'] = get_image_path( $picture[$i] );
357    $picture[$i]['image_url'] = get_image_url( $picture[$i] );
358  }
359
360  if ($i=='current')
361  {
362    if ( $picture[$i]['is_picture'] )
363    {
364      if ( $user['enabled_high']=='true' )
365      {
366        $hi_url=get_high_url($picture[$i]);
367        if ( !empty($hi_url) )
368        {
369          $picture[$i]['high_url'] = $hi_url;
370          $picture[$i]['download_url'] = get_download_url('h',$picture[$i]);
371        }
372      }
373    }
374    else
375    { // not a pic - need download link
376      $picture[$i]['download_url'] = get_download_url('e',$picture[$i]);
377    }
378  }
379
380  $picture[$i]['thumbnail'] = get_thumbnail_url($row);
381
382  if ( !empty( $row['name'] ) )
383  {
384    $picture[$i]['name'] = $row['name'];
385  }
386  else
387  {
388    $file_wo_ext = get_filename_wo_extension($row['file']);
389    $picture[$i]['name'] = str_replace('_', ' ', $file_wo_ext);
390  }
391
392  $picture[$i]['url'] = duplicate_picture_url(
393    array(
394      'image_id' => $row['id'],
395      'image_file' => $row['file'],
396      ),
397    array(
398      'start',
399      )
400    );
401
402  if ('previous'==$i and $page['previous_item']==$page['first_item'])
403  {
404    $picture['first'] = $picture[$i];
405  }
406  if ('next'==$i and $page['next_item']==$page['last_item'])
407  {
408    $picture['last'] = $picture[$i];
409  }
410}
411
412// calculation of width and height for the current picture
413if (empty($picture['current']['width']))
414{
415  $taille_image = @getimagesize($picture['current']['image_path']);
416  if ($taille_image!==false)
417  {
418    $picture['current']['width'] = $taille_image[0];
419    $picture['current']['height']= $taille_image[1];
420  }
421}
422
423if (!empty($picture['current']['width']))
424{
425  list(
426    $picture['current']['scaled_width'],
427    $picture['current']['scaled_height']
428    ) = get_picture_size(
429      $picture['current']['width'],
430      $picture['current']['height'],
431      @$user['maxwidth'],
432      @$user['maxheight']
433    );
434}
435
436$url_admin =
437  get_root_url().'admin.php?page=picture_modify'
438  .'&amp;cat_id='.(isset($page['category']) ? $page['category']['id'] : '')
439  .'&amp;image_id='.$page['image_id']
440;
441
442$url_slide = add_url_params(
443  $picture['current']['url'],
444  array( 'slideshow'=>$conf['slideshow_period'] )
445  );
446
447
448$template->set_filename('picture', 'picture.tpl');
449if ( isset( $_GET['slideshow'] ) )
450{
451  $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
452  $page['slideshow'] = true;
453  if ( $conf['light_slideshow'] )
454  {
455    $template->set_filename('picture', 'slideshow.tpl');
456  }
457  if ( isset($page['next_item']) )
458  {
459    // $redirect_msg, $refresh, $url_link and $title are required for creating
460    // an automated refresh page in header.tpl
461    $refresh= $_GET['slideshow'];
462    $url_link = add_url_params(
463        $picture['next']['url'],
464        array('slideshow'=>$refresh)
465      );
466    $redirect_msg = nl2br(l10n('redirect_msg'));
467  }
468}
469
470$title =  $picture['current']['name'];
471$title_nb = ($page['current_rank'] + 1).'/'.count($page['items']);
472
473// metadata
474$url_metadata = duplicate_picture_url();
475$url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
476
477
478// do we have a plugin that can show metadata for something else than images?
479$metadata_showable = trigger_event(
480  'get_element_metadata_available',
481  (
482    ($conf['show_exif'] or $conf['show_iptc'])
483    and isset($picture['current']['image_path'])
484    ),
485  $picture['current']['path']
486  );
487
488if ( $metadata_showable and pwg_get_session_var('show_metadata') )
489{
490  $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
491}
492
493
494$page['body_id'] = 'thePicturePage';
495
496// allow plugins to change what we computed before passing data to template
497$picture = trigger_event('picture_pictures_data', $picture);
498
499
500if (isset($picture['next']['image_url'])
501    and $picture['next']['is_picture'] )
502{
503  $template->assign_block_vars(
504    'prefetch',
505    array (
506      'URL' => $picture['next']['image_url']
507      )
508    );
509}
510
511//------------------------------------------------------- navigation management
512foreach (array('first','previous','next','last') as $which_image)
513{
514  if (isset($picture[$which_image]))
515  {
516    $template->assign_block_vars(
517      $which_image,
518      array(
519        'TITLE_IMG' => $picture[$which_image]['name'],
520        'IMG' => $picture[$which_image]['thumbnail'],
521        'U_IMG' => $picture[$which_image]['url'],
522        )
523      );
524  }
525  else
526  {
527    $template->assign_block_vars(
528      $which_image.'_unactive',
529      array()
530      );
531  }
532}
533
534$template->assign_vars(
535  array(
536    'SECTION_TITLE' => $page['title'],
537    'PICTURE_TITLE' => $picture['current']['name'],
538    'PHOTO' => $title_nb,
539    'TITLE' => $picture['current']['name'],
540
541    'LEVEL_SEPARATOR' => $conf['level_separator'],
542
543    'U_HOME' => make_index_url(),
544    'U_UP' => $url_up,
545    'U_METADATA' => $url_metadata,
546    'U_ADMIN' => $url_admin,
547    'U_SLIDESHOW'=> $url_slide,
548    'U_ADD_COMMENT' => $url_self,
549    )
550  );
551
552if ($conf['show_picture_name_on_title'])
553{
554  $template->assign_block_vars('title', array());
555}
556
557//------------------------------------------------------- upper menu management
558
559// download link
560if ( isset($picture['current']['download_url']) )
561{
562  $template->assign_block_vars(
563    'download',
564    array(
565      'U_DOWNLOAD' => $picture['current']['download_url']
566      )
567    );
568}
569
570// button to set the current picture as representative
571if (is_admin() and isset($page['category']))
572{
573  $template->assign_block_vars(
574    'representative',
575    array(
576      'URL' => add_url_params($url_self,
577                  array('action'=>'set_as_representative')
578               )
579      )
580    );
581}
582
583// caddie button
584if (is_admin())
585{
586  $template->assign_block_vars(
587    'caddie',
588    array(
589      'URL' => add_url_params($url_self,
590                  array('action'=>'add_to_caddie')
591               )
592      )
593    );
594}
595
596// favorite manipulation
597if (!$user['is_the_guest'])
598{
599  // verify if the picture is already in the favorite of the user
600  $query = '
601SELECT COUNT(*) AS nb_fav
602  FROM '.FAVORITES_TABLE.'
603  WHERE image_id = '.$page['image_id'].'
604    AND user_id = '.$user['id'].'
605;';
606  $result = pwg_query($query);
607  $row = mysql_fetch_array($result);
608
609  if ($row['nb_fav'] == 0)
610  {
611    $template->assign_block_vars(
612      'favorite',
613      array(
614        'FAVORITE_IMG'  =>
615          get_root_url().get_themeconf('icon_dir').'/favorite.png',
616        'FAVORITE_HINT' => l10n('add_favorites_hint'),
617        'FAVORITE_ALT'  => l10n('add_favorites_alt'),
618        'U_FAVORITE'    => add_url_params(
619          $url_self,
620          array('action'=>'add_to_favorites')
621          ),
622        )
623      );
624  }
625  else
626  {
627    $template->assign_block_vars(
628      'favorite',
629      array(
630        'FAVORITE_IMG'  =>
631          get_root_url().get_themeconf('icon_dir').'/del_favorite.png',
632        'FAVORITE_HINT' => l10n('del_favorites_hint'),
633        'FAVORITE_ALT'  => l10n('del_favorites_alt'),
634        'U_FAVORITE'    => add_url_params(
635          $url_self,
636          array('action'=>'remove_from_favorites')
637          ),
638        )
639      );
640  }
641}
642//------------------------------------ admin link for information modifications
643if ( is_admin() )
644{
645  $template->assign_block_vars('admin', array());
646}
647
648//--------------------------------------------------------- picture information
649$header_infos = array();        //for html header use
650// legend
651if (isset($picture['current']['comment'])
652    and !empty($picture['current']['comment']))
653{
654  $template->assign_block_vars(
655    'legend',
656    array(
657      'COMMENT_IMG' =>
658        trigger_event('render_element_description',
659          $picture['current']['comment'])
660      ));
661  $header_infos['COMMENT'] = strip_tags($picture['current']['comment']);
662}
663
664$infos = array();
665
666// author
667if (!empty($picture['current']['author']))
668{
669  $infos['INFO_AUTHOR'] =
670// FIXME because of search engine partial rewrite, giving the author
671// name threw GET is not supported anymore. This feature should come
672// back later, with a better design
673//     '<a href="'.
674//       PHPWG_ROOT_PATH.'category.php?cat=search'.
675//       '&amp;search=author:'.$picture['current']['author']
676//       .'">'.$picture['current']['author'].'</a>';
677    $picture['current']['author'];
678  $header_infos['INFO_AUTHOR'] = $picture['current']['author'];
679}
680else
681{
682  $infos['INFO_AUTHOR'] = l10n('N/A');
683}
684
685// creation date
686if (!empty($picture['current']['date_creation']))
687{
688  $val = format_date($picture['current']['date_creation']);
689  $url = make_index_url(
690    array(
691      'chronology_field'=>'created',
692      'chronology_style'=>'monthly',
693      'chronology_view'=>'list',
694      'chronology_date' => explode('-', $picture['current']['date_creation'])
695      )
696    );
697  $infos['INFO_CREATION_DATE'] =
698    '<a href="'.$url.'" rel="nofollow">'.$val.'</a>';
699}
700else
701{
702  $infos['INFO_CREATION_DATE'] = l10n('N/A');
703}
704
705// date of availability
706$val = format_date($picture['current']['date_available'], 'mysql_datetime');
707$url = make_index_url(
708  array(
709    'chronology_field'=>'posted',
710    'chronology_style'=>'monthly',
711    'chronology_view'=>'list',
712    'chronology_date' => explode(
713      '-',
714      substr($picture['current']['date_available'], 0, 10)
715      )
716    )
717  );
718$infos['INFO_POSTED_DATE'] = '<a href="'.$url.'" rel="nofollow">'.$val.'</a>';
719
720// size in pixels
721if ($picture['current']['is_picture'] and isset($picture['current']['width']) )
722{
723  if ($picture['current']['scaled_width'] !== $picture['current']['width'] )
724  {
725    $infos['INFO_DIMENSIONS'] =
726      '<a href="'.$picture['current']['image_url'].'" title="'.
727      l10n('Original dimensions').'">'.
728      $picture['current']['width'].'*'.$picture['current']['height'].'</a>';
729  }
730  else
731  {
732    $infos['INFO_DIMENSIONS'] =
733      $picture['current']['width'].'*'.$picture['current']['height'];
734  }
735}
736else
737{
738  $infos['INFO_DIMENSIONS'] = l10n('N/A');
739}
740
741// filesize
742if (!empty($picture['current']['filesize']))
743{
744  $infos['INFO_FILESIZE'] =
745    sprintf(l10n('%d Kb'), $picture['current']['filesize']);
746}
747else
748{
749  $infos['INFO_FILESIZE'] = l10n('N/A');
750}
751
752// number of visits
753$infos['INFO_VISITS'] = $picture['current']['hit'];
754
755// file
756$infos['INFO_FILE'] = $picture['current']['file'];
757
758// tags
759$tags = get_common_tags( array($page['image_id']), -1);
760if ( count($tags) )
761{
762  $infos['INFO_TAGS'] = '';
763  foreach ($tags as $num => $tag)
764  {
765    $infos['INFO_TAGS'] .= $num ? ', ' : '';
766    $infos['INFO_TAGS'] .= '<a href="'
767      .make_index_url(
768        array(
769          'tags' => array($tag)
770          )
771        )
772      .'">'.$tag['name'].'</a>';
773  }
774  $header_infos['INFO_TAGS'] = strip_tags($infos['INFO_TAGS']);
775}
776else
777{
778  $infos['INFO_TAGS'] = l10n('N/A');
779}
780
781$template->assign_vars($infos);
782
783// related categories
784if ( count($related_categories)==1 and
785    isset($page['category']) and
786    $related_categories[0]['category_id']==$page['category']['id'] )
787{ // no need to go to db, we have all the info
788  $template->assign_block_vars(
789    'category',
790      array('LINE'=>get_cat_display_name( $page['category']['upper_names'] ))
791    );
792}
793else
794{ // use only 1 sql query to get names for all related categories
795  $ids = array();
796  foreach ($related_categories as $category)
797  {// add all uppercats to $ids
798    $ids = array_merge($ids, explode(',', $category['uppercats']) );
799  }
800  $ids = array_unique($ids);
801  $query = '
802SELECT id, name, permalink
803  FROM '.CATEGORIES_TABLE.'
804  WHERE id IN ('.implode(',',$ids).')';
805  $cat_map = hash_from_query($query, 'id');
806  foreach ($related_categories as $category)
807  {
808    $cats = array();
809    foreach ( explode(',', $category['uppercats']) as $id )
810    {
811      $cats[] = $cat_map[$id];
812    }
813    $template->assign_block_vars('category', array('LINE'=>get_cat_display_name($cats) ) );
814  }
815}
816
817//slideshow end
818if (isset($_GET['slideshow']))
819{
820  if (!is_numeric($_GET['slideshow']))
821  {
822    $_GET['slideshow'] = $conf['slideshow_period'];
823  }
824
825  $template->assign_block_vars(
826    'stop_slideshow',
827    array(
828      'U_SLIDESHOW' => $picture['current']['url'],
829      )
830    );
831}
832
833// maybe someone wants a special display (call it before page_header so that
834// they can add stylesheets)
835$element_content = trigger_event(
836  'render_element_content',
837  '',
838  $picture['current']
839  );
840$template->assign_var( 'ELEMENT_CONTENT', $element_content );
841
842// +-----------------------------------------------------------------------+
843// |                               sub pages                               |
844// +-----------------------------------------------------------------------+
845
846include(PHPWG_ROOT_PATH.'include/picture_rate.inc.php');
847include(PHPWG_ROOT_PATH.'include/picture_comment.inc.php');
848if ($metadata_showable and pwg_get_session_var('show_metadata') <> null )
849{
850  include(PHPWG_ROOT_PATH.'include/picture_metadata.inc.php');
851}
852//------------------------------------------------------------ log informations
853pwg_log($picture['current']['id'], 'picture');
854
855include(PHPWG_ROOT_PATH.'include/page_header.php');
856trigger_action('loc_end_picture');
857$template->parse('picture');
858include(PHPWG_ROOT_PATH.'include/page_tail.php');
859?>
Note: See TracBrowser for help on using the repository browser.