Changeset 1609


Ignore:
Timestamp:
Nov 15, 2006, 5:25:12 AM (17 years ago)
Author:
rvelices
Message:

completely replaced get_thumbnail_src it get_thumbnail_url
or get_thumbnail_path

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/cat_modify.php

    r1500 r1609  
    389389  {
    390390    $query = '
    391 SELECT tn_ext,path
     391SELECT id,tn_ext,path
    392392  FROM '.IMAGES_TABLE.'
    393393  WHERE id = '.$category['representative_picture_id'].'
    394394;';
    395395    $row = mysql_fetch_array(pwg_query($query));
    396     $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
     396    $src = get_thumbnail_url($row);
    397397    $url = PHPWG_ROOT_PATH.'admin.php?page=picture_modify';
    398398    $url.= '&image_id='.$category['representative_picture_id'];
  • trunk/admin/element_set_global.php

    r1314 r1609  
    123123';
    124124    pwg_query($query);
    125    
     125
    126126    update_category($_POST['dissociate']);
    127127  }
     
    400400  }
    401401
    402   while ($row = mysql_fetch_array($result))
    403   {
    404     $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
     402  while ($row = mysql_fetch_assoc($result))
     403  {
     404    $src = get_thumbnail_url($row);
    405405
    406406    $template->assign_block_vars(
  • trunk/admin/element_set_unit.php

    r1314 r1609  
    2929 * Management of elements set. Elements can belong to a category or to the
    3030 * user caddie.
    31  * 
     31 *
    3232 */
    33  
     33
    3434if (!defined('PHPWG_ROOT_PATH'))
    3535{
     
    5151{
    5252  $collection = explode(',', $_POST['list']);
    53  
     53
    5454  $datas = array();
    55  
     55
    5656  $query = '
    5757SELECT id, date_creation
     
    7676      }
    7777    }
    78    
     78
    7979    if ($conf['allow_html_descriptions'])
    8080    {
     
    104104      $data{'date_creation'} = $row['date_creation'];
    105105    }
    106    
     106
    107107    array_push($datas, $data);
    108108
     
    113113    }
    114114  }
    115  
     115
    116116  mass_updates(
    117117    IMAGES_TABLE,
     
    122122    $datas
    123123    );
    124  
     124
    125125  array_push($page['infos'], l10n('Picture informations updated'));
    126126}
     
    142142
    143143    'L_SUBMIT'=>$lang['submit'],
    144    
     144
    145145    'U_ELEMENTS_PAGE'
    146146    =>$base_url.get_query_string_diff(array('display','start')),
    147    
     147
    148148    'U_GLOBAL_MODE'
    149149    =>
     
    151151    .get_query_string_diff(array('mode','display'))
    152152    .'&mode=global',
    153    
     153
    154154    'F_ACTION'=>$base_url.get_query_string_diff(array()),
    155155    )
     
    191191  // tags
    192192  $all_tags = get_all_tags();
    193  
     193
    194194  $element_ids = array();
    195195
     
    203203  $result = pwg_query($query);
    204204
    205   while ($row = mysql_fetch_array($result))
     205  while ($row = mysql_fetch_assoc($result))
    206206  {
    207207    // echo '<pre>'; print_r($row); echo '</pre>';
    208208    array_push($element_ids, $row['id']);
    209    
    210     $src = get_thumbnail_src($row['path'], @$row['tn_ext']);
     209
     210    $src = get_thumbnail_url($row);
    211211
    212212    $query = '
     
    216216;';
    217217    $selected_tags = array_from_query($query, 'tag_id');
    218    
     218
    219219    // creation date
    220220    if (!empty($row['date_creation']))
     
    242242        '</p>';
    243243    }
    244    
     244
    245245    $template->assign_block_vars(
    246246      'element',
     
    259259        'DESCRIPTION' => @$row['comment'],
    260260        'DATE_CREATION_YEAR' => $year,
    261        
     261
    262262        'TAG_SELECTION' => $tag_selection,
    263263        )
    264264      );
    265    
     265
    266266    get_day_list('element.date_creation_day', $day);
    267267    get_month_list('element.date_creation_month', $month);
  • trunk/admin/picture_modify.php

    r1571 r1609  
    142142';
    143143  pwg_query($query);
    144  
     144
    145145  update_category($_POST['cat_associated']);
    146146}
     
    224224    '</p>';
    225225}
    226  
     226
    227227$template->assign_vars(
    228228  array(
     
    235235    'PATH'=>$row['path'],
    236236
    237     'TN_SRC' => get_thumbnail_src($row['path'], @$row['tn_ext']),
     237    'TN_SRC' => get_thumbnail_url($row),
    238238
    239239    'NAME' =>
  • trunk/admin/waiting.php

    r1458 r1609  
    4343  $to_validate = array();
    4444  $to_reject = array();
    45  
     45
    4646  if (isset($_POST['submit']))
    47   {   
     47  {
    4848    foreach (explode(',', $_POST['list']) as $waiting_id)
    4949    {
     
    107107      $dir = get_complete_dir($row['storage_category_id']);
    108108      unlink($dir.$row['file']);
    109       if (isset($row['tn_ext']) and $row['tn_ext'] != '')
     109      $element_info = array(
     110        'path' => $dir.$row['file'],
     111        'tn_ext' =>
     112          (isset($row['tn_ext']) and $row['tn_ext']!='') ? $row['tn_ext']:'jpg'
     113        );
     114      $tn_path = get_thumbnail_path( $element_info );
     115
     116      if ( @is_file($tn_path) )
    110117      {
    111         unlink(
    112           get_thumbnail_src(
    113             $dir.$row['file'],
    114             $row['tn_ext']
    115             )
    116           );
    117       }
    118       else if (@is_file(get_thumbnail_src($dir.$row['file'], 'jpg')))
    119       {
    120         unlink(
    121           get_thumbnail_src(
    122             $dir.$row['file'],
    123             'jpg'
    124             )
    125           );
     118        unlink( $tn_path );
    126119      }
    127120    }
    128    
     121
    129122    $query = '
    130123DELETE
     
    155148  'L_RESET'=>$lang['reset'],
    156149  'L_DELETE'=>$lang['delete'],
    157  
     150
    158151  'F_ACTION'=>str_replace( '&', '&amp;', $_SERVER['REQUEST_URI'])
    159152  ));
    160  
     153
    161154//---------------------------------------------------------------- form display
    162155$cat_names = array();
     
    183176  $class='row1';
    184177  if ( $i++ % 2== 0 ) $class='row2';
    185  
     178
    186179  $template->assign_block_vars(
    187180    'picture',
     
    195188        (strlen($row['file']) > 10) ?
    196189          (substr($row['file'], 0, 10)).'...' : $row['file'],
    197       'PREVIEW_URL_IMG'=>$preview_url, 
     190      'PREVIEW_URL_IMG'=>$preview_url,
    198191      'UPLOAD_EMAIL'=>get_email_address_as_display_text($row['mail_address']),
    199192      'UPLOAD_USERNAME'=>$row['username']
     
    209202        $url = $cat_names[$row['storage_category_id']]['dir'];
    210203    $url.= 'thumbnail/'.$thumbnail;
    211        
     204
    212205    $template->assign_block_vars(
    213206      'picture.thumbnail',
     
    230223    )
    231224  );
    232  
     225
    233226//----------------------------------------------------------- sending html code
    234227$template->assign_var_from_handle('ADMIN_CONTENT', 'waiting');
  • trunk/include/functions.inc.php

    r1596 r1609  
    681681}
    682682
    683 /**
    684 DEPRECATED use get_thumbnail_path or get_thumbnail_url
    685  */
    686 function get_thumbnail_src($path, $tn_ext = '', $with_rewrite = true)
    687 {
    688   if ($with_rewrite)
    689     return get_thumbnail_url( array('path'=>$path, 'tn_ext'=>$tn_ext) );
    690   else
    691     return get_thumbnail_path( array('path'=>$path, 'tn_ext'=>$tn_ext) );
    692 }
    693 
    694683/* Returns the PATH to the thumbnail to be displayed. If the element does not
    695684 * have a thumbnail, the default mime image path is returned. The PATH can be
Note: See TracChangeset for help on using the changeset viewer.