use the right display name for users

This commit is contained in:
John Bintz 2009-10-26 19:39:46 -04:00
parent c12ed95806
commit 95c67538b9
4 changed files with 25 additions and 5 deletions

View File

@ -24,7 +24,7 @@ class WDTSDisplayFilters {
} }
function the_approved_credit($user, $content = '') { function the_approved_credit($user, $content = '') {
return '<div class="wdts-approved-credit">' . sprintf(__('Written by %1$s <strong>%2$s</strong>', 'what-did-they-say'), get_avatar($user->ID, 20), $user->user_nicename) . '</div>'; return '<div class="wdts-approved-credit">' . sprintf(__('Written by %1$s <strong>%2$s</strong>', 'what-did-they-say'), get_avatar($user->ID, 20), $user->display_name) . '</div>';
} }
function _process_transcript_content($transcript) { function _process_transcript_content($transcript) {

View File

@ -1076,7 +1076,7 @@ class WhatDidTheySayAdmin {
$available_filters = $this->_get_available_override_filters(); $available_filters = $this->_get_available_override_filters();
$suggested_amount = 20 + ($this->transcript_count * 0.1); $suggested_amount = 20 + ($this->transcript_count * 0.1);
$users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login"); $users = $wpdb->get_results("SELECT ID, user_login, display_name from $wpdb->users ORDER BY user_login");
include('partials/admin.inc'); include('partials/admin.inc');
} }
@ -1101,7 +1101,7 @@ class WhatDidTheySayAdmin {
$language_options = new WDTSLanguageOptions(); $language_options = new WDTSLanguageOptions();
$users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login"); $users = $wpdb->get_results("SELECT ID, user_login, display_name from $wpdb->users ORDER BY user_login");
$nonce = wp_create_nonce('what-did-they-say'); $nonce = wp_create_nonce('what-did-they-say');
include('partials/meta-box.inc'); include('partials/meta-box.inc');

View File

@ -54,7 +54,7 @@
<select name="wdts[transcripts][<?php echo $code ?>][user_id]"> <select name="wdts[transcripts][<?php echo $code ?>][user_id]">
<?php foreach ($users as $user) { ?> <?php foreach ($users as $user) { ?>
<option value="<?php echo $user->ID ?>" <option value="<?php echo $user->ID ?>"
<?php echo ($user->ID == $transcript['user_id']) ? 'selected="selected"' : '' ?>><?php echo $user->user_login ?></option> <?php echo ($user->ID == $transcript['user_id']) ? 'selected="selected"' : '' ?>><?php echo $user->display_name ?> (<?php echo $user->user_login ?>)</option>
<?php } ?> <?php } ?>
</select> </select>
<?php <?php

View File

@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> <head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="" /> <link rel="selenium.base" href="http://comicpress.local/" />
<title>TestMetaboxApprovedTranscriptEditing</title> <title>TestMetaboxApprovedTranscriptEditing</title>
</head> </head>
<body> <body>
@ -31,6 +31,11 @@
<td>//textarea[@name=&quot;wdts[transcripts][en][transcript]&quot;]</td> <td>//textarea[@name=&quot;wdts[transcripts][en][transcript]&quot;]</td>
<td>This is a test transcript.</td> <td>This is a test transcript.</td>
</tr> </tr>
<tr>
<td>select</td>
<td>//select[@name=&quot;wdts[transcripts][en][user_id]&quot;]</td>
<td>index=1</td>
</tr>
<tr> <tr>
<td>select</td> <td>select</td>
<td>//select[@name=&quot;wdts[language]&quot;]</td> <td>//select[@name=&quot;wdts[language]&quot;]</td>
@ -51,6 +56,11 @@
<td>//textarea[@name=&quot;wdts[transcripts][de][transcript]&quot;]</td> <td>//textarea[@name=&quot;wdts[transcripts][de][transcript]&quot;]</td>
<td>Dies ist ein Test transcript.</td> <td>Dies ist ein Test transcript.</td>
</tr> </tr>
<tr>
<td>select</td>
<td>//select[@name=&quot;wdts[transcripts][de][user_id]&quot;]</td>
<td>index=2</td>
</tr>
<tr> <tr>
<td>clickAndWait</td> <td>clickAndWait</td>
<td>publish</td> <td>publish</td>
@ -71,6 +81,16 @@
<td>//textarea[@name=&quot;wdts[transcripts][de][transcript]&quot;]</td> <td>//textarea[@name=&quot;wdts[transcripts][de][transcript]&quot;]</td>
<td>Dies ist ein Test transcript.</td> <td>Dies ist ein Test transcript.</td>
</tr> </tr>
<tr>
<td>assertSelectedIndex</td>
<td>//select[@name=&quot;wdts[transcripts][en][user_id]&quot;]</td>
<td>1</td>
</tr>
<tr>
<td>assertSelectedIndex</td>
<td>//select[@name=&quot;wdts[transcripts][de][user_id]&quot;]</td>
<td>2</td>
</tr>
</tbody></table> </tbody></table>
</body> </body>