source: trunk/picture.php @ 19

Last change on this file since 19 was 19, checked in by z0rglub, 21 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.5 KB
Line 
1<?php
2/***************************************************************************
3 *                                picture.php                              *
4 *                            -------------------                          *
5 *   application          : PhpWebGallery 1.3                              *
6 *   author               : Pierrick LE GALL <pierrick@z0rglub.com>        *
7 *                                                                         *
8 ***************************************************************************/
9
10/***************************************************************************
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 ***************************************************************************/
17
18// this page shows the image full size
19// (or resized to the max size the user has chosen)
20// and two thumbnail : previous and next picture of your gallery
21//----------------------------------------------------------- personnal include
22include_once( './include/init.inc.php' );       
23//-------------------------------------------------- access authorization check
24check_cat_id( $_GET['cat'] );
25check_login_authorization();
26if ( isset( $page['cat'] ) && is_numeric( $page['cat'] ) )
27{
28  check_restrictions( $page['cat'] );
29}
30//---------------------------------------- incrementation of the number of hits
31$query = 'update '.PREFIX_TABLE.'images';
32$query.= ' set hit=hit+1';
33$query.= ' where id='.$_GET['image_id'];
34$query.= ';';
35@mysql_query( $query );
36//-------------------------------------------------------------- initialization
37initialize_category( 'picture' );
38$cat_directory = $page['cat_dir']; // by default
39//------------------------------------- main picture information initialization
40$query = 'select id,date_available,comment,hit';
41$query.= ',author,name,file,date_creation,filesize,width,height,cat_id';
42$query.= ' from '.PREFIX_TABLE.'images';
43$query.= $page['where'];
44$query.= ' and id = '.$_GET['image_id'];
45$query.= $conf['order_by'];
46$query.= ';';
47$result = mysql_query( $query );
48$row = mysql_fetch_array( $result );
49$page['id']             = $row['id'];
50$page['file']           = $row['file'];
51$page['name']           = $row['name'];
52$page['date_available'] = $row['date_available'];
53$page['comment']        = $row['comment'];
54$page['hit']            = $row['hit'];
55$page['author']         = $row['author'];
56$page['date_creation']  = $row['date_creation'];
57$page['filesize']       = $row['filesize'];
58$page['width']          = $row['width'];
59$page['height']         = $row['height'];
60$page['cat_id']         = $row['cat_id'];
61// retrieving the number of the picture in its category (in order)
62$query = 'select id';
63$query.= ' from '.PREFIX_TABLE.'images';
64$query.= $page['where'];
65$query.= $conf['order_by'];
66$query.= ';';
67$result = mysql_query( $query );
68$page['num'] = 0;
69$row = mysql_fetch_array( $result );
70while ( $row['id'] != $page['id'] )
71{
72  $page['num']++;
73  $row = mysql_fetch_array( $result );
74}
75//--------------------------------------------------------- favorite management
76if ( isset( $_GET['add_fav'] ) )
77{
78  if ( $_GET['add_fav'] == 1 )
79  {
80    // verify if the picture is already in the favorite of the user
81    $query = 'select count(*) as nb_fav';
82    $query.= ' from '.PREFIX_TABLE.'favorites';
83    $query.= ' where image_id = '.$page['id'];
84    $query.= ' and user_id = '.$user['id'];
85    $query.= ';';
86    $result = mysql_query( $query );
87    $row = mysql_fetch_array( $result );
88    if ( $row['nb_fav'] == 0 )
89    {
90      $query = 'insert into '.PREFIX_TABLE.'favorites';
91      $query.= ' (image_id,user_id) values';
92      $query.= ' ('.$page['id'].','.$user['id'].')';
93      $query.= ';';
94      $result = mysql_query( $query );
95    }
96  }
97  if ( $_GET['add_fav'] == 0 )
98  {
99    $query = 'delete from '.PREFIX_TABLE.'favorites';
100    $query.= ' where user_id = '.$user['id'];
101    $query.= ' and image_id = '.$page['id'];
102    $query.= ';';
103    $result = mysql_query( $query );
104   
105    $page['cat_nb_images'] = $page['cat_nb_images'] - 1;
106    if ( $page['cat_nb_images'] <= 0 )
107    {
108      // there is no favorite picture anymore
109      // we redirect the user to the category page
110      $url = add_session_id( 'category.php' );
111      header( 'Request-URI: '.$url );
112      header( 'Content-Location: '.$url ); 
113      header( 'Location: '.$url );
114      exit();
115    }
116    // redirection of the user to the picture.php page
117    // with the right picture
118    $page['num'] = $page['num'] - 1;
119    if ( $page['num'] == -1 )
120    {
121      $page['num'] = 0;
122    }
123    $query = 'select id';
124    $query.= ' from '.PREFIX_TABLE.'images';
125    $query.= $page['where'];
126    $query.= $conf['order_by'];
127    $query.= ' limit '.$page['num'].',1';
128    $query.= ';';
129    $result = mysql_query( $query );
130    $row = mysql_fetch_array( $result );
131    $redirect = './picture.php?image_id='.$row['id'].'&cat='.$page['cat'];
132    $redirect.= '&expand='.$_GET['expand'];
133    if ( $page['cat'] == 'search' )
134    {
135      $redirect.= '&search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
136    }
137    $url = add_session_id( $redirect, true );
138    header( 'Request-URI: '.$url );
139    header( 'Content-Location: '.$url ); 
140    header( 'Location: '.$url );
141    exit();
142  }
143}
144//----------------------------------------------------- template initialization
145$vtp = new VTemplate;
146$handle = $vtp->Open( './template/default/picture.vtp' );
147// language
148$vtp->setGlobalVar( $handle, 'back',             $lang['back'] );
149$vtp->setGlobalVar( $handle, 'submit',           $lang['submit'] );
150$vtp->setGlobalVar( $handle, 'comments_title',   $lang['comments_title'] );
151$vtp->setGlobalVar( $handle, 'comments_del',     $lang['comments_del'] );
152$vtp->setGlobalVar( $handle, 'delete',           $lang['delete'] );
153$vtp->setGlobalVar( $handle, 'comments_add',     $lang['comments_add'] );
154$vtp->setGlobalVar( $handle, 'author',           $lang['author'] );
155// user
156$vtp->setGlobalVar( $handle, 'page_style',       $user['style'] );
157$vtp->setGlobalVar( $handle, 'text_color',       $user['couleur_text'] );
158// structure
159$vtp->setGlobalVar( $handle, 'frame_start',      get_frame_start() );
160$vtp->setGlobalVar( $handle, 'frame_begin',      get_frame_begin() );
161$vtp->setGlobalVar( $handle, 'frame_end',        get_frame_end() );
162//------------------------------------------------------------------ page title
163if ( $page['name'] != "" )
164{
165  $vtp->setGlobalVar( $handle, 'page_title', $page['name'] );
166}
167else
168{
169  $vtp->setGlobalVar( $handle, 'page_title', $page['file'] );
170}
171//-------------------------------------------------- previous picture thumbnail
172if ( $page['num'] >= 1 )
173{
174  $prev = $page['num'] - 1;
175  $query = 'select id,name,file,tn_ext,cat_id';
176  $query.= ' from '.PREFIX_TABLE.'images';
177  $query.= $page['where'];
178  $query.= $conf['order_by'];
179  $query.= ' limit '.$prev.',1';
180  $query.= ';';
181  $result = mysql_query( $query );
182  $row = mysql_fetch_array( $result );
183
184  if ( !is_numeric( $page['cat'] ) )
185  {
186    if ( $array_cat_directories[$row['cat_id']] == '' )
187    {
188      $cat_result = get_cat_info( $row['cat_id'] );
189      $array_cat_directories[$row['cat_id']] = $cat_result['dir'];
190    }
191    $cat_directory = $array_cat_directories[$row['cat_id']];
192  }
193               
194  $file = substr ( $row['file'], 0, strrpos ( $row['file'], '.' ) );
195  $lien_thumbnail = $cat_directory.'/thumbnail/';
196  $lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext'];
197               
198  $prev_title = $lang['previous_image'].' : ';
199  $alt_thumbnaill = '';
200  if ( $row['name'] != "" )
201  {
202    $alt_thumbnail = $row['name'];
203  }
204  else
205  {
206    $alt_thumbnail = $file;
207  }
208  $prev_title.= $alt_thumbnail;
209 
210  $url_link = './picture.php?image_id='.$row['id'].'&amp;cat='.$page['cat'];
211  $url_link.= '&amp;expand='.$_GET['expand'];
212  if ( $page['cat'] == 'search' )
213  {
214    $url_link.= '&amp;search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
215  }
216  // sending vars for display
217  $vtp->addSession( $handle, 'previous' );
218  $vtp->setGlobalVar( $handle, 'previous.url', add_session_id( $url_link ) );
219  $vtp->setGlobalVar( $handle, 'previous.title', $prev_title );
220  $vtp->setGlobalVar( $handle, 'previous.src', $lien_thumbnail );
221  $vtp->setGlobalVar( $handle, 'previous.alt', $alt_thumbnail );
222  $vtp->closeSession( $handle, 'previous' );
223}
224else
225{
226  $vtp->addSession( $handle, 'previous_empty' );
227  $vtp->closeSession( $handle, 'previous_empty' );
228}
229//-------------------------------------------------------- main picture display
230if ( is_numeric( $page['cat'] ) )
231{
232  $intitule_cat = get_cat_display_name( $page['cat_name'], " - ",
233                                        "font-style:italic;" );
234}
235else
236{
237  $cat_result = get_cat_info( $page['cat_id'] );
238  if ( $array_cat_directories[$page['cat_id']] == "" )
239  {
240    $array_cat_directories[$page['cat_id']] = $cat_result['dir'];
241  }
242  $cat_directory = $array_cat_directories[$page['cat_id']];
243  $intitule_cat = $page['title'];
244}
245$n = $page['num'] + 1;
246$intitule_titre = replace_space( $intitule_cat." - " ).$n.'/'.
247$intitule_titre.= $page['cat_nb_images']."<br />";
248if ( $page['name'] != "" )
249{
250  $intitule_file = $page['name'];
251}
252else
253{
254  $intitule_file = str_replace( "_", " ",
255                                substr( $page['file'], 0,
256                                        strrpos ( $page['file'], ".") ) );
257}
258if ( $page['cat'] == 'search' )
259{
260  $intitule_file = replace_search( $intitule_file, $_GET['search'] );
261}
262$vtp->setGlobalVar( $handle, 'title', $intitule_titre.$intitule_file );
263
264$lien_image = $cat_directory.$page['file'];
265
266// calcul de la largeur et de la hauteur
267if ( $page['width'] == "" )
268{
269  $taille_image = @getimagesize( $lien_image );
270  $original_width = $taille_image[0];
271  $original_height = $taille_image[1];
272}
273else
274{
275  $original_width = $page['width'];
276  $original_height = $page['height'];
277}
278
279$picture_size = get_picture_size( $original_width, $original_height,
280                                  $user['maxwidth'], $user['maxheight'] );
281$final_width  = $picture_size[0];
282$final_height = $picture_size[1];
283       
284$url_link = './category.php?cat='.$page['cat'].'&amp;';
285$url_link.= 'num='.$page['num'].'&amp;expand='.$_GET['expand'];
286if ( $page['cat'] == 'search' )
287{
288  $url_link.= "&amp;search=".$_GET['search'].'&amp;mode='.$_GET['mode'];
289}
290$vtp->setGlobalVar( $handle, 'picture_link', add_session_id( $url_link ) );
291$vtp->setGlobalVar( $handle, 'picture_width', $final_width );
292$vtp->setGlobalVar( $handle, 'picture_height', $final_height );
293$vtp->setGlobalVar( $handle, 'picture_border_color', $user['couleur_text'] );
294$vtp->setGlobalVar( $handle, 'picture_src', $lien_image );
295$vtp->setGlobalVar( $handle, 'picture_alt', $page['file'] );
296
297if ( $page['comment'] != '' )
298{
299  if ( $page['cat'] == 'search' )
300  {
301    $picture_comment = replace_search( $page['comment'], $_GET['search'] );
302    $vtp->setGlobalVar( $handle, 'picture_comment', $picture_comment );
303  }
304  else
305  {
306    $vtp->setGlobalVar( $handle, 'picture_comment', $page['comment'] );
307  }
308}
309//--------------------------------------------------------- picture information
310// author
311if ( $page['author'] != "" )
312{
313  $vtp->addSession( $handle, 'info_line' );
314  $vtp->setVar( $handle, 'info_line.name', $lang['author'].' : ' );
315  $vtp->setVar( $handle, 'info_line.content', $page['author'] );
316  $vtp->closeSession( $handle, 'info_line' );
317}
318// creation date
319if ( $page['date_creation'] != "" )
320{
321  $vtp->addSession( $handle, 'info_line' );
322  $vtp->setVar( $handle, 'info_line.name', $lang['creation_date'].' : ' );
323  $tab_date = explode( '-', $page['date_creation'] );
324  $vtp->setVar( $handle, 'info_line.content',
325                $tab_date[2].'/'.$tab_date[1].'/'.$tab_date[0] );
326  $vtp->closeSession( $handle, 'info_line' );
327}
328// date of availability
329$vtp->addSession( $handle, 'info_line' );
330$vtp->setVar( $handle, 'info_line.name', $lang['registration_date'].' : ' );
331$tab_date = explode( '-', $page['date_available'] );
332$vtp->setVar( $handle, 'info_line.content',
333              $tab_date[2].'/'.$tab_date[1].'/'.$tab_date[0] );
334$vtp->closeSession( $handle, 'info_line' );
335// size in pixels
336$vtp->addSession( $handle, 'info_line' );
337$vtp->setVar( $handle, 'info_line.name', $lang['size'].' : ' );
338if ( $original_width != $final_width || $original_height != $final_height )
339{
340  $content = '[ <a href="'.$lien_image.'" title="'.$lang['true_size'].'">';
341  $content.= $original_width.'*'.$original_height.'</a> ]';
342  $vtp->setVar( $handle, 'info_line.content', $content );
343}
344else
345{
346  $content = $original_width.'*'.$original_height;
347  $vtp->setVar( $handle, 'info_line.content', $content );
348}
349$vtp->closeSession( $handle, 'info_line' );
350// file
351$vtp->addSession( $handle, 'info_line' );
352$vtp->setVar( $handle, 'info_line.name', $lang['file'].' : ' );
353if ( $page['cat'] == 'search' )
354{
355  $content = replace_search( $page['file'], $_GET['search'] );
356  $vtp->setVar( $handle, 'info_line.content', $content );
357}
358else
359{
360  $vtp->setVar( $handle, 'info_line.content', $page['file'] );
361}
362$vtp->closeSession( $handle, 'info_line' );
363// filesize
364if ( $page['filesize'] == "" )
365{
366  $poids = floor ( filesize( $lien_image ) / 1024 );
367}
368else
369{
370  $poids = $page['filesize'];
371}
372$vtp->addSession( $handle, 'info_line' );
373$vtp->setVar( $handle, 'info_line.name', $lang['filesize'].' : ' );
374$vtp->setVar( $handle, 'info_line.content', $poids.' KB' );
375$vtp->closeSession( $handle, 'info_line' );
376// number of visits
377$vtp->addSession( $handle, 'info_line' );
378$vtp->setVar( $handle, 'info_line.name', $lang['visited'].' : ' );
379$vtp->setVar( $handle, 'info_line.content', $page['hit'].' '.$lang['times'] );
380$vtp->closeSession( $handle, 'info_line' );
381//------------------------------------------------------- favorite manipulation
382if ( $page['cat'] != 'fav' && !$user['is_the_guest'] )
383{
384  $url = './picture.php?cat='.$page['cat'].'&amp;image_id='.$page['id'];
385  $url.= '&amp;expand='.$_GET['expand'].'&amp;add_fav=1';
386  if ( $page['cat'] == 'search' )
387  {
388    $url.= '&amp;search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
389  }
390  $vtp->addSession( $handle, 'favorite' );
391  $vtp->setVar( $handle, 'favorite.link', add_session_id( $url ) );
392  $vtp->setVar( $handle, 'favorite.title', $lang['add_favorites_hint'] );
393  $vtp->setVar( $handle, 'favorite.src',
394                './theme/'.$user['theme'].'/favorite.gif' );
395  $vtp->setVar( $handle, 'favorite.alt','[ '.$lang['add_favorites_alt'].' ]' );
396  $vtp->closeSession( $handle, 'favorite' );
397}
398if ( $page['cat'] == 'fav' )
399{
400  $url = './picture.php?cat='.$page['cat'].'&amp;image_id='.$page['id'];
401  $url.= '&amp;expand='.$_GET['expand'].'&amp;add_fav=0';
402  $vtp->addSession( $handle, 'favorite' );
403  $vtp->setVar( $handle, 'favorite.link', add_session_id( $url ) );
404  $vtp->setVar( $handle, 'favorite.title', $lang['del_favorites_hint'] );
405  $vtp->setVar( $handle, 'favorite.src',
406                './theme/'.$user['theme'].'/del_favorite.gif' );
407  $vtp->setVar( $handle, 'favorite.alt','[ '.$lang['del_favorites_alt'].' ]' );
408  $vtp->closeSession( $handle, 'favorite' );
409}
410//------------------------------------ admin link for information modifications
411if ( $user['status'] == "admin" && is_numeric( $page['cat'] ) )
412{
413  $vtp->addSession( $handle, 'modification' );
414  $url = './admin/admin.php?page=infos_images&amp;cat_id='.$page['cat'];
415  $url.= '&amp;num='.$page['num'];
416  $vtp->setVar( $handle, 'modification.link',
417                add_session_id( $url )."#".$page['id'] );
418  $vtp->setVar( $handle, 'modification.name', $lang['link_info_image'] );
419}
420//---------------------------------------------- next picture thumbnail display
421if ( $page['num'] < $page['cat_nb_images']-1 )
422{
423  $next = $page['num'] + 1;
424  $query = 'SELECT id,name,file,tn_ext,cat_id';
425  $query.= ' FROM '.PREFIX_TABLE.'images';
426  $query.= $page['where'];
427  $query.= $conf['order_by'];
428  $query.= ' LIMIT '.$next.',1';
429  $query.= ';';
430  $result = mysql_query( $query );
431  $row = mysql_fetch_array( $result );
432               
433  if ( !is_numeric( $page['cat'] ) )
434  {
435    if ( $array_cat_directories[$row['cat_id']] == "" )
436    {
437      $cat_result = get_cat_info( $row['cat_id'] );
438      $array_cat_directories[$row['cat_id']] = $cat_result['dir'];
439    }
440    $cat_directory = $array_cat_directories[$row['cat_id']];
441  }
442
443  $file = substr ( $row['file'], 0, strrpos ( $row['file'], ".") );
444  $lien_thumbnail = $cat_directory."thumbnail/";
445  $lien_thumbnail.= $conf['prefix_thumbnail'].$file.".".$row['tn_ext'];
446 
447  if ( $row['name'] != "" )
448  {
449    $alt_thumbnail = $row['name'];
450  }
451  else
452  {
453    $alt_thumbnail = $file;
454  }
455  $next_title = $lang['next_image']." : ".$alt_thumbnail;
456
457  $url_link = './picture.php?image_id='.$row['id'].'&amp;cat='.$page['cat'];
458  $url_link.= '&amp;expand='.$_GET['expand'];
459  if ( $page['cat'] == 'search' )
460  {
461    $url_link.= "&amp;search=".$_GET['search'].'&amp;mode='.$_GET['mode'];
462  }
463  // sending vars for display
464  $vtp->addSession( $handle,   'next' );
465  $vtp->setGlobalVar( $handle, 'next.url', add_session_id( $url_link ) );
466  $vtp->setGlobalVar( $handle, 'next.title', $next_title );
467  $vtp->setGlobalVar( $handle, 'next.src', $lien_thumbnail );
468  $vtp->setGlobalVar( $handle, 'next.alt', $alt_thumbnail );
469  $vtp->closeSession( $handle, 'next' );
470}
471else
472{
473  $vtp->addSession( $handle, 'previous_empty' );
474  $vtp->closeSession( $handle, 'previous_empty' );
475}
476//---------------------------------------------------- users's comments display
477if ( $conf['show_comments'] )
478{
479  $vtp->addSession( $handle, 'comments' );
480  // comment registeration
481  if ( isset( $_POST['content'] ) && $_POST['content'] != '' )
482  {
483    $author = $user['pseudo'];
484    if ( $_POST['author'] != "" )
485    {
486      $author = $_POST['author'];
487    }
488    $query = 'insert into '.PREFIX_TABLE.'comments';
489    $query.= ' (author,date,image_id,content) values';
490    $query.= " ('".$author."',".time().",".$page['id'];
491    $query.= ",'".htmlspecialchars( $_POST['content'], ENT_QUOTES)."');";
492    mysql_query( $query );
493  }
494  // comment deletion
495  if ( isset( $_GET['del'] )
496       && is_numeric( $_GET['del'] )
497       && $user['status'] == 'admin' )
498  {
499    $query = 'delete from '.PREFIX_TABLE.'comments';
500    $query.= ' where id = '.$_GET['del'].';';
501    mysql_query( $query );
502  }
503  // number of comment for this picture
504  $query = 'select count(*) as nb_comments';
505  $query.= ' from '.PREFIX_TABLE.'comments';
506  $query.= ' where image_id = '.$page['id'].';';
507  $row = mysql_fetch_array( mysql_query( $query ) );
508  $page['nb_comments'] = $row['nb_comments'];
509  // navigation bar creation
510  $url = './picture.php?cat='.$page['cat'].'&amp;image_id='.$page['id'];
511  $url.= '&amp;expand='.$_GET['expand'];
512  if ( $page['cat'] == 'search' )
513  {
514    $url.= '&amp;search='.$_GET['search'].'&amp;mode='.$_GET['mode'];
515  }
516  if( !isset( $_GET['start'] )
517      || !is_numeric( $_GET['start'] )
518      || ( is_numeric( $_GET['start'] ) && $_GET['start'] < 0 ) )
519  {
520    $page['start'] = 0;
521  }
522  else
523  {
524    $page['start'] = $_GET['start'];
525  }
526  $page['navigation_bar'] = create_navigation_bar( $url, $page['nb_comments'],
527                                                   $page['start'],
528                                                   $conf['nb_comment_page'],
529                                                   '' );
530  // sending vars for display
531  $vtp->setGlobalVar( $handle, 'navigation_bar', $page['navigation_bar'] );
532  $vtp->setGlobalVar( $handle, 'nb_comments', $page['nb_comments'] );
533
534  $query = 'select id,author,date,image_id,content';
535  $query.= ' from '.PREFIX_TABLE.'comments';
536  $query.= ' where image_id = '.$page['id'];
537  $query.= ' order by date asc';
538  $query.= ' limit '.$page['start'].', '.$conf['nb_comment_page'].';';
539  $result = mysql_query( $query );
540               
541  while ( $row = mysql_fetch_array( $result ) )
542  {
543    $vtp->addSession( $handle, 'comment' );
544    $vtp->setVar( $handle, 'comment.author', $row['author'] );
545    $displayed_date = $lang['day'][date( "w", $row['date'] )];
546    $displayed_date.= date( " j ", $row['date'] );
547    $displayed_date.= $lang['month'][date( "n", $row['date'] )];
548    $displayed_date.= date( " Y G:i", $row['date'] );
549    $vtp->setVar( $handle, 'comment.date', $displayed_date );
550    $vtp->setVar( $handle, 'comment.content', nl2br( $row['content'] ) );
551    if ( $user['status'] == 'admin' )
552    {
553      $vtp->addSession( $handle, 'delete' );
554      $vtp->setVar( $handle, 'delete.link',
555                    add_session_id( $url.'&amp;del='.$row['id'] ) );
556      $vtp->closeSession( $handle, 'delete' );
557    }
558    $vtp->closeSession( $handle, 'comment' );
559  }
560  // form action
561  $action = str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'] );
562  $vtp->setGlobalVar( $handle, 'form_action', $action );
563  // display author field if the user is not logged in
564  if ( !$user['is_the_guest'] )
565  {
566    $vtp->addSession( $handle, 'author_known' );
567    $vtp->setVar( $handle, 'author_known.value', $user['pseudo'] );
568    $vtp->closeSession( $handle, 'author_known' );
569  }
570  else
571  {
572    $vtp->addSession( $handle, 'author_field' );
573    $vtp->closeSession( $handle, 'author_field' );
574  }
575  $vtp->closeSession( $handle, 'comments' );
576}
577//------------------------------------------------------------ log informations
578pwg_log( 'picture', $intitule_cat, $page['file'] );
579mysql_close();
580//----------------------------------------------------------- html code display
581$code = $vtp->Display( $handle, 0 );
582echo $code;
583//------------------------------------------------------------ log informations
584$query = 'insert into '.PREFIX_TABLE.'history';
585$query.= ' (date,login,IP,page,titre,categorie) values';
586$query.= " (".time().", '".$user['pseudo']."','".$_SERVER['REMOTE_ADDR']."'";
587$query.= ",'picture','".$page['file']."','".$intitule_cat."');";
588@mysql_query( $query );
589?>
Note: See TracBrowser for help on using the repository browser.