UpdateOnDismiss(); break; case 'profile': $this->UpdateOnDismiss(); pl_redirect('profile/edit'); break; case 'photo': $this->UpdateOnDismiss(); pl_redirect('photo/change'); break; case 'geoloc': $this->UpdateOnDismiss(); pl_redirect('profile/edit/adresses'); break; } } protected function GetDisplayText() {} public function Display(&$page) { header('Content-Type: text/html; charset=utf-8'); $page->changeTpl('reminder/profile_update.tpl', NO_SKIN); $page->assign('baseurl', $this->GetBaseUrl()); $user = S::user(); $res = XDB::query('SELECT date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old, date AS profile_date, p.attach AS photo FROM auth_user_md5 AS u LEFT JOIN photo AS p ON (u.user_id = p.uid) WHERE user_id = {?}', $user->id()); list($is_profile_old, $profile_date, $has_photo) = $res->fetchOneRow(); $profile_date = $is_profile_old ? $profile_date : null; $page->assign('profile_update', $profile_date); $page->assign('needs_photo', $has_photo); require_once 'geoloc.inc.php'; $res = localize_addresses($user->id()); $page->assign('geocoding_incitation', count($res)); $page->assign('incitations_count', ($is_profile_old ? 1 : 0) + ($has_photo ? 1 : 0) + (count($res) > 0 ? 1 : 0)); } public static function IsCandidate(User &$user, $candidate) { $res = XDB::query('SELECT date < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_profile_old, p.attach AS photo FROM auth_user_md5 AS u LEFT JOIN photo AS p ON (u.user_id = p.uid) 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); } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>