Ignore:
Timestamp:
Feb 8, 2014, 11:26:08 AM (10 years ago)
Author:
mistic100
Message:

fix bugs in "import all" and level sync

File:
1 edited

Legend:

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

    r27242 r27265  
    9898    $photo['category'] = array($photo['category']);
    9999  }
    100  
    101   // level
    102   $level = 0;
    103   if (in_array('level', $photo['fills']) && !$photo['visibility']['ispublic'])
    104   {
    105     $level = 8;
    106     if ($photo['visibility']['isfamily']) $level = 4;
    107     if ($photo['visibility']['isfriend']) $level = 2;
    108   }
    109100
    110101  // add photo
    111   $photo['image_id'] = add_uploaded_file($photo['path'], basename($photo['path']), $photo['category'], $level);
     102  $photo['image_id'] = add_uploaded_file($photo['path'], basename($photo['path']), $photo['category']);
    112103
    113104  // do some updates
     
    127118      $updates['latitude'] = pwg_db_real_escape_string($photo['location']['latitude']);
    128119      $updates['longitude'] = pwg_db_real_escape_string($photo['location']['longitude']);
     120    }
     121    if (in_array('level', $photo['fills']) && !$photo['visibility']['ispublic'])
     122    {
     123      $updates['level'] = 8;
     124      if ($photo['visibility']['isfamily']) $updates['level'] = 4;
     125      if ($photo['visibility']['isfriend']) $updates['level'] = 2;
    129126    }
    130127
Note: See TracChangeset for help on using the changeset viewer.