$link_text = '[img]' . $remote_photo_path . $remote_photo_name . '[/img]' . "\n";
- $r = q("update item set `body` = '%s' where `id` = %d and `uid` = %d limit 1",
- dbesc($link_text . $parent_item['body']),
- intval($parent_item['id']),
- intval($parent_item['uid'])
- );
+ if(! strstr($parent_item['body'],$link_text)) {
+ $r = q("update item set `body` = '%s' where `id` = %d and `uid` = %d limit 1",
+ dbesc($link_text . $parent_item['body']),
+ intval($parent_item['id']),
+ intval($parent_item['uid'])
+ );
+ }
return;
}