Procházet zdrojové kódy

Merge pull request #1158 from Arantor/release-2.1

Some display changes that needed doing
Arantor před 11 roky
rodič
revize
dacce1471a

+ 0 - 2
Sources/Display.php

@@ -524,8 +524,6 @@ function Display()
 	// Information about the current topic...
 	$context['is_locked'] = $topicinfo['locked'];
 	$context['is_sticky'] = $topicinfo['is_sticky'];
-	$context['is_very_hot'] = $topicinfo['num_replies'] >= $modSettings['hotTopicVeryPosts'];
-	$context['is_hot'] = $topicinfo['num_replies'] >= $modSettings['hotTopicPosts'];
 	$context['is_approved'] = $topicinfo['approved'];
 
 	// @todo Tricks? We don't want to show the poll icon in the topic class here, so pretend it's not one.

+ 0 - 4
Sources/ManagePosts.php

@@ -361,10 +361,6 @@ function ModifyTopicSettings($return_config = false)
 			array('int', 'defaultMaxTopics', 'postinput' => $txt['manageposts_topics']),
 			array('int', 'defaultMaxMessages', 'postinput' => $txt['manageposts_posts']),
 			array('check', 'disable_print_topic'),
-		'',
-			// Hot topics (etc)...
-			array('int', 'hotTopicPosts', 'postinput' => $txt['manageposts_posts']),
-			array('int', 'hotTopicVeryPosts', 'postinput' => $txt['manageposts_posts']),
 		'',
 			// All, next/prev...
 			array('int', 'enableAllMessages', 'postinput' => $txt['manageposts_posts'], 'subtext' => $txt['enableAllMessages_zero']),

+ 0 - 2
Sources/MessageIndex.php

@@ -562,8 +562,6 @@ function MessageIndex()
 				'is_sticky' => !empty($row['is_sticky']),
 				'is_locked' => !empty($row['locked']),
 				'is_poll' => $modSettings['pollMode'] == '1' && $row['id_poll'] > 0,
-				'is_hot' => $row['num_replies'] >= $modSettings['hotTopicPosts'],
-				'is_very_hot' => $row['num_replies'] >= $modSettings['hotTopicVeryPosts'],
 				'is_posted_in' => false,
 				'icon' => $row['first_icon'],
 				'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.png',

+ 0 - 2
Sources/Recent.php

@@ -1281,8 +1281,6 @@ function UnreadTopics()
 			'is_sticky' => !empty($row['is_sticky']),
 			'is_locked' => !empty($row['locked']),
 			'is_poll' => $modSettings['pollMode'] == '1' && $row['id_poll'] > 0,
-			'is_hot' => $row['num_replies'] >= $modSettings['hotTopicPosts'],
-			'is_very_hot' => $row['num_replies'] >= $modSettings['hotTopicVeryPosts'],
 			'is_posted_in' => false,
 			'icon' => $row['first_icon'],
 			'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.png',

+ 0 - 2
Sources/Search.php

@@ -1997,8 +1997,6 @@ function prepareSearchContext($reset = false)
 		'is_sticky' => !empty($message['is_sticky']),
 		'is_locked' => !empty($message['locked']),
 		'is_poll' => $modSettings['pollMode'] == '1' && $message['id_poll'] > 0,
-		'is_hot' => $message['num_replies'] >= $modSettings['hotTopicPosts'],
-		'is_very_hot' => $message['num_replies'] >= $modSettings['hotTopicVeryPosts'],
 		'posted_in' => !empty($participants[$message['id_topic']]),
 		'views' => $message['num_views'],
 		'replies' => $message['num_replies'],

+ 2 - 7
Sources/Subs.php

@@ -2800,19 +2800,14 @@ function url_image_size($url)
 }
 
 /**
- * Sets the class of the current topic based on is_very_hot, veryhot, hot, etc
+ * Sets the class of the current topic based on, normal, sticky, locked, etc
  *
  * @param array &$topic_context
  */
 function determineTopicClass(&$topic_context)
 {
 	// Set topic class depending on locked status and number of replies.
-	if ($topic_context['is_very_hot'])
-		$topic_context['class'] = 'veryhot';
-	elseif ($topic_context['is_hot'])
-		$topic_context['class'] = 'hot';
-	else
-		$topic_context['class'] = 'normal';
+	$topic_context['class'] = 'normal';
 
 	$topic_context['class'] .= $topic_context['is_poll'] ? '_poll' : '_post';
 

+ 0 - 2
Themes/default/languages/Admin.english.php

@@ -579,8 +579,6 @@ $txt['oldTopicDays_zero'] = '0 to disable';
 $txt['defaultMaxTopics'] = 'Number of topics per page in the message index';
 $txt['defaultMaxMessages'] = 'Number of posts per page in a topic page';
 $txt['disable_print_topic'] = 'Disable print topic feature';
-$txt['hotTopicPosts'] = 'Number of posts for a hot topic';
-$txt['hotTopicVeryPosts'] = 'Number of posts for a very hot topic';
 $txt['enableAllMessages'] = 'Max topic size to show "All" posts';
 $txt['enableAllMessages_zero'] = '0 to never show "All"';
 $txt['disableCustomPerPage'] = 'Disable user defined topic/message count per page';

+ 0 - 2
Themes/default/languages/Help.english.php

@@ -386,8 +386,6 @@ $helptxt['enableEmbeddedFlash'] = 'This option will allow your users to use Flas
 $helptxt['xmlnews_enable'] = 'Allows people to link to <a href="%1$s?action=.xml;sa=news" target="_blank" class="new_win">Recent news</a>
 	and similar data.  It is also recommended that you limit the size of recent posts/news because, when rss data
 	is displayed in some clients, it is expected to be truncated.';
-$helptxt['hotTopicPosts'] = 'Change the number of posts for a topic to reach the state of a &quot;hot&quot; or
-	&quot;very hot&quot; topic.';
 $helptxt['globalCookies'] = 'Makes log in cookies available across subdomains.  For example, if...<br />
 	your site is http://www.example.com/,<br />
 	and your forum is http://forum.example.com/,<br />

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

@@ -36,7 +36,7 @@ $txt['default_topic_message'] = 'Welcome to Simple Machines Forum!<br /><br />We
 $txt['default_board_name'] = 'General Discussion';
 $txt['default_board_description'] = 'Feel free to talk about anything and everything in this board.';
 $txt['default_category_name'] = 'General Category';
-$txt['default_time_format'] = '%B %d, %Y, %I:%M:%S %p';
+$txt['default_time_format'] = '%b %d, %Y, %I:%M %p';
 $txt['default_news'] = 'SMF - Just Installed!';
 $txt['default_karmaLabel'] = 'Karma:';
 $txt['default_karmaSmiteLabel'] = '[smite]';

+ 0 - 2
Themes/default/languages/index.english.php

@@ -287,8 +287,6 @@ $txt['ban_continue_browse'] = 'You may continue to browse the forum as a guest.'
 
 $txt['mark_as_read'] = 'Mark ALL messages as read';
 
-$txt['hot_topics'] = 'Hot Topic (More than %1$d replies)';
-$txt['very_hot_topics'] = 'Very Hot Topic (More than %1$d replies)';
 $txt['locked_topic'] = 'Locked Topic';
 $txt['normal_topic'] = 'Normal Topic';
 $txt['participation_caption'] = 'Topic you have posted in';

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

@@ -1789,8 +1789,6 @@ VALUES ('smfVersion', '{$smf_version}'),
 	('enableEmbeddedFlash', '0'),
 	('xmlnews_enable', '1'),
 	('xmlnews_maxlen', '255'),
-	('hotTopicPosts', '15'),
-	('hotTopicVeryPosts', '25'),
 	('registration_method', '{$registration_method}'),
 	('send_validation_onChange', '0'),
 	('send_welcomeEmail', '1'),

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

@@ -2300,8 +2300,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('theme_guests', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableEmbeddedFlash', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_enable', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_maxlen', '255');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicPosts', '15');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicVeryPosts', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('registration_method', '{$registration_method}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onChange', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');

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

@@ -1932,8 +1932,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('theme_guests', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableEmbeddedFlash', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_enable', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_maxlen', '255');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicPosts', '15');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicVeryPosts', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('registration_method', '{$registration_method}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onChange', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');

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

@@ -1932,8 +1932,6 @@ INSERT INTO {$db_prefix}settings (variable, value) VALUES ('theme_guests', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('enableEmbeddedFlash', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_enable', '1');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('xmlnews_maxlen', '255');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicPosts', '15');
-INSERT INTO {$db_prefix}settings (variable, value) VALUES ('hotTopicVeryPosts', '25');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('registration_method', '{$registration_method}');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_validation_onChange', '0');
 INSERT INTO {$db_prefix}settings (variable, value) VALUES ('send_welcomeEmail', '1');

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

@@ -570,9 +570,32 @@ WHERE variable LIKE 'integrate_%';
 /******************************************************************************/
 --- Cleaning up old settings
 /******************************************************************************/
+---# Updating the default time format
+---{
+if (!empty($modSettings['time_format']))
+{
+	// First, use the shortened form of the month in the date.
+	$time_format = str_replace('%B', '%b', $modSettings['time_format']);
+
+	// Second, shorten the time to stop including seconds.
+	$time_format = str_replace(':%S', '', $time_format);
+
+	// Then, update the database.
+	$smcFunc['db_query']('', '
+		UPDATE {db_prefix}settings
+		SET value = {string:new_format}
+		WHERE variable = {literal:time_format}',
+		array(
+			'new_format' => $time_format,
+		)
+	);
+}
+---}
+---#
+
 ---# Showing contact details to guests should never happen.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts');
 ---#
 
 ---# Cleaning up old theme settings.

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

@@ -649,9 +649,32 @@ WHERE variable LIKE 'integrate_%';
 /******************************************************************************/
 --- Cleaning up old settings
 /******************************************************************************/
+---# Updating the default time format
+---{
+if (!empty($modSettings['time_format']))
+{
+	// First, use the shortened form of the month in the date.
+	$time_format = str_replace('%B', '%b', $modSettings['time_format']);
+
+	// Second, shorten the time to stop including seconds.
+	$time_format = str_replace(':%S', '', $time_format);
+
+	// Then, update the database.
+	$smcFunc['db_query']('', '
+		UPDATE {db_prefix}settings
+		SET value = {string:new_format}
+		WHERE variable = {literal:time_format}',
+		array(
+			'new_format' => $time_format,
+		)
+	);
+}
+---}
+---#
+
 ---# Showing contact details to guests should never happen.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts');
 ---#
 
 ---# Cleaning up old theme settings.

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

@@ -640,9 +640,32 @@ WHERE variable LIKE 'integrate_%';
 /******************************************************************************/
 --- Cleaning up old settings
 /******************************************************************************/
+---# Updating the default time format
+---{
+if (!empty($modSettings['time_format']))
+{
+	// First, use the shortened form of the month in the date.
+	$time_format = str_replace('%B', '%b', $modSettings['time_format']);
+
+	// Second, shorten the time to stop including seconds.
+	$time_format = str_replace(':%S', '', $time_format);
+
+	// Then, update the database.
+	$smcFunc['db_query']('', '
+		UPDATE {db_prefix}settings
+		SET value = {string:new_format}
+		WHERE variable = {literal:time_format}',
+		array(
+			'new_format' => $time_format,
+		)
+	);
+}
+---}
+---#
+
 ---# Showing contact details to guests should never happen.
 DELETE FROM {$db_prefix}settings
-WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames');
+WHERE variable IN ('enableStickyTopics', 'guest_hideContacts', 'notify_new_registration', 'attachmentEncryptFilenames', 'hotTopicPosts', 'hotTopicVeryPosts');
 ---#
 
 ---# Cleaning up old theme settings.