+ if($photo) {
+ logger('mod-crepair: updating photo from ' . $photo);
+ require_once("Photo.php");
+
+ $photos = import_profile_photo($photo,local_user(),$contact['id']);
+
+ $x = q("UPDATE `contact` SET `photo` = '%s',
+ `thumb` = '%s',
+ `micro` = '%s',
+ `name-date` = '%s',
+ `uri-date` = '%s',
+ `avatar-date` = '%s'
+ WHERE `id` = %d LIMIT 1
+ ",
+ dbesc($photos[0]),
+ dbesc($photos[1]),
+ dbesc($photos[2]),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ dbesc(datetime_convert()),
+ intval($contact['id'])
+ );
+ }
+