Changeset 1059 for trunk/picture.php


Ignore:
Timestamp:
Feb 28, 2006, 5:28:06 AM (18 years ago)
Author:
rvelices
Message:

calendar improvements: week on weekly list starts on Monday,
ability to show grayed months/weeks/days (without any picture in it),
added icons for created/posted fields
language uniformization

calendar fixes: correct number of pictures in calendar view,
code simplification (I hope so)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r1057 r1059  
    174174          array_push( $already_there, $row['element_id'] );
    175175        }
    176        
     176
    177177        if ( count($already_there)>0 )
    178178        {
     
    184184          pwg_query($query);
    185185        }
    186        
     186
    187187        $query = '
    188188UPDATE '. RATE_TABLE . '
     
    192192        pwg_query($query);
    193193
    194         setcookie('pwg_anonymous_rater', $anonymous_id, 
     194        setcookie('pwg_anonymous_rater', $anonymous_id,
    195195                   strtotime('+10 years'), cookie_path() );
    196196      }
     
    198198    else
    199199    {
    200       setcookie('pwg_anonymous_rater', $anonymous_id, 
     200      setcookie('pwg_anonymous_rater', $anonymous_id,
    201201                 strtotime('+10 years'), cookie_path() );
    202202    }
     
    293293    $i = 'current';
    294294  }
    295  
     295
    296296  foreach (array_keys($row) as $key)
    297297  {
     
    307307    $picture[$i]['is_picture'] = true;
    308308  }
    309  
     309
    310310  $cat_directory = dirname($row['path']);
    311311  $file_wo_ext = get_filename_wo_extension($row['file']);
     
    347347
    348348  $picture[$i]['thumbnail'] = get_thumbnail_src($row['path'], @$row['tn_ext']);
    349  
     349
    350350  if ( !empty( $row['name'] ) )
    351351  {
     
    377377if ($url_up_start>0)
    378378{
    379   $url_up .= '&start='.$url_up_start; 
     379  $url_up .= '&start='.$url_up_start;
    380380}
    381381
     
    408408  $query.= ';';
    409409  $result = pwg_query( $query );
    410  
     410
    411411  if ( $_GET['add_fav'] == 1 )
    412412  {
     
    461461    }
    462462  }
    463  
     463
    464464  if ( $register_comment )
    465465  {
     
    480480      $data{'image_id'} = $_GET['image_id'];
    481481      $data{'content'} = htmlspecialchars( $_POST['content'], ENT_QUOTES);
    482      
     482
    483483      if (!$conf['comments_validation'] or $user['status'] == 'admin')
    484484      {
     
    490490        $data{'validated'} = 'false';
    491491      }
    492      
     492
    493493      include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
    494494      $fields = array('author', 'date', 'image_id', 'content', 'validated',
    495495                      'validation_date');
    496496      mass_inserts(COMMENTS_TABLE, $fields, array($data));
    497      
     497
    498498      // information message
    499499      $message = $lang['comment_added'];
    500500
    501501      if (!$conf['comments_validation'] or $user['status'] == 'admin')
    502      
     502
    503503      if ( $conf['comments_validation'] and $user['status'] != 'admin' )
    504504      {
     
    541541
    542542$title_img = $picture['current']['name'];
    543 if ( isset( $page['cat'] ) ) 
    544 {
    545   if (is_numeric( $page['cat'] )) 
     543if ( isset( $page['cat'] ) )
     544{
     545  if (is_numeric( $page['cat'] ))
    546546  {
    547547    $title_img = replace_space(get_cat_display_name($page['cat_name']));
     
    648648  'L_UP_HINT' => $lang['home_hint'],
    649649  'L_UP_ALT' => $lang['home'],
    650  
     650
    651651  'U_HOME' => (PHPWG_ROOT_PATH.'category.php'),
    652652  'U_UP' => $url_up,
     
    687687}
    688688// button to set the current picture as representative
    689 if ('admin' == $user['status'] and 
     689if ('admin' == $user['status'] and
    690690    isset($page['cat']) and is_numeric($page['cat']))
    691691{
     
    741741    $url.= get_query_string_diff(array('add_fav'));
    742742    $url.= '&add_fav=0';
    743    
     743
    744744    $template->assign_block_vars(
    745745      'favorite',
     
    805805// date of availability
    806806$val = format_date($picture['current']['date_available'], 'mysql_datetime');
    807 $infos['INFO_AVAILABILITY_DATE'] = '<a href="'.
     807$infos['INFO_POSTED_DATE'] = '<a href="'.
    808808   PHPWG_ROOT_PATH.'category.php?calendar=posted-c-'.
    809809   substr($picture['current']['date_available'],0,10).'">'.$val.'</a>';
     
    894894      die('Exif extension not available, admin should disable exif display');
    895895    }
    896    
     896
    897897    if ($exif = @read_exif_data($picture['current']['src']))
    898898    {
     
    913913              $key = $lang['exif_field_'.$field];
    914914            }
    915            
     915
    916916            $template->assign_block_vars(
    917917              'metadata.line',
     
    933933              $key = $lang['exif_field_'.$tokens[1]];
    934934            }
    935            
     935
    936936            $template->assign_block_vars(
    937937              'metadata.line',
     
    958958        );
    959959    }
    960    
     960
    961961    foreach ($iptc as $field => $value)
    962962    {
     
    966966        $key = $lang[$field];
    967967      }
    968      
     968
    969969      $template->assign_block_vars(
    970970        'metadata.line',
     
    981981{
    982982  if ( !is_numeric( $_GET['slideshow'] ) ) $_GET['slideshow'] = $conf['slideshow_period'];
    983  
     983
    984984  $template->assign_block_vars('stop_slideshow', array(
    985985  'U_SLIDESHOW'=>$picture['current']['url']
     
    10201020      WHERE element_id = '.$_GET['image_id'] . '
    10211021      AND user_id = '.$user['id'] ;
    1022  
     1022
    10231023      if ($user['is_the_guest'])
    10241024      {
     
    10311031        $query .= ' AND anonymous_id = \''.$anonymous_id . '\'';
    10321032      }
    1033      
     1033
    10341034      $result = pwg_query($query);
    10351035      if (mysql_num_rows($result) > 0)
     
    10451045      }
    10461046    }
    1047     else 
     1047    else
    10481048    {
    10491049      $sentence = $lang['never_rated'].'. '.$lang['Rate'];
     
    11111111  $query.= ';';
    11121112  $row = mysql_fetch_array( pwg_query( $query ) );
    1113  
     1113
    11141114  // navigation bar creation
    11151115  $url = PHPWG_ROOT_PATH.'picture.php';
     
    11621162    }
    11631163  }
    1164  
     1164
    11651165  if (!$user['is_the_guest']
    11661166      or ($user['is_the_guest'] and $conf['comments_forall']))
Note: See TracChangeset for help on using the changeset viewer.