git-svn-id: https://develop.svn.wordpress.org/trunk@2062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2005-01-07 01:11:51 +00:00
parent f0318fb457
commit 6ca2c31abd
3 changed files with 25 additions and 26 deletions

View File

@ -44,7 +44,9 @@ if (empty($post_status)) $post_status = 'draft';
?> ?>
<input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" /> <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
<input type="hidden" name="action" value='<?php echo $form_action ?>' /> <input type="hidden" name="action" value="<?php echo $form_action ?>" />
<input type="hidden" name="post_author" value="<?php echo $post_author ?>" />
<?php echo $form_extra ?> <?php echo $form_extra ?>
<?php if (isset($_GET['message']) && 2 > $_GET['message']) : ?> <?php if (isset($_GET['message']) && 2 > $_GET['message']) : ?>
<script type="text/javascript"> <script type="text/javascript">
@ -152,7 +154,7 @@ if ('publish' != $post_status || 0 == $post_ID) {
<tr> <tr>
<th scope="row"><?php _e('Post author'); ?>:</th> <th scope="row"><?php _e('Post author'); ?>:</th>
<td> <td>
<select name="post_author" id="post_author"> <select name="post_author_override" id="post_author_override">
<?php <?php
foreach ($users as $o) : foreach ($users as $o) :
if ( $post_author == $o->ID ) $selected = 'selected="selected"'; if ( $post_author == $o->ID ) $selected = 'selected="selected"';

View File

@ -239,7 +239,9 @@ case 'editpost':
$prev_status = $_POST['prev_status']; $prev_status = $_POST['prev_status'];
$post_status = $_POST['post_status']; $post_status = $_POST['post_status'];
$menu_order = (int) $_POST['menu_order']; $menu_order = (int) $_POST['menu_order'];
if (! empty($_POST['post_author'])) { if (! empty($_POST['post_author_override'])) {
$post_author = (int) $_POST['post_author_override'];
} else if (! empty($_POST['post_author'])) {
$post_author = (int) $_POST['post_author']; $post_author = (int) $_POST['post_author'];
} else { } else {
$post_author = (int) $_POST['user_ID']; $post_author = (int) $_POST['user_ID'];

View File

@ -242,35 +242,30 @@ function get_cat_ID($cat_name='General') {
} }
// Get author's preferred display name // Get author's preferred display name
function get_author_name($auth_id) { function get_author_name( $auth_id ) {
$authordata = get_userdata($auth_id); $authordata = get_userdata( $auth_id );
switch($authordata["user_idmode"]) { switch( $authordata['user_idmode'] ) {
case "nickname": case 'nickname':
$authorname = $authordata["user_nickname"]; $authorname = $authordata['user_nickname'];
case "login":
$authorname = $authordata["user_login"];
break; break;
case 'login':
case "firstname": $authorname = $authordata['user_login'];
$authorname = $authordata["user_firstname"];
break; break;
case 'firstname':
case "lastname": $authorname = $authordata['user_firstname'];
$authorname = $authordata["user_lastname"];
break; break;
case 'lastname':
case "namefl": $authorname = $authordata['user_lastname'];
$authorname = $authordata["user_firstname"]." ".$authordata["user_lastname"];
break; break;
case 'namefl':
case "namelf": $authorname = $authordata['user_firstname'].' '.$authordata['user_lastname'];
$authorname = $authordata["user_lastname"]." ".$authordata["user_firstname"]; break;
case 'namelf':
$authorname = $authordata['user_lastname'].' '.$authordata['user_firstname'];
break; break;
default: default:
$authorname = $authordata["user_nickname"]; $authorname = $authordata['user_nickname'];
break; break;
} }
@ -279,7 +274,7 @@ function get_author_name($auth_id) {
// get extended entry info (<!--more-->) // get extended entry info (<!--more-->)
function get_extended($post) { function get_extended($post) {
list($main,$extended) = explode('<!--more-->',$post); list($main,$extended) = explode('<!--more-->', $post, 2);
// Strip leading and trailing whitespace // Strip leading and trailing whitespace
$main = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$main); $main = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$main);