Compare commits

...

2 commits

Author SHA1 Message Date
8254313ebe topic_mute: Fix options not appearing 2025-03-02 14:41:19 -08:00
3c3a6305f3 Remove (now detrimental) debug line
Not intended to laugh at the user, I promise ;_; Was running into a bug
due to too much usage of empty() to coerce variables into booleans.
2025-03-02 14:38:57 -08:00
2 changed files with 8 additions and 7 deletions

View file

@ -25,7 +25,6 @@ function topic_is_muted($topic, $user = -1)
{ {
global $context, $smcFunc, $user_info; global $context, $smcFunc, $user_info;
if ($user_info['is_guest']) { if ($user_info['is_guest']) {
die('lol');
return false; return false;
} }
@ -115,15 +114,17 @@ function mute_theme_option()
} }
$option = array( $option = array(
array(
'id' => 'topic_mute_roadblock', 'id' => 'topic_mute_roadblock',
'label' => $txt['topic_mute_roadblock'], 'label' => $txt['topic_mute_roadblock'],
'default' => false, 'default' => false,
),
); );
$context['theme_options'] = array_merge( $context['theme_options'] = array_merge(
array_slice($context['theme_options'], 0, $posting_idx - 1, true), array_slice($context['theme_options'], 0, $posting_idx, true),
$option, $option,
array_slice($context['theme_options'], $posting_idx - 1, null, true), array_slice($context['theme_options'], $posting_idx, null, true),
); );
} }

View file

@ -2,6 +2,6 @@
$txt['mute_topic'] = 'Mute Topic'; $txt['mute_topic'] = 'Mute Topic';
$txt['unmute_topic'] = 'Unmute Topic'; $txt['unmute_topic'] = 'Unmute Topic';
$txt['topic_mute_roadblock'] = 'Present an option to show muted threads'; $txt['topic_mute_roadblock'] = 'Hide the option to show muted threads';
?> ?>