Pārlūkot izejas kodu

Merge pull request #4 from emanuele45/master

few small fixes
Spuds 13 gadi atpakaļ
vecāks
revīzija
c38bde2441

+ 1 - 1
Sources/ManagePosts.php

@@ -230,7 +230,7 @@ function ModifyPostSettings($return_config = false)
 					if ($column == 'body' && $index['type'] == 'fulltext')
 						$fulltext = true;
 
-			if (isset($body_type) && $_POST['max_messageLength'] > 65535 && $body_type == 'text')
+			if (isset($body_type) && ($_POST['max_messageLength'] > 65535 || $_POST['max_messageLength'] == 0) && $body_type == 'text')
 			{
 				// @todo Show an error message?!
 				// MySQL only likes fulltext indexes on text columns... for now?

+ 13 - 2
Sources/ManageServer.php

@@ -484,6 +484,16 @@ function prepareServerSettingsContext(&$config_vars)
 			$varname = $config_var[0];
 			global $$varname;
 
+			// Set the subtext in case it's part of the label.
+			// @todo Temporary. Preventing divs inside label tags.
+			$divPos = strpos($config_var[1], '<div');
+			$subtext = '';
+			if ($divPos !== false)
+			{
+				$subtext = preg_replace('~</?div[^>]*>~', '', substr($config_var[1], $divPos));
+				$config_var[1] = substr($config_var[1], 0, $divPos);
+			}
+
 			$context['config_vars'][] = array(
 				'label' => $config_var[1],
 				'help' => isset($config_var[5]) ? $config_var[5] : '',
@@ -494,15 +504,16 @@ function prepareServerSettingsContext(&$config_vars)
 				'value' => $config_var[2] == 'file' ? htmlspecialchars($$varname) : (isset($modSettings[$config_var[0]]) ? htmlspecialchars($modSettings[$config_var[0]]) : (in_array($config_var[3], array('int', 'float')) ? 0 : '')),
 				'disabled' => !empty($context['settings_not_writable']) || !empty($config_var['disabled']),
 				'invalid' => false,
+				'subtext' => $subtext,
 				'javascript' => '',
 				'preinput' => '',
 				'postinput' => '',
 			);
+			
 		}
 	}
 
 	createToken('admin-ssc');
-	createToken('admin-dbsc');
 }
 
 /**
@@ -659,7 +670,7 @@ function prepareDBSettingContext(&$config_vars)
 		}
 	}
 
-	call_integration_hook('integrate_prepare_server_settings', array(&$config_vars));
+	call_integration_hook('integrate_prepare_db_settings', array(&$config_vars));
 	createToken('admin-dbsc');
 }
 

+ 1 - 1
Sources/Subs-Editor.php

@@ -2011,7 +2011,7 @@ function create_control_verification(&$verificationOptions, $do_test = false)
 			$incorrectQuestions = array();
 			while ($row = $smcFunc['db_fetch_assoc']($request))
 			{
-				if (empty($_REQUEST[$verificationOptions['id'] . '_vv']['q'][$row['id_comment']]) || trim($smcFunc['htmlspecialchars'](strtolower($_REQUEST[$verificationOptions['id'] . '_vv']['q'][$row['id_comment']]))) != strtolower($row['answer']))
+				if (!isset($_REQUEST[$verificationOptions['id'] . '_vv']['q'][$row['id_comment']]) || trim($_REQUEST[$verificationOptions['id'] . '_vv']['q'][$row['id_comment']]) == '' || trim($smcFunc['htmlspecialchars'](strtolower($_REQUEST[$verificationOptions['id'] . '_vv']['q'][$row['id_comment']]))) != strtolower($row['answer']))
 					$incorrectQuestions[] = $row['id_comment'];
 			}
 			$smcFunc['db_free_result']($request);

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

@@ -258,7 +258,7 @@ function template_main()
 								', $topic['is_sticky'] ? '<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" class="floatright" alt="" id="stickyicon' . $topic['first_post']['id'] . '" style="margin: 0;" />' : '';
 
 			echo '
-								', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
+								', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
 
 			// Is this topic new? (assuming they are logged in!)
 			if ($topic['new'] && $context['user']['is_logged'])

+ 2 - 1
Themes/default/Admin.template.php

@@ -1396,7 +1396,7 @@ function template_core_features()
 // This little beauty shows questions and answer from the captcha type feature.
 function template_callback_question_answer_list()
 {
-	global $txt, $context;
+	global $txt, $context, $settings;
 
 	echo '
 			<dt>
@@ -1430,6 +1430,7 @@ function template_callback_question_answer_list()
 		<dt id="add_more_question_placeholder" style="display: none;"></dt><dd></dd>
 		<dt id="add_more_link_div" style="display: none;">
 			<a href="#" onclick="addAnotherQuestion(); return false;">&#171; ', $txt['setup_verification_add_more'], ' &#187;</a>
+			<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/admin.js?fin20"></script>
 
 		</dt><dd></dd>';
 

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

@@ -255,7 +255,7 @@ function template_main()
 					</td>
 					<td class="subject ', $alternate_class, '">
 						<div ', (!empty($topic['quick_mod']['modify']) ? 'id="topic_' . $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' . $topic['id'] . '\', \'' . $topic['first_post']['id'] . '\');"' : ''), '>
-							', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], (!$context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
+							', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], ($context['can_approve_posts'] && !$topic['approved'] ? '&nbsp;<em>(' . $txt['awaiting_approval'] . ')</em>' : ''), '</span>', $topic['is_sticky'] ? '</strong>' : '';
 
 			// Is this topic new? (assuming they are logged in!)
 			if ($topic['new'] && $context['user']['is_logged'])

+ 2 - 2
Themes/default/css/index.css

@@ -125,12 +125,12 @@ input:focus, textarea:focus, button:focus, select:focus
 }
 
 /* All input elements that are checkboxes or radio buttons shouldn't have a border around them. */
-.input_check, .input_radio
+input.input_check, input.input_radio
 {
 	border: none;
 	background: none;
 }
-h3.catbg .input_check
+h3.catbg input.input_check
 {
 	margin: 9px 7px 0 7px;
 }