diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-04 16:44:15 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-04-04 16:44:15 +0000 |
| commit | 7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc (patch) | |
| tree | c6fd23b598f3994eddb18cb1c0f2e8d95ff054fa /wp-admin/includes/comment.php | |
| parent | f650f48c048bfbbb2ae702b6425d87e39358d748 (diff) | |
| download | wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.tar.gz wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.tar.xz wordpress-mu-7740e89de3e1bc0cc636120e3ca8ab9e97e4d3cc.zip | |
Merged with WordPress 2.5, unstable, only for testing
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1218 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-admin/includes/comment.php')
| -rw-r--r-- | wp-admin/includes/comment.php | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/wp-admin/includes/comment.php b/wp-admin/includes/comment.php index ae0d1d9..e08ae4d 100644 --- a/wp-admin/includes/comment.php +++ b/wp-admin/includes/comment.php @@ -8,9 +8,7 @@ function comment_exists($comment_author, $comment_date) { } function edit_comment() { - global $user_ID; - $comment_ID = (int) $_POST['comment_ID']; $comment_post_ID = (int) $_POST['comment_post_ID']; if (!current_user_can( 'edit_post', $comment_post_ID )) @@ -23,6 +21,14 @@ function edit_comment() { $_POST['comment_content'] = $_POST['content']; $_POST['comment_ID'] = (int) $_POST['comment_ID']; + foreach ( array ('aa', 'mm', 'jj', 'hh', 'mm') as $timeunit ) { + if ( !empty( $_POST['hidden_' . $timeunit] ) && $_POST['hidden_' . $timeunit] != $_POST[$timeunit] ) { + $_POST['edit_date'] = '1'; + break; + } + } + + if (!empty ( $_POST['edit_date'] ) ) { $aa = $_POST['aa']; $mm = $_POST['mm']; @@ -65,4 +71,26 @@ function get_pending_comments_num( $post_id ) { return $pending; } -?>
\ No newline at end of file +// Add avatars to relevant places in admin, or try to + +function floated_admin_avatar( $name ) { + global $comment; + + $id = $avatar = false; + if ( $comment->comment_author_email ) + $id = $comment->comment_author_email; + if ( $comment->user_id ) + $id = $comment->user_id; + + if ( $id ) + $avatar = get_avatar( $id, 32 ); + + return "$avatar $name"; +} + +if ( is_admin() && ('edit-comments.php' == $pagenow || 'edit.php' == $pagenow) ) { + if ( get_option('show_avatars') ) + add_filter( 'comment_author', 'floated_admin_avatar' ); +} + +?> |
