diff options
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r-- | Zotlabs/Module/Manage.php | 10 | ||||
-rw-r--r-- | Zotlabs/Module/React.php | 51 |
2 files changed, 56 insertions, 5 deletions
diff --git a/Zotlabs/Module/Manage.php b/Zotlabs/Module/Manage.php index 5ae79dbb2..4ca044c4a 100644 --- a/Zotlabs/Module/Manage.php +++ b/Zotlabs/Module/Manage.php @@ -93,9 +93,9 @@ class Manage extends \Zotlabs\Web\Controller { $channels[$x]['mail'] = intval($mails[0]['total']); - $events = q("SELECT type, start, adjust FROM `event` - WHERE `event`.`uid` = %d AND start < '%s' AND start > '%s' and `ignore` = 0 - ORDER BY `start` ASC ", + $events = q("SELECT etype, dtstart, adjust FROM `event` + WHERE `event`.`uid` = %d AND dtstart < '%s' AND dtstart > '%s' and `dismissed` = 0 + ORDER BY `dtstart` ASC ", intval($channels[$x]['channel_id']), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now + 7 days')), dbesc(datetime_convert('UTC', date_default_timezone_get(), 'now - 1 days')) @@ -108,14 +108,14 @@ class Manage extends \Zotlabs\Web\Controller { $str_now = datetime_convert('UTC', date_default_timezone_get(), 'now', 'Y-m-d'); foreach($events as $e) { $bd = false; - if($e['type'] === 'birthday') { + if($e['etype'] === 'birthday') { $channels[$x]['birthdays'] ++; $bd = true; } else { $channels[$x]['events'] ++; } - if(datetime_convert('UTC', ((intval($e['adjust'])) ? date_default_timezone_get() : 'UTC'), $e['start'], 'Y-m-d') === $str_now) { + if(datetime_convert('UTC', ((intval($e['adjust'])) ? date_default_timezone_get() : 'UTC'), $e['dtstart'], 'Y-m-d') === $str_now) { $channels[$x]['all_events_today'] ++; if($bd) $channels[$x]['birthdays_today'] ++; diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php new file mode 100644 index 000000000..28c7c239c --- /dev/null +++ b/Zotlabs/Module/React.php @@ -0,0 +1,51 @@ +<?php + +namespace Zotlabs\Module; + + +class React extends \Zotlabs\Web\Controller { + + function get() { + if(! local_channel()) + return; + + $postid = $_REQUEST['postid']; + + if(! $postid) + return; + + $emoji = $_REQUEST['emoji']; + if($_REQUEST['emoji']) { + + $i = q("select * from item where id = %d and uid = %d", + intval($postid), + intval(local_channel()) + ); + + if(! $i) + return; + + $channel = \App::get_channel(); + + $n = array(); + $n['aid'] = $channel['channel_account_id']; + $n['uid'] = $channel['channel_id']; + $n['item_origin'] = true; + $n['parent'] = $postid; + $n['parent_mid'] = $i[0]['mid']; + $n['mid'] = item_message_id(); + $n['verb'] = ACTIVITY_REACT . '#' . $emoji; + $n['body'] = "\n\n[zmg]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n"; + $n['author_xchan'] = $channel['channel_hash']; + + $x = item_store($n); + if($x['success']) { + $nid = $x['item_id']; + \Zotlabs\Daemon\Master::Summon(array('Notifier','like',$nid)); + } + + } + + } + +}
\ No newline at end of file |