Bugfix: Avoid duplicated birthday events
This commit is contained in:
parent
722b18ead7
commit
cb0600976d
3 changed files with 48 additions and 7 deletions
|
|
@ -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]') ;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue