From 56f0af20672266507dd16d5759698929b098d3e7 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 4 Sep 2014 01:27:28 +0200 Subject: [PATCH] The "ignore" feature can be disabled and enabled, the value will now be retrieved. --- include/features.php | 1 + object/Item.php | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/features.php b/include/features.php index 24955ba1..091dfc6e 100644 --- a/include/features.php +++ b/include/features.php @@ -60,6 +60,7 @@ function get_features() { array('filing', t('Saved Folders'), t('Ability to file posts under folders')), array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')), array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator')), + array('ignore_posts', t('Mute Post Notifications'), t('Ability to mute notifications for a thread')), ), ); diff --git a/object/Item.php b/object/Item.php index 90b0c3fe..19e3fdea 100644 --- a/object/Item.php +++ b/object/Item.php @@ -199,14 +199,21 @@ class Item extends BaseObject { 'classundo' => (($item['starred']) ? "" : "hidden"), 'starred' => t('starred'), ); - $ignore = array( - 'do' => t("ignore thread"), - 'undo' => t("unignore thread"), - 'toggle' => t("toggle ignore status"), - 'classdo' => (($item['starred']) ? "hidden" : ""), - 'classundo' => (($item['starred']) ? "" : "hidden"), - 'ignored' => t('ignored'), + $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1", + intval($item['uid']), + intval($item['id']) ); + if (count($r)) { + $ignore = array( + 'do' => t("ignore thread"), + 'undo' => t("unignore thread"), + 'toggle' => t("toggle ignore status"), + 'classdo' => (($r[0]['ignored']) ? "hidden" : ""), + 'classundo' => (($r[0]['ignored']) ? "" : "hidden"), + 'ignored' => t('ignored'), + ); + } + $tagger = ''; if(feature_enabled($conv->get_profile_owner(),'commtag')) { $tagger = array( @@ -344,8 +351,7 @@ class Item extends BaseObject { 'edpost' => ((feature_enabled($conv->get_profile_owner(),'edit_posts')) ? $edpost : ''), 'isstarred' => $isstarred, 'star' => ((feature_enabled($conv->get_profile_owner(),'star_posts')) ? $star : ''), - /* 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''), */ - 'ignore' => $ignore, + 'ignore' => ((feature_enabled($conv->get_profile_owner(),'ignore_posts')) ? $ignore : ''), 'tagger' => $tagger, 'filer' => ((feature_enabled($conv->get_profile_owner(),'filing')) ? $filer : ''), 'drop' => $drop,