diff --git a/include/submit.php b/include/submit.php index 90876c2d..754474a9 100644 --- a/include/submit.php +++ b/include/submit.php @@ -6,17 +6,17 @@ require_once('site-health.php'); function run_submit($url) { global $a; - + if(! strlen($url)) return false; logger('Updating: ' . $url); - + //First run a notice script for the site it is hosted on. $site_health = notice_site($url, true); - + $submit_start = microtime(true); - + $nurl = str_replace(array('https:','//www.'), array('http:','//'), $url); $profile_exists = false; @@ -26,7 +26,7 @@ function run_submit($url) { dbesc($nurl) ); - if(count($r)) { + if(count($r)) { $profile_exists = true; $profile_id = $r[0]['id']; @@ -38,7 +38,7 @@ function run_submit($url) { intval($profile_id) ); } - + //Remove duplicates. if(count($r) > 1){ for($i=1; $iconfig['maintenance']['remove_profile_health_threshold']){ logger('Nuked bad health record.'); nuke_record($url); } - + return false; - + } - + //We don't care about valid dfrn if the user indicates to be hidden. elseif($parms['explicit-hide'] && $profile_exists) { logger('User opted out of the directory.'); @@ -117,18 +117,18 @@ function run_submit($url) { $parms['comm'] = intval($parms['comm']); if($profile_exists) { - $r = q("UPDATE `profile` SET - `name` = '%s', + $r = q("UPDATE `profile` SET + `name` = '%s', `pdesc` = '%s', - `locality` = '%s', - `region` = '%s', - `postal-code` = '%s', - `country-name` = '%s', + `locality` = '%s', + `region` = '%s', + `postal-code` = '%s', + `country-name` = '%s', `homepage` = '%s', `nurl` = '%s', `comm` = %d, `tags` = '%s', - `updated` = '%s' + `updated` = '%s' WHERE `id` = %d LIMIT 1", $parms['fn'], @@ -140,7 +140,7 @@ function run_submit($url) { dbesc($url), dbesc($nurl), intval($parms['comm']), - $parms['tags'], + $parms['tags'], dbesc(datetime_convert()), intval($profile_id) ); @@ -206,15 +206,15 @@ function run_submit($url) { } } } - + $submit_photo_start = microtime(true); - + require_once("Photo.php"); $photo_failure = false; - + $status = false; - + if($profile_id) { $img_str = fetch_url($photo,true); $img = new Photo($img_str); @@ -232,11 +232,11 @@ function run_submit($url) { nuke_record($url); return false; } - + $submit_end = microtime(true); $photo_time = round(($submit_end - $submit_photo_start) * 1000); $time = round(($submit_end - $submit_start) * 1000); - + //Record the scrape speed in a scrapes table. if($site_health && $status) q( "INSERT INTO `site-scrape` (`site_health_id`, `dt_performed`, `request_time`, `scrape_time`, `photo_time`, `total_time`)". @@ -247,7 +247,7 @@ function run_submit($url) { $photo_time, $time ); - + return $status; }