diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-07 14:28:14 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-07 14:28:14 +0000 |
| commit | 9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe (patch) | |
| tree | a0bb93e81f1856204377f936a97a8a285f77f2b7 /wp-inst/wp-admin/edit.php | |
| parent | 16cdc878fce216364bd57f498baeeb1b94ca8662 (diff) | |
| download | wordpress-mu-9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe.tar.gz wordpress-mu-9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe.tar.xz wordpress-mu-9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe.zip | |
WP Merge and new features
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@550 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-admin/edit.php')
| -rw-r--r-- | wp-inst/wp-admin/edit.php | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/wp-inst/wp-admin/edit.php b/wp-inst/wp-admin/edit.php index d8e201f..a39338d 100644 --- a/wp-inst/wp-admin/edit.php +++ b/wp-inst/wp-admin/edit.php @@ -3,7 +3,7 @@ require_once('admin.php'); $title = __('Posts'); $parent_file = 'edit.php'; -$list_js = true; +wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' ); require_once('admin-header.php'); $_GET['m'] = (int) $_GET['m']; @@ -91,16 +91,17 @@ if ( count($arc_result) ) { ?> <select name='m'> <?php foreach ($arc_result as $arc_row) { - $arc_year = $arc_row->yyear; - $arc_month = $arc_row->mmonth; + if ( $arc_row->yyear == 0 ) + continue; + $arc_row->mmonth = zeroise($arc_row->mmonth, 2); - if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == (int) $_GET['m'] ) + if( isset($_GET['m']) && $arc_row->yyear . $arc_row->mmonth == (int) $_GET['m'] ) $default = 'selected="selected"'; else $default = null; - echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">'; - echo $month[zeroise($arc_month, 2)] . " $arc_year"; + echo "<option $default value='$arc_row->yyear$arc_row->mmonth'>"; + echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear"; echo "</option>\n"; } ?> @@ -114,7 +115,6 @@ if ( count($arc_result) ) { ?> <br style="clear:both;" /> <?php - // define the columns to display, the syntax is 'internal name' => 'display name' $posts_columns = array( 'id' => __('ID'), @@ -133,7 +133,8 @@ $posts_columns['control_delete'] = ''; ?> -<table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> +<table class="widefat"> + <thead> <tr> <?php foreach($posts_columns as $column_display_name) { ?> @@ -141,10 +142,13 @@ $posts_columns['control_delete'] = ''; <?php } ?> </tr> + </thead> + <tbody id="the-list"> <?php if ($posts) { $bgcolor = ''; foreach ($posts as $post) { start_wp(); +add_filter('the_title','wp_specialchars'); $class = ('alternate' == $class) ? '' : 'alternate'; ?> <tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'> @@ -181,7 +185,7 @@ foreach($posts_columns as $column_name=>$column_display_name) { case 'comments': ?> - <td><a href="edit.php?p=<?php echo $id ?>&c=1"> + <td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1"> <?php comments_number(__('0'), __('1'), __('%')) ?> </a></td> <?php @@ -207,7 +211,7 @@ foreach($posts_columns as $column_name=>$column_display_name) { case 'control_delete': ?> - <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='post.php?action=delete&post=$id' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post "%s".\\n"OK" to delete, "Cancel" to stop."), wp_specialchars(get_the_title('', ''), 1) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> + <td><?php if ( current_user_can('delete_post',$post->ID) ) { echo "<a href='" . wp_nonce_url("post.php?action=delete&post=$id", 'delete-post_' . $post->ID) . "' class='delete' onclick=\"return deleteSomething( 'post', " . $id . ", '" . sprintf(__("You are about to delete this post "%s".\\n"OK" to delete, "Cancel" to stop."), js_escape(get_the_title()) ) . "' );\">" . __('Delete') . "</a>"; } ?></td> <?php break; @@ -229,7 +233,8 @@ foreach($posts_columns as $column_name=>$column_display_name) { </tr> <?php } // end if ($posts) -?> +?> + </tbody> </table> <div id="ajax-response"></div> @@ -245,45 +250,40 @@ if ( 1 == count($posts) ) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date"); if ($comments) { ?> -<h3><?php _e('Comments') ?></h3> -<ol id="comments"> +<h3 id="comments"><?php _e('Comments') ?></h3> +<ol id="the-comment-list" class="commentlist"> <?php +$i = 0; foreach ($comments as $comment) { -$comment_status = wp_get_comment_status($comment->comment_ID); -?> -<li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> > - <?php comment_date('Y-n-j') ?> - @ - <?php comment_time('g:m:s a') ?> - <?php - if ( current_user_can('edit_post', $post->ID) ) { - echo "[ <a href=\"comment.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit') . "</a>"; - echo " - <a href=\"comment.php?action=deletecomment&p=".$post->ID."&comment=".$comment->comment_ID."\" onclick=\"return confirm('" . sprintf(__("You are about to delete this comment by \'%s\'\\n \'OK\' to delete, \'Cancel\' to stop."), $comment->comment_author) . "')\">" . __('Delete') . "</a> "; - if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { - if ('approved' == wp_get_comment_status($comment->comment_ID)) { - echo " - <a href=\"comment.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> "; - } else { - echo " - <a href=\"comment.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Approve') . "</a> "; - } - } - echo "]"; - } // end if any comments to show - ?> - <br /> - <strong> - <?php comment_author() ?> - ( - <?php comment_author_email_link() ?> - / - <?php comment_author_url_link() ?> - )</strong> (IP: - <?php comment_author_IP() ?> - ) - <?php comment_text() ?> - -</li> -<!-- /comment --> + ++$i; $class = ''; + $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); + $comment_status = wp_get_comment_status($comment->comment_ID); + if ('unapproved' == $comment_status) + $class .= ' unapproved'; + if ($i % 2) + $class .= ' alternate'; + echo "<li id='comment-$comment->comment_ID' class='$class'>"; +?> +<p><strong><?php comment_author() ?></strong> <?php if ($comment->comment_author_email) { ?>| <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <?php comment_author_url_link() ?> <?php } ?>| <?php _e('IP:') ?> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a></p> + +<?php comment_text() ?> + +<p><?php comment_date('M j, g:i A'); ?> — [ +<?php +if ( current_user_can('edit_post', $comment->comment_post_ID) ) { + echo " <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; + echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . sprintf(__("You are about to delete this comment by "%s".\\n"Cancel" to stop, "OK" to delete."), js_escape($comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> '; + if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { + echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>'; + echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>'; + } + echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&delete_type=spam&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', $comment->comment_ID, '" . sprintf(__("You are about to mark as spam this comment by "%s".\\n"Cancel" to stop, "OK" to mark as spam."), js_escape( $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ]"; +} // end if any comments to show +?> +</p> + </li> + <?php //end of the loop, don't delete } // end foreach echo '</ol>'; |
