Forráskód Böngészése

Merge pull request #1253 from Arantor/release-2.1

Merging various goodies
Arantor 10 éve
szülő
commit
a483165b88

+ 1 - 1
Sources/Subs.php

@@ -3212,7 +3212,7 @@ function template_footer()
 
 	// Show the load time?  (only makes sense for the footer.)
 	$context['show_load_time'] = !empty($modSettings['timeLoadPageEnable']);
-	$context['load_time'] = round(array_sum(explode(' ', microtime())) - array_sum(explode(' ', $time_start)), 3);
+	$context['load_time'] = comma_format(round(array_sum(explode(' ', microtime())) - array_sum(explode(' ', $time_start)), 3));
 	$context['load_queries'] = $db_count;
 
 	if (isset($settings['use_default_images']) && $settings['use_default_images'] == 'defaults' && isset($settings['default_template']))

+ 0 - 34
Themes/default/Calendar.template.php

@@ -521,41 +521,7 @@ function template_event_post()
 {
 	global $context, $txt, $scripturl;
 
-	// Start the javascript for drop down boxes...
 	echo '
-		<script><!-- // --><![CDATA[
-			var monthLength;
-			monthLength = [
-				31, 28, 31, 30,
-				31, 30, 31, 31,
-				30, 31, 30, 31
-			];
-			function generateDays()
-			{
-				var days, selected, dayElement, monthElement, yearElement;
-				dayElement = document.getElementById("day"), yearElement = document.getElementById("year"), monthElement = document.getElementById("month");
-
-				monthLength[1] = 28;
-				if (yearElement.options[yearElement.selectedIndex].value % 4 == 0)
-					monthLength[1] = 29;
-
-				selected = dayElement.selectedIndex;
-				while (dayElement.options.length)
-				{
-					dayElement.options[0] = null;
-				}
-				days = monthLength[monthElement.value - 1];
-
-				for (i = 0; i <= days; ++i)
-				{
-					dayElement.options[dayElement.length] = new Option(i, i);
-				}
-
-				if (selected < days)
-					dayElement.selectedIndex = selected;
-			}
-		// ]]></script>
-
 		<form action="', $scripturl, '?action=calendar;sa=post" method="post" name="postevent" accept-charset="', $context['character_set'], '" onsubmit="submitonce(this);smc_saveEntities(\'postevent\', [\'evtitle\']);" style="margin: 0;">';
 
 	if (!empty($context['event']['new']))

+ 0 - 28
Themes/default/ManageCalendar.template.php

@@ -15,34 +15,6 @@ function template_edit_holiday()
 {
 	global $context, $scripturl, $txt, $modSettings;
 
-	// Start with javascript for getting the calendar dates right.
-	echo '
-		<script><!-- // --><![CDATA[
-			var monthLength = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
-
-			function generateDays()
-			{
-				var days = 0, selected = 0;
-				var dayElement = document.getElementById("day"), yearElement = document.getElementById("year"), monthElement = document.getElementById("month");
-
-				monthLength[1] = 28;
-				if (yearElement.options[yearElement.selectedIndex].value % 4 == 0)
-					monthLength[1] = 29;
-
-				selected = dayElement.selectedIndex;
-				while (dayElement.options.length)
-					dayElement.options[0] = null;
-
-				days = monthLength[monthElement.value - 1];
-
-				for (i = 1; i <= days; i++)
-					dayElement.options[dayElement.length] = new Option(i, i);
-
-				if (selected < days)
-					dayElement.selectedIndex = selected;
-			}
-		// ]]></script>';
-
 	// Show a form for all the holiday information.
 	echo '
 	<div id="admincenter">

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

@@ -268,7 +268,7 @@ function template_modify_user_subscription()
 					</dl>
 					<fieldset>
 						<legend>', $txt['start_date_and_time'], '</legend>
-						<select name="year" id="year" onchange="generateDays(\'\');">';
+						<select name="year" id="year" onchange="generateDays();">';
 
 	// Show a list of all the years we allow...
 	for ($year = 2005; $year <= 2030; $year++)
@@ -278,7 +278,7 @@ function template_modify_user_subscription()
 	echo '
 						</select>&nbsp;
 						', (isset($txt['calendar_month']) ? $txt['calendar_month'] : $txt['calendar_month']), '&nbsp;
-						<select name="month" id="month" onchange="generateDays(\'\');">';
+						<select name="month" id="month" onchange="generateDays();">';
 
 	// There are 12 months per year - ensure that they all get listed.
 	for ($month = 1; $month <= 12; $month++)

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

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

+ 3 - 3
Themes/default/SplitTopics.template.php

@@ -101,7 +101,7 @@ function template_select()
 					<li class="windowbg', $message['alternate'] ? '2' : '', '" id="not_selected_', $message['id'], '">
 						<div class="content">
 							<div class="message_header">
-								<a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><img src="', $settings['images_url'], '/split_select.png" alt="-&gt;"></a>
+								<a class="split_icon floatright" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=down;msg=', $message['id'], '" onclick="return select(\'down\', ', $message['id'], ');"><span class="generic_icons split_sel" title="-&gt;"></span></a>
 								', sprintf($txt['post_by_member'], $message['subject'], $message['poster']), '<br>
 								<em>', $message['time'], '</em>
 							</div>
@@ -133,7 +133,7 @@ function template_select()
 					<li class="windowbg', $message['alternate'] ? '2' : '', '" id="selected_', $message['id'], '">
 						<div class="content">
 							<div class="message_header">
-								<a class="split_icon floatleft" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=up;msg=', $message['id'], '" onclick="return select(\'up\', ', $message['id'], ');"><img src="', $settings['images_url'], '/split_deselect.png" alt="&lt;-"></a>
+								<a class="split_icon floatleft" href="', $scripturl, '?action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=up;msg=', $message['id'], '" onclick="return select(\'up\', ', $message['id'], ');"><span class="generic_icons split_desel" title="&lt;-"></span></a>
 								', sprintf($txt['post_by_member'], $message['subject'], $message['poster']), '<br>
 								<em>', $message['time'], '</em>
 							</div>
@@ -211,7 +211,7 @@ function template_select()
 					newItem = document.createElement("LI");
 					newItem.className = "windowbg2";
 					newItem.id = curSection + "_" + curId;
-					newItem.innerHTML = "<div class=\\"content\\"><div class=\\"message_header\\"><a class=\\"split_icon float" + (curSection == "selected" ? "left" : "right") + "\\" href=\\"" + smf_prepareScriptUrl(smf_scripturl) + "action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=" + (curSection == "selected" ? "up" : "down") + ";msg=" + curId + "\\" onclick=\\"return select(\'" + (curSection == "selected" ? "up" : "down") + "\', " + curId + ");\\"><img src=\\"', $settings['images_url'], '/split_" + (curSection == "selected" ? "de" : "") + "select.png\\" alt=\\"" + (curSection == "selected" ? "&lt;-" : "-&gt;") + "\\"></a><strong>" + curChange.getElementsByTagName("subject")[0].firstChild.nodeValue + "</strong> ', $txt['by'], ' <strong>" + curChange.getElementsByTagName("poster")[0].firstChild.nodeValue + "</strong><br><em>" + curChange.getElementsByTagName("time")[0].firstChild.nodeValue + "</em></div><div class=\\"post\\">" + curChange.getElementsByTagName("body")[0].firstChild.nodeValue + "</div></div>";
+					newItem.innerHTML = "<div class=\\"content\\"><div class=\\"message_header\\"><a class=\\"split_icon float" + (curSection == "selected" ? "left" : "right") + "\\" href=\\"" + smf_prepareScriptUrl(smf_scripturl) + "action=splittopics;sa=selectTopics;subname=', $context['topic']['subject'], ';topic=', $context['topic']['id'], '.', $context['not_selected']['start'], ';start2=', $context['selected']['start'], ';move=" + (curSection == "selected" ? "up" : "down") + ";msg=" + curId + "\\" onclick=\\"return select(\'" + (curSection == "selected" ? "up" : "down") + "\', " + curId + ");\\"><span class=\\"generic_icons split_" + (curSection == "selected" ? "de" : "") + "sel\\" title=\\"" + (curSection == "selected" ? "&lt;-" : "-&gt;") + "\\"></span></a><strong>" + curChange.getElementsByTagName("subject")[0].firstChild.nodeValue + "</strong> ', $txt['by'], ' <strong>" + curChange.getElementsByTagName("poster")[0].firstChild.nodeValue + "</strong><br><em>" + curChange.getElementsByTagName("time")[0].firstChild.nodeValue + "</em></div><div class=\\"post\\">" + curChange.getElementsByTagName("body")[0].firstChild.nodeValue + "</div></div>";
 
 					// So, where do we insert it?
 					if (typeof sInsertBeforeId == "string")

+ 19 - 6
Themes/default/css/index.css

@@ -1735,22 +1735,22 @@ ul li.greeting {
 	width: 16px;
 	height: 16px;
 	display: inline-block;
-	background: url(../images/pm_icons.png) no-repeat 0 0;
+	background: url(../images/generic_icons.png) no-repeat 0 -64px;
 }
 .pm_icons.inbox {
-	background-position: 0 0;
+	background-position: 0 -64px;
 }
 .pm_icons.switch {
-	background-position: -16px 0;
+	background-position: -16px -64px;
 }
 .pm_icons.replied {
-	background-position: -32px 0;
+	background-position: -32px -64px;
 }
 .pm_icons.im_on {
-	background-position: -48px 0;
+	background-position: -48px -64px;
 }
 .pm_icons.im_off {
-	background-position: -64px 0;
+	background-position: -64px -64px;
 }
 
 /* Styles for the board index and child boards tables.
@@ -3087,6 +3087,19 @@ tr.windowbg td, tr.windowbg2 td, tr.highlight2 td {
 .generic_icons.move {
 	background-position: -112px -32px;
 }
+/* Most of the bottom row is already declared via .pm_icons */
+
+.generic_icons.del_small {
+	background-position: -80px -64px;
+	width: 9px;
+	height: 9px;
+}
+.generic_icons.split_desel {
+	background-position: -96px -64px;
+}
+.generic_icons.split_sel {
+	background-position: -112px -64px;
+}
 
 /* Styles for (fatal) errors.
 ------------------------------------------------- */

BIN
Themes/default/images/generic_icons.png


BIN
Themes/default/images/icons/modify_small.png


BIN
Themes/default/images/icons/show_sticky.png


BIN
Themes/default/images/pm_icons.png


BIN
Themes/default/images/split_deselect.png


BIN
Themes/default/images/split_select.png


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

@@ -412,7 +412,7 @@ function theme_linktree($force_show = false)
 			echo $tree['extra_before'], ' ';
 
 		// Show the link, including a URL if it should have one.
-		echo $settings['linktree_link'] && isset($tree['url']) ? '
+		echo isset($tree['url']) ? '
 							<a href="' . $tree['url'] . '"><span>' . $tree['name'] . '</span></a>' : '<span>' . $tree['name'] . '</span>';
 
 		// Show something after the link...?

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

@@ -98,7 +98,6 @@ $txt['user_text'] = 'Show personal text in message view';
 $txt['gender_images'] = 'Show gender images in message view';
 $txt['news_fader'] = 'Show news fader 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['show_view_profile_button'] = 'Show view profile button under post';
 $txt['header_logo_url'] = 'Logo image URL';
 $txt['header_logo_url_desc'] = '(leave blank to show forum name or default logo.)';

+ 6 - 2
Themes/default/scripts/script.js

@@ -1543,12 +1543,16 @@ function pollOptions()
 function generateDays(offset)
 {
 	// Work around JavaScript's lack of support for default values...
-	offset = typeof(offset) != 'undefined' ? offset : 0;
+	offset = typeof(offset) != 'undefined' ? offset : '';
 
 	var days = 0, selected = 0;
 	var dayElement = document.getElementById("day" + offset), yearElement = document.getElementById("year" + offset), monthElement = document.getElementById("month" + offset);
 
-	monthLength[1] = 28;
+	var monthLength = [
+		31, 28, 31, 30,
+		31, 30, 31, 31,
+		30, 31, 30, 31
+	];
 	if (yearElement.options[yearElement.selectedIndex].value % 4 == 0)
 		monthLength[1] = 29;
 

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

@@ -2048,8 +2048,6 @@ VALUES (1, 'name', '{$default_theme_name}'),
 	(1, 'show_gender', '0'),
 	(1, 'show_newsfader', '0'),
 	(1, 'number_recent_posts', '0'),
-	(1, 'show_member_bar', '1'),
-	(1, 'linktree_link', '1'),
 	(1, 'show_profile_buttons', '1'),
 	(1, 'show_stats_index', '1'),
 	(1, 'newsfader_time', '5000'),

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

@@ -2581,8 +2581,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_blur
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_gender', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_newsfader', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_recent_posts', '0');
-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, 'show_profile_buttons', '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');

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

@@ -2200,8 +2200,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_blur
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_gender', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_newsfader', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_recent_posts', '0');
-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, 'show_profile_buttons', '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');

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

@@ -2200,8 +2200,6 @@ INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_blur
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_gender', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'show_newsfader', '0');
 INSERT INTO {$db_prefix}themes (id_theme, variable, value) VALUES (1, 'number_recent_posts', '0');
-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, 'show_profile_buttons', '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');

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

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

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

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

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

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