Browse Source

Merge pull request #191 from emanuele45/master

a couple of fixes here and there
emanuele45 12 years ago
parent
commit
b2bf5a50fa

+ 1 - 1
Sources/Karma.php

@@ -159,7 +159,7 @@ function BookOfUnknown()
 	if (strpos($_GET['action'], 'mozilla') !== false && !isBrowser('gecko'))
 		redirectexit('http://www.getfirefox.com/');
 	elseif (strpos($_GET['action'], 'mozilla') !== false)
-		redirectexit('about:mozilla');
+		redirectexit('about:mozilla', true);
 
 	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"' : '', '>

+ 17 - 10
Sources/ManageSettings.php

@@ -2199,10 +2199,14 @@ function list_integration_hooks()
 {
 	global $sourcedir, $scripturl, $context, $txt, $modSettings, $settings;
 
-	$context['filter'] = '';
+	$context['filter_url'] = '';
+	$context['current_filter'] = '';
 	$currentHooks = get_integration_hooks();
 	if (isset($_GET['filter']) && in_array($_GET['filter'], array_keys($currentHooks)))
-		$context['filter'] = ';filter=' . $_GET['filter'];
+	{
+		$context['filter_url'] = ';filter=' . $_GET['filter'];
+		$context['current_filter'] = $_GET['filter'];
+	}
 
 	if (!empty($modSettings['handlinghooks_enabled']))
 	{
@@ -2231,7 +2235,7 @@ function list_integration_hooks()
 				remove_integration_function($_REQUEST['hook'], $function_remove, $file);
 				add_integration_function($_REQUEST['hook'], $function_add, $file);
 
-				redirectexit('action=admin;area=modsettings;sa=hooks' . $context['filter']);
+				redirectexit('action=admin;area=modsettings;sa=hooks' . $context['filter_url']);
 			}
 		}
 	}
@@ -2240,7 +2244,7 @@ function list_integration_hooks()
 		'id' => 'list_integration_hooks',
 		'title' => $txt['hooks_title_list'],
 		'items_per_page' => 20,
-		'base_href' => $scripturl . '?action=admin;area=modsettings;sa=hooks' . $context['filter'] . ';' . $context['session_var'] . '=' . $context['session_id'],
+		'base_href' => $scripturl . '?action=admin;area=modsettings;sa=hooks' . $context['filter_url'] . ';' . $context['session_var'] . '=' . $context['session_id'],
 		'default_sort_col' => 'hook_name',
 		'get_items' => array(
 			'function' => 'get_integration_hooks_data',
@@ -2305,7 +2309,7 @@ function list_integration_hooks()
 						$change_status = array(\'before\' => \'\', \'after\' => \'\');
 						if ($data[\'can_be_disabled\'] && $data[\'status\'] != \'deny\')
 						{
-							$change_status[\'before\'] = \'<a href="\' . $scripturl . \'?action=admin;area=modsettings;sa=hooks;do=\' . ($data[\'enabled\'] ? \'disable\' : \'enable\') . \';hook=\' . $data[\'hook_name\'] . \';function=\' . $data[\'real_function\'] . (!empty($data[\'included_file\']) ? \';includedfile=\' . urlencode($data[\'included_file\']) : \'\') . $context[\'filter\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . javaScriptEscape($txt[\'quickmod_confirm\']) . \');">\';
+							$change_status[\'before\'] = \'<a href="\' . $scripturl . \'?action=admin;area=modsettings;sa=hooks;do=\' . ($data[\'enabled\'] ? \'disable\' : \'enable\') . \';hook=\' . $data[\'hook_name\'] . \';function=\' . $data[\'real_function\'] . (!empty($data[\'included_file\']) ? \';includedfile=\' . urlencode($data[\'included_file\']) : \'\') . $context[\'filter_url\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . javaScriptEscape($txt[\'quickmod_confirm\']) . \');">\';
 							$change_status[\'after\'] = \'</a>\';
 						}
 						return $change_status[\'before\'] . \'<img src="\' . $settings[\'images_url\'] . \'/admin/post_moderation_\' . $data[\'status\'] . \'.png" alt="\' . $data[\'img_text\'] . \'" title="\' . $data[\'img_text\'] . \'" />\' . $change_status[\'after\'];
@@ -2347,7 +2351,7 @@ function list_integration_hooks()
 
 					if (!$data[\'hook_exists\'])
 						return \'
-						<a href="\' . $scripturl . \'?action=admin;area=modsettings;sa=hooks;do=remove;hook=\' . $data[\'hook_name\'] . \';function=\' . urlencode($data[\'function_name\']) . $context[\'filter\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . javaScriptEscape($txt[\'quickmod_confirm\']) . \');">
+						<a href="\' . $scripturl . \'?action=admin;area=modsettings;sa=hooks;do=remove;hook=\' . $data[\'hook_name\'] . \';function=\' . urlencode($data[\'function_name\']) . $context[\'filter_url\'] . \';\' . $context[\'admin-hook_token_var\'] . \'=\' . $context[\'admin-hook_token\'] . \';\' . $context[\'session_var\'] . \'=\' . $context[\'session_id\'] . \'" onclick="return confirm(\' . javaScriptEscape($txt[\'quickmod_confirm\']) . \');">
 							<img src="\' . $settings[\'images_url\'] . \'/icons/quick_remove.png" alt="\' . $txt[\'hooks_button_remove\'] . \'" title="\' . $txt[\'hooks_button_remove\'] . \'" />
 						</a>\';
 				'),
@@ -2355,7 +2359,7 @@ function list_integration_hooks()
 			),
 		);
 		$list_options['form'] = array(
-			'href' => $scripturl . '?action=admin;area=modsettings;sa=hooks' . $context['filter'] . ';' . $context['session_var'] . '=' . $context['session_id'],
+			'href' => $scripturl . '?action=admin;area=modsettings;sa=hooks' . $context['filter_url'] . ';' . $context['session_var'] . '=' . $context['session_id'],
 			'name' => 'list_integration_hooks',
 		);
 	}
@@ -2458,12 +2462,11 @@ function get_integration_hooks_data($start, $per_page, $sort)
 
 	$sort_options = $sort_types[$sort];
 	$sort = array();
-	$context['hooks_filters'] = '';
 	$hooks_filters = array();
 
 	foreach ($hooks as $hook => $functions)
 	{
-		$hooks_filters[] = '<option onclick="window.location = \'' . $scripturl . '?action=admin;area=modsettings;sa=hooks;filter=' . $hook . '\';">' . $hook . '</option>';
+		$hooks_filters[] = '<option ' . ($context['current_filter'] == $hook ? 'selected="selected" ' : '') . 'onclick="window.location = \'' . $scripturl . '?action=admin;area=modsettings;sa=hooks;filter=' . $hook . '\';">' . $hook . '</option>';
 		foreach ($functions as $function)
 		{
 			$enabled = strstr($function, ']') === false;
@@ -2487,7 +2490,11 @@ function get_integration_hooks_data($start, $per_page, $sort)
 	}
 
 	if (!empty($hooks_filters))
-		$context['hooks_filters'] = '<select style="margin-left:15px;">' . '<option>---</option><option onclick="window.location = \'' . $scripturl . '?action=admin;area=modsettings;sa=hooks\';">' . $txt['hooks_reset_filter'] . '</option>' . implode('', $hooks_filters) . '</select>';
+		$context['insert_after_template'] .= '
+		<script type="text/javascript"><!-- // --><![CDATA[
+			var hook_name_header = document.getElementById(\'header_list_integration_hooks_hook_name\');
+			hook_name_header.innerHTML += ' . JavaScriptEscape('<select style="margin-left:15px;"><option>---</option><option onclick="window.location = \'' . $scripturl . '?action=admin;area=modsettings;sa=hooks\';">' . $txt['hooks_reset_filter'] . '</option>' . implode('', $hooks_filters) . '</select>'). ';
+		// ]]></script>';
 
 	$temp_data = array();
 	$id = 0;

+ 6 - 6
Sources/MessageIndex.php

@@ -359,7 +359,7 @@ function MessageIndex()
 			SELECT
 				t.id_topic, t.num_replies, t.locked, t.num_views, t.is_sticky, t.id_poll, t.id_previous_board,
 				' . ($user_info['is_guest'] ? '0' : 'IFNULL(lt.id_msg, IFNULL(lmr.id_msg, -1)) + 1') . ' AS new_from,
-				t.id_last_msg, t.approved, t.unapproved_posts, t.id_redirect_topic, ml.poster_time AS last_poster_time,
+				t.id_last_msg, t.approved, t.unapproved_posts, ml.poster_time AS last_poster_time,
 				ml.id_msg_modified, ml.subject AS last_subject, ml.icon AS last_icon,
 				ml.poster_name AS last_member_name, ml.id_member AS last_id_member, ' . (!empty($settings['avatars_on_indexes']) ? 'meml.avatar,' : '') . '
 				IFNULL(meml.real_name, ml.poster_name) AS last_display_name, t.id_first_msg,
@@ -510,8 +510,8 @@ function MessageIndex()
 					'preview' => $row['first_body'],
 					'icon' => $row['first_icon'],
 					'icon_url' => $settings[$context['icon_sources'][$row['first_icon']]] . '/post/' . $row['first_icon'] . '.png',
-					'href' => $scripturl . '?topic=' . (empty($row['id_redirect_topic']) ? $row['id_topic'] : $row['id_redirect_topic']) . '.0',
-					'link' => '<a href="' . $scripturl . '?topic=' . (empty($row['id_redirect_topic']) ? $row['id_topic'] : $row['id_redirect_topic']). '.0">' . $row['first_subject'] . '</a>'
+					'href' => $scripturl . '?topic=' . $row['id_topic'] . '.0',
+					'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . '.0">' . $row['first_subject'] . '</a>'
 				),
 				'last_post' => array(
 					'id' => $row['id_last_msg'],
@@ -528,8 +528,8 @@ function MessageIndex()
 					'preview' => $row['last_body'],
 					'icon' => $row['last_icon'],
 					'icon_url' => $settings[$context['icon_sources'][$row['last_icon']]] . '/post/' . $row['last_icon'] . '.png',
-					'href' => $scripturl . '?topic=' . (empty($row['id_redirect_topic']) ? $row['id_topic'] : $row['id_redirect_topic']) . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')),
-					'link' => '<a href="' . $scripturl . '?topic=' . (empty($row['id_redirect_topic']) ? $row['id_topic'] : $row['id_redirect_topic']) . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')) . '" ' . ($row['num_replies'] == 0 ? '' : 'rel="nofollow"') . '>' . $row['last_subject'] . '</a>'
+					'href' => $scripturl . '?topic=' . $row['id_topic'] . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')),
+					'link' => '<a href="' . $scripturl . '?topic=' . $row['id_topic'] . ($user_info['is_guest'] ? ('.' . (!empty($options['view_newest_first']) ? 0 : ((int) (($row['num_replies']) / $context['pageindex_multiplier'])) * $context['pageindex_multiplier']) . '#msg' . $row['id_last_msg']) : (($row['num_replies'] == 0 ? '.0' : '.msg' . $row['id_last_msg']) . '#new')) . '" ' . ($row['num_replies'] == 0 ? '' : 'rel="nofollow"') . '>' . $row['last_subject'] . '</a>'
 				),
 				'is_sticky' => !empty($modSettings['enableStickyTopics']) && !empty($row['is_sticky']),
 				'is_locked' => !empty($row['locked']),
@@ -543,7 +543,7 @@ function MessageIndex()
 				'new' => $row['new_from'] <= $row['id_msg_modified'],
 				'new_from' => $row['new_from'],
 				'newtime' => $row['new_from'],
-				'new_href' => $scripturl . '?topic=' . (empty($row['id_redirect_topic']) ? $row['id_topic'] : $row['id_redirect_topic']) . '.msg' . $row['new_from'] . '#new',
+				'new_href' => $scripturl . '?topic=' . $row['id_topic'] . '.msg' . $row['new_from'] . '#new',
 				'pages' => $pages,
 				'replies' => comma_format($row['num_replies']),
 				'views' => comma_format($row['num_views']),

+ 3 - 0
Sources/PersonalMessage.php

@@ -990,6 +990,9 @@ function prepareMessageContext($type = 'subject', $reset = false)
 		'is_replied_to' => &$context['message_replied'][$message['id_pm']],
 		'is_unread' => &$context['message_unread'][$message['id_pm']],
 		'is_selected' => !empty($temp_pm_selected) && in_array($message['id_pm'], $temp_pm_selected),
+		'is_message_author' => $message['id_member_from'] == $user_info['id'],
+		'can_report' => !empty($modSettings['enableReportPM']),
+		'can_see_ip' => allowedTo('moderate_forum') || ($message['id_member'] == $user_info['id'] && !empty($user_info['id'])),
 	);
 
 	$counter++;

+ 6 - 5
Themes/default/Display.template.php

@@ -338,10 +338,13 @@ function template_main()
 										<li class="email"><a href="', $scripturl, '?action=emailuser;sa=email;msg=', $message['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
 
 		// Stuff for the staff to wallop them with.
+		echo '
+										<li><hr /></li>';
+
 		// Maybe they want to report this post to the moderator(s)?
 		if ($context['can_report_moderator'])
 			echo '
-										<li class="report_link"><hr /><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>';
+										<li class="report_link"><a href="', $scripturl, '?action=reporttm;topic=', $context['current_topic'], '.', $message['counter'], ';msg=', $message['id'], '">', $txt['report_to_mod'], '</a></li>';
 
 		// Can we issue a warning because of this post?  Remember, we can't give guests warnings.
 		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
@@ -400,8 +403,7 @@ function template_main()
 			echo '
 								<li class="poster_online"><a href="', $scripturl,'?action=pm">', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';
 		}
-
-		if (($context['can_send_pm']) && (!$message['is_message_author']) && (!$message['member']['is_guest']))
+		elseif (($context['can_send_pm']) && (!$message['is_message_author']) && (!$message['member']['is_guest']))
 		{
 			if(!empty($modSettings['onlineEnable']))
 				echo '
@@ -410,8 +412,7 @@ function template_main()
 				echo '
 								<li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '">', $txt['send_message'], '</a></li>';
 		}
-
-		if ((!$context['can_send_pm']) && (!empty($modSettings['onlineEnable'])))
+		elseif ((!$context['can_send_pm']) && (!empty($modSettings['onlineEnable'])))
 			echo '
 								<li class="poster_online">', ($message['member']['online']['is_online']) ? $txt['online'] : $txt['offline'], '<img src="'. $message['member']['online']['image_href']. '" alt="" /></li>';
 

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

@@ -33,8 +33,7 @@ function template_control_richedit($editor_id, $smileyContainer = null, $bbcCont
 
 				$("#', $editor_id, '").sceditorBBCodePlugin({
 					style: "', $settings['default_theme_url'], '/css/jquery.sceditor.default.css",
-					emoticonsCompat: true,
-					supportedWysiwyg: (is_ie || is_ff || is_opera || is_safari || is_chrome),',
+					emoticonsCompat: true,',
 					!empty($editor_context['locale']) ? '
 					locale: \'' . $editor_context['locale'] . '\',' : '', '
 					colors: "black,red,yellow,pink,green,orange,purple,blue,beige,brown,teal,navy,maroon,limegreen,white"';

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

@@ -97,7 +97,7 @@ function template_show_list($list_id = null)
 				$col_header['class'] = 'last_th';
 
 			echo '
-					<th scope="col"', empty($col_header['class']) ? '' : ' class="' . $col_header['class'] . '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '>', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '&nbsp;' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <img class="sort" src="' . $settings['images_url'] . '/sort_' . $col_header['sort_image'] . '.png" alt="" /></a>'), '</th>';
+					<th scope="col" id="header_', $list_id, '_', $col_header['id'], '"', empty($col_header['class']) ? '' : ' class="' . $col_header['class'] . '"', empty($col_header['style']) ? '' : ' style="' . $col_header['style'] . '"', empty($col_header['colspan']) ? '' : ' colspan="' . $col_header['colspan'] . '"', '>', empty($col_header['href']) ? '' : '<a href="' . $col_header['href'] . '" rel="nofollow">', empty($col_header['label']) ? '&nbsp;' : $col_header['label'], empty($col_header['href']) ? '' : (empty($col_header['sort_image']) ? '</a>' : ' <img class="sort" src="' . $settings['images_url'] . '/sort_' . $col_header['sort_image'] . '.png" alt="" /></a>'), '</th>';
 		}
 
 		echo '

+ 110 - 65
Themes/default/PersonalMessage.template.php

@@ -173,30 +173,32 @@ function template_folder()
 			$window_class = $message['alternate'] == 0 ? 'windowbg' : 'windowbg2';
 
 			echo '
-	<div class="', $window_class, ' clear">
+	<div class="', $window_class, '">
 		<div class="poster">
-			<a id="msg', $message['id'], '"></a>
-			<h4>';
+			<ul class="dropmenu">
+				<li>
+					<h4>
+						<a id="msg', $message['id'], '"></a>';
+		// Show a link to the member's profile.
+		echo '
+						<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
+							<span style="padding: 6px; display: block;">', $message['member']['name'], '</span>';
 
-			// Show online and offline buttons?
-			if (!empty($modSettings['onlineEnable']) && !$message['member']['is_guest'])
-				echo '
-				<img src="', $message['member']['online']['image_href'], '" alt="', $message['member']['online']['member_online_text'], '" />';
+		// Show avatars, images, etc.?
+		if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
+			echo '
+
+							', $message['member']['avatar']['image'], '';
 
 			echo '
-				', $message['member']['link'], '
-			</h4>
-			<ul class="reset smalltext" id="msg_', $message['id'], '_extra_info">';
+						</a>
+					</h4>
+					<ul class="smalltext" id="msg_', $message['id'], '_extra_info">';
 
 			// Show the member's custom title, if they have one.
 			if (isset($message['member']['title']) && $message['member']['title'] != '')
 				echo '
-				<li class="title">', $message['member']['title'], '</li>';
-
-			// Show the member's primary group (like 'Administrator') if they have one.
-			if (isset($message['member']['group']) && $message['member']['group'] != '')
-				echo '
-				<li class="membergroup">', $message['member']['group'], '</li>';
+						<li class="title">', $message['member']['title'], '</li>';
 
 			// Don't show these things for guests.
 			if (!$message['member']['is_guest'])
@@ -204,48 +206,37 @@ function template_folder()
 				// Show the post group if and only if they have no other group or the option is on, and they are in a post group.
 				if ((empty($settings['hide_post_group']) || $message['member']['group'] == '') && $message['member']['post_group'] != '')
 					echo '
-				<li class="postgroup">', $message['member']['post_group'], '</li>';
-				echo '
-				<li class="icons">', $message['member']['group_icons'], '</li>';
-
-				// Show avatars, images, etc.?
-				if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))
-					echo '
-				<li class="avatar">
-					<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
-						', $message['member']['avatar']['image'], '
-					</a>
-				</li>';
+						<li class="postgroup">', $message['member']['post_group'], '</li>';
 
 				// Show how many posts they have made.
 				if (!isset($context['disabled_fields']['posts']))
 					echo '
-				<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
+						<li class="postcount">', $txt['member_postcount'], ': ', $message['member']['posts'], '</li>';
 
 				// Is karma display enabled?  Total or +/-?
 				if ($modSettings['karmaMode'] == '1')
 					echo '
-				<li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
+						<li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
 				elseif ($modSettings['karmaMode'] == '2')
 					echo '
-				<li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
+						<li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';
 
 				// Is this user allowed to modify this member's karma?
 				if ($message['member']['karma']['allow'])
 					echo '
-				<li class="karma_allow">
-					<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a> <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
-				</li>';
+						<li class="karma_allow">
+							<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a> <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';f=', $context['folder'], ';start=', $context['start'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pm=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
+						</li>';
 
 				// Show the member's gender icon?
 				if (!empty($settings['show_gender']) && $message['member']['gender']['image'] != '' && !isset($context['disabled_fields']['gender']))
 					echo '
-				<li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
+						<li class="gender">', $txt['gender'], ': ', $message['member']['gender']['image'], '</li>';
 
 				// Show their personal text?
 				if (!empty($settings['show_blurb']) && $message['member']['blurb'] != '')
 					echo '
-				<li class="blurb">', $message['member']['blurb'], '</li>';
+						<li class="blurb">', $message['member']['blurb'], '</li>';
 
 				// Any custom fields to show as icons?
 				if (!empty($message['member']['custom_fields']))
@@ -259,60 +250,88 @@ function template_folder()
 						{
 							$shown = true;
 							echo '
-				<li class="im_icons">
-					<ul>';
+						<li class="im_icons">
+							<ul>';
 						}
 						echo '
-						<li>', $custom['value'], '</li>';
+								<li>', $custom['value'], '</li>';
 					}
 					if ($shown)
 					echo '
-					</ul>
-				</li>';
+							</ul>
+						</li>';
 				}
 
 				// This shows the popular messaging icons.
 				if ($message['member']['has_messenger'] && $message['member']['can_view_profile'])
 					echo '
-				<li class="im_icons">
-					<ul>', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '
-						<li>' . $message['member']['icq']['link'] . '</li>' : '', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '
-						<li>' . $message['member']['msn']['link'] . '</li>' : '', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '
-						<li>' . $message['member']['aim']['link'] . '</li>' : '', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '
-						<li>' . $message['member']['yim']['link'] . '</li>' : '', '
-					</ul>
-				</li>';
+						<li class="im_icons">
+							<ul>', !isset($context['disabled_fields']['icq']) && !empty($message['member']['icq']['link']) ? '
+								<li>' . $message['member']['icq']['link'] . '</li>' : '', !isset($context['disabled_fields']['msn']) && !empty($message['member']['msn']['link']) ? '
+								<li>' . $message['member']['msn']['link'] . '</li>' : '', !isset($context['disabled_fields']['aim']) && !empty($message['member']['aim']['link']) ? '
+								<li>' . $message['member']['aim']['link'] . '</li>' : '', !isset($context['disabled_fields']['yim']) && !empty($message['member']['yim']['link']) ? '
+								<li>' . $message['member']['yim']['link'] . '</li>' : '', '
+							</ul>
+						</li>';
+
+				// Stuff for the staff to wallop them with.
+				echo '
+						<li><hr /></li>';
+
+				if ($message['can_report'])
+					echo '
+						<li class="report_link"><a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '">' . $txt['pm_report_to_admin'] . '</a></li>';
+
+		// Can we issue a warning because of this post?  Remember, we can't give guests warnings.
+		if ($context['can_issue_warning'] && !$message['is_message_author'] && !$message['member']['is_guest'])
+			echo '
+										<li class="issue_warning"><a href="', $scripturl, '?action=profile;area=issuewarning;u=', $message['member']['id'], ';msg=', $message['id'], '"><img src="', $settings['images_url'], '/warn.png" alt="', $txt['issue_warning_post'], '" title="', $txt['issue_warning_post'], '" /></a></li>';
+
+		// Show the IP to this user for this post - because you can moderate?
+		if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
+			echo '
+										<li class="poster_ip"><a href="', $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '">', $message['member']['ip'], '</a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a></li>';
+
+		// Or, should we show it because this is you?
+		elseif ($message['can_see_ip'])
+			echo '
+										<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $message['member']['ip'], '</a></li>';
+
+		// Okay, you are logged in, then we can show something about why IPs are logged...
+		else
+			echo '
+										<li class="poster_ip"><a href="', $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a></li>';
 
 				// Show the profile, website, email address, and personal message buttons.
 				if ($message['member']['show_profile_buttons'])
 				{
 					echo '
-				<li class="profile">
-					<ul>';
+						<li class="profile">
+							<ul>';
 
 					// Show the profile button
 					if ($message['member']['can_view_profile'])
 						echo '
-						<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" />' : $txt['view_profile']), '</a></li>';
+								<li><a href="', $message['member']['href'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/icons/profile_sm.png" alt="' . $txt['view_profile'] . '" title="' . $txt['view_profile'] . '" />' : $txt['view_profile']), '</a></li>';
 
 					// Don't show an icon if they haven't specified a website.
 					if ($message['member']['website']['url'] != '' && !isset($context['disabled_fields']['website']))
 						echo '
-						<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.png" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
+								<li><a href="', $message['member']['website']['url'], '" title="' . $message['member']['website']['title'] . '" target="_blank" class="new_win">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/www_sm.png" alt="' . $message['member']['website']['title'] . '" />' : $txt['www']), '</a></li>';
 
 					// Don't show the email address if they want it hidden.
 					if (in_array($message['member']['show_email'], array('yes', 'yes_permission_override', 'no_through_forum')) && $context['can_send_email'])
 						echo '
-						<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $message['member']['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
+								<li><a href="', $scripturl, '?action=emailuser;sa=email;uid=', $message['member']['id'], '" rel="nofollow">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/email_sm.png" alt="' . $txt['email'] . '" title="' . $txt['email'] . '" />' : $txt['email']), '</a></li>';
 
 					// Since we know this person isn't a guest, you *can* message them.
 					if ($context['can_send_pm'])
 						echo '
-						<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.png" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
+								<li><a href="', $scripturl, '?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline'], '">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/im_' . ($message['member']['online']['is_online'] ? 'on' : 'off') . '.png" alt="' . ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']) . '" />' : ($message['member']['online']['is_online'] ? $txt['pm_online'] : $txt['pm_offline']), '</a></li>';
 
 					echo '
-					</ul>
-				</li>';
+							</ul>
+						</li>';
 				}
 
 				// Any custom fields for standard placement?
@@ -321,14 +340,45 @@ function template_folder()
 					foreach ($message['member']['custom_fields'] as $custom)
 						if (empty($custom['placement']) || empty($custom['value']))
 							echo '
-				<li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
+						<li class="custom">', $custom['title'], ': ', $custom['value'], '</li>';
 				}
 
 				// Are we showing the warning status?
 				if ($message['member']['can_see_warning'])
 				echo '
-				<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.png" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
+						<li class="warning">', $context['can_issue_warning'] ? '<a href="' . $scripturl . '?action=profile;area=issuewarning;u=' . $message['member']['id'] . '">' : '', '<img src="', $settings['images_url'], '/warning_', $message['member']['warning_status'], '.png" alt="', $txt['user_warn_' . $message['member']['warning_status']], '" />', $context['can_issue_warning'] ? '</a>' : '', '<span class="warn_', $message['member']['warning_status'], '">', $txt['warn_' . $message['member']['warning_status']], '</span></li>';
 			}
+			echo '
+					</ul>
+				</li>
+				<li class="icons">', $message['member']['group_icons'], '</li>';
+			// Show the member's primary group (like 'Administrator') if they have one.
+			if (isset($message['member']['group']) && $message['member']['group'] != '')
+				echo '
+				<li class="membergroup">', $message['member']['group'], '</li>';
+
+		// Show online and offline buttons? PHP could do with a little bit of cleaning up here for brevity, but it works.
+		// The plan is to make these buttons act sensibly, and link to your own inbox in your own posts (with new PM notification).
+		// Still has a little bit of hard-coded text. This may be a place where translators should be able to write inclusive strings,
+		// instead of dealing with $txt['by'] etc in the markup. Must be brief to work, anyway. Cannot ramble on at all.
+		if ($context['can_send_pm'] && $message['is_message_author'])
+		{
+			echo '
+				<li class="poster_online"><a href="', $scripturl,'?action=pm">', $txt['pm_short'], ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a></li>';
+		}
+		elseif ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest'])
+		{
+			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
+				echo '
+				<li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '">', $txt['send_message'], '</a></li>';
+		}
+		elseif (!$context['can_send_pm'] && !empty($modSettings['onlineEnable']))
+			echo '
+				<li class="poster_online">', ($message['member']['online']['is_online']) ? $txt['online'] : $txt['offline'], '<img src="'. $message['member']['online']['image_href']. '" alt="" /></li>';
+
 
 			// Done with the information about the poster... on to the post itself.
 			echo '
@@ -400,12 +450,7 @@ function template_folder()
 				</ul>
 			</div>
 			<div class="post">
-				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
-				<div class="smalltext reportlinks">
-					', (!empty($modSettings['enableReportPM']) && $context['folder'] != 'sent' ? '<div class="righttext"><a href="' . $scripturl . '?action=pm;sa=report;l=' . $context['current_label_id'] . ';pmsg=' . $message['id'] . '">' . $txt['pm_report_to_admin'] . '</a></div>' : '');
-
-			echo '
-				</div>';
+				<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>';
 
 			// Are there any custom profile fields for above the signature?
 			if (!empty($message['member']['custom_fields']))

+ 5 - 4
Themes/default/Profile.template.php

@@ -340,10 +340,10 @@ function template_showPosts()
 			<h3 class="catbg">
 				', (!isset($context['attachments']) && empty($context['is_topics']) ? $txt['showMessages'] : (!empty($context['is_topics']) ? $txt['showTopics'] : $txt['showAttachments'])), ' - ', $context['member']['name'], '
 			</h3>
-		</div>
+		</div>', !empty($context['page_index']) ? '
 		<div class="pagesection">
-			<div class="pagelinks">', $context['page_index'], '</div>
-		</div>';
+			<div class="pagelinks">' . $context['page_index'] . '</div>
+		</div>' : '';
 
 	// Button shortcuts
 	$quote_button = create_button('quote.png', 'reply_quote', 'quote', 'class="centericon"');
@@ -429,7 +429,8 @@ function template_showPosts()
 		</table>';
 
 	// Show more page numbers.
-	echo '
+	if (!empty($context['page_index']))
+		echo '
 		<div class="pagesection" style="margin-bottom: 0;">
 			<div class="pagelinks">', $context['page_index'], '</div>
 		</div>';

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

@@ -1208,6 +1208,13 @@ div#admin_menu {
 	line-height: 1.8em;
 }
 
+li#collapse_button {
+	float: right;
+	position: absolute;
+	top: 0;
+	right: 0;
+}
+
 /* Styles for the standard button lists.
 ------------------------------------------------------- */
 
@@ -1955,7 +1962,7 @@ p#whoisviewing {
 }
 /* poster and postarea + moderation area underneath */
 /* Need to sort the overflow on the post backgrounds. */
-#forumposts .windowbg, #forumposts .windowbg2 {
+#forumposts .windowbg, #forumposts .windowbg2, #personal_messages div.windowbg, #personal_messages div.windowbg2 {
 	overflow: visible;
 	float: left;
 	width: 100%;
@@ -3843,7 +3850,7 @@ span.hidelink {
 /* Forum posts may require some special treatment for dealing with clearing floated content. */
 /* Suspect it will be necessary to use float: left; width: 100%; on the windowbg and windowbg2 divs. */
 
-#forumposts .windowbg, #forumposts .windowbg2, #statistics .flow_hidden {
+#forumposts .windowbg, #forumposts .windowbg2, #statistics .flow_hidden, #personal_messages .windowbg, #personal_messages .windowbg2 {
 	background: /*#e8eff5;*/#f0f4f7;
 	margin: 12px 0 0 0;
 	padding: 8px 8px 16px 8px;
@@ -3851,7 +3858,7 @@ span.hidelink {
 	border-radius: 5px;
 	box-shadow: 0 -2px 2px rgba(0,0,0,0.1);
 }
-#forumposts .windowbg2 {
+#forumposts .windowbg2, #personal_messages .windowbg2 {
 	background: #eaf1f4;
 }
 #statistics .flow_hidden {

+ 33 - 16
Themes/default/css/rtl.css

@@ -87,18 +87,6 @@ table.table_list a.unreadlink, table.table_list a.collapse {
 table.table_list a.collapse {
 	margin: 10px 1em 0 5px;
 }
-.table_grid th.first_th, tr.catbg th.first_th {
-	background: #a8bace url(../images/theme/main_block.png) no-repeat 100% -240px;
-}
-.table_grid th.last_th, tr.catbg th.last_th {
-	background: #a8bace url(../images/theme/main_block.png) no-repeat 0 -240px;
-}
-tr.titlebg th.first_th {
-	background: #e3e9ef url(../images/theme/main_block.png) no-repeat 100% -340px;
-}
-tr.titlebg th.last_th {
-	background: #e3e9ef url(../images/theme/main_block.png) no-repeat 0 -340px;
-}
 
 /* Styles for the standard dropdown menus.
 ------------------------------------------------------- */
@@ -107,6 +95,7 @@ tr.titlebg th.last_th {
 }
 .dropmenu {
 	float: right;
+	padding: 0;
 }
 .dropmenu li {
 	float: right;
@@ -123,7 +112,7 @@ tr.titlebg th.last_th {
 	margin-right: 1109.5em;
 }
 .dropmenu ul ul a:focus {
-	margin-right: 2228em;
+	margin-right: 0;
 }
 /* Level 3 submenu wrapper positioning. */
 .dropmenu li ul ul {
@@ -139,7 +128,19 @@ tr.titlebg th.last_th {
 }
 /* Reposition as visible on hover. */
 .dropmenu li li:hover ul, .dropmenu li li.sfhover ul {
-	right: auto;
+	right: 14.5em;
+}
+/* Reposition as visible on hover. */
+.dropmenu li li:hover ul, .dropmenu li li.sfhover ul {
+	right: 14.5em;
+}
+/* Indicator for additonal levels. Best in the anchor so it stays visible on hover. */
+.dropmenu li li.subsections a {
+	background: url(../images/admin/subsection_rtl.png) no-repeat 1% 40%;
+}
+/* For no-js background. */
+.dropmenu li li.subsections a:focus {
+	background:  #e3e9ef url(../images/admin/subsection_rtl.png) no-repeat 1% 40%, url(../images/theme/lower_section.png) 0 0 repeat-x;
 }
 
 /* The dropdown menu toggle image */
@@ -154,6 +155,12 @@ tr.titlebg th.last_th {
 	left: 0;
 }
 
+li#collapse_button {
+	float: left;
+	position: relative;
+	right: 0;
+}
+
 /* Styles for the standard button lists.
 ------------------------------------------------------- */
 .buttonlist ul {
@@ -205,6 +212,14 @@ div#upper_section div.user ul {
 	padding-right: 10px;
 }
 
+.button_submit, .button_reset, .button_link {
+	float: left;
+}
+
+#search_form {
+	text-align: left;
+}
+
 /* The navigation list (i.e. linktree) */
 .navigate_section ul li {
 	float: right;
@@ -246,7 +261,6 @@ form#ic_login ul li {
 }
 img#upshrink_ic, img#newsupshrink {
 	float: right;
-	margin: 10px 0 0 5px;
 }
 
 /* Styles for the message (topic) index.
@@ -555,7 +569,7 @@ h3.titlebg img {
 tr.titlebg td {
 	padding-right: 0.7em;
 }
-#admin_menu {
+div#admin_menu {
 	padding-right: 0;
 }
 #admin_content {
@@ -585,6 +599,9 @@ tr.titlebg td {
 .topic_table td.lastpost {
 	background: none;
 }
+#info_center .cat_bar, .table_grid tr.catbg th, #show_attachments th, #searchform .roundframe .title_bar {
+	text-align: right;
+}
 /* Styles for (fatal) errors.
 ------------------------------------------------- */
 .errorbox p.alert {

BIN
Themes/default/images/admin/subsection_rtl.png


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

@@ -96,17 +96,6 @@ function template_html_above()
 		echo '
 	<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css?alp21" />';
 
-	// RTL languages require an additional stylesheet.
-	if ($context['right_to_left'])
-	{
-		echo '
-		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl.css?alp21" />';
-
-	if (!empty($context['theme_variant']))
-		echo '
-		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl', $context['theme_variant'], '.css?alp21" />';
-	}
-
 	// Save some database hits, if a width for multiple wrappers is set in admin.
 	if(!empty($settings['forum_width']))
 		echo '
@@ -122,6 +111,17 @@ function template_html_above()
 	// load in any javascript files from mods and themes
 	template_javascript();
 
+	// RTL languages require an additional stylesheet.
+	if ($context['right_to_left'])
+	{
+		echo '
+		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl.css?alp21" />';
+
+	if (!empty($context['theme_variant']))
+		echo '
+		<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/css/rtl', $context['theme_variant'], '.css?alp21" />';
+	}
+
 	echo '
 	<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
 	<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
@@ -521,7 +521,7 @@ function template_menu()
 	// Menu bar will still accommodate ten buttons on a 1024, with theme set to 90%. That's more than enough.
 	// If anyone is terrified of losing 40px out of the menu bar, set your theme to 92% instead of 90%. :P
 	echo '
-				<li style="float: right; position: absolute; top: 0; right: 0;">
+				<li id="collapse_button">
 					<img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="padding: 4px 9px 3px 9px; display: none;" />
 				</li>';
 

+ 40 - 52
Themes/default/scripts/jquery.sceditor.bbcode.js

@@ -164,19 +164,21 @@
 				} },
 				email: { txtExec: function(caller, selected) {
 					var	display = selected && selected.indexOf('@') > -1 ? null : selected,
-						email	= prompt(this._("Enter the e-mail address:"), (display ? '' : selected)),
-						text	= prompt(this._("Enter the displayed text:"), display || email) || email;
-
-					if(email)
+						email	= prompt(this._("Enter the e-mail address:"), (display ? '' : selected));
+					if (email)
+					{
+						var text	= prompt(this._("Enter the displayed text:"), display || email) || email;
 						this.insertText("[email=" + email + "]" + text + "[/email]");
+					}
 				} },
 				link: { txtExec: function(caller, selected) {
 					var	display = selected && selected.indexOf('http://') > -1 ? null : selected,
-						url	= prompt(this._("Enter URL:"), (display ? 'http://' : selected)),
-						text	= prompt(this._("Enter the displayed text:"), display || url) || url;
-
-					if(url)
+						url	= prompt(this._("Enter URL:"), (display ? 'http://' : selected));
+					if (url)
+					{
+						var text	= prompt(this._("Enter the displayed text:"), display || url) || url;
 						this.insertText("[url=" + url + "]" + text + "[/url]");
+					}
 				} },
 				quote: { txtExec: ["[quote]", "[/quote]"] },
 				youtube: { txtExec: function(caller) {
@@ -1032,7 +1034,7 @@
 
 				var width = ' width=' + $(element).width();
 				var height = ' height=' + $(element).height();
-				var alt = $(element).attr('alt') != undefined ? ' alt=' + $(element).attr('author').php_unhtmlspecialchars() : '';
+				var alt = $(element).attr('alt') != undefined ? ' alt=' + $(element).attr('alt').php_unhtmlspecialchars() : '';
 
 				return '[img' + width + height + alt + ']' + element.attr('src') + '[/img]';
 			},
@@ -1067,6 +1069,9 @@
 				// make sure this link is not an e-mail, if it is return e-mail BBCode
 				if(element.attr('href').substr(0, 7) === 'mailto:')
 					return '[email=' + element.attr('href').substr(7) + ']' + content + '[/email]';
+				// make sure this link is not an ftp, if it is return ftp BBCode
+				else if(element.attr('href').substr(0, 3) === 'ftp')
+					return '[ftp=' + element.attr('href') + ']' + content + '[/ftp]';
 
 				if(element.attr('target') !== undefined)
 					return '[url=' + decodeURI(element.attr('href')) + ']' + content + '[/url]';
@@ -1112,7 +1117,8 @@
 		// START_COMMAND: Quote
 		quote: {
 			tags: {
-				blockquote: null
+				blockquote: null,
+				cite: null
 			},
 			isBlock: true,
 			format: function(element, content) {
@@ -1120,35 +1126,15 @@
 				var date = '';
 				var link = '';
 
-				if ($(element).children("cite:first").length === 1)
-				{
-					author = $(element).children("cite:first").find("author").text();
-					date = $(element).children("cite:first").find("date").attr('timestamp');
-					link = $(element).children("cite:first").find("quote_link").text();
-
-					$(element).attr({'author': author.php_htmlspecialchars(), 'date': date, 'link': link});
-					if (author != '')
-						author = ' author=' + author;
-					if (date != '')
-						date = ' date=' + date;
-					if (link != '')
-						link = ' link=' + link;
-
-					content = '';
-					$(element).children("cite:first").remove();
+				if (element[0].tagName.toLowerCase() == 'cite')
+					return '';
 
-					var preserve_newline = $(element).children().last().is("br") && $(element).children().last().last().is("br");
-					content = this.elementToBbcode($(element)) + (preserve_newline ? "\n" : '');
-				}
-				else
-				{
-					if ($(element).attr('author') != undefined)
-						author = ' author=' + $(element).attr('author').php_unhtmlspecialchars();
-					if ($(element).attr('date') != undefined)
-						date = ' date=' + $(element).attr('date');
-					if ($(element).attr('link') != undefined)
-						link = ' link=' + $(element).attr('link');
-				}
+				if ($(element).attr('author'))
+					author = ' author=' + $(element).attr('author').php_unhtmlspecialchars();
+				if ($(element).attr('date'))
+					date = ' date=' + $(element).attr('date');
+				if ($(element).attr('link'))
+					link = ' link=' + $(element).attr('link');
 
 				return '[quote' + author + date + link + ']' + content + '[/quote]';
 			},
@@ -1156,11 +1142,14 @@
 				return ['author', 'date', 'link'];
 			},
 			html: function(element, attrs, content) {
-				var author = '';
-				var sDate = '';
-				var link = '';
-				if(typeof attrs.author !== "undefined")
-					author = bbc_quote_from + ': <author>' + attrs.author + '</author>';
+				var attr_author = '', author = '';
+				var attr_date = '', sDate = '';
+				var attr_link = '', link = '';
+				if(typeof attrs.author !== "undefined" && attrs.author)
+				{
+					attr_author = attrs.author;
+					author = bbc_quote_from + ': ' + attr_author;
+				}
 
 				// Links could be in the form: link=topic=71.msg201#msg201 that would fool javascript, so we need a workaround
 				// Probably no more necessary
@@ -1168,26 +1157,25 @@
 				{
 					if (key.substr(0, 4) == 'link' && attrs.hasOwnProperty(key))
 					{
-						var possible_url = key.length > 4 ? key.substr(5) + '=' + attrs[key] : attrs[key];
+						var attr_link = key.length > 4 ? key.substr(5) + '=' + attrs[key] : attrs[key];
 
-						link = possible_url.substr(0, 7) == 'http://' ? possible_url : smf_scripturl + '?' + possible_url;
-						author = author == '' ? '<a href="' + link + '">' + bbc_quote_from + ': <author src=">' + link + '</author></a>' : '<a href="' + link + '">' + author + '</a>';
-						link = '<quote_link style="display:none">' + possible_url + '</quote_link>';
+						link = attr_link.substr(0, 7) == 'http://' ? attr_link : smf_scripturl + '?' + attr_link;
+						author = author == '' ? '<a href="' + link + '">' + bbc_quote_from + ': ' + link + '</a>' : '<a href="' + link + '">' + author + '</a>';
 					}
 				}
 
-				if(typeof attrs.date !== "undefined")
+				if(typeof attrs.date !== "undefined" && attrs.date)
 				{
-					var date = new Date(attrs.date * 1000);
-					sDate = date;
+					attr_date = attrs.date;
+					sDate = '<date timestamp="' + attr_date + '">' + new Date(attrs.date * 1000) + '</date>';
 				}
 
 				if (author == '' && sDate == '')
 					author = bbc_quote;
 				else
-					author += ' ';
+					author += ' ' + bbc_search_on;
 
-				content = '<blockquote><cite>' + author + bbc_search_on + ' ' + '<date timestamp="' + attrs.date + '">' + sDate + '</date>' + link + '</cite>' + content + '</blockquote>';
+				content = '<blockquote author="' + attr_author + '" date="' + attr_date + '" link="' + attr_link + '"><cite>' + author + ' ' + sDate + '</cite>' + content + '</blockquote>';
 
 				return content;
 			}

+ 3 - 8
Themes/default/scripts/jquery.sceditor.js

@@ -1315,17 +1315,11 @@
 		 * @memberOf jQuery.sceditor.prototype
 		 */
 		base.toggleTextMode = function () {
-			/*
-			// Possible replacement
 			// don't allow switching to WYSIWYG if doesn't support it
 			if(!$.sceditor.isWysiwygSupported() && base.inSourceMode())
 				return;
 
 			if(base.inSourceMode())
-			*/
-
-
-			if(base.inSourceMode() && base.options.supportedWysiwyg)
 				base.setWysiwygEditorValue(base.getTextareaValue());
 			else
 				base.setTextareaValue(base.getWysiwygEditorValue());
@@ -3418,10 +3412,11 @@
 
 		},
 		getText: function() {
+			var current_value = '';
 			if(this.inSourceMode())
-				var current_value = this.getTextareaValue(false);
+				current_value = this.getTextareaValue(false);
 			else
-				var current_value = this.getWysiwygEditorValue();
+				current_value = this.getWysiwygEditorValue();
 
 			return current_value;
 		},