Browse Source

Merge pull request #198 from Spuds/fixins

Fixins
emanuele45 12 years ago
parent
commit
31227862d5

+ 2 - 2
Sources/Calendar.php

@@ -205,7 +205,7 @@ function CalendarPost()
 			$eventOptions = array(
 				'board' => 0,
 				'topic' => 0,
-				'title' => substr($_REQUEST['evtitle'], 0, 60),
+				'title' => $smcFunc['substr']($_REQUEST['evtitle'], 0, 100),
 				'member' => $user_info['id'],
 				'start_date' => sprintf('%04d-%02d-%02d', $_POST['year'], $_POST['month'], $_POST['day']),
 				'span' => isset($_POST['span']) && $_POST['span'] > 0 ? min((int) $modSettings['cal_maxspan'], (int) $_POST['span'] - 1) : 0,
@@ -236,7 +236,7 @@ function CalendarPost()
 			}
 
 			$eventOptions = array(
-				'title' => substr($_REQUEST['evtitle'], 0, 60),
+				'title' => $smcFunc['substr']($_REQUEST['evtitle'], 0, 100),
 				'span' => empty($modSettings['cal_allowspan']) || empty($_POST['span']) || $_POST['span'] == 1 || empty($modSettings['cal_maxspan']) || $_POST['span'] > $modSettings['cal_maxspan'] ? 0 : min((int) $modSettings['cal_maxspan'], (int) $_POST['span'] - 1),
 				'start_date' => strftime('%Y-%m-%d', mktime(0, 0, 0, (int) $_REQUEST['month'], (int) $_REQUEST['day'], (int) $_REQUEST['year'])),
 			);

+ 12 - 6
Sources/ManageServer.php

@@ -338,21 +338,27 @@ function ModifyCacheSettings($return_config = false)
 		$detected['memcached'] = $txt['memcached_cache'];
 	if (function_exists('xcache_set'))
 		$detected['xcache'] = $txt['xcache_cache'];
-
-	// set a message to show what, if anything, we found
+	if (function_exists('file_put_contents'))
+		$detected['smf'] = $txt['default_cache'];
+		
+	// set our values to show what, if anything, we found
 	if (empty($detected))
+	{
 		$txt['cache_settings_message'] = $txt['detected_no_caching'];
+		$cache_level = array($txt['cache_off']);
+		$detected['none'] = $txt['cache_off'];
+	}
 	else
+	{
 		$txt['cache_settings_message'] = sprintf($txt['detected_accelerators'], implode(', ', $detected));
-
-	// This is always an option
-	$detected['smf'] = $txt['default_cache'];
+		$cache_level = array($txt['cache_off'], $txt['cache_level1'], $txt['cache_level2'], $txt['cache_level3']);
+	}
 
 	// Define the variables we want to edit.
 	$config_vars = array(
 		// Only a few settings, but they are important
 		array('', $txt['cache_settings_message'], '', 'desc'),
-		array('cache_enable', $txt['cache_enable'], 'file', 'select', array($txt['cache_off'], $txt['cache_level1'], $txt['cache_level2'], $txt['cache_level3']), 'cache_enable'),
+		array('cache_enable', $txt['cache_enable'], 'file', 'select', $cache_level, 'cache_enable'),
 		array('cache_accelerator', $txt['cache_accelerator'], 'file', 'select', $detected),
 		array('cache_memcached', $txt['cache_memcached'], 'file', 'text', $txt['cache_memcached'], 'cache_memcached'),
 		array('cachedir', $txt['cachedir'], 'file', 'text', 36, 'cache_cachedir'),

+ 2 - 1
Sources/ManageSmileys.php

@@ -387,7 +387,8 @@ function EditSmileySets()
 				),
 				'data' => array(
 					'function' => create_function('$rowData', '
-						return $rowData[\'selected\'] ? \'<strong>*</strong>\' : \'\';
+						global $settings;
+						return $rowData[\'selected\'] ? \'<img src="\' . $settings[\'images_url\'] . \'/icons/field_valid.png" alt="*" class="icon" />\' : \'\';
 					'),
 					'style' => 'text-align: center;',
 				),

+ 1 - 0
Sources/Post.php

@@ -2022,6 +2022,7 @@ function Post2()
 		$context['linktree'][] = array(
 			'url' => $scripturl . '?topic=' . $topic . '.0',
 			'name' => $_POST['subject'],
+			'extra_before' => $settings['linktree_inline'] ? $txt['topic'] . ': ' : ''
 		);
 
 		if (isset($_REQUEST['msg']))

+ 2 - 2
Sources/Subs-Calendar.php

@@ -803,8 +803,8 @@ function validateEventPost()
 		// No title?
 		if ($smcFunc['htmltrim']($_POST['evtitle']) === '')
 			fatal_lang_error('no_event_title', false);
-		if ($smcFunc['strlen']($_POST['evtitle']) > 30)
-			$_POST['evtitle'] = $smcFunc['substr']($_POST['evtitle'], 0, 30);
+		if ($smcFunc['strlen']($_POST['evtitle']) > 100)
+			$_POST['evtitle'] = $smcFunc['substr']($_POST['evtitle'], 0, 100);
 		$_POST['evtitle'] = str_replace(';', '', $_POST['evtitle']);
 	}
 }

+ 1 - 1
Sources/Subs-Db-mysql.php

@@ -110,7 +110,7 @@ function db_fix_prefix(&$db_prefix, $db_name)
 }
 
 /**
- * Callback for preg_replace_calback on the query.
+ * Callback for preg_replace_callback on the query.
  * It allows to replace on the fly a few pre-defined strings, for
  * convenience ('query_see_board', 'query_wanna_see_board'), with
  * their current values from $user_info.

+ 4 - 2
Sources/Subs-List.php

@@ -82,7 +82,8 @@ function createList($listOptions)
 		$list_context['items_per_page'] = $listOptions['items_per_page'];
 
 		// Then create a page index.
-		$list_context['page_index'] = constructPageIndex($listOptions['base_href'] . (empty($list_context['sort']) ? '' : ';' . $request_var_sort . '=' . $list_context['sort']['id'] . ($list_context['sort']['desc'] ? ';' . $request_var_desc : '')) . ($list_context['start_var_name'] != 'start' ? ';' . $list_context['start_var_name'] . '=%1$d' : ''), $list_context['start'], $list_context['total_num_items'], $list_context['items_per_page'], $list_context['start_var_name'] != 'start');
+		if ($list_context['total_num_items'] > $list_context['items_per_page'])
+			$list_context['page_index'] = constructPageIndex($listOptions['base_href'] . (empty($list_context['sort']) ? '' : ';' . $request_var_sort . '=' . $list_context['sort']['id'] . ($list_context['sort']['desc'] ? ';' . $request_var_desc : '')) . ($list_context['start_var_name'] != 'start' ? ';' . $list_context['start_var_name'] . '=%1$d' : ''), $list_context['start'], $list_context['total_num_items'], $list_context['items_per_page'], $list_context['start_var_name'] != 'start');
 	}
 
 	// Prepare the headers of the table.
@@ -108,7 +109,8 @@ function createList($listOptions)
 
 	// Call the function and include which items we want and in what order.
 	$list_items = call_user_func_array($listOptions['get_items']['function'], array_merge(array($list_context['start'], $list_context['items_per_page'], $sort), empty($listOptions['get_items']['params']) ? array() : $listOptions['get_items']['params']));
-
+	$list_items = empty($list_items) ? array() : $list_items;
+	
 	// Loop through the list items to be shown and construct the data values.
 	$list_context['rows'] = array();
 	foreach ($list_items as $item_id => $list_item)

+ 1 - 1
Sources/Subs.php

@@ -3649,7 +3649,7 @@ function clean_cache($type = '')
 
 				// Remove all unused scripts and data from shared memory and disk cache,
 				// e.g. all data that isn't used in the current requests.
-				eaccelerator_clear();
+				@eaccelerator_clear();
 			}
 		case 'mmcache':
 			if (function_exists('mmcache_gc'))

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

@@ -56,7 +56,7 @@ function template_show_list($list_id = null)
 	if (isset($cur_list['additional_rows']['top_of_list']))
 		template_additional_rows('top_of_list', $cur_list);
 
-	if (!empty($cur_list['items_per_page']) || isset($cur_list['additional_rows']['above_column_headers']))
+	if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['above_column_headers']))
 	{
 		echo '
 			<div class="flow_auto">';
@@ -139,7 +139,7 @@ function template_show_list($list_id = null)
 			</tbody>
 			</table>';
 
-	if (!empty($cur_list['items_per_page']) || isset($cur_list['additional_rows']['below_table_data']))
+	if ((!empty($cur_list['items_per_page']) && !empty($cur_list['page_index'])) || isset($cur_list['additional_rows']['below_table_data']))
 	{
 		echo '
 			<div class="flow_auto">';

+ 7 - 1
Themes/default/Profile.template.php

@@ -1687,9 +1687,15 @@ function template_profile_theme_settings()
 									<option value="0"', empty($context['member']['options']['display_quick_reply']) ? ' selected="selected"' : '', '>', $txt['display_quick_reply1'], '</option>
 									<option value="1"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 1 ? ' selected="selected"' : '', '>', $txt['display_quick_reply2'], '</option>
 									<option value="2"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 2 ? ' selected="selected"' : '', '>', $txt['display_quick_reply3'], '</option>
-									<option value="3"', !empty($context['member']['options']['display_quick_reply']) && $context['member']['options']['display_quick_reply'] == 3 ? ' selected="selected"' : '', '>', $txt['display_quick_reply4'], '</option>
 								</select>
 							</dd>
+							<dt>
+								<label for="use_editor_quick_reply">', $txt['use_editor_quick_reply'], '</label>
+							</dt>
+							<dd>
+								<input type="hidden" name="default_options[use_editor_quick_reply]" value="0" />
+								<label for="use_editor_quick_reply"><input type="checkbox" name="default_options[use_editor_quick_reply]" id="use_editor_quick_reply" value="1"', !empty($context['member']['options']['use_editor_quick_reply']) ? ' checked="checked"' : '', ' class="input_check" /></label>
+							</dd>
 							<dt>
 								<label for="display_quick_mod">', $txt['display_quick_mod'], '</label>
 							</dt>

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

@@ -428,10 +428,6 @@ function theme_linktree($force_show = false)
 		echo '
 			<li', ($link_num == count($context['linktree']) - 1) ? ' class="last"' : '', '>';
 
-		// Show something before the link?
-		if (isset($tree['extra_before']))
-			echo $tree['extra_before'];
-
 		// Don't show a separator for the first one.
 		// Better here. Always points to the next level when the linktree breaks to a second line.
 		// Picked a better looking HTML entity, and added support for RTL plus a span for styling.

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

@@ -46,7 +46,7 @@ $txt['default_smileyset_name'] = 'Alienine\'s Set';
 $txt['default_aaron_smileyset_name'] = 'Aaron\'s Set';
 $txt['default_akyhne_smileyset_name'] = 'Akyhne\'s Set';
 $txt['default_fugue_smileyset_name'] = 'Fugue\'s Set';
-$txt['default_theme_name'] = 'SMF Default Theme - Curve';
+$txt['default_theme_name'] = 'SMF Default Theme - Curve II';
 $txt['default_core_theme_name'] = 'Core Theme';
 $txt['default_classic_theme_name'] = 'Classic YaBB SE Theme';
 $txt['default_babylon_theme_name'] = 'Babylon Theme';

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

@@ -205,7 +205,7 @@ $txt['setting_warning_show_all'] = 'All Users';
 
 $txt['signature_settings'] = 'Signature Settings';
 $txt['signature_settings_desc'] = 'Use the settings on this page to decide how member signatures should be treated in SMF.';
-$txt['signature_settings_warning'] = 'Note that settings are not applied to existing signatures by default. Click <a href="' . $scripturl . '?action=admin;area=featuresettings;sa=sig;apply;%2$s=%1$s">here</a> to apply rules to all existing signatures.';
+$txt['signature_settings_warning'] = 'Note that settings are not applied to existing signatures by default. Click <a href="' . $scripturl . '?action=admin;area=featuresettings;sa=sig;apply;%2$s=%1$s">here</a> to apply updated rules to existing signatures.';
 $txt['signature_enable'] = 'Enable signatures';
 $txt['signature_max_length'] = 'Maximum allowed characters';
 $txt['signature_max_lines'] = 'Maximum amount of lines';

+ 9 - 1
Themes/default/scripts/smf_jquery_plugins.js

@@ -107,8 +107,9 @@
 			$('#' + oSettings.tooltipID).fadeOut('slow').trigger("unload").remove();
 		}
 		
+		// used to keep html encoded
 		function htmlspecialchars(string)
-		{ 
+		{
 			return $('<span>').text(string).html();
 		}
 		
@@ -176,6 +177,13 @@
 					return false;
 				});
 			}
+			
+			// clear the tip on a click
+			$(this).bind("click", function(event){
+				hideTooltip(this);
+				return true;
+			});
+
 		});
 	};