scaleImageSquare(80); $r = $img->store($profile_id); } if($profile_id) { $r = q("UPDATE `profile` SET `photo` = '%s' WHERE `id` = %d LIMIT 1", dbesc($a->get_baseurl() . '/photo/' . $profile_id . '.jpg'), intval($profile_id) ); } else nuke_record($url); exit; } function nuke_record($url) { $nurl = str_replace(array('https:','//www.'), array('http:','//'), $url); $r = q("SELECT `id` FROM `profile` WHERE ( `homepage` = '%s' OR `nurl` = '%s' ) ", dbesc($url), dbesc($nurl) ); if(count($r)) { foreach($r as $rr) { q("DELETE FROM `photo` WHERE `profile-id` = %d LIMIT 1", intval($rr['id']) ); q("DELETE FROM `profile` WHERE `id` = %d LIMIT 1", intval($rr['id']) ); } } return; }