X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdatetime.php;h=8d4961cd7c39334776487958711a40e99036ac10;hb=d898616f8df8900834d70e5b33e2f40c711b8027;hp=a17c405dc365ea391d3ada2fd0c3f16d82f3e855;hpb=8b7d5d0efc3e28b2f7a5407f6583c8232739aa71;p=friendica.git diff --git a/include/datetime.php b/include/datetime.php index a17c405dc3..8d4961cd7c 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -4,6 +4,7 @@ * @brief Some functions for date and time related tasks. */ +use \Friendica\Core\Config; /** * @brief Two-level sort for timezones. @@ -271,8 +272,9 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke $lang = substr(get_browser_language(), 0, 2); // Check if the detected language is supported by the picker - if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) - $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en'); + if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) { + $lang = Config::get('system', 'language', 'en'); + } $o = ''; $dateformat = ''; @@ -569,6 +571,17 @@ function update_contact_birthdays() { * */ + // Check for duplicates + $s = q("SELECT `id` FROM `event` WHERE `uid` = %d AND `cid` = %d AND `start` = '%s' AND `type` = '%s' LIMIT 1", + intval($rr['uid']), + intval($rr['id']), + dbesc(datetime_convert('UTC','UTC', $nextbd)), + dbesc('birthday')); + + if (dbm::is_result($s)) { + continue; + } + $bdtext = sprintf( t('%s\'s birthday'), $rr['name']); $bdtext2 = sprintf( t('Happy Birthday %s'), ' [url=' . $rr['url'] . ']' . $rr['name'] . '[/url]') ;