From e81ac9e0637c4533aeb144511b8f68ec8a99e257 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 3 Jun 2016 16:04:54 -0700 Subject: turn emoji ability into a feature so that either a member or the site admin can disable it. Default is enabled. --- Zotlabs/Lib/ThreadItem.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 0ba0c0a13..65f00b867 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -347,6 +347,7 @@ class ThreadItem { 'has_tags' => $has_tags, // Item toolbar buttons + 'emojis' => (($this->is_toplevel() && $this->is_commentable() && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''), 'like' => $like, 'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''), 'share' => $share, -- cgit v1.2.3 From a7e5e3d5740e499fdf44874d9d361cf344dfd290 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 3 Jun 2016 18:13:21 -0700 Subject: allow any (current) emoji to be displayed on any site, and provide a default list of reactions that can be over-ridden via configuration if a site doesn't like our choices or perhaps the ordering of our choices. --- Zotlabs/Lib/ThreadItem.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index 65f00b867..e55931f40 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -14,6 +14,8 @@ class ThreadItem { private $template = 'conv_item.tpl'; private $comment_box_template = 'comment_item.tpl'; private $commentable = false; + // list of supported reaction emojis - a site can over-ride this via config system.reactions + private $reactions = ['1f60a','1f44f','1f37e','1f48b','1f61e','2665','1f622','1f62e','1f634','1f61c','1f607','1f608']; private $toplevel = false; private $children = array(); private $parent = null; @@ -50,6 +52,14 @@ class ThreadItem { $this->add_child($child); } } + + // allow a site to configure the order and content of the reaction emoji list + if($this->toplevel) { + $x = get_config('system','reactions'); + if($x && is_array($x) && count($x)) { + $this->reactions = $x; + } + } } /** @@ -345,7 +355,7 @@ class ThreadItem { 'photo' => $body['photo'], 'event' => $body['event'], 'has_tags' => $has_tags, - + 'reactions' => $this->reactions, // Item toolbar buttons 'emojis' => (($this->is_toplevel() && $this->is_commentable() && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''), 'like' => $like, -- cgit v1.2.3 From 1877df0e703489d44119cddf05621570a71d5bd5 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 3 Jun 2016 18:39:11 -0700 Subject: missed table rename in event query in mod_manage --- Zotlabs/Module/Manage.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zotlabs') 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'] ++; -- cgit v1.2.3 From af4352adf28ed56187a53b739098e78f423cb920 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 3 Jun 2016 18:46:59 -0700 Subject: need to set item_origin on locally created reactions so they propagate properly --- Zotlabs/Module/React.php | 1 + 1 file changed, 1 insertion(+) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php index 85a1e2350..28c7c239c 100644 --- a/Zotlabs/Module/React.php +++ b/Zotlabs/Module/React.php @@ -30,6 +30,7 @@ class React extends \Zotlabs\Web\Controller { $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(); -- cgit v1.2.3 From b84f7cd37fdad61e04878580645cab8c53c666f4 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 4 Jun 2016 03:32:03 -0700 Subject: class functions called incorrectly --- Zotlabs/Module/Admin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 4cabd78ca..b2c6baf1d 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -1547,8 +1547,8 @@ class Admin extends \Zotlabs\Web\Controller { // Toggle theme status - toggle_theme($themes, $theme, $result); - $s = rebuild_theme_table($themes); + $this->toggle_theme($themes, $theme, $result); + $s = $this->rebuild_theme_table($themes); if($result) info( sprintf('Theme %s enabled.', $theme)); else @@ -1561,7 +1561,7 @@ class Admin extends \Zotlabs\Web\Controller { // display theme details require_once('library/markdown.php'); - if (theme_status($themes,$theme)) { + if ($this->theme_status($themes,$theme)) { $status="on"; $action= t("Disable"); } else { $status="off"; $action= t("Enable"); -- cgit v1.2.3 From a0d339f208ce991ccc429e7d4ac1bbacce393b38 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sat, 4 Jun 2016 15:53:30 -0700 Subject: short-term solution to emoji size issue - make them 32px from the sender --- Zotlabs/Module/React.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/React.php b/Zotlabs/Module/React.php index 28c7c239c..ed4f87e7e 100644 --- a/Zotlabs/Module/React.php +++ b/Zotlabs/Module/React.php @@ -35,7 +35,7 @@ class React extends \Zotlabs\Web\Controller { $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['body'] = "\n\n[zmg=32x32]" . z_root() . '/images/emoji/' . $emoji . '.png[/zmg]' . "\n\n"; $n['author_xchan'] = $channel['channel_hash']; $x = item_store($n); -- cgit v1.2.3