Browse Source

Merge pull request #262 from emanuele45/master

A fix and a happy Joker :P
emanuele45 12 years ago
parent
commit
0245038338

+ 4 - 4
Sources/Load.php

@@ -1531,13 +1531,13 @@ function loadTheme($id_theme = 0, $initialize = true)
 	// Some basic information...
 	if (!isset($context['html_headers']))
 		$context['html_headers'] = '';
-	if(!isset($context['javascript_files']))
+	if (!isset($context['javascript_files']))
 		$context['javascript_files'] = array();
-	if(!isset($context['css_files']))
+	if (!isset($context['css_files']))
 		$context['css_files'] = array();
-	if(!isset($context['javascript_inline']))
+	if (!isset($context['javascript_inline']))
 		$context['javascript_inline'] = array('standard' => array(), 'defer' => array());
-	if(!isset($context['javascript_vars']))
+	if (!isset($context['javascript_vars']))
 		$context['javascript_vars'] = array();
 
 	$context['menu_separator'] = !empty($settings['use_image_buttons']) ? ' ' : ' | ';

+ 5 - 5
Sources/ManageAttachments.php

@@ -214,7 +214,7 @@ function ManageAttachmentSettings($return_config = false)
 
 		if (!empty($_POST['use_subdirectories_for_attachments']))
 		{
-			if(isset($_POST['use_subdirectories_for_attachments']) && empty($_POST['basedirectory_for_attachments']))
+			if (isset($_POST['use_subdirectories_for_attachments']) && empty($_POST['basedirectory_for_attachments']))
 				$_POST['basedirectory_for_attachments'] = (!empty($modSettings['basedirectory_for_attachments']) ? ($modSettings['basedirectory_for_attachments']) : $boarddir);
 
 			if (!empty($_POST['use_subdirectories_for_attachments']) && !empty($modSettings['attachment_basedirectories']))
@@ -2077,7 +2077,7 @@ function ManageAttachmentPaths()
 				$bid = -1;
 				$use_subdirectories_for_attachments = 0;
 				if (!empty($modSettings['attachment_basedirectories']))
-					foreach($modSettings['attachment_basedirectories'] as $bid => $base)
+					foreach ($modSettings['attachment_basedirectories'] as $bid => $base)
 						if (strpos($modSettings['attachmentUploadDir'][$_POST['current_dir']], $base . DIRECTORY_SEPARATOR) !==false)
 						{
 							$use_subdirectories_for_attachments = 1;
@@ -2158,7 +2158,7 @@ function ManageAttachmentPaths()
 
 		If (isset($_POST['base_dir']))
 		{
-			foreach($_POST['base_dir'] as $id => $dir)
+			foreach ($_POST['base_dir'] as $id => $dir)
 			{
 				if (!empty($dir) && $dir != $modSettings['attachmentUploadDir'][$id])
 				{
@@ -2232,11 +2232,11 @@ function ManageAttachmentPaths()
 		{
 			$errors = array();
 			if (!empty($_SESSION['errors']['dir']))
-				foreach($_SESSION['errors']['dir'] as $error)
+				foreach ($_SESSION['errors']['dir'] as $error)
 					$errors['dir'][] = $smcFunc['htmlspecialchars']($error, ENT_QUOTES);
 
 			if (!empty($_SESSION['errors']['base']))
-				foreach($_SESSION['errors']['base'] as $error)
+				foreach ($_SESSION['errors']['base'] as $error)
 					$errors['base'][] = $smcFunc['htmlspecialchars']($error, ENT_QUOTES);
 		}
 		unset($_SESSION['errors']);

+ 1 - 1
Sources/MessageIndex.php

@@ -486,7 +486,7 @@ function MessageIndex()
 			if (!empty($settings['avatars_on_indexes']))
 			{
 				// Allow themers to show the latest poster's avatar along with the topic
-				if(!empty($row['avatar']))
+				if (!empty($row['avatar']))
 				{
 					if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 					{

+ 1 - 1
Sources/ModerationCenter.php

@@ -880,7 +880,7 @@ function ModReport()
 	{
 		$context['report']['comments'][] = array(
 			'id' => $row['id_comment'],
-			'message' => $row['comment'],
+			'message' => strtr($row['comment'], array("\n" => '<br />')),
 			'time' => timeformat($row['time_sent']),
 			'member' => array(
 				'id' => $row['id_member'],

+ 1 - 1
Sources/Post.php

@@ -1223,7 +1223,7 @@ function Post2()
 				$keep_ids[] = (int) $dummy;
 
 		if (isset($_SESSION['temp_attachments']))
-			foreach($_SESSION['temp_attachments'] as $attachID => $attachment)
+			foreach ($_SESSION['temp_attachments'] as $attachID => $attachment)
 			{
 				if ((isset($_SESSION['temp_attachments']['post']['files'], $attachment['name']) && in_array($attachment['name'], $_SESSION['temp_attachments']['post']['files'])) || in_array($attachID, $keep_temp) || strpos($attachID, 'post_tmp_' . $user_info['id']) === false)
 					continue;

+ 62 - 1
Sources/Printpage.php

@@ -239,7 +239,7 @@ function PrintTopic()
 
 	// Split the topics up so we can print them.
 	$request = $smcFunc['db_query']('', '
-		SELECT subject, poster_time, body, IFNULL(mem.real_name, poster_name) AS poster_name
+		SELECT subject, poster_time, body, IFNULL(mem.real_name, poster_name) AS poster_name, id_msg
 		FROM {db_prefix}messages AS m
 			LEFT JOIN {db_prefix}members AS mem ON (mem.id_member = m.id_member)
 		WHERE m.id_topic = {int:current_topic}' . ($modSettings['postmod_active'] && !allowedTo('approve_posts') ? '
@@ -264,6 +264,7 @@ function PrintTopic()
 			'time' => timeformat($row['poster_time'], false),
 			'timestamp' => forum_time(true, $row['poster_time']),
 			'body' => parse_bbc($row['body'], 'print'),
+			'id_msg' => $row['id_msg'],
 		);
 
 		if (!isset($context['topic_subject']))
@@ -271,6 +272,66 @@ function PrintTopic()
 	}
 	$smcFunc['db_free_result']($request);
 
+	// Fetch attachments so we can print them if asked, enabled and allowed
+	if (isset($_REQUEST['images']) && !empty($modSettings['attachmentEnable']) && allowedTo('view_attachments'))
+	{
+		$messages = array();
+		foreach ($context['posts'] as $temp)
+			$messages[] = $temp['id_msg'];
+		
+		// build the request
+		$request = $smcFunc['db_query']('', '
+			SELECT
+				a.id_attach, a.id_msg, a.approved, a.width, a.height, a.file_hash, a.filename, a.id_folder, a.mime_type
+			FROM {db_prefix}attachments AS a
+			WHERE a.id_msg IN ({array_int:message_list})
+				AND a.attachment_type = {int:attachment_type}',
+			array(
+				'message_list' => $messages,
+				'attachment_type' => 0,
+				'is_approved' => 1,
+			)
+		);
+		$temp = array();
+		while ($row = $smcFunc['db_fetch_assoc']($request))
+		{
+			$temp[$row['id_attach']] = $row;
+			if (!isset($context['printattach'][$row['id_msg']]))
+				$context['printattach'][$row['id_msg']] = array();
+		}
+		$smcFunc['db_free_result']($request);
+		ksort($temp);
+
+		// load them into $context so the template can use them
+		foreach ($temp as $row)
+		{
+			if (!empty($row['width']) && !empty($row['height'])) 
+			{
+				if (!empty($modSettings['max_image_width']) && (empty($modSettings['max_image_height']) || $row['height'] * ($modSettings['max_image_width'] / $row['width']) <= $modSettings['max_image_height']))
+				{
+					if ($row['width'] > $modSettings['max_image_width']) 
+					{
+						$row['height'] = floor($row['height'] * ($modSettings['max_image_width'] / $row['width']));
+						$row['width'] = $modSettings['max_image_width'];
+					}
+				}
+				elseif (!empty($modSettings['max_image_width']))
+				{
+					if ($row['height'] > $modSettings['max_image_height']) 
+					{
+						$row['width'] = floor($row['width'] * $modSettings['max_image_height'] / $row['height']);
+						$row['height'] = $modSettings['max_image_height'];
+					}
+				}
+				
+				$row['filename'] = getAttachmentFilename($row['filename'], $row['id_attach'], $row['id_folder'], false, $row['file_hash']);
+
+				// save for the template
+				$context['printattach'][$row['id_msg']][] = $row;
+			}
+		}
+	}
+	
 	// Set a canonical URL for this page.
 	$context['canonical_url'] = $scripturl . '?topic=' . $topic . '.0';
 }

+ 1 - 1
Sources/Profile.php

@@ -777,7 +777,7 @@ function loadCustomFields($memID, $area = 'summary')
 		// Parse BBCode
 		if ($row['bbc'])
 			$output_html = parse_bbc($output_html);
-		elseif($row['field_type'] == 'textarea')
+		elseif ($row['field_type'] == 'textarea')
 			// Allow for newlines at least
 			$output_html = strtr($output_html, array("\n" => '<br />'));
 

+ 4 - 3
Sources/ScheduledTasks.php

@@ -912,7 +912,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 
 	// Now we know how many we're sending, let's send them.
 	$request = $smcFunc['db_query']('', '
-		SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html
+		SELECT /*!40001 SQL_NO_CACHE */ id_mail, recipient, body, subject, headers, send_html, time_sent
 		FROM {db_prefix}mail_queue
 		ORDER BY priority ASC, id_mail ASC
 		LIMIT ' . $number,
@@ -931,6 +931,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 			'subject' => $row['subject'],
 			'headers' => $row['headers'],
 			'send_html' => $row['send_html'],
+			'time_sent' => $row['time_sent'],
 		);
 	}
 	$smcFunc['db_free_result']($request);
@@ -994,7 +995,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 
 		// Hopefully it sent?
 		if (!$result)
-			$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html']);
+			$failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent']);
 	}
 
 	// Any emails that didn't send?
@@ -1024,7 +1025,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
 		// Add our email back to the queue, manually.
 		$smcFunc['db_insert']('insert',
 			'{db_prefix}mail_queue',
-			array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string'),
+			array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string'),
 			$failed_emails,
 			array('id_mail')
 		);

+ 28 - 2
Sources/SendTopic.php

@@ -335,6 +335,29 @@ function ReportToModerator()
 	loadLanguage('Post');
 	loadTemplate('SendTopic');
 
+	addInlineJavascript('
+	var error_box = $("#error_box");
+	$("#report_comment").keyup(function() {
+		var post_too_long = $("#error_post_too_long");
+		if ($(this).val().length > 254)
+		{
+			if (post_too_long.length == 0)
+			{
+				error_box.show();
+				if ($.trim(error_box.html()) == \'\')
+					error_box.append("<ul id=\'error_list\'></ul>");
+
+				$("#error_list").append("<li id=\'error_post_too_long\' class=\'error\'>" + ' . JavaScriptEscape($txt['post_too_long']) . ' + "</li>");
+			}
+		}
+		else
+		{
+			post_too_long.remove();
+			if ($("#error_list li").length == 0)
+				error_box.hide();
+		}
+	});', true);
+
 	$context['comment_body'] = !isset($_POST['comment']) ? '' : trim($_POST['comment']);
 	$context['email_address'] = !isset($_POST['email']) ? '' : trim($_POST['email']);
 
@@ -375,7 +398,10 @@ function ReportToModerator2()
 	// Make sure we have a comment and it's clean.
 	if (!isset($_POST['comment']) || $smcFunc['htmltrim']($_POST['comment']) === '')
 		$post_errors[] = 'no_comment';
-	$poster_comment = strtr($smcFunc['htmlspecialchars']($_POST['comment']), array("\r" => '', "\n" => '', "\t" => ''));
+	$poster_comment = strtr($smcFunc['htmlspecialchars']($_POST['comment']), array("\r" => '', "\t" => ''));
+
+	if ($smcFunc['strlen']($poster_comment) > 254)
+		$post_errors[] = 'post_too_long';
 
 	// Guests need to provide their address!
 	if ($user_info['is_guest'])
@@ -410,7 +436,7 @@ function ReportToModerator2()
 
 		$context['post_errors'] = array();
 		foreach ($post_errors as $post_error)
-			$context['post_errors'][] = $txt['error_' . $post_error];
+			$context['post_errors'][$post_error] = $txt['error_' . $post_error];
 
 		return ReportToModerator();
 	}

+ 1 - 1
Sources/Subs-BoardIndex.php

@@ -233,7 +233,7 @@ function getBoardIndex($boardIndexOptions)
 		if (!empty($settings['avatars_on_indexes']))
 		{
 			// Allow themers to show the latest poster's avatar along with the board
-			if(!empty($row_board['avatar']))
+			if (!empty($row_board['avatar']))
 			{
 				if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
 				{

+ 1 - 1
Sources/Subs.php

@@ -2902,7 +2902,7 @@ function setupThemeContext($forceload = false)
 	$context['show_pm_popup'] = $context['user']['popup_messages'] && !empty($options['popup_messages']) && (!isset($_REQUEST['action']) || $_REQUEST['action'] != 'pm');
 
 	// 2.1+: Add the PM popup here instead. Theme authors can still override it simply by editing/removing the 'fPmPopup' in the array.
-	if($context['show_pm_popup'])
+	if ($context['show_pm_popup'])
 		addInlineJavascript('
 		$(document).ready(function(){
 			new smc_Popup({

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

@@ -535,7 +535,7 @@ function template_main()
 					echo '
 											[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>]&nbsp;|&nbsp;[<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
 				echo '
-											<br />', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . $txt['attach_viewed'] : '<br />' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '
+											<br />', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . '<br />' . sptrinf($txt['attach_viewed'], $attachment['downloads']) : '<br />' . sptrinf($txt['attach_downloaded'], $attachment['downloads'])), '
 										</div>';
 
 				echo '
@@ -946,4 +946,4 @@ function template_main()
 
 }
 
-?>
+?>

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

@@ -172,7 +172,7 @@ function template_maintenance()
 							<dd><select name="to">
 								<option value="0">', $txt['attachment_transfer_select'], '</option>';
 
-	foreach($context['attach_dirs'] as $id => $dir)
+	foreach ($context['attach_dirs'] as $id => $dir)
 		echo '
 								<option value="', $id, '">', $dir, '</option>';
 	echo '

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

@@ -368,7 +368,7 @@ function template_folder()
 		}
 		elseif ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest'])
 		{
-			if(!empty($modSettings['onlineEnable']))
+			if (!empty($modSettings['onlineEnable']))
 				echo '
 				<li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['member_online_text'], '">', $txt['send_message'], ' <img src="'. $message['member']['online']['image_href']. '" alt="" /></a></li>';
 			else

+ 75 - 36
Themes/default/Printpage.template.php

@@ -12,7 +12,10 @@
 
 function template_print_above()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $txt, $topic, $scripturl;
+	
+	$url_text = $scripturl . '?action=printpage;topic=' . $topic . '.0';
+	$url_images = $url_text . ';images';
 
 	echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
@@ -22,89 +25,95 @@ function template_print_above()
 		<link rel="canonical" href="', $context['canonical_url'], '" />
 		<title>', $txt['print_page'], ' - ', $context['topic_subject'], '</title>
 		<style type="text/css">
-			body, a
-			{
+			body, a {
 				color: #000;
 				background: #fff;
 			}
-			body, td, .normaltext
-			{
+			body, td, .normaltext {
 				font-family: Verdana, arial, helvetica, serif;
 				font-size: small;
 			}
-			h1#title
-			{
+			h1#title {
 				font-size: large;
 				font-weight: bold;
 			}
-			h2#linktree
-			{
+			h2#linktree {
 				margin: 1em 0 2.5em 0;
 				font-size: small;
 				font-weight: bold;
 			}
-			dl#posts
-			{
+			dl#posts {
 				width: 90%;
 				margin: 0;
 				padding: 0;
 				list-style: none;
 			}
-			div.postheader, #poll_data
-			{
+			div.postheader, #poll_data {
 				border: solid #000;
 				border-width: 1px 0;
 				padding: 4px 0;
 			}
-			div.postbody
-			{
+			div.postbody {
 				margin: 1em 0 2em 2em;
 			}
-			table
-			{
+			table {
 				empty-cells: show;
 			}
-			blockquote, code
-			{
+			blockquote, code {
 				border: 1px solid #000;
 				margin: 3px;
 				padding: 1px;
 				display: block;
 			}
-			code
-			{
+			code {
 				font: x-small monospace;
 			}
-			blockquote
-			{
+			blockquote {
 				font-size: x-small;
 			}
-			.smalltext, .quoteheader, .codeheader
-			{
+			.smalltext, .quoteheader, .codeheader {
 				font-size: x-small;
 			}
-			.largetext
-			{
+			.largetext {
 				font-size: large;
 			}
-			.centertext
-			{
+			.centertext {
 				text-align: center;
 			}
-			hr
-			{
+			hr {
 				height: 1px;
 				border: 0;
 				color: black;
 				background-color: black;
 			}
-			.voted
-			{
+			.voted {
 				font-weight: bold;
 			}
+			@media print {
+				.print_options {
+					display:none;
+				}
+			}
+			@media screen {
+				.print_options {
+					margin:1em;
+				}
+			}
 		</style>
 	</head>
 	<body>
+		<div class="print_options">';
+
+	// which option is set, text or text&images
+	if (isset($_REQUEST['images']))
+		echo '
+			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
+	else
+		echo '
+			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
+
+	echo '
+		</div>
 		<h1 id="title">', $context['forum_name_html_safe'], '</h1>
 		<h2 id="linktree">', $context['category_name'], ' => ', (!empty($context['parent_boards']) ? implode(' => ', $context['parent_boards']) . ' => ' : ''), $context['board_name'], ' => ', $txt['topic_started'], ': ', $context['poster_name'], ' ', $txt['search_on'], ' ', $context['post_time'], '</h2>
 		<div id="posts">';
@@ -112,7 +121,7 @@ function template_print_above()
 
 function template_main()
 {
-	global $context, $settings, $options, $txt;
+	global $context, $options, $txt, $scripturl, $topic;
 
 	if (!empty($context['poll']))
 	{
@@ -132,19 +141,49 @@ function template_main()
 	}
 
 	foreach ($context['posts'] as $post)
+	{
 		echo '
 			<div class="postheader">
 				', $txt['title'], ': <strong>', $post['subject'], '</strong><br />
 				', $txt['post_by'], ': <strong>', $post['member'], '</strong> ', $txt['search_on'], ' <strong>', $post['time'], '</strong>
 			</div>
 			<div class="postbody">
-				', $post['body'], '
+				', $post['body'];
+				
+		// Show attachment images
+		if (isset($_GET['images']) && !empty($context['printattach'][$post['id_msg']]))
+		{
+			echo '
+				<hr />';
+			
+			foreach ($context['printattach'][$post['id_msg']] as $attach)
+				echo '
+					<img width="' . $attach['width'] . '" height="' . $attach['height'] . '" src="', $scripturl . '?action=dlattach;topic=' . $topic . '.0;attach=' . $attach['id_attach'] . '" alt="" />';
+		}
+			
+		echo '
 			</div>';
+	}
 }
 
 function template_print_below()
 {
-	global $context, $settings, $options;
+	global $topic, $txt, $scripturl;
+	
+	$url_text = $scripturl . '?action=printpage;topic=' . $topic . '.0';
+	$url_images = $url_text . ';images';
+	
+	echo '
+		</div>
+		<div class="print_options">';
+
+	// Show the text / image links
+	if (isset($_GET['images']))
+		echo '
+			<a href="', $url_text, '">', $txt['print_page_text'], '</a> | <strong><a href="', $url_images, '">', $txt['print_page_images'], '</a></strong>';
+	else
+		echo '
+			<strong><a href="', $url_text, '">', $txt['print_page_text'], '</a></strong> | <a href="', $url_images, '">', $txt['print_page_images'], '</a>';
 
 	echo '
 		</div>

+ 13 - 8
Themes/default/SendTopic.template.php

@@ -209,18 +209,23 @@ function template_report()
 
 	if (!empty($context['post_errors']))
 	{
-		echo '
-				<div class="errorbox">
-					<ul>';
+	echo '
+				<div id="error_box" class="errorbox">
+					<ul id="error_list">';
 
-		foreach ($context['post_errors'] as $error)
+		foreach ($context['post_errors'] as $key => $error)
 			echo '
-						<li class="error">', $error, '</li>';
+						<li id="error_', $key, '" class="error">', $error, '</li>';
 
 		echo '
-					</ul>
-				</div>';
+					</ul>';
 	}
+	else
+		echo '
+				<div style="display:none" id="error_box" class="errorbox">';
+
+		echo '
+				</div>';
 
 	echo '
 						<p class="noticebox">', $txt['report_to_mod_func'], '</p>
@@ -243,7 +248,7 @@ function template_report()
 								<label for="report_comment">', $txt['enter_comment'], '</label>:
 							</dt>
 							<dd>
-								<input type="text" id="report_comment" name="comment" size="50" value="', $context['comment_body'], '" maxlength="255" />
+								<textarea type="text" id="report_comment" name="comment" rows="5">', $context['comment_body'], '</textarea>
 							</dd>';
 
 	if ($context['require_verification'])

+ 3 - 0
Themes/default/css/index.css

@@ -2719,6 +2719,9 @@ dl.send_mail dd {
 #report_topic dl.settings dd {
 	width: 79%;
 }
+#report_comment {
+	width: 70%;
+}
 
 /* Styles for the split topic section.
 ---------------------------------------------------- */

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

@@ -97,7 +97,7 @@ function template_html_above()
 	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21" />';
 
 	// Save some database hits, if a width for multiple wrappers is set in admin.
-	if(!empty($settings['forum_width']))
+	if (!empty($settings['forum_width']))
 		echo '
 	<style type="text/css">#wrapper, .frame {width: ', $settings['forum_width'], ';}</style>';
 

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

@@ -241,6 +241,8 @@ $txt['error_no_question'] = 'No question was filled in for this poll.';
 $txt['error_no_message'] = 'The message body was left empty.';
 $txt['error_long_message'] = 'The message exceeds the maximum allowed length (%1$d characters).';
 $txt['error_no_comment'] = 'The comment field was left empty.';
+// duplicate of post_too_long in Post.{language}.php
+$txt['error_post_too_long'] = 'Your message is too long. Please go back and shorten it, then try again.';
 $txt['error_session_timeout'] = 'Your session timed out while posting. Please try to re-submit your message.';
 $txt['error_no_to'] = 'No recipients specified.';
 $txt['error_bad_to'] = 'One or more \'to\'-recipients could not be found.';

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

@@ -67,6 +67,7 @@ $txt['right_align'] = 'Right align';
 $txt['superscript'] = 'Superscript';
 $txt['subscript'] = 'Subscript';
 $txt['table_tr'] = 'Insert table row';
+// post_too_long seems unused (duplicate in Errors: error_post_too_long
 $txt['post_too_long'] = 'Your message is too long. Please go back and shorten it, then try again.';
 $txt['horizontal_rule'] = 'Horizontal Rule';
 $txt['font_size'] = 'Font size';

+ 5 - 4
Themes/default/languages/index.english.php

@@ -364,6 +364,8 @@ $txt['you_have_many_msgs'] = 'You\'ve got %2$d messages... Click <a href="%1$s">
 $txt['total_boards'] = 'Total Boards';
 
 $txt['print_page'] = 'Print Page';
+$txt['print_page_text'] = 'Text only';
+$txt['print_page_images'] = 'Text with Images';
 
 $txt['valid_email'] = 'This must be a valid email address.';
 
@@ -564,9 +566,8 @@ $txt['mlist_search_results'] = 'Search results for';
 $txt['mlist_search_by'] = 'Search by %1$s';
 $txt['mlist_menu_view'] = 'View the memberlist';
 
-$txt['attach_downloaded'] = 'downloaded';
-$txt['attach_viewed'] = 'viewed';
-$txt['attach_times'] = 'times';
+$txt['attach_downloaded_many'] = 'downloaded %1$d times';
+$txt['attach_viewed_many'] = 'viewed %1$d times';
 
 $txt['settings'] = 'Settings';
 $txt['never'] = 'Never';
@@ -829,4 +830,4 @@ $txt['debug_tokens'] = 'Tokens: ';
 $txt['debug_browser'] = 'Browser ID: ';
 $txt['debug_hooks'] = 'Hooks called: ';
 
-?>
+?>

+ 1 - 1
other/install.php

@@ -1214,7 +1214,7 @@ function DatabasePopulation()
 		$smcFunc['db_optimize_table']($table) != -1 or $db_messed = true;
 
 		// Optimizing one sqlite table, optimizes them all
-		if($db_type == 'sqlite')
+		if ($db_type == 'sqlite')
 			break;
 
 		if (!empty($db_messed))