2
0
Эх сурвалжийг харах

This is the time for last edit (and as bonus a bit of parenthesis clenup :P)

Signed-off-by: emanuele <[email protected]>
emanuele 12 жил өмнө
parent
commit
9e77749f19

+ 2 - 0
Sources/Display.php

@@ -1283,6 +1283,8 @@ function prepareDisplayContext($reset = false)
 
 	// Is this user the message author?
 	$output['is_message_author'] = $message['id_member'] == $user_info['id'];
+	if (!empty($output['modified']['name']))
+		$output['modified']['last_edit_text'] = sprintf($txt['last_edit_by'], $output['modified']['time'], $output['modified']['name']);
 
 	call_integration_hook('integrate_prepare_display_context', array(&$output, &$message));
 

+ 4 - 1
Sources/Post.php

@@ -608,7 +608,7 @@ function Post($post_errors = array())
 		// Get the existing message.
 		$request = $smcFunc['db_query']('', '
 			SELECT
-				m.id_member, m.modified_time, m.smileys_enabled, m.body,
+				m.id_member, m.modified_time, m.modified_name, m.smileys_enabled, m.body,
 				m.poster_name, m.poster_email, m.subject, m.icon, m.approved,
 				IFNULL(a.size, -1) AS filesize, a.filename, a.id_attach,
 				a.approved AS attachment_approved, t.id_member_started AS id_member_poster,
@@ -659,7 +659,10 @@ function Post($post_errors = array())
 
 		// When was it last modified?
 		if (!empty($row['modified_time']))
+		{
 			$context['last_modified'] = timeformat($row['modified_time']);
+			$context['last_modified_text'] = sprintf($txt['last_edit_by'], $context['last_modified'], $row['modified_name']);
+		}
 
 		// Get the stuff ready for the form.
 		$form_subject = $row['subject'];

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

@@ -382,7 +382,7 @@ function template_info_center()
 					</h4>
 			</div>
 			<p class="inline">
-				', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
+				', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', '<strong>', $txt['online'], ': </strong>', comma_format($context['num_guests']), ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ', comma_format($context['num_users_online']), ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];
 
 	// Handle hidden users and buddies.
 	$bracketList = array();

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

@@ -395,15 +395,15 @@ function template_main()
 		// 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']))
+		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>';
 		}
 
-		if (($context['can_send_pm']) && (!$message['is_message_author']) && (!$message['member']['is_guest']))
+		if ($context['can_send_pm'] && !$message['is_message_author'] && !$message['member']['is_guest'])
 		{
-			if(!empty($modSettings['onlineEnable']))
+			if (!empty($modSettings['onlineEnable']))
 				echo '
 								<li class="poster_online"><a href="', $scripturl,'?action=pm;sa=send;u=', $message['member']['id'], '" title="', $message['member']['online']['member_online_text'], '">', $txt['send_message'], ' <img src="'. $message['member']['online']['image_href']. '" alt="" /></a></li>';
 			else
@@ -411,13 +411,13 @@ function template_main()
 								<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'])))
+		if (!$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>';
 
 		// Are we showing the warning status?
 		// Don't show these things for guests.
-		if ((!$message['member']['is_guest']) &&($message['member']['can_see_warning']))
+		if (!$message['member']['is_guest'] && $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>';
 
@@ -437,7 +437,7 @@ function template_main()
 		if ($settings['show_modify'] && !empty($message['modified']['name']))
 			echo '
 									<span class="smalltext modified" id="modified_', $message['id'], '">
-										', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '
+										', $message['modified']['last_edit_text'], '
 									</span>';
 
 			echo '
@@ -774,7 +774,7 @@ function template_main()
 			echo '
 								<input type="button" value="', $txt['spell_check'], '" onclick="spellCheck(\'postmodify\', \'message\');" tabindex="', $context['tabindex']++, '" class="button_submit" />';
 
-		if (($context['drafts_save']) && !empty($options['drafts_show_saved_enabled']))
+		if ($context['drafts_save'] && !empty($options['drafts_show_saved_enabled']))
 			echo '
 								<input type="submit" name="save_draft" value="', $txt['draft_save'], '" onclick="return confirm(' . JavaScriptEscape($txt['draft_save_note']) . ') && submitThisOnce(this);" accesskey="d" tabindex="', $context['tabindex']++, '" class="button_submit" />
 								<input type="hidden" id="id_draft" name="id_draft" value="', empty($context['id_draft']) ? 0 : $context['id_draft'], '" />';

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

@@ -359,8 +359,7 @@ function template_main()
 	if (isset($context['last_modified']))
 		echo '
 					<div class="padding smalltext">
-						<strong>', $txt['last_edit'], ':</strong>
-						', $context['last_modified'], '
+						', $context['last_modified_text'], '
 					</div>';
 
 	// If the admin has enabled the hiding of the additional options - show a link and image for it.

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

@@ -4041,6 +4041,9 @@ tr.catbg th:last-child, #show_attachments th:last-child {
 	width: 100%;
 	-moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sizing: border-box;
 }
+#postmodify .lastedit{
+	font-weight: bold;
+}
 
 /* Subtle zebra striping to make tables easier to follow. Will make a solution for IE8. */
 /* CSS for locked, sticky, etc has not been applied yet. Don't panic. She'll be right, mate. :P */ 

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

@@ -180,7 +180,8 @@ $txt['memberlist_searchable'] = 'Searchable list of all registered members.';
 $txt['welcome_member'] = 'Please welcome'; //Deprecated
 $txt['welcome_newest_member'] = 'Please welcome %1$s, our newest member.';
 $txt['admin_center'] = 'Administration Center';
-$txt['last_edit'] = 'Last Edit';
+$txt['last_edit'] = 'Last Edit'; // Deprecated
+$txt['last_edit_by'] = '<span class="lastedit">Last Edit</span>: %1$s by %2$s';
 $txt['notify_deactivate'] = 'Would you like to deactivate notification on this topic?';
 
 $txt['recent_posts'] = 'Recent Posts';
@@ -310,7 +311,7 @@ $txt['ip'] = 'IP';
 
 $txt['www'] = 'WWW';
 
-$txt['by'] = 'by';
+$txt['by'] = 'by'; // Deprecated
 
 $txt['hours'] = 'hours';
 $txt['minutes'] = 'minutes';