From 72f6edd59507797ef4073aed01ca1a0d14fa8cfd Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 30 Jun 2013 00:38:02 -0700 Subject: add age to directory profile - requires updating on each birthday and that part is still missing --- boot.php | 2 +- include/items.php | 1 + include/poller.php | 3 +++ include/zot.php | 1 + install/database.sql | 2 ++ install/update.php | 11 ++++++++++- mod/zfinger.php | 3 +++ version.inc | 2 +- 8 files changed, 22 insertions(+), 3 deletions(-) diff --git a/boot.php b/boot.php index 7106fd18f..db61a79ae 100755 --- a/boot.php +++ b/boot.php @@ -43,7 +43,7 @@ require_once('include/taxonomy.php'); define ( 'RED_PLATFORM', 'Red Matrix' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1047 ); +define ( 'DB_UPDATE_VERSION', 1048 ); define ( 'EOL', '
' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); diff --git a/include/items.php b/include/items.php index 0f260c8d2..2169dfe37 100755 --- a/include/items.php +++ b/include/items.php @@ -860,6 +860,7 @@ function get_profile_elements($x) { $arr['desc'] = (($x['title']) ? htmlentities($x['title'],ENT_COMPAT,'UTF-8',false) : ''); $arr['dob'] = datetime_convert('UTC','UTC',$x['birthday'],'Y-m-d'); + $arr['age'] = (($x['age']) ? intval($x['age']) : 0); $arr['gender'] = (($x['gender']) ? htmlentities($x['gender'], ENT_COMPAT,'UTF-8',false) : ''); $arr['marital'] = (($x['marital']) ? htmlentities($x['marital'], ENT_COMPAT,'UTF-8',false) : ''); diff --git a/include/poller.php b/include/poller.php index dff16d3d7..f50bd4e3e 100644 --- a/include/poller.php +++ b/include/poller.php @@ -63,6 +63,9 @@ function poller_run($argv, $argc){ // once daily run birthday_updates and then expire in background + // FIXME: add birthday updates, both locally and for xprof for use + // by directory servers + $d1 = get_config('system','last_expire_day'); $d2 = intval(datetime_convert('UTC','UTC','now','d')); diff --git a/include/zot.php b/include/zot.php index 14a29005d..be0760a05 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1225,6 +1225,7 @@ function import_directory_profile($hash,$profile) { $arr['xprof_hash'] = $hash; $arr['xprof_desc'] = (($profile['description']) ? htmlentities($profile['description'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_dob'] = datetime_convert('','',$profile['birthday'],'Y-m-d'); // !!!! check this for 0000 year + $arr['xprof_age'] = (($profile['age']) ? intval($profile['age']) : 0); $arr['xprof_gender'] = (($profile['gender']) ? htmlentities($profile['gender'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_marital'] = (($profile['marital']) ? htmlentities($profile['marital'], ENT_COMPAT,'UTF-8',false) : ''); $arr['xprof_sexual'] = (($profile['sexual']) ? htmlentities($profile['sexual'], ENT_COMPAT,'UTF-8',false) : ''); diff --git a/install/database.sql b/install/database.sql index 30b8edfd7..5cb0146f7 100644 --- a/install/database.sql +++ b/install/database.sql @@ -941,6 +941,7 @@ CREATE TABLE IF NOT EXISTS `xprof` ( `xprof_hash` char(255) NOT NULL, `xprof_desc` char(255) NOT NULL DEFAULT '', `xprof_dob` char(12) NOT NULL DEFAULT '', + `xprof_age` tinyint(3) NOT NULL DEFAULT '0', `xprof_gender` char(255) NOT NULL DEFAULT '', `xprof_marital` char(255) NOT NULL DEFAULT '', `xprof_sexual` char(255) NOT NULL DEFAULT '', @@ -952,6 +953,7 @@ CREATE TABLE IF NOT EXISTS `xprof` ( PRIMARY KEY (`xprof_hash`), KEY `xprof_desc` (`xprof_desc`), KEY `xprof_dob` (`xprof_dob`), + KEY `xprof_age` (`xprof_age`), KEY `xprof_gender` (`xprof_gender`), KEY `xprof_marital` (`xprof_marital`), KEY `xprof_sexual` (`xprof_sexual`), diff --git a/install/update.php b/install/update.php index ee95b7e01..ef436c688 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@