diff options
author | friendica <info@friendica.com> | 2012-08-16 23:11:24 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-08-16 23:11:24 -0700 |
commit | 34e42c4cb34c78d9cb8ac48e9d80e58984346156 (patch) | |
tree | f3673e1366874af851144c7613f2a003c2f3b7c1 /mod/ping.php | |
parent | a7c1c22a2a9a5088f0961556bf58e4177005043d (diff) | |
download | volse-hubzilla-34e42c4cb34c78d9cb8ac48e9d80e58984346156.tar.gz volse-hubzilla-34e42c4cb34c78d9cb8ac48e9d80e58984346156.tar.bz2 volse-hubzilla-34e42c4cb34c78d9cb8ac48e9d80e58984346156.zip |
don't count ignored events in notifications
Diffstat (limited to 'mod/ping.php')
-rw-r--r-- | mod/ping.php | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mod/ping.php b/mod/ping.php index 59a56d919..1bf0a8840 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -16,6 +16,8 @@ function ping_init(&$a) { $result['register'] = 0; $result['events'] = 0; $result['events_today'] = 0; + $result['birthdays'] = 0; + $result['birthdays_today'] = 0; $result['notice'] = array(); $result['info'] = array(); @@ -155,8 +157,8 @@ function ping_init(&$a) { $t5 = dba_timer(); - $events = q("SELECT count(`event`.`id`) as total, start, adjust FROM `event` - WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' + $events = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event` + WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and ignore = 0 ORDER BY `start` ASC ", intval(local_user()), dbesc(datetime_convert('UTC','UTC','now + 7 days')), @@ -169,8 +171,16 @@ function ping_init(&$a) { if($result['events']) { $str_now = datetime_convert('UTC',$a->timezone,'now','Y-m-d'); foreach($events as $x) { - if(datetime_convert('UTC',((intval($x['adjust'])) ? $a->timezone : 'UTC'), $x['start'],'Y-m-d') === $str_now) + $bd = false; + if($x['type'] === 'birthday') { + $result['birthdays'] ++; + $bd = true; + } + if(datetime_convert('UTC',((intval($x['adjust'])) ? $a->timezone : 'UTC'), $x['start'],'Y-m-d') === $str_now) { $result['events_today'] ++; + if($bd) + $result['birthdays_today'] ++; + } } } } |