Преглед изворни кода

Merge pull request #9 from emanuele45/master

This time is quite big... :P
Spuds пре 13 година
родитељ
комит
7a9a7323be

+ 21 - 0
Sources/Load.php

@@ -2087,6 +2087,27 @@ function loadLanguage($template_name, $lang = '', $fatal = true, $force_reload =
 			log_error(sprintf($txt['theme_language_error'], $template_name . '.' . $lang, 'template'));
 			break;
 		}
+
+		// For the sake of backward compatibility
+		if (!empty($txt['emails']))
+		{
+			foreach ($txt['emails'] as $key => $value)
+			{
+				$txt[$key . '_subject'] = $value['subject'];
+				$txt[$key . '_body'] = $value['body'];
+			}
+			$txt['emails'] = array();
+		}
+		if (!empty($birthdayEmails))
+		{
+			foreach ($birthdayEmails as $key => $value)
+			{
+				$txtBirthdayEmails[$key . '_subject'] = $value['subject'];
+				$txtBirthdayEmails[$key . '_body'] = $value['body'];
+				$txtBirthdayEmails[$key . '_author'] = $value['author'];
+			}
+			$birthdayEmails = array();
+		}
 	}
 
 	// Keep track of what we're up to soldier.

+ 7 - 0
Sources/LogInOut.php

@@ -105,6 +105,13 @@ function Login2()
 		if ($_GET['member'] != $user_info['id'])
 			fatal_lang_error('login_cookie_error', false);
 
+		$user_info['can_mod'] = allowedTo('access_mod_center') || (!$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || ($modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']))));
+		if ($user_info['can_mod'] && isset($user_settings['openid_uri']) && empty($user_settings['openid_uri']))
+		{
+			$_SESSION['moderate_time'] = time();
+			unset($_SESSION['just_registered']);
+		}
+
 		// Some whitelisting for login_url...
 		if (empty($_SESSION['login_url']))
 			redirectexit();

+ 7 - 4
Sources/ManageBoards.php

@@ -144,13 +144,15 @@ function ManageBoardsMain()
 			$prev_child_level = 0;
 			$prev_board = 0;
 			$stack = array();
+			// Just a shortcut, this is the same for all the urls
+			$security = $context['session_var'] . '=' . $context['session_id'] . ';' . $context['admin-bm-' . $context['move_board'] . '_token_var'] . '=' . $context['admin-bm-' . $context['move_board'] . '_token'];
 			foreach ($boardList[$catid] as $boardid)
 			{
 				if (!isset($context['categories'][$catid]['move_link']))
 					$context['categories'][$catid]['move_link'] = array(
 						'child_level' => 0,
 						'label' => $txt['mboards_order_before'] . ' \'' . htmlspecialchars($boards[$boardid]['name']) . '\'',
-						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=before;' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['admin-bm-' . $context['move_board'] . '_token_var'] . '=' . $context['admin-bm-' . $context['move_board'] . '_token'],
+						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=before;' . $security,
 					);
 
 				if (!$context['categories'][$catid]['boards'][$boardid]['move'])
@@ -158,12 +160,12 @@ function ManageBoardsMain()
 					array(
 						'child_level' => $boards[$boardid]['level'],
 						'label' => $txt['mboards_order_after'] . '\'' . htmlspecialchars($boards[$boardid]['name']) . '\'',
-						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=after;' . $context['session_var'] . '=' . $context['session_id'],
+						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=after;' . $security,
 					),
 					array(
 						'child_level' => $boards[$boardid]['level'] + 1,
 						'label' => $txt['mboards_order_child_of'] . ' \'' . htmlspecialchars($boards[$boardid]['name']) . '\'',
-						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=child;' . $context['session_var'] . '=' . $context['session_id'],
+						'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_board=' . $boardid . ';move_to=child;' . $security,
 					),
 				);
 
@@ -192,7 +194,7 @@ function ManageBoardsMain()
 				$context['categories'][$catid]['move_link'] = array(
 					'child_level' => 0,
 					'label' => $txt['mboards_order_before'] . ' \'' . htmlspecialchars($tree['node']['name']) . '\'',
-					'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_cat=' . $catid . ';move_to=top;' . $context['session_var'] . '=' . $context['session_id'],
+					'href' => $scripturl . '?action=admin;area=manageboards;sa=move;src_board=' . $context['move_board'] . ';target_cat=' . $catid . ';move_to=top;' . $security,
 				);
 		}
 	}
@@ -291,6 +293,7 @@ function EditCategory()
 
 	// Create a special token.
 	createToken('admin-bc-' . $_REQUEST['cat']);
+	$context['token_check'] = 'admin-bc-' . $_REQUEST['cat'];
 
 	call_integration_hook('integrate_edit_category');
 }

+ 15 - 8
Sources/ManageMail.php

@@ -278,15 +278,22 @@ function list_getMailQueueSize()
  */
 function ModifyMailSettings($return_config = false)
 {
-	global $txt, $scripturl, $context, $settings, $birthdayEmails, $modSettings;
+	global $txt, $scripturl, $context, $settings, $modSettings, $txtBirthdayEmails;
 
 	loadLanguage('EmailTemplates');
 
-	$body = $birthdayEmails[empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']]['body'];
-	$subject = $birthdayEmails[empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']]['subject'];
+	$body = $txtBirthdayEmails[(empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']) . '_body'];
+	$subject = $txtBirthdayEmails[(empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']) . '_subject'];
 
 	$emails = array();
-	foreach ($birthdayEmails as $index => $dummy)
+	$processedBirthdayEmails = array();
+	foreach ($txtBirthdayEmails as $key => $value)
+	{
+		$index = substr($key, 0, strrpos($key, '_'));
+		$element = substr($key, strrpos($key, '_') + 1);
+		$processedBirthdayEmails[$index][$element] = $value;
+	}
+	foreach ($processedBirthdayEmails as $index => $dummy)
 		$emails[$index] = $index;
 
 	$config_vars = array(
@@ -302,8 +309,8 @@ function ModifyMailSettings($return_config = false)
 			array('text', 'smtp_username'),
 			array('password', 'smtp_password'),
 		'',
-			array('select', 'birthday_email', $emails, 'value' => empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email'], 'javascript' => 'onchange="fetch_birthday_preview()"'),
-			'birthday_subject' => array('var_message', 'birthday_subject', 'var_message' => $birthdayEmails[empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']]['subject'], 'disabled' => true, 'size' => strlen($subject) + 3),
+			array('select', 'birthday_email', $emails, 'value' => array('subject' => $subject, 'body' => $body), 'javascript' => 'onchange="fetch_birthday_preview()"'),
+			'birthday_subject' => array('var_message', 'birthday_subject', 'var_message' => $processedBirthdayEmails[empty($modSettings['birthday_email']) ? 'happy_birthday' : $modSettings['birthday_email']]['subject'], 'disabled' => true, 'size' => strlen($subject) + 3),
 			'birthday_body' => array('var_message', 'birthday_body', 'var_message' => nl2br($body), 'disabled' => true, 'size' => ceil(strlen($body) / 25)),
 	);
 
@@ -341,9 +348,9 @@ function ModifyMailSettings($return_config = false)
 		var bDay = {';
 
 	$i = 0;
-	foreach ($birthdayEmails as $index => $email)
+	foreach ($processedBirthdayEmails as $index => $email)
 	{
-		$is_last = ++$i == count($birthdayEmails);
+		$is_last = ++$i == count($processedBirthdayEmails);
 		$context['settings_insert_above'] .= '
 			' . $index . ': {
 				subject: ' . JavaScriptEscape($email['subject']) . ',

+ 4 - 4
Sources/ManageMembers.php

@@ -902,16 +902,16 @@ function MembersAwaitingActivation()
 			),
 			'date_registered' => array(
 				'header' => array(
-					'value' => $txt['date_registered'],
+					'value' => $context['current_filter'] == 4 ? $txt['viewmembers_online'] : $txt['date_registered'],
 				),
 				'data' => array(
 					'function' => create_function('$rowData', '
-						return timeformat($rowData[\'date_registered\']);
+						return timeformat($rowData[\'' . ($context['current_filter'] == 4 ? 'last_login' : 'date_registered') . '\']);
 					'),
 				),
 				'sort' => array(
-					'default' => 'date_registered DESC',
-					'reverse' => 'date_registered',
+					'default' => $context['current_filter'] == 4 ? 'mem.last_login DESC' : 'date_registered DESC',
+					'reverse' => $context['current_filter'] == 4 ? 'mem.last_login' : 'date_registered',
 				),
 			),
 			'duplicates' => array(

+ 3 - 13
Sources/ManageSettings.php

@@ -39,7 +39,7 @@ function loadGeneralSettingParameters($subActions = array(), $defaultAction = ''
 	$context['sub_template'] = 'show_settings';
 
 	// By default do the basic settings.
-	$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (!empty($defaultAction) ? $defaultAction : array_pop($temp = array_keys($subActions)));
+	$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : (!empty($defaultAction) ? $defaultAction : array_pop(array_keys($subActions)));
 	$context['sub_action'] = $_REQUEST['sa'];
 }
 
@@ -63,14 +63,6 @@ function ModifyFeatureSettings()
 
 	call_integration_hook('integrate_modify_features', array(&$subActions));
 
-	// If Advanced Profile Fields are disabled don't show the setting page
-	if (!in_array('cp', $context['admin_features']))
-		unset($subActions['profile']);
-
-	// Same for Karma
-	if (!in_array('k', $context['admin_features']))
-		unset($subActions['karma']);
-
 	loadGeneralSettingParameters($subActions, 'basic');
 
 	// Load up all the tabs...
@@ -115,10 +107,6 @@ function ModifySecuritySettings()
 
 	call_integration_hook('integrate_modify_security', array(&$subActions));
 
-	// If Warning System is disabled don't show the setting page
-	if (!in_array('w', $context['admin_features']))
-		unset($subActions['moderation']);
-
 	loadGeneralSettingParameters($subActions, 'general');
 
 	// Load up all the tabs...
@@ -395,6 +383,8 @@ function ModifyCoreFeatures($return_config = false)
 
 		// Make any setting changes!
 		updateSettings($setting_changes);
+		// This is needed to let menus appear if cache > 2
+		clean_cache('data');
 
 		// Any post save things?
 		foreach ($core_features as $id => $feature)

+ 9 - 1
Sources/Poll.php

@@ -451,6 +451,8 @@ function EditPoll()
 			'is_last' => true
 		);
 
+		$context['last_choice_id'] = $last_id;
+
 		if ($context['can_moderate_poll'])
 			$context['poll']['expiration'] = $_POST['poll_expire'];
 
@@ -527,6 +529,7 @@ function EditPoll()
 				'label' => '',
 				'is_last' => true
 			);
+			$context['last_choice_id'] = $last_id;
 		}
 		// New poll?
 		else
@@ -551,6 +554,7 @@ function EditPoll()
 				array('id' => 3, 'number' => 4, 'votes' => -1, 'label' => '', 'is_last' => false),
 				array('id' => 4, 'number' => 5, 'votes' => -1, 'label' => '', 'is_last' => true)
 			);
+			$context['last_choice_id'] = 4;
 		}
 	}
 	$context['page_title'] = $context['is_edit'] ? $txt['poll_edit'] : $txt['add_poll'];
@@ -633,15 +637,19 @@ function EditPoll2()
 		isAllowedTo('poll_add_' . ($user_info['id'] == $bcinfo['id_member_started'] ? 'own' : 'any'));
 
 	$optionCount = 0;
+	$idCount = 0;
 	// Ensure the user is leaving a valid amount of options - there must be at least two.
 	foreach ($_POST['options'] as $k => $option)
 	{
 		if (trim($option) != '')
+		{
 			$optionCount++;
+			$idCount = max($idCount, $k);
+		}
 	}
 	if ($optionCount < 2)
 		$poll_errors[] = 'poll_few';
-	elseif ($optionCount > 256)
+	elseif ($optionCount > 256 || $idCount > 255)
 		$poll_errors[] = 'poll_many';
 
 	// Also - ensure they are not removing the question.

+ 10 - 6
Sources/Post.php

@@ -205,6 +205,7 @@ function Post()
 			array('id' => 3, 'number' => 4, 'label' => '', 'is_last' => false),
 			array('id' => 4, 'number' => 5, 'label' => '', 'is_last' => true)
 		);
+		$context['last_choice_id'] = 4;
 	}
 
 	if ($context['make_event'])
@@ -487,6 +488,14 @@ function Post()
 				);
 			}
 
+			// One empty option for those with js disabled...I know are few... :P
+			$context['choices'][] = array(
+				'id' => $choice_id++,
+				'number' => $choice_id,
+				'label' => '',
+				'is_last' => false
+			);
+
 			if (count($context['choices']) < 2)
 			{
 				$context['choices'][] = array(
@@ -495,13 +504,8 @@ function Post()
 					'label' => '',
 					'is_last' => false
 				);
-				$context['choices'][] = array(
-					'id' => $choice_id++,
-					'number' => $choice_id,
-					'label' => '',
-					'is_last' => false
-				);
 			}
+			$context['last_choice_id'] = $choice_id;
 			$context['choices'][count($context['choices']) - 1]['is_last'] = true;
 		}
 

+ 2 - 1
Sources/ScheduledTasks.php

@@ -1344,7 +1344,8 @@ function scheduled_birthdayemails()
 	{
 		// We need to do some shuffling to make this work properly.
 		loadLanguage('EmailTemplates', $lang);
-		$txt['emails']['happy_birthday'] = $birthdayEmails[$greeting];
+		$txt['emails']['happy_birthday']['subject'] = $txtBirthdayEmails[$greeting . '_subject'];
+		$txt['emails']['happy_birthday']['body'] = $txtBirthdayEmails[$greeting . '_body'];
 
 		foreach ($recps as $recp)
 		{

+ 71 - 0
Sources/Security.php

@@ -1175,4 +1175,75 @@ function spamProtection($error_type)
 	return false;
 }
 
+/**
+ * A generic function to create a pair of index.php and .htaccess files in a directory
+ * @param string $path, the (absolute) directory path
+ * @param boolean $attachments, if the directory is an attachments directory or not
+ * @return true on success, error string if anything fails
+ */
+function secureDirectory($path, $attachments = false)
+{
+	if (empty($path))
+		return 'empty_path';
+
+	if (!is_writable($path))
+		return 'path_not_writable';
+
+	$directoryname = basename($path);
+
+	$errors = array();
+	$close = empty($attachments) ? '
+</Files>' : '
+	Allow from localhost
+</Files>
+
+RemoveHandler .php .php3 .phtml .cgi .fcgi .pl .fpl .shtml';
+
+	if (file_exists($path . '/.htaccess'))
+		$errors[] = 'htaccess_exists';
+	else
+	{
+		$fh = @fopen($path . '/.htaccess', 'w');
+		if ($fh) {
+			fwrite($fh, '<Files *>
+	Order Deny,Allow
+	Deny from all' . $close);
+			fclose($fh);
+		}
+		$errors[] = 'htaccess_cannot_create_file';
+	}
+
+	if (file_exists($path . '/index.php'))
+		$errors[] = 'index-php_exists';
+	else
+	{
+		$fh = @fopen($path . '/index.php', 'w');
+		if ($fh) {
+			fwrite($fh, '<?php
+
+// This file is here solely to protect your ' . $directoryname . ' directory.
+
+// Look for Settings.php....
+if (file_exists(dirname(dirname(__FILE__)) . \'/Settings.php\'))
+{
+	// Found it!
+	require(dirname(dirname(__FILE__)) . \'/Settings.php\');
+	header(\'Location: \' . $boardurl);
+}
+// Can\'t find it... just forget it.
+else
+	exit;
+
+?>');
+			fclose($fh);
+		}
+		$errors[] = 'index-php_cannot_create_file';
+	}
+
+	if (!empty($errors))
+		return $errors;
+	else
+		return true;
+}
+
 ?>

+ 2 - 2
Sources/Subs-Membergroups.php

@@ -404,7 +404,7 @@ function removeMembersFromGroups($members, $groups = null, $permissionCheckDone
 	// Do the log.
 	if (!empty($log_inserts) && !empty($modSettings['modlog_enabled']))
 	{
-		require_once($sourcedir . 'Logging.php');
+		require_once($sourcedir . '/Logging.php');
 		foreach ($log_inserts as $extra)
 			logAction('removed_from_group', $extra, 'admin');
 	}
@@ -565,7 +565,7 @@ function addMembersToGroup($members, $group, $type = 'auto', $permissionCheckDon
 
 	// Log the data.
 	$log_inserts = array();
-	require_once($sourcedir . 'Logging.php');
+	require_once($sourcedir . '/Logging.php');
 	foreach ($members as $member)
 		logAction('added_to_group', array('group' => $group_names[$group], 'member' => $member), 'admin');
 

+ 1 - 1
Sources/Subs-Members.php

@@ -109,7 +109,7 @@ function deleteMembers($users, $check_not_admin = false)
 	if (empty($users))
 		return;
 
-	require_once($sourcedir . 'Logging.php');
+	require_once($sourcedir . '/Logging.php');
 	// Log the action - regardless of who is deleting it.
 	$log_inserts = array();
 	foreach ($user_log_details as $user)

+ 3 - 3
Sources/Subs-Post.php

@@ -3227,12 +3227,12 @@ function loadEmailTemplate($template, $replacements = array(), $lang = '', $load
 	if ($loadLang)
 		loadLanguage('EmailTemplates', $lang);
 
-	if (!isset($txt['emails'][$template]))
+	if (!isset($txt['emails_' . $template . '_subject']) || !isset($txt['emails_' . $template . '_body']))
 		fatal_lang_error('email_no_template', 'template', array($template));
 
 	$ret = array(
-		'subject' => $txt['emails'][$template]['subject'],
-		'body' => $txt['emails'][$template]['body'],
+		'subject' => $txt['emails_' . $template . '_subject'],
+		'body' => $txt['emails_' . $template . '_body'],
 	);
 
 	// Add in the default replacements.

+ 19 - 3
Sources/Subs.php

@@ -501,7 +501,7 @@ function updateSettings($changeArray, $update = false, $debug = false)
  */
 function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flexible_start = false)
 {
-	global $modSettings;
+	global $modSettings, $context;
 
 	// Save whether $start was less than 0 or not.
 	$start = (int) $start;
@@ -517,6 +517,8 @@ function constructPageIndex($base_url, &$start, $max_value, $num_per_page, $flex
 	else
 		$start = max(0, (int) $start - ((int) $start % (int) $num_per_page));
 
+	$context['current_page'] = $start / $num_per_page;
+
 	// Wireless will need the protocol on the URL somewhere.
 	if (WIRELESS)
 		$base_url .= ';' . WIRELESS_PROTOCOL;
@@ -2608,7 +2610,7 @@ function obExit($header = null, $do_footer = null, $from_index = false, $from_fa
 	{
 		// Was the page title set last minute? Also update the HTML safe one.
 		if (!empty($context['page_title']) && empty($context['page_title_html_safe']))
-			$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));
+			$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title'])) . (!empty($context['current_page']) ? ' - ' . $txt['page'] . ' ' . ($context['current_page'] + 1) : '');
 
 		// Start up the session URL fixer.
 		ob_start('ob_sessrewrite');
@@ -2965,7 +2967,7 @@ function setupThemeContext($forceload = false)
 		$context['page_title'] = '';
 
 	// Set some specific vars.
-	$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));
+	$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title'])) . (!empty($context['current_page']) ? ' - ' . $txt['page'] . ' ' . ($context['current_page'] + 1) : '');
 	$context['meta_keywords'] = !empty($modSettings['meta_keywords']) ? $smcFunc['htmlspecialchars']($modSettings['meta_keywords']) : '';
 }
 
@@ -3020,6 +3022,20 @@ function template_header()
 				if (!file_exists($boarddir . '/' . $securityFile))
 					unset($securityFiles[$i]);
 			}
+			// We are already checking so many files...just few more doesn't make any difference! :P
+			if (!empty($modSettings['currentAttachmentUploadDir']))
+			{
+				if (!is_array($modSettings['attachmentUploadDir']))
+					$modSettings['attachmentUploadDir'] = @unserialize($modSettings['attachmentUploadDir']);
+				$path = $modSettings['attachmentUploadDir'][$modSettings['currentAttachmentUploadDir']];
+			}
+			else
+			{
+				$path = $modSettings['attachmentUploadDir'];
+				$id_folder_thumb = 1;
+			}
+			secureDirectory($path, true);
+			secureDirectory($cachedir);
 
 			if (!empty($securityFiles) || (!empty($modSettings['cache_enable']) && !is_writable($cachedir)))
 			{

+ 3 - 0
Themes/default/ManageBoards.template.php

@@ -174,6 +174,9 @@ function template_modify_category()
 						<input type="submit" name="delete" value="', $txt['mboards_delete_cat'], '" onclick="return confirm(\'', $txt['catConfirm'], '\');" class="button_submit" />';
 	echo '
 						<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />';
+	if (!empty($context['token_check']))
+		echo '
+						<input type="hidden" name="', $context[$context['token_check'] . '_token_var'], '" value="', $context[$context['token_check'] . '_token'], '" />';
 
 	// If this category is empty we don't bother with the next confirmation screen.
 	if ($context['category']['is_empty'])

+ 3 - 1
Themes/default/Poll.template.php

@@ -18,6 +18,7 @@ function template_main()
 	echo '
 		<script type="text/javascript"><!-- // --><![CDATA[
 			var pollOptionNum = 0;
+			var pollOptionId = ', $context['last_choice_id'], ';
 
 			function addPollOption()
 			{
@@ -28,8 +29,9 @@ function template_main()
 							pollOptionNum++;
 				}
 				pollOptionNum++
+				pollOptionId++
 
-				setOuterHTML(document.getElementById("pollMoreOptions"), \'<li><label for="options-\' + pollOptionNum + \'" ', (isset($context['poll_error']['no_question']) ? ' class="error"' : ''), '>', $txt['option'], ' \' + pollOptionNum + \'</label>: <input type="text" name="options[\' + (pollOptionNum - 1) + \']" id="options-\' + (pollOptionNum - 1) + \'" value="" size="80" maxlength="255" class="input_text" /></li><li id="pollMoreOptions"></li\');
+				setOuterHTML(document.getElementById("pollMoreOptions"), \'<li><label for="options-\' + pollOptionId + \'" ', (isset($context['poll_error']['no_question']) ? ' class="error"' : ''), '>', $txt['option'], ' \' + pollOptionNum + \'</label>: <input type="text" name="options[\' + (pollOptionId) + \']" id="options-\' + (pollOptionId) + \'" value="" size="80" maxlength="255" class="input_text" /></li><li id="pollMoreOptions"></li\');
 			}
 		// ]]></script>';
 

+ 3 - 1
Themes/default/Post.template.php

@@ -37,6 +37,7 @@ function template_main()
 	if ($context['make_poll'])
 		echo '
 			var pollOptionNum = 0, pollTabIndex;
+			var pollOptionId = ', $context['last_choice_id'], ';
 			function addPollOption()
 			{
 				if (pollOptionNum == 0)
@@ -49,8 +50,9 @@ function template_main()
 						}
 				}
 				pollOptionNum++
+				pollOptionId++
 
-				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<li><label for="options-'), ' + pollOptionNum + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>: <input type="text" name="options['), ' + pollOptionNum + ', JavaScriptEscape(']" id="options-'), ' + pollOptionNum + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text" /></li><li id="pollMoreOptions"></li>'), ');
+				setOuterHTML(document.getElementById(\'pollMoreOptions\'), ', JavaScriptEscape('<li><label for="options-'), ' + pollOptionId + ', JavaScriptEscape('">' . $txt['option'] . ' '), ' + pollOptionNum + ', JavaScriptEscape('</label>: <input type="text" name="options['), ' + pollOptionId + ', JavaScriptEscape(']" id="options-'), ' + pollOptionId + ', JavaScriptEscape('" value="" size="80" maxlength="255" tabindex="'), ' + pollTabIndex + ', JavaScriptEscape('" class="input_text" /></li><li id="pollMoreOptions"></li>'), ');
 			}';
 
 	// If we are making a calendar event we want to ensure we show the current days in a month etc... this is done here.

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

@@ -374,7 +374,7 @@ $txt['attach_path_manage'] = 'Manage Attachment Paths';
 $txt['attach_paths'] = 'Attachment Paths';
 $txt['attach_current_dir'] = 'Current Directory';
 $txt['attach_path'] = 'Path';
-$txt['attach_current_size'] = 'Current Size (KB)';
+$txt['attach_current_size'] = 'Current Size (kB)';
 $txt['attach_num_files'] = 'Files';
 $txt['attach_dir_status'] = 'Status';
 $txt['attach_add_path'] = 'Add Path';

Разлика између датотеке није приказан због своје велике величине
+ 388 - 425
Themes/default/languages/EmailTemplates.english.php


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

@@ -35,7 +35,7 @@ $txt['cant_change_own_karma'] = 'Sorry, you are not permitted to modify your own
 $txt['karma_wait_time'] = 'Sorry, you can\'t repeat a karma action without waiting %1$s %2$s.';
 $txt['feature_disabled'] = 'Sorry, this feature is disabled.';
 $txt['cant_access_upload_path'] = 'Cannot access attachments upload path!';
-$txt['file_too_big'] = 'Your file is too large. The maximum attachment size allowed is %1$d KB.';
+$txt['file_too_big'] = 'Your file is too large. The maximum attachment size allowed is %1$d kB.';
 $txt['attach_timeout'] = 'Your attachment couldn\'t be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.<br /><br />Please consult your server administrator for more information.';
 $txt['filename_exists'] = 'Sorry! There is already an attachment with the same filename as the one you tried to upload. Please rename the file and try again.';
 $txt['bad_attachment'] = 'Your attachment has failed security checks and cannot be uploaded. Please consult the forum administrator.';

+ 3 - 3
Themes/default/languages/Help.english.php

@@ -296,9 +296,9 @@ $helptxt['attachment_manager_settings'] = 'Attachments are files that members ca
 		<strong>Check attachment extension</strong>:<br /> Do you want to check the extension of the files?<br />
 		<strong>Allowed attachment extensions</strong>:<br /> You can set the allowed extensions of attached files.<br />
 		<strong>Attachments directory</strong>:<br /> The path to your attachment folder<br />(example: /home/sites/yoursite/www/forum/attachments)<br />
-		<strong>Max attachment folder space</strong> (in KB):<br /> Select how large the attachment folder can be, including all files within it.<br />
-		<strong>Max attachment size per post</strong> (in KB):<br /> Select the maximum filesize of all attachments made per post.  If this is lower than the per-attachment limit, this will be the limit.<br />
-		<strong>Max size per attachment</strong> (in KB):<br /> Select the maximum filesize of each separate attachment.<br />
+		<strong>Max attachment folder space</strong> (in kB):<br /> Select how large the attachment folder can be, including all files within it.<br />
+		<strong>Max attachment size per post</strong> (in kB):<br /> Select the maximum filesize of all attachments made per post.  If this is lower than the per-attachment limit, this will be the limit.<br />
+		<strong>Max size per attachment</strong> (in kB):<br /> Select the maximum filesize of each separate attachment.<br />
 		<strong>Max number of attachments per post</strong>:<br /> Select the number of attachments a person can make, per post.<br />
 		<strong>Display attachment as picture in posts</strong>:<br /> If the uploaded file is a picture, this will show it underneath the post.<br />
 		<strong>Resize images when showing under posts</strong>:<br /> If the above option is selected, this will save a separate (smaller) attachment for the thumbnail to decrease bandwidth.<br />

+ 2 - 2
Themes/default/languages/Post.english.php

@@ -115,8 +115,8 @@ $txt['reported_by'] = 'has been reported by';
 $txt['board_moderate'] = 'on a board you moderate';
 $txt['report_comment'] = 'The reporter has made the following comment';
 
-$txt['attach_restrict_attachmentPostLimit'] = 'maximum total size %1$dKB';
-$txt['attach_restrict_attachmentSizeLimit'] = 'maximum individual size %1$dKB';
+$txt['attach_restrict_attachmentPostLimit'] = 'maximum total size %1$d kB';
+$txt['attach_restrict_attachmentSizeLimit'] = 'maximum individual size %1$d kB';
 $txt['attach_restrict_attachmentNumPerPostLimit'] = '%1$d per post';
 $txt['attach_restrictions'] = 'Restrictions:';
 

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

@@ -50,7 +50,7 @@ $txt['search_method_title'] = 'Search - method';
 $txt['search_method_save'] = 'Save';
 $txt['search_method_messages_table_space'] = 'Space used by forum messages in the database';
 $txt['search_method_messages_index_space'] = 'Space used to index messages in the database';
-$txt['search_method_kilobytes'] = 'KB';
+$txt['search_method_kilobytes'] = 'kB';
 $txt['search_method_fulltext_index'] = 'Fulltext index';
 $txt['search_method_no_index_exists'] = 'doesn\'t currently exist';
 $txt['search_method_fulltext_create'] = 'create a fulltext index';

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

@@ -136,7 +136,7 @@ $txt['themeadmin_edit_filename'] = 'Filename';
 $txt['themeadmin_edit_modified'] = 'Last Modified';
 $txt['themeadmin_edit_size'] = 'Size';
 $txt['themeadmin_edit_bytes'] = 'B';
-$txt['themeadmin_edit_kilobytes'] = 'KB';
+$txt['themeadmin_edit_kilobytes'] = 'kB';
 $txt['themeadmin_edit_error'] = 'The file you tried to save generated the following error:';
 $txt['themeadmin_edit_on_line'] = 'Beginning on line';
 $txt['themeadmin_edit_preview'] = 'Preview';

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

@@ -93,6 +93,7 @@ $txt['warn_mute'] = 'Muted';
 $txt['message_index'] = 'Message Index';
 $txt['news'] = 'News';
 $txt['home'] = 'Home';
+$txt['page'] = 'Page';
 
 $txt['lock_unlock'] = 'Lock/Unlock Topic';
 $txt['post'] = 'Post';
@@ -743,7 +744,7 @@ $txt['debug_subtemplates'] = 'Sub templates: ';
 $txt['debug_language_files'] = 'Language files: ';
 $txt['debug_stylesheets'] = 'Style sheets: ';
 $txt['debug_files_included'] = 'Files included: ';
-$txt['debug_kb'] = 'KB.';
+$txt['debug_kb'] = 'kB.';
 $txt['debug_show'] = 'show';
 $txt['debug_cache_hits'] = 'Cache hits: ';
 $txt['debug_cache_seconds_bytes'] = '%1$ss - %2$s bytes';

+ 5 - 3
other/install.php

@@ -725,11 +725,13 @@ function DatabaseSettings()
 		$incontext['db']['prefix'] = $_POST['db_prefix'];
 	}
 	else
+	{
 		$incontext['db']['prefix'] = 'smf_';
 
-	// Should we use a non standard port?
-	if (!empty($db_port))
-		$incontext['db']['server'] .= ':' . $db_port;
+		// Should we use a non standard port?
+		if (!empty($db_port))
+			$incontext['db']['server'] .= ':' . $db_port;
+	}
 
 	// Are we submitting?
 	if (isset($_POST['db_type']))

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

@@ -253,22 +253,22 @@ CREATE SEQUENCE {$db_prefix}ban_items_seq;
 CREATE TABLE {$db_prefix}ban_items (
   id_ban int default nextval('{$db_prefix}ban_items_seq'),
   id_ban_group smallint NOT NULL default '0',
-  ip_low1 smallint(255) NOT NULL default '0',
-  ip_high1 smallint(255) NOT NULL default '0',
-  ip_low2 smallint(255) NOT NULL default '0',
-  ip_high2 smallint(255) NOT NULL default '0',
-  ip_low3 smallint(255) NOT NULL default '0',
-  ip_high3 smallint(255) NOT NULL default '0',
-  ip_low4 smallint(255) NOT NULL default '0',
-  ip_high4 smallint(255) NOT NULL default '0',
-  ip_low5 smallint(255) NOT NULL default '0',
-  ip_high5 smallint(255) NOT NULL default '0',
-  ip_low6 smallint(255) NOT NULL default '0',
-  ip_high6 smallint(255) NOT NULL default '0',
-  ip_low7 smallint(255) NOT NULL default '0',
-  ip_high7 smallint(255) NOT NULL default '0',
-  ip_low8 smallint(255) NOT NULL default '0',
-  ip_high8 smallint(255) NOT NULL default '0',
+  ip_low1 smallint NOT NULL default '0',
+  ip_high1 smallint NOT NULL default '0',
+  ip_low2 smallint NOT NULL default '0',
+  ip_high2 smallint NOT NULL default '0',
+  ip_low3 smallint NOT NULL default '0',
+  ip_high3 smallint NOT NULL default '0',
+  ip_low4 smallint NOT NULL default '0',
+  ip_high4 smallint NOT NULL default '0',
+  ip_low5 smallint NOT NULL default '0',
+  ip_high5 smallint NOT NULL default '0',
+  ip_low6 smallint NOT NULL default '0',
+  ip_high6 smallint NOT NULL default '0',
+  ip_low7 smallint NOT NULL default '0',
+  ip_high7 smallint NOT NULL default '0',
+  ip_low8 smallint NOT NULL default '0',
+  ip_high8 smallint NOT NULL default '0',
   hostname varchar(255) NOT NULL,
   email_address varchar(255) NOT NULL,
   id_member int NOT NULL default '0',

Неке датотеке нису приказане због велике количине промена