]> git.mxchange.org Git - friendica.git/blobdiff - include/datetime.php
old behaviour restored
[friendica.git] / include / datetime.php
index 779c7a5aadae7f9b46e33fa1525130bbf3abad9b..9e1d4b55c9ba622c4242ac5db3f31c3721e12639 100644 (file)
@@ -339,7 +339,7 @@ function relative_date($posted_date, $format = null) {
 
        $abs = strtotime($localtime);
 
-       if (is_null($posted_date) || $posted_date === '0000-00-00 00:00:00' || $abs === False) {
+       if (is_null($posted_date) || $posted_date <= NULL_DATE || $abs === False) {
                 return t('never');
        }
 
@@ -571,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]') ;