- Cache::set("gprobe:".$urlparts["host"],serialize($arr));
-
- if(count($arr) && x($arr,'network') && $arr['network'] === NETWORK_DFRN) {
- q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)
- values ( '%s', '%s', '%s', '%s') ",
- dbesc($arr['name']),
- dbesc($arr['url']),
- dbesc(normalise_link($arr['url'])),
- dbesc($arr['photo'])
- );
- }
- $r = q("select * from gcontact where nurl = '%s' limit 1",
+ Cache::set("gprobe:".$urlparts["host"], $arr);
+
+ if (!in_array($arr["network"], array(NETWORK_FEED, NETWORK_PHANTOM)))
+ update_gcontact($arr);
+
+ $r = q("SELECT `id`, `url`, `network` FROM `gcontact` WHERE `nurl` = '%s' ORDER BY `id` LIMIT 1",