Changeset 29251


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

update for 2.7

Location:
extensions/Google2Piwigo
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Google2Piwigo/admin.php

    r28832 r29251  
    55 
    66load_language('plugin.lang', PICASA_WA_PATH); 
     7$conf['google2piwigo'] = safe_unserialize($conf['google2piwigo']); 
    78 
    89if (!file_exists(PICASA_WA_CACHE)) 
  • 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']); 
  • extensions/Google2Piwigo/main.inc.php

    r28832 r29251  
    1717define('PICASA_WA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . PICASA_WA_ID); 
    1818define('PICASA_WA_CACHE', PHPWG_ROOT_PATH . $conf['data_location'] . 'picasa_wa_cache/'); 
    19 define('PICASA_WA_VERSION',  'auto'); 
    2019 
    2120 
    22 include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php'); 
     21if (defined('IN_WS')) 
     22{ 
     23  include_once(PICASA_WA_PATH . 'include/ws_functions.inc.php'); 
    2324 
    24  
    25 add_event_handler('init', 'picasa_wa_init'); 
    26 add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method'); 
     25  add_event_handler('ws_add_methods', 'picasa_wa_add_ws_method'); 
     26} 
    2727 
    2828if (defined('IN_ADMIN')) 
     
    6666  } 
    6767} 
    68  
    69 function picasa_wa_init() 
    70 { 
    71   global $conf; 
    72   include_once(PICASA_WA_PATH . 'maintain.inc.php'); 
    73   $maintain = new Google2Piwigo_maintain(PICASA_WA_ID); 
    74   $maintain->autoUpdate(PICASA_WA_VERSION, 'install'); 
    75  
    76   $conf['google2piwigo'] = unserialize($conf['google2piwigo']); 
    77 } 
Note: See TracChangeset for help on using the changeset viewer.