Ignore:
Timestamp:
08/23/14 12:51:23 (6 years ago)
Author:
mistic100
Message:

update for 2.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Google2Piwigo/include/ws_functions.inc.php

    r26198 r29251  
    2828  } 
    2929   
    30   global $conf, $pwg_loaded_plugins; 
     30  global $conf; 
     31   
     32  $conf['google2piwigo'] = safe_unserialize($conf['google2piwigo']); 
    3133   
    3234  include_once(PHPWG_ROOT_PATH . 'admin/include/functions.php'); 
     
    130132  if (!empty($params['fills'])) 
    131133  { 
    132     $params['fills'] = rtrim($params['fills'], ','); 
    133     $params['fills'] = explode(',', $params['fills']); 
     134    $fills = rtrim($params['fills'], ','); 
     135    $fills = explode(',', $fills); 
     136    $fills = array_flip($fills); 
    134137   
    135138    $updates = array(); 
    136     if (in_array('fill_name', $params['fills']))        $updates['name'] = pwg_db_real_escape_string($photo['title']);  
    137     if (in_array('fill_date', $params['fills']))        $updates['date_creation'] = date('Y-m-d H:i:s', $photo['timestamp']); 
    138     if (in_array('fill_author', $params['fills']))      $updates['author'] = pwg_db_real_escape_string($photo['author']); 
    139     if (in_array('fill_description', $params['fills'])) $updates['comment'] = pwg_db_real_escape_string($photo['description']); 
    140     if (in_array('fill_geotag', $params['fills']) and !empty($photo['latlon'])) 
     139    if (isset($fills['fill_name']))        $updates['name'] = pwg_db_real_escape_string($photo['title']);  
     140    if (isset($fills['fill_date']))        $updates['date_creation'] = date('Y-m-d H:i:s', $photo['timestamp']); 
     141    if (isset($fills['fill_author']))      $updates['author'] = pwg_db_real_escape_string($photo['author']); 
     142    if (isset($fills['fill_description'])) $updates['comment'] = pwg_db_real_escape_string($photo['description']); 
     143    if (isset($fills['fill_geotag']) and !empty($photo['latlon'])) 
    141144    { 
    142145      $latlon = explode(' ', $photo['latlon']); 
     
    157160    } 
    158161     
    159     if (!empty($photo['tags']) and in_array('fill_tags', $params['fills'])) 
     162    if (!empty($photo['tags']) and isset($fills['fill_tags'])) 
    160163    { 
    161164      set_tags(get_tag_ids($photo['tags']), $photo['image_id']); 
Note: See TracChangeset for help on using the changeset viewer.