Is it possible to suppress notifications for threads that have been made sticky?
Not sure this is what you want, but 'NO ALERTS OR EMAILS' button can be removed from stickies -
Display.php
if ($context['can_print'])
$context['normal_buttons']['print'] = array('text' => 'print', 'custom' => 'rel="nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0');
if ($context['can_set_notify'] && !$context['is_sticky'])
$context['normal_buttons']['notify'] = array(
'text' => 'notify_topic_' . $context['topic_notification_mode'],
'sub_buttons' => array(
array(
'test' => 'can_unwatch',
'text' => 'notify_topic_0',
'url' => $scripturl . '?action=notifytopic;topic=' . $context['current_topic'] . ';mode=0;' . $context['session_var'] . '=' . $context['session_id'],
),
Doesn't seem to break anything.
that's the opposite of what they want...
they want sticky posts to generate NO notification
in other words, automatic unwatch for everyone if the thread is sticky
So you want to unnotify everyone who's watching the topic after it's made sticky?
Looks like you'd have to run a database query on log_notify table to remove all id_members for that id_topic.
I want to know where members can set their notifications so that they don't get alerts or emails if a post thread in a board is made sticky. That ii, each member sets in - can't find it Personal Menu>notifications or anywhere else.
They would have to change the notification setting for each topic they are following that's stickied. Not sure why you're trying to do this. There's no way to globally unnotify all topics that become stickied after notification is enabled.
Ah, ok SOoL, You recall yesterday I added the Mod to sort Sticky objects. I administer an SMF forum for a retirement complex that has a lot of internal activities. Yesterday, I sorted lot of event wrapped calendar entries to the top and in date order by making them sticky and 'weighting' them via that installed Mod.
This caused anyone that was email-subscribed to the respective Board to receive an email.
Perhaps it would be a nice idea to make the Board subscription more granular?
Doesn't sound like that's an intended behaviour, members should only receive notification if a reply is posted to the topic, not when it's moved. A board subscription is not the same as a topic subscription, but it's logged in the same table. The mod apparently is triggering the emails, but it should only happen once when you reorder the topics.
Quote from: Sir Osis of Liver on July 29, 2024, 11:14:08 PMDoesn't sound like that's an intended behaviour, members should only receive notification if a reply is posted to the topic, not when it's moved. A board subscription is not the same as a topic subscription, but it's logged in the same table. The mod apparently is triggering the emails, but it should only happen once when you reorder the topics.
Ah! Thanks again SOoL - that both interesting and valuable info :)
QuoteQuote from: Sir Osis of Liver on July 29, 2024, 10:25:33 PMNot sure this is what you want, but 'NO ALERTS OR EMAILS' button can be removed from stickies -
Display.php
if ($context['can_print'])
$context['normal_buttons']['print'] = array('text' => 'print', 'custom' => 'rel="nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0');
if ($context['can_set_notify'] && !$context['is_sticky'])
$context['normal_buttons']['notify'] = array(
'text' => 'notify_topic_' . $context['topic_notification_mode'],
'sub_buttons' => array(
array(
'test' => 'can_unwatch',
'text' => 'notify_topic_0',
'url' => $scripturl . '?action=notifytopic;topic=' . $context['current_topic'] . ';mode=0;' . $context['session_var'] . '=' . $context['session_id'],
),
Doesn't seem to break anything.
Hey SOoL - where in Sources/Dislay.php do I insert that code please and do I need to remove anything? I tried inserting near the top but it broke the display back of a test post.
PS - SOol - I'm assuming this code:
if ($context['can_set_notify'] && !$context['is_sticky'])
$context['normal_buttons']['notify'] = array(
'text' => 'notify_topic_' . $context['topic_notification_mode'],
'sub_buttons' => array(
array(
'test' => 'can_unwatch',
'text' => 'notify_topic_0',
'url' => $scripturl . '?action=notifytopic;topic=' . $context['current_topic'] . ';mode=0;' . $context['session_var'] . '=' . $context['session_id'],
),
needs to be added to this existing code:
if ($context['can_print'])
$context['normal_buttons']['print'] = array('text' => 'print', 'custom' => 'rel="nofollow"', 'url' => $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0');
I did that and receiving a 500 error when subsequently trying to post anything?
No, you don't need to mess with all that code, I just included it so you'd be able to find the relevant line -
if ($context['can_set_notify'])
and change it to this -
if ($context['can_set_notify'] && !$context['is_sticky'])
That will remove the notification button from the topic, not the board.
Quote from: ColinJM on July 29, 2024, 10:55:18 PMYesterday, I sorted lot of event wrapped calendar entries to the top and in date order by making them sticky and 'weighting' them via that installed Mod.
This caused anyone that was email-subscribed to the respective Board to receive an email.
Ok, just looking at this in test install. When you sticky a topic that a member is watching, they receive an email that 'A topic you are watching has been marked as a sticky topic', with link to topic and unsubscribe link. That's normal core behaviour, nothing to do with the mod. When you reorder stickies with the mod, no emails are sent. There's no notification setting to disable that specific email, would take some digging in the code to find it.
Topic.php
// Notify people that this topic has been stickied?
// if (empty($is_sticky))
// sendNotifications($topic, 'sticky');
Quote from: Sir Osis of Liver on July 30, 2024, 04:43:04 PMThere's no notification setting to disable that specific email
In the notifications settings you can select whether you want notifications on 'replies and moderation', 'moderation only if I started the topic' and 'replies only' - this is where the 'moderation' part of it comes in, see also if you move a topic.
It's my understanding that OP wants to disable only the notification that's mailed to subscribers when a topic is stickied, which he may be doing regularly to schedule events. Don't think any of the notification settings are that specific, and even if they were would require a database query to apply the change to all members, as notification settings are not included in theme member options.
Just correcting the point that there *are* settings for opting out of moderation emails, just not as extensively as would be useful.
PHEW! Quite a bit for my morning brain to digest - thanks heaps all - will reply further when I have my brain frogs in one sock. :P ;D
OK - since my brain is stroke limited as to storing multiple thoughts I've documented my findings:31/07/2024 – Notifications On Sticky Threads
Precis1. SMF Thread https://www.simplemachines.org/community/index.php?topic=589394.0 refers.
2. From August 2024, Forum Calendar entries will be linked to a post. These posts will be stickied and sorted using the newly installed Sticky Topics Order mod.
3. August Forum Calendar events and activities were entered, with a linked thread in the respective Board, then all the August events were stickied before being sorted. (they need to be stickied before they can be sorted using the Sticky Topics Order mod.
4. All the August event subjects that were stickied generated emails if members were subscribed to that thread which, in some cases resulted in quite a few emails for members.
5. SOoL has provided a code change (/sources/Display.php) to remove the notification button from threads that are made sticky – Sool says it doesn't supress that sticky email – but testing using Colin Molloy and Admin has Colin Molloy not receiving alert or email sticky notification on new calendar entry threads.
6. Good to have Calendar event threads stickied and ordered but removing the notification from sticked threads is of limited value because most members set their notifications at Board level.
7. Arantor referred me to Member notification settings that may assist with threads made sticky and the relevant Board is set to notify. Set Colin Molloy to Only replies and this seems to work with Sool's Code change to Display.php.
8. The issue with Sools Display.php code change is that it removes the Notify button permanently as some members may want to set Notify on for event thread.
9. So tried creating a thread and making it sticky with the Display.php code change off and leaving Colin Molloy's to Only replies. This stopped sticky notifications but will mean individual notification settings all members.
Conclusion1. The Sticky Topics Order is a good and useful mod.
2. SOol's /Sources/Display.php works at a post thread level but not where Boards are set to Notify. It also permanently removes the Notify button from Stickied threads which doesn't give a Member to set the notify.
3. Application of Arantor's suggestion, that is, to have each member change their Personal Menu/Notifications/Boards and Topics – Notify me of: value to Only Replies appears to be the solution pending any unwanted behaviour or loss of any functionality.
I want to reiterate my appreciation for the help I've received from you guys - thanks so much!
Just to clarify (and hopefully simplify), if your original purpose was just to eliminate the email that members receive when a topic they're watching is stickied, this little code hack will do that without affecting anything else, or require members to change their notification setttings.
Topic.php
// Notify people that this topic has been stickied?
// if (empty($is_sticky))
// sendNotifications($topic, 'sticky');
I would leave the notify button in display template, so members keep the option to follow the sticky.
SOoL - Yes I agree on the ability to make it sticky threads subscribable?
My, you are a resourceful chap! ;D , will that hack also suppress forum alerts?
I don't get emails or alerts. If you comment out the sendNotifications() function it removes both.
OK thanks SOos 8)