Changes in trunk/wp-admin/edit.php [4349:3422]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r4349 r3422 4 4 $title = __('Posts'); 5 5 $parent_file = 'edit.php'; 6 wp_enqueue_script( 1 == $_GET['c'] ? 'admin-comments' : 'listman' );6 $list_js = true; 7 7 require_once('admin-header.php'); 8 8 … … 56 56 <h2> 57 57 <?php 58 59 wp('what_to_show=posts&posts_per_page=15&posts_per_archive_page=-1'); 58 $what_to_show = 'posts'; 59 $posts_per_page = 15; 60 $posts_per_archive_page = -1; 61 62 wp(); 60 63 61 64 if ( is_month() ) { … … 74 77 </h2> 75 78 76 <form name="searchform" id="searchform" action="" method="get">79 <form name="searchform" action="" method="get" style="float: left; width: 16em; margin-right: 3em;"> 77 80 <fieldset> 78 81 <legend><?php _e('Search Posts…') ?></legend> 79 82 <input type="text" name="s" value="<?php if (isset($s)) echo wp_specialchars($s, 1); ?>" size="17" /> 80 <input type="submit" name="submit" value="<?php _e('Search') ?>" class="button"/>83 <input type="submit" name="submit" value="<?php _e('Search') ?>" /> 81 84 </fieldset> 82 85 </form> 83 86 84 <?php $arc_result = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_ type = 'post' ORDER BY post_date DESC");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"); 85 88 86 89 if ( count($arc_result) ) { ?> 87 90 88 <form name="viewarc" id="viewarc" action="" method="get">91 <form name="viewarc" action="" method="get" style="float: left; width: 20em; margin-bottom: 1em;"> 89 92 <fieldset> 90 93 <legend><?php _e('Browse Month…') ?></legend> 91 94 <select name='m'> 92 95 <?php 93 foreach ($arc_result as $arc_row) { 94 if ( $arc_row->yyear == 0 ) 95 continue; 96 $arc_row->mmonth = zeroise($arc_row->mmonth, 2); 97 98 if( isset($_GET['m']) && $arc_row->yyear . $arc_row->mmonth == (int) $_GET['m'] ) 96 foreach ($arc_result as $arc_row) { 97 $arc_year = $arc_row->yyear; 98 $arc_month = $arc_row->mmonth; 99 100 if( isset($_GET['m']) && $arc_year . zeroise($arc_month, 2) == (int) $_GET['m'] ) 99 101 $default = 'selected="selected"'; 100 102 else 101 103 $default = null; 102 103 echo "<option $default value= '$arc_row->yyear$arc_row->mmonth'>";104 echo $ wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";104 105 echo "<option $default value=\"" . $arc_year.zeroise($arc_month, 2) . '">'; 106 echo $month[zeroise($arc_month, 2)] . " $arc_year"; 105 107 echo "</option>\n"; 106 108 } 107 109 ?> 108 110 </select> 109 <input type="submit" name="submit" value="<?php _e('Show Month') ?>" class="button"/>111 <input type="submit" name="submit" value="<?php _e('Show Month') ?>" /> 110 112 </fieldset> 111 113 </form> … … 113 115 <?php } ?> 114 116 115 <form name="viewcat" id="viewcat" action="" method="get">116 <fieldset>117 <legend><?php _e('Browse Category…') ?></legend>118 <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?>119 <input type="submit" name="submit" value="<?php _e('Show Category') ?>" class="button" />120 </fieldset>121 </form>122 123 <?php do_action('restrict_manage_posts'); ?>124 125 117 <br style="clear:both;" /> 126 118 127 119 <?php 120 128 121 // define the columns to display, the syntax is 'internal name' => 'display name' 129 122 $posts_columns = array( … … 144 137 ?> 145 138 146 <table class="widefat"> 147 <thead> 139 <table id="the-list-x" width="100%" cellpadding="3" cellspacing="3"> 148 140 <tr> 149 141 … … 153 145 154 146 </tr> 155 </thead>156 <tbody id="the-list">157 147 <?php 158 148 if ($posts) { 159 149 $bgcolor = ''; 160 150 foreach ($posts as $post) { start_wp(); 161 add_filter('the_title','wp_specialchars');162 151 $class = ('alternate' == $class) ? '' : 'alternate'; 163 152 ?> … … 169 158 170 159 switch($column_name) { 171 160 172 161 case 'id': 173 162 ?> 174 <th scope="row" style="text-align: center"><?php echo $id ?></th>163 <th scope="row"><?php echo $id ?></th> 175 164 <?php 176 165 break; … … 196 185 case 'comments': 197 186 ?> 198 <td style="text-align: center"><a href="edit.php?p=<?php echo $id ?>&c=1">187 <td><a href="edit.php?p=<?php echo $id ?>&c=1"> 199 188 <?php comments_number(__('0'), __('1'), __('%')) ?> 200 189 </a></td> … … 222 211 case 'control_delete': 223 212 ?> 224 <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>213 <td><?php if ( current_user_can('edit_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> 225 214 <?php 226 215 break; … … 244 233 <?php 245 234 } // end if ($posts) 246 ?> 247 </tbody> 235 ?> 248 236 </table> 249 237 … … 261 249 if ($comments) { 262 250 ?> 263 <h3 id="comments"><?php _e('Comments') ?></h3> 264 <ol id="the-comment-list" class="commentlist"> 265 <?php 266 $i = 0; 251 <h3><?php _e('Comments') ?></h3> 252 <ol id="comments"> 253 <?php 267 254 foreach ($comments as $comment) { 268 269 ++$i; $class = ''; 270 $authordata = get_userdata($wpdb->get_var("SELECT post_author FROM $wpdb->posts WHERE ID = $comment->comment_post_ID")); 271 $comment_status = wp_get_comment_status($comment->comment_ID); 272 if ('unapproved' == $comment_status) 273 $class .= ' unapproved'; 274 if ($i % 2) 275 $class .= ' alternate'; 276 echo "<li id='comment-$comment->comment_ID' class='$class'>"; 277 ?> 278 <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> 279 280 <?php comment_text() ?> 281 282 <p><?php comment_date('M j, g:i A'); ?> — [ 283 <?php 284 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 285 echo " <a href='comment.php?action=editcomment&comment=".$comment->comment_ID."\'>" . __('Edit') . '</a>'; 286 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> '; 287 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 288 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>'; 289 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>'; 290 } 291 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> ]"; 292 } // end if any comments to show 293 ?> 294 </p> 295 </li> 296 255 $comment_status = wp_get_comment_status($comment->comment_ID); 256 ?> 257 258 <li <?php if ("unapproved" == $comment_status) echo "class='unapproved'"; ?> > 259 <?php comment_date('Y-n-j') ?> 260 @ 261 <?php comment_time('g:m:s a') ?> 262 <?php 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=\"post.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> "; 266 if ( ('none' != $comment_status) && ( current_user_can('moderate_comments') ) ) { 267 if ('approved' == wp_get_comment_status($comment->comment_ID)) { 268 echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> "; 269 } else { 270 echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Approve') . "</a> "; 271 } 272 } 273 echo "]"; 274 } // end if any comments to show 275 ?> 276 <br /> 277 <strong> 278 <?php comment_author() ?> 279 ( 280 <?php comment_author_email_link() ?> 281 / 282 <?php comment_author_url_link() ?> 283 )</strong> (IP: 284 <?php comment_author_IP() ?> 285 ) 286 <?php comment_text() ?> 287 288 </li> 289 <!-- /comment --> 297 290 <?php //end of the loop, don't delete 298 291 } // end foreach
Note: See TracChangeset
for help on using the changeset viewer.