X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Freminder%2Fprofile_update.inc.php;h=c853f5f0b5daedb017690b55c2a72f30433a2944;hb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;hp=8ab7bc1dc08f1b6016d893607379555d769e3858;hpb=a959b199b8f4790bf311c4e9c4b96b4ffb494eeb;p=platal.git diff --git a/include/reminder/profile_update.inc.php b/include/reminder/profile_update.inc.php index 8ab7bc1..c853f5f 100644 --- a/include/reminder/profile_update.inc.php +++ b/include/reminder/profile_update.inc.php @@ -51,8 +51,8 @@ class ReminderProfileUpdate extends Reminder $res = XDB::query('SELECT date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old, date AS profile_date, LENGTH(p.attach) > 0 AS has_photo - FROM auth_user_md5 AS u - LEFT JOIN photo AS p ON (u.user_id = p.uid) + FROM auth_user_md5 AS u + LEFT JOIN photo AS p ON (u.user_id = p.uid) WHERE user_id = {?}', $this->user->id()); list($is_profile_old, $profile_date, $has_photo) = $res->fetchOneRow(); @@ -61,9 +61,11 @@ class ReminderProfileUpdate extends Reminder $page->assign('profile_last_update', $profile_date); $page->assign('photo_incitation', !$has_photo); - require_once 'geoloc.inc.php'; - $res = localize_addresses($this->user->id()); - $page->assign('geocoding_incitation', count($res)); + $res = XDB::query('SELECT COUNT(*) + FROM profile_addresses + WHERE pid = {?} AND accuracy = 0', + $this->user->id()); + $page->assign('geocoding_incitation', $res->fetchOneCell()); } public function template() @@ -88,10 +90,13 @@ class ReminderProfileUpdate extends Reminder WHERE user_id = {?}', $user->id()); list($is_profile_old, $has_photo) = $res->fetchOneRow(); - require_once 'geoloc.inc.php'; - $res = localize_addresses($user->id()); - return (count($res) || !$has_photo || $is_profile_old); + $res = XDB::query('SELECT COUNT(*) + FROM profile_addresses + WHERE pid = {?} AND accuracy = 0', + $user->id()); + + return ($res->fetchOneCell() || !$has_photo || $is_profile_old); } }