diff options
author | friendica <info@friendica.com> | 2012-12-27 23:33:37 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-12-27 23:33:37 -0800 |
commit | dda4d689bbdd871f5bd8809ce5381aaee5004d5b (patch) | |
tree | b70722cf3b35db85aa30ce61e902c592583a7b08 /boot.php | |
parent | 55e77a57d0ea20844b481ff9b194bdf424857c5e (diff) | |
download | volse-hubzilla-dda4d689bbdd871f5bd8809ce5381aaee5004d5b.tar.gz volse-hubzilla-dda4d689bbdd871f5bd8809ce5381aaee5004d5b.tar.bz2 volse-hubzilla-dda4d689bbdd871f5bd8809ce5381aaee5004d5b.zip |
This was bloody hard to sort out.... but now it's sorted and we can move forward again. Put back xtag for efficient keyword searching, use it in conjunction with xprof['keywords'] to avoid a SQL triple join and group_concat (which simply won't scale on a directory server), figured out how best to work timezone corrected birthdays into the protocol. The directory can even provide an age if one was provided to it. Both of these things need some more work, but we have the mechanisms and a plan how to do it right instead of "how the !@#$ are we going to do pull this off?"
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 25 |
1 files changed, 23 insertions, 2 deletions
@@ -16,7 +16,7 @@ require_once('include/features.php'); define ( 'FRIENDICA_PLATFORM', 'Friendica Red'); define ( 'FRIENDICA_VERSION', trim(file_get_contents('version.inc')) . 'R'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1010 ); +define ( 'DB_UPDATE_VERSION', 1011 ); define ( 'EOL', '<br />' . "\r\n" ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); @@ -1722,6 +1722,27 @@ if(! function_exists('current_theme_url')) { } } +function z_birthday($dob,$tz,$format="Y-m-d H:i:s") { + + if(! strlen($tz)) + $tz = 'UTC'; + + $tmp_dob = substr($dob,5); + if(intval($tmp_dob)) { + $y = datetime_convert($tz,$tz,'now','Y'); + $bd = $y . '-' . $tmp_dob . ' 00:00'; + $t_dob = strtotime($bd); + $now = strtotime(datetime_convert($tz,$tz,'now')); + if($t_dob < $now) + $bd = $y + 1 . '-' . $tmp_dob . ' 00:00'; + $birthday = datetime_convert($tz,'UTC',$bd,$format); + } + + return $birthday; + +} + + if(! function_exists('feed_birthday')) { function feed_birthday($uid,$tz) { @@ -1763,7 +1784,7 @@ if(! function_exists('feed_birthday')) { $now = strtotime(datetime_convert($tz,$tz,'now')); if($t_dob < $now) $bd = $y + 1 . '-' . $tmp_dob . ' 00:00'; - $birthday = datetime_convert($tz,'UTC',$bd,ATOM_TIME); + $birthday = datetime_convert($tz,'UTC',$bd,$format); } } |