Changeset 531 for trunk/picture.php
- Timestamp:
- Sep 23, 2004, 6:42:11 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r511 r531 194 194 195 195 $picture[$i]['url'] = PHPWG_ROOT_PATH.'picture.php'; 196 $picture[$i]['url'].= get_query_string_diff(array('image_id','add_fav')); 196 $picture[$i]['url'].= get_query_string_diff(array('image_id','add_fav', 197 'slideshow')); 197 198 $picture[$i]['url'].= '&image_id='.$row['id']; 198 199 } … … 208 209 $url_admin.= '&cat_id='.$page['cat']; 209 210 $url_admin.= '&image_id='.$_GET['image_id']; 211 212 $url_slide = $picture['current']['url'].'&slideshow='.$conf['slideshow_period']; 210 213 //----------------------------------------------------------- rate registration 211 214 if (isset($_GET['rate']) … … 374 377 $title = $picture['current']['name']; 375 378 $refresh = 0; 376 if ( isset( $_GET['slideshow'] ) and $ next )379 if ( isset( $_GET['slideshow'] ) and $has_next ) 377 380 { 378 381 $refresh= $_GET['slideshow']; … … 386 389 $title_img = replace_space(get_cat_display_name( $page['cat_name'], " > ")); 387 390 $n = $page['num'] + 1; 388 $title_nb = "Photo".' '.$n.'/'; 389 $title_nb.= $page['cat_nb_images']; 390 //$title_img.= $picture['current']['name']; 391 $title_nb = $n.'/'.$page['cat_nb_images']; 391 392 } 392 393 else if ( $page['cat'] == 'search' ) … … 410 411 $picture_size = get_picture_size( $original_width, $original_height, 411 412 $user['maxwidth'], $user['maxheight'] ); 413 414 // metadata 415 if ($conf['show_exif'] or $conf['show_iptc']) 416 { 417 $metadata_showable = true; 418 } 419 else 420 { 421 $metadata_showable = false; 422 } 423 424 $url_metadata = PHPWG_ROOT_PATH.'picture.php'; 425 $url_metadata .= get_query_string_diff(array('add_fav', 'slideshow', 'show_metadata')); 426 if ($metadata_showable and !isset($_GET['show_metadata'])) 427 { 428 $url_metadata.= '&show_metadata=1'; 429 } 412 430 413 431 include(PHPWG_ROOT_PATH.'include/page_header.php'); … … 438 456 'L_DOWNLOAD' => $lang['download'], 439 457 'L_DOWNLOAD_HINT' => $lang['download_hint'], 440 'L_PICTURE_SHOW_METADATA' => $lang['picture_show_metadata'], 441 'L_PICTURE_HIDE_METADATA' => $lang['picture_hide_metadata'], 442 443 'T_DEL_IMG' =>PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/delete.gif', 458 'L_PICTURE_METADATA' => $lang['picture_show_metadata'], 444 459 445 460 'U_HOME' => add_session_id($url_home), 461 'U_METADATA' => add_session_id($url_metadata), 446 462 'U_ADMIN' => add_session_id($url_admin), 463 'U_SLIDESHOW'=> add_session_id($url_slide), 447 464 'U_ADD_COMMENT' => add_session_id(str_replace( '&', '&', $_SERVER['REQUEST_URI'] )) 448 465 ) 449 466 ); 450 451 //-------------------------------------------------------- slideshow management 452 if ( isset( $_GET['slideshow'] ) ) 453 { 454 if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period'][0]; 455 456 $template->assign_block_vars('stop_slideshow', array( 457 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'] ) 458 )); 467 //-------------------------------------------------------- upper menu management 468 // download link if file is not a picture 469 if (!$picture['current']['is_picture']) 470 { 471 $template->assign_block_vars('download', array( 472 'U_DOWNLOAD' => $picture['current']['download'] 473 )); 459 474 } 460 475 else 461 476 { 462 $template->assign_block_vars('start_slideshow', array()); 463 foreach ( $conf['slideshow_period'] as $option ) 464 { 465 $template->assign_block_vars('start_slideshow.second', array( 466 'SLIDESHOW_SPEED'=>$option, 467 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'].'&slideshow='.$option) 468 )); 469 } 470 } 471 477 $template->assign_block_vars('ecard', array( 478 'U_ECARD' => $picture['current']['url'] 479 )); 480 } 481 482 //------------------------------------------------------- favorite manipulation 483 if ( !$user['is_the_guest'] ) 484 { 485 // verify if the picture is already in the favorite of the user 486 $query = 'SELECT COUNT(*) AS nb_fav'; 487 $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id']; 488 $query.= ' AND user_id = '.$user['id'].';'; 489 $result = mysql_query( $query ); 490 $row = mysql_fetch_array( $result ); 491 if (!$row['nb_fav']) 492 { 493 $url = PHPWG_ROOT_PATH.'picture.php'; 494 $url.= get_query_string_diff(array('rate','add_fav')); 495 $url.= '&add_fav=1'; 496 497 $template->assign_block_vars( 498 'favorite', 499 array( 500 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/favorite.gif', 501 'FAVORITE_HINT' =>$lang['add_favorites_hint'], 502 'FAVORITE_ALT' =>$lang['add_favorites_alt'], 503 'U_FAVORITE' => $url 504 )); 505 } 506 else 507 { 508 $url = PHPWG_ROOT_PATH.'picture.php'; 509 $url.= get_query_string_diff(array('rate','add_fav')); 510 $url.= '&add_fav=0'; 511 512 $template->assign_block_vars( 513 'favorite', 514 array( 515 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/del_favorite.gif', 516 'FAVORITE_HINT' =>$lang['del_favorites_hint'], 517 'FAVORITE_ALT' =>$lang['del_favorites_alt'], 518 'U_FAVORITE'=> $url 519 )); 520 } 521 } 522 //------------------------------------ admin link for information modifications 523 if ( $user['status'] == 'admin' ) 524 { 525 $template->assign_block_vars('admin', array()); 526 } 527 528 //-------------------------------------------------------- navigation management 472 529 if ($has_prev) 473 530 { … … 503 560 )); 504 561 } 505 // download link if file is not a picture 506 if (!$picture['current']['is_picture']) 507 { 508 $template->assign_block_vars( 509 'download', 510 array( 511 'U_DOWNLOAD' => $picture['current']['download'] 512 )); 513 } 562 514 563 515 564 // author … … 643 692 )); 644 693 } 645 //-------------------------------------------------------------------- metadata 646 if ($conf['show_exif'] or $conf['show_iptc']) 647 { 648 $metadata_showable = true; 649 } 650 else 651 { 652 $metadata_showable = false; 653 } 654 655 if ($metadata_showable and !isset($_GET['show_metadata'])) 656 { 657 $url = PHPWG_ROOT_PATH.'picture.php?'.$_SERVER['QUERY_STRING']; 658 $url.= '&show_metadata=1'; 659 $template->assign_block_vars('show_metadata', array('URL' => $url)); 660 } 694 695 //metadata 661 696 662 697 if ($metadata_showable and isset($_GET['show_metadata'])) 663 698 { 664 $url = PHPWG_ROOT_PATH.'picture.php';665 $url.= get_query_string_diff(array('show_metadata','add_fav'));666 667 $template->assign_block_vars('hide_metadata', array('URL' => $url));668 669 699 include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php'); 670 671 700 $template->assign_block_vars('metadata', array()); 672 673 701 if ($conf['show_exif']) 674 702 { … … 679 707 array('TITLE' => 'EXIF Metadata') 680 708 ); 681 709 682 710 foreach ($conf['show_exif_fields'] as $field) 683 711 { … … 724 752 } 725 753 } 726 727 754 if ($conf['show_iptc']) 728 755 { … … 756 783 } 757 784 } 785 //slideshow end 786 if ( isset( $_GET['slideshow'] ) ) 787 { 788 if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period']; 789 790 $template->assign_block_vars('stop_slideshow', array( 791 'U_SLIDESHOW'=>add_session_id( $picture['current']['url'] ) 792 )); 793 } 794 758 795 //------------------------------------------------------------------- rate form 759 796 if ($conf['rate']) … … 806 843 )); 807 844 } 808 }809 //------------------------------------------------------- favorite manipulation810 if ( !$user['is_the_guest'] )811 {812 // verify if the picture is already in the favorite of the user813 $query = 'SELECT COUNT(*) AS nb_fav';814 $query.= ' FROM '.FAVORITES_TABLE.' WHERE image_id = '.$_GET['image_id'];815 $query.= ' AND user_id = '.$user['id'].';';816 $result = mysql_query( $query );817 $row = mysql_fetch_array( $result );818 if (!$row['nb_fav'])819 {820 $url = PHPWG_ROOT_PATH.'picture.php';821 $url.= get_query_string_diff(array('rate','add_fav'));822 $url.= '&add_fav=1';823 824 $template->assign_block_vars(825 'favorite',826 array(827 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/favorite.gif',828 'FAVORITE_HINT' =>$lang['add_favorites_hint'],829 'FAVORITE_ALT' =>'[ '.$lang['add_favorites_alt'].' ]',830 'U_FAVORITE' => $url831 ));832 }833 else834 {835 $url = PHPWG_ROOT_PATH.'picture.php';836 $url.= get_query_string_diff(array('rate','add_fav'));837 $url.= '&add_fav=0';838 839 $template->assign_block_vars(840 'favorite',841 array(842 'FAVORITE_IMG' => PHPWG_ROOT_PATH.'template/'.$user['template'].'/theme/del_favorite.gif',843 'FAVORITE_HINT' =>$lang['del_favorites_hint'],844 'FAVORITE_ALT' =>'[ '.$lang['del_favorites_alt'].' ]',845 'U_FAVORITE'=> $url846 ));847 }848 }849 //------------------------------------ admin link for information modifications850 if ( $user['status'] == 'admin' )851 {852 $template->assign_block_vars('modification', array());853 845 } 854 846
Note: See TracChangeset
for help on using the changeset viewer.