Changeset 2406 for branches


Ignore:
Timestamp:
Jun 28, 2008, 3:58:35 PM (16 years ago)
Author:
mathiasm
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_7/picture.php

    r2326 r2406  
    2929include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
    3030include_once(PHPWG_ROOT_PATH.'include/functions_picture.inc.php');
     31include_once(PHPWG_ROOT_PATH.'include/functions_session.inc.php');
    3132
    3233// Check Access and exit when user status is not ok
     
    4950    duplicate_index_url()
    5051    );
     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
    5165}
    5266
     
    459473// metadata
    460474$url_metadata = duplicate_picture_url();
     475$url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
     476
    461477
    462478// do we have a plugin that can show metadata for something else than images?
     
    470486  );
    471487
    472 if ($metadata_showable)
    473 {
    474   if ( !isset($_GET['metadata']) )
    475   {
    476     $url_metadata = add_url_params( $url_metadata, array('metadata'=>null) );
    477   }
    478   else
    479   {
    480     $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
    481   }
    482 }
     488if ( $metadata_showable and pwg_get_session_var('show_metadata') )
     489{
     490  $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1);
     491}
     492
    483493
    484494$page['body_id'] = 'thePicturePage';
     
    771781$template->assign_vars($infos);
    772782
    773 
    774783// related categories
    775784if ( count($related_categories)==1 and
     
    778787{ // no need to go to db, we have all the info
    779788  $template->assign_block_vars(
    780       'category',
     789    'category',
    781790      array('LINE'=>get_cat_display_name( $page['category']['upper_names'] ))
    782791    );
     
    837846include(PHPWG_ROOT_PATH.'include/picture_rate.inc.php');
    838847include(PHPWG_ROOT_PATH.'include/picture_comment.inc.php');
    839 if ($metadata_showable and isset($_GET['metadata']))
     848if ($metadata_showable and pwg_get_session_var('show_metadata') <> null )
    840849{
    841850  include(PHPWG_ROOT_PATH.'include/picture_metadata.inc.php');
Note: See TracChangeset for help on using the changeset viewer.