Procházet zdrojové kódy

- In the spirit of GSD, let's remove an option that's on by default, that I've never seen disabled anywhere, and that might as well just be permanently on to keep it simple.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer před 11 roky
rodič
revize
1ce7bb7392

+ 1 - 1
Sources/Display.php

@@ -1110,7 +1110,7 @@ function Display()
 	$context['can_reply_approved'] = $context['can_reply'];
 	$context['can_reply_approved'] = $context['can_reply'];
 	$context['can_reply'] |= $context['can_reply_unapproved'];
 	$context['can_reply'] |= $context['can_reply_unapproved'];
 	$context['can_quote'] = $context['can_reply'] && (empty($modSettings['disabledBBC']) || !in_array('quote', explode(',', $modSettings['disabledBBC'])));
 	$context['can_quote'] = $context['can_reply'] && (empty($modSettings['disabledBBC']) || !in_array('quote', explode(',', $modSettings['disabledBBC'])));
-	$context['can_mark_unread'] = !$user_info['is_guest'] && $settings['show_mark_read'];
+	$context['can_mark_unread'] = !$user_info['is_guest'];
 	$context['can_unwatch'] = !$user_info['is_guest'] && $modSettings['enable_unwatch'];
 	$context['can_unwatch'] = !$user_info['is_guest'] && $modSettings['enable_unwatch'];
 
 
 	$context['can_send_topic'] = (!$modSettings['postmod_active'] || $topicinfo['approved']) && allowedTo('send_topic');
 	$context['can_send_topic'] = (!$modSettings['postmod_active'] || $topicinfo['approved']) && allowedTo('send_topic');

+ 30 - 33
Sources/Recent.php

@@ -433,7 +433,7 @@ function UnreadTopics()
 		die;
 		die;
 	}
 	}
 
 
-	$context['showCheckboxes'] = !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $settings['show_mark_read'];
+	$context['showCheckboxes'] = !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1;
 
 
 	$context['showing_all_topics'] = isset($_GET['all']);
 	$context['showing_all_topics'] = isset($_GET['all']);
 	$context['start'] = (int) $_REQUEST['start'];
 	$context['start'] = (int) $_REQUEST['start'];
@@ -1334,45 +1334,42 @@ function UnreadTopics()
 	$context['querystring_board_limits'] = sprintf($context['querystring_board_limits'], $_REQUEST['start']);
 	$context['querystring_board_limits'] = sprintf($context['querystring_board_limits'], $_REQUEST['start']);
 	$context['topics_to_mark'] = implode('-', $topic_ids);
 	$context['topics_to_mark'] = implode('-', $topic_ids);
 
 
-	if ($settings['show_mark_read'])
+	// Build the recent button array.
+	if ($is_topics)
 	{
 	{
-		// Build the recent button array.
-		if ($is_topics)
-		{
-			$context['recent_buttons'] = array(
-				'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_mark_read'] . '\');"', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']),
-			);
-
-			if ($context['showCheckboxes'])
-				$context['recent_buttons']['markselectread'] = array(
-					'text' => 'quick_mod_markread',
-					'image' => 'markselectedread.png',
-					'lang' => true,
-					'url' => 'javascript:document.quickModForm.submit();',
-				);
+		$context['recent_buttons'] = array(
+			'markread' => array('text' => !empty($context['no_board_limits']) ? 'mark_as_read' : 'mark_read_short', 'image' => 'markread.png', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_mark_read'] . '\');"', 'url' => $scripturl . '?action=markasread;sa=' . (!empty($context['no_board_limits']) ? 'all' : 'board' . $context['querystring_board_limits']) . ';' . $context['session_var'] . '=' . $context['session_id']),
+		);
 
 
-			if (!empty($context['topics']) && !$context['showing_all_topics'])
-				$context['recent_buttons']['readall'] = array('text' => 'unread_topics_all', 'image' => 'markreadall.png', 'lang' => true, 'url' => $scripturl . '?action=unread;all' . $context['querystring_board_limits'], 'active' => true);
-		}
-		elseif (!$is_topics && isset($context['topics_to_mark']))
-		{
-			$context['recent_buttons'] = array(
-				'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_mark_read'] . '\');"', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']),
+		if ($context['showCheckboxes'])
+			$context['recent_buttons']['markselectread'] = array(
+				'text' => 'quick_mod_markread',
+				'image' => 'markselectedread.png',
+				'lang' => true,
+				'url' => 'javascript:document.quickModForm.submit();',
 			);
 			);
 
 
-			if ($context['showCheckboxes'])
-				$context['recent_buttons']['markselectread'] = array(
-					'text' => 'quick_mod_markread',
-					'image' => 'markselectedread.png',
-					'lang' => true,
-					'url' => 'javascript:document.quickModForm.submit();',
-				);
-		}
+		if (!empty($context['topics']) && !$context['showing_all_topics'])
+			$context['recent_buttons']['readall'] = array('text' => 'unread_topics_all', 'image' => 'markreadall.png', 'lang' => true, 'url' => $scripturl . '?action=unread;all' . $context['querystring_board_limits'], 'active' => true);
+	}
+	elseif (!$is_topics && isset($context['topics_to_mark']))
+	{
+		$context['recent_buttons'] = array(
+			'markread' => array('text' => 'mark_as_read', 'image' => 'markread.png', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . $txt['are_sure_mark_read'] . '\');"', 'url' => $scripturl . '?action=markasread;sa=unreadreplies;topics=' . $context['topics_to_mark'] . ';' . $context['session_var'] . '=' . $context['session_id']),
+		);
 
 
-		// Allow mods to add additional buttons here
-		call_integration_hook('integrate_recent_buttons');
+		if ($context['showCheckboxes'])
+			$context['recent_buttons']['markselectread'] = array(
+				'text' => 'quick_mod_markread',
+				'image' => 'markselectedread.png',
+				'lang' => true,
+				'url' => 'javascript:document.quickModForm.submit();',
+			);
 	}
 	}
 
 
+	// Allow mods to add additional buttons here
+	call_integration_hook('integrate_recent_buttons');
+
 	$context['no_topic_listing'] = empty($context['topics']);
 	$context['no_topic_listing'] = empty($context['topics']);
 
 
 	// Allow helpdesks and bug trackers and what not to add their own unread data (just add a template_layer to show custom stuff in the template!)
 	// Allow helpdesks and bug trackers and what not to add their own unread data (just add a template_layer to show custom stuff in the template!)

+ 2 - 2
Themes/default/BoardIndex.template.php

@@ -212,8 +212,8 @@ function template_main()
 	</div>';
 	</div>';
 
 
 	// Show the mark all as read button?
 	// Show the mark all as read button?
-	if ($context['user']['is_logged'] && $settings['show_mark_read'] && !empty($context['categories']))
-	echo '
+	if ($context['user']['is_logged'] && !empty($context['categories']))
+		echo '
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
 		<div class="mark_read">', template_button_strip($context['mark_read_button'], 'right'), '</div>';
 }
 }
 
 

+ 1 - 1
Themes/default/MessageIndex.template.php

@@ -113,7 +113,7 @@ function template_main()
 	}
 	}
 
 
 	// They can only mark read if they are logged in and it's enabled!
 	// They can only mark read if they are logged in and it's enabled!
-	if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
+	if (!$context['user']['is_logged'])
 		unset($context['normal_buttons']['markread']);
 		unset($context['normal_buttons']['markread']);
 
 
 	if (!$context['no_topic_listing'])
 	if (!$context['no_topic_listing'])

+ 0 - 4
Themes/default/Settings.template.php

@@ -167,10 +167,6 @@ function template_settings()
 			'id' => 'linktree_link',
 			'id' => 'linktree_link',
 			'label' => $txt['current_pos_text_img'],
 			'label' => $txt['current_pos_text_img'],
 		),
 		),
-		array(
-			'id' => 'show_mark_read',
-			'label' => $txt['enable_mark_as_read'],
-		),
 		array(
 		array(
 			'id' => 'enable_news',
 			'id' => 'enable_news',
 			'label' => $txt['enable_random_news'],
 			'label' => $txt['enable_random_news'],

+ 0 - 1
Themes/default/languages/Themes.english.php

@@ -100,7 +100,6 @@ $txt['news_fader'] = 'Show news fader on board index';
 $txt['member_list_bar'] = 'Show members list bar on board index';
 $txt['member_list_bar'] = 'Show members list bar on board index';
 $txt['current_pos_text_img'] = 'Show current position in forum as link instead of text';
 $txt['current_pos_text_img'] = 'Show current position in forum as link instead of text';
 $txt['show_view_profile_button'] = 'Show view profile button under post';
 $txt['show_view_profile_button'] = 'Show view profile button under post';
-$txt['enable_mark_as_read'] = 'Enable and show \'Mark as Read\' buttons';
 $txt['header_logo_url'] = 'Logo image URL';
 $txt['header_logo_url'] = 'Logo image URL';
 $txt['header_logo_url_desc'] = '(leave blank to show forum name or default logo.)';
 $txt['header_logo_url_desc'] = '(leave blank to show forum name or default logo.)';
 $txt['number_recent_posts'] = 'Number of recent posts to display on board index';
 $txt['number_recent_posts'] = 'Number of recent posts to display on board index';

+ 0 - 1
other/install_2-1_mysql.sql

@@ -2049,7 +2049,6 @@ VALUES (1, 'name', '{$default_theme_name}'),
 	(1, 'show_member_bar', '1'),
 	(1, 'show_member_bar', '1'),
 	(1, 'linktree_link', '1'),
 	(1, 'linktree_link', '1'),
 	(1, 'show_profile_buttons', '1'),
 	(1, 'show_profile_buttons', '1'),
-	(1, 'show_mark_read', '1'),
 	(1, 'show_stats_index', '1'),
 	(1, 'show_stats_index', '1'),
 	(1, 'newsfader_time', '5000'),
 	(1, 'newsfader_time', '5000'),
 	(1, 'additional_options_collapsable', '1'),
 	(1, 'additional_options_collapsable', '1'),

+ 0 - 1
other/install_2-1_postgresql.sql

@@ -2582,7 +2582,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_re
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
-INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_mark_read', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');

+ 0 - 1
other/install_2-1_sqlite.sql

@@ -2201,7 +2201,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_re
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
-INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_mark_read', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');

+ 0 - 1
other/install_2-1_sqlite3.sql

@@ -2201,7 +2201,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_re
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_member_bar', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'linktree_link', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_profile_buttons', '1');
-INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_mark_read', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_stats_index', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'newsfader_time', '5000');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'additional_options_collapsable', '1');

+ 1 - 1
other/upgrade_2-1_mysql.sql

@@ -667,7 +667,7 @@ WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_regis
 
 
 ---# Cleaning up old theme settings.
 ---# Cleaning up old theme settings.
 DELETE FROM {$db_prefix}themes
 DELETE FROM {$db_prefix}themes
-WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply');
+WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply', 'show_mark_read');
 ---#
 ---#
 
 
 /******************************************************************************/
 /******************************************************************************/

+ 1 - 1
other/upgrade_2-1_postgresql.sql

@@ -746,7 +746,7 @@ WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_regis
 
 
 ---# Cleaning up old theme settings.
 ---# Cleaning up old theme settings.
 DELETE FROM {$db_prefix}themes
 DELETE FROM {$db_prefix}themes
-WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply');
+WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply', 'show_mark_read');
 ---#
 ---#
 
 
 /******************************************************************************/
 /******************************************************************************/

+ 1 - 1
other/upgrade_2-1_sqlite.sql

@@ -737,7 +737,7 @@ WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_regis
 
 
 ---# Cleaning up old theme settings.
 ---# Cleaning up old theme settings.
 DELETE FROM {$db_prefix}themes
 DELETE FROM {$db_prefix}themes
-WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply');
+WHERE variable IN ('show_board_desc', 'no_new_reply_warning', 'display_quick_reply', 'show_mark_read');
 ---#
 ---#
 
 
 /******************************************************************************/
 /******************************************************************************/