- Timestamp:
- Dec 26, 2013, 12:48:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/instagram2piwigo/include/ws_functions.inc.php
r19583 r26199 1 1 <?php 2 if (!defined('INSTAG_PATH'))die('Hacking attempt!');2 defined('INSTAG_PATH') or die('Hacking attempt!'); 3 3 4 4 function instagram_add_ws_method($arr) … … 14 14 'fills' => array('default' =>null), 15 15 ), 16 'Used by Instagram2Piwigo' 16 'Used by Instagram2Piwigo', 17 null, 18 array('hidden'=>true) 17 19 ); 18 20 } … … 26 28 27 29 global $conf; 28 $conf['Instagram2Piwigo'] = unserialize($conf['Instagram2Piwigo']);29 30 30 if ( empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key']))31 if (empty($conf['Instagram2Piwigo']['api_key']) or empty($conf['Instagram2Piwigo']['secret_key'])) 31 32 { 32 33 return new PwgError(null, l10n('Please fill your API keys on the configuration tab')); … … 65 66 'username' => $photo_f->getUser()->getFullName(true), 66 67 'tags' => $photo_f->getTags()->toArray(), 68 'location' => $photo_f->getLocation(), 67 69 ); 68 70 $photo = array_merge($param, $photo); … … 95 97 96 98 $updates = array(); 97 if (in_array('fill_name', $photo['fills'])) $updates['name'] = $photo['title'];99 if (in_array('fill_name', $photo['fills'])) $updates['name'] = pwg_db_real_escape_string($photo['title']); 98 100 if (in_array('fill_taken', $photo['fills'])) $updates['date_creation'] = $photo['date']; 99 if (in_array('fill_author', $photo['fills'])) $updates['author'] = $photo['username']; 101 if (in_array('fill_author', $photo['fills'])) $updates['author'] = pwg_db_real_escape_string($photo['username']); 102 if (in_array('fill_geotag', $photo['fills']) and !empty($photo['location']) ) 103 { 104 $updates['latitude'] = pwg_db_real_escape_string($photo['location']->getLat()); 105 $updates['longitude'] = pwg_db_real_escape_string($photo['location']->getLng()); 106 } 100 107 101 108 if (count($updates)) … … 108 115 } 109 116 110 if ( !empty($photo['tags']) and in_array('fill_tags', $photo['fills']))117 if (!empty($photo['tags']) and in_array('fill_tags', $photo['fills'])) 111 118 { 112 119 $raw_tags = implode(',', $photo['tags']); … … 115 122 } 116 123 117 return sprintf(l10n('Photo "%s" imported'), $photo['title']);124 return l10n('Photo "%s" imported', $photo['title']); 118 125 } 119 120 ?>
Note: See TracChangeset
for help on using the changeset viewer.