2 require_once('admin.php');
5 $parent_file = 'edit.php';
7 require_once('admin-header.php');
9 $_GET['m'] = (int) $_GET['m'];
11 $drafts = get_users_drafts( $user_ID );
12 $other_drafts = get_others_drafts( $user_ID);
14 if ($drafts || $other_drafts) {
17 <?php if ($drafts) { ?>
18 <p><strong><?php _e('Your Drafts:') ?></strong>
21 foreach ($drafts as $draft) {
24 $draft->post_title = stripslashes($draft->post_title);
25 if ($draft->post_title == '')
26 $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
27 echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
34 <?php if ($other_drafts) { ?>
35 <p><strong><?php _e('Other’s Drafts:') ?></strong>
38 foreach ($other_drafts as $draft) {
41 $draft->post_title = stripslashes($draft->post_title);
42 if ($draft->post_title == '')
43 $draft->post_title = sprintf(__('Post #%s'), $draft->ID);
44 echo "<a href='post.php?action=edit&post=$draft->ID' title='" . __('Edit this draft') . "'>$draft->post_title</a>";
58 $what_to_show = 'posts';
60 $posts_per_archive_page = -1;
65 single_month_title(' ');
66 } elseif ( is_search() ) {
67 printf(__('Search for “%s”'), wp_specialchars($_GET['s']) );
70 printf(__('Comments on %s'), $post->post_title);
71 elseif ( ! is_paged() || get_query_var('paged') == 1 )
79 <form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;">
81 <legend><?php _e('Search Posts…') ?></legend>
82 <input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" />
83 <input type="submit" name="submit" value="<?php _e('Search') ?>" />
87 <?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_date != '0000-00-00 00:00:00' ORDER BY post_date DESC");
89 if ( count($arc_result) ) { ?>
91 <form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;">
93 <legend><?php _e('Browse Month…') ?></legend>
96 foreach ($arc_result as $arc_row) {
97 $arc_year = $arc_row->yyear;
98 $arc_month = $arc_row->mmonth;
100 if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == (int) $_GET['m'] )
101 $default = 'selected="selected"';
105 echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">';
106 echo $month[zeroise($arc_month, 2)] . " $arc_year";
111 <input type="submit" name="submit" value="<?php _e('Show Month') ?>" />
117 <br style="clear:both;" />
121 // define the columns to display, the syntax is 'internal name' => 'display name'
122 $posts_columns = array(
124 'date' => __('When'),
125 'title' => __('Title'),
126 'categories' => __('Categories'),
127 'comments' => __('Comments'),
128 'author' => __('Author')
130 $posts_columns = apply_filters('manage_posts_columns', $posts_columns);
132 // you can not edit these at the moment
133 $posts_columns['control_view'] = '';
134 $posts_columns['control_edit'] = '';
135 $posts_columns['control_delete'] = '';
139 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3">
142 <?php foreach($posts_columns as $column_display_name) { ?>
143 <th scope="col"><?php echo $column_display_name; ?></th>
150 foreach ($posts as $post) { start_wp();
151 $class = ('alternate' == $class) ? '' : 'alternate';
153 <tr id='post-<?php echo $id; ?>' class='<?php echo $class; ?>'>
157 foreach($posts_columns as $column_name=>$column_display_name) {
159 switch($column_name) {
163 <th scope="row"><?php echo $id ?></th>
169 <td><?php the_time('Y-m-d \<\b\r \/\> g:i:s a'); ?></td>
174 <td><?php the_title() ?>
175 <?php if ('private' == $post->post_status) _e(' - <strong>Private</strong>'); ?></td>
181 <td><?php the_category(','); ?></td>
187 <td><a href="edit.php?p=<?php echo $id ?>&c=1">
188 <?php comments_number(__('0'), __('1'), __('%')) ?>
195 <td><?php the_author() ?></td>
201 <td><a href="<?php the_permalink(); ?>" rel="permalink" class="edit"><?php _e('View'); ?></a></td>
207 <td><?php if ( current_user_can('edit_post',$post->ID) ) { echo "<a href='post.php?action=edit&post=$id' class='edit'>" . __('Edit') . "</a>"; } ?></td>
211 case 'control_delete':
213 <td><?php if ( current_user_can('edit_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>
219 <td><?php do_action('manage_posts_custom_column', $column_name, $id); ?></td>
230 <tr style='background-color: <?php echo $bgcolor; ?>'>
231 <td colspan="8"><?php _e('No posts found.') ?></td>
238 <div id="ajax-response"></div>
240 <div class="navigation">
241 <div class="alignleft"><?php next_posts_link(__('« Previous Entries')) ?></div>
242 <div class="alignright"><?php previous_posts_link(__('Next Entries »')) ?></div>
246 if ( 1 == count($posts) ) {
248 $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved != 'spam' ORDER BY comment_date");
251 <h3><?php _e('Comments') ?></h3>
254 foreach ($comments as $comment) {
255 $comment_status = wp_get_comment_status($comment->comment_ID);
258 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> >
259 <?php comment_date('Y-n-j') ?>
261 <?php comment_time('g:m:s a') ?>
263 if ( current_user_can('edit_post', $post->ID) ) {
264 echo "[ <a href=\"post.php?action=editcomment&comment=".$comment->comment_ID."\">" . __('Edit') . "</a>";
265 echo ' - <a href="' . wp_nonce_url('post.php?action=deletecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return confirm(\'' . __("You are about to delete this comment.\\n"Cancel" to stop, "OK" to delete.") . "');\">" . __('Delete') . '</a> ';
267 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) {
268 if ('approved' == wp_get_comment_status($comment->comment_ID)) {
269 echo ' - <a href="' . wp_nonce_url('post.php?action=unapprovecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '">' . __('Unapprove') . '</a> ';
271 echo ' - <a href="' . wp_nonce_url('post.php?action=approvecomment&p=' . $post->ID . '&comment=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '">' . __('Approve') . '</a> ';
275 } // end if any comments to show
279 <?php comment_author() ?>
281 <?php comment_author_email_link() ?>
283 <?php comment_author_url_link() ?>
285 <?php comment_author_IP() ?>
287 <?php comment_text() ?>
291 <?php //end of the loop, don't delete
299 include('admin-footer.php');