don't count ignored events in notifications
This commit is contained in:
parent
a7c1c22a2a
commit
34e42c4cb3
16
mod/ping.php
16
mod/ping.php
@ -16,6 +16,8 @@ function ping_init(&$a) {
|
|||||||
$result['register'] = 0;
|
$result['register'] = 0;
|
||||||
$result['events'] = 0;
|
$result['events'] = 0;
|
||||||
$result['events_today'] = 0;
|
$result['events_today'] = 0;
|
||||||
|
$result['birthdays'] = 0;
|
||||||
|
$result['birthdays_today'] = 0;
|
||||||
$result['notice'] = array();
|
$result['notice'] = array();
|
||||||
$result['info'] = array();
|
$result['info'] = array();
|
||||||
|
|
||||||
@ -155,8 +157,8 @@ function ping_init(&$a) {
|
|||||||
|
|
||||||
$t5 = dba_timer();
|
$t5 = dba_timer();
|
||||||
|
|
||||||
$events = q("SELECT count(`event`.`id`) as total, start, adjust FROM `event`
|
$events = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event`
|
||||||
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s'
|
WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and ignore = 0
|
||||||
ORDER BY `start` ASC ",
|
ORDER BY `start` ASC ",
|
||||||
intval(local_user()),
|
intval(local_user()),
|
||||||
dbesc(datetime_convert('UTC','UTC','now + 7 days')),
|
dbesc(datetime_convert('UTC','UTC','now + 7 days')),
|
||||||
@ -169,8 +171,16 @@ function ping_init(&$a) {
|
|||||||
if($result['events']) {
|
if($result['events']) {
|
||||||
$str_now = datetime_convert('UTC',$a->timezone,'now','Y-m-d');
|
$str_now = datetime_convert('UTC',$a->timezone,'now','Y-m-d');
|
||||||
foreach($events as $x) {
|
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'] ++;
|
$result['events_today'] ++;
|
||||||
|
if($bd)
|
||||||
|
$result['birthdays_today'] ++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,10 @@ $slide
|
|||||||
<a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Full Sharing</a><a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Cautious Sharing</a><a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Follow Only</a><br />
|
<a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Full Sharing</a><a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Cautious Sharing</a><a href="" style="background-color: #CCC; padding: 3px; border-radius: 5px; margin-left: 15px;">Follow Only</a><br />
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
<div id="abook-advanced" class="fakelink" onclick="openClose('abook-advanced-panel');">Advanced Permissions</div>
|
||||||
|
|
||||||
|
<div id="abook-advanced-panel" style="display: none;">
|
||||||
|
|
||||||
<span class="abook-them">$them</span><span class="abook-me">$me</span>
|
<span class="abook-them">$them</span><span class="abook-me">$me</span>
|
||||||
<br />
|
<br />
|
||||||
<br />
|
<br />
|
||||||
@ -37,6 +41,7 @@ $slide
|
|||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<input class="contact-edit-submit" type="submit" name="submit" value="$submit" />
|
<input class="contact-edit-submit" type="submit" name="submit" value="$submit" />
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user