Changeset 9020 for trunk/wp-admin/upload.php
- Timestamp:
- 09/28/2008 03:00:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload.php
r9016 r9020 150 150 </div></form> 151 151 </div></div> 152 153 <?php 154 if ( isset($_GET['posted']) && (int) $_GET['posted'] ) { 155 $_GET['message'] = '1'; 156 $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 157 } 158 159 $messages[1] = __('Media attachment updated.'); 160 $messages[2] = __('Media deleted.'); 161 $messages[3] = __('Error saving media attachment.'); 162 163 if ( isset($_GET['message']) && (int) $_GET['message'] ) 164 $message = $messages[$_GET['message']]; 165 166 if ( isset($message) ) { ?> 167 <div id="message" class="updated fade"><p><?php echo $message; ?></p></div> 168 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 169 } 170 ?> 171 172 <?php do_action('restrict_manage_posts'); ?> 152 173 153 174 <div class="wrap"> … … 186 207 ?></h2> 187 208 188 <form id="posts-filter" action="" method="get">189 209 <ul class="subsubsub"> 190 210 <?php … … 218 238 </ul> 219 239 220 <?php 221 if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET['posted']; ?> 222 <div id="message" class="updated fade"><p><strong><?php _e('Your media has been saved.'); ?></strong> <a href="<?php echo get_permalink( $_GET['posted'] ); ?>"><?php _e('View media'); ?></a> | <a href="<?php echo get_edit_post_link( $_GET['posted'] ); ?>"><?php _e('Edit media'); ?></a></p></div> 223 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']); 224 endif; 225 226 $messages[1] = __('Media attachment updated.'); 227 $messages[2] = __('Media deleted.'); 228 $messages[3] = __('Error saving media attachment.'); 229 230 if ( isset($_GET['message']) && (int) $_GET['message'] ) 231 $message = $messages[$_GET['message']]; 232 233 if ( isset($message) ) { ?> 234 <div id="message" class="updated fade"><p><?php echo $message; ?></p></div> 235 <?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); 236 } 237 ?> 238 239 <?php do_action('restrict_manage_posts'); ?> 240 <div class="filter"> 241 <form id="list-filter" action="" method="get"> 242 <?php 243 if ( ! is_singular() && ! isset($_GET['detached']) ) { 244 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC"; 245 246 $arc_result = $wpdb->get_results( $arc_query ); 247 248 $month_count = count($arc_result); 249 250 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?> 251 <select name='m'> 252 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option> 253 <?php 254 foreach ($arc_result as $arc_row) { 255 if ( $arc_row->yyear == 0 ) 256 continue; 257 $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 ); 258 259 if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] ) 260 $default = ' selected="selected"'; 261 else 262 $default = ''; 263 264 echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>"; 265 echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear"; 266 echo "</option>\n"; 267 } 268 ?> 269 </select> 270 <?php endif; // month_count ?> 271 272 <input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" /> 273 274 <?php } // ! is_singular ?> 275 </form></div> 276 277 <form id="posts-filter" action="" method="get"> 240 278 241 279 <div class="tablenav"> 242 243 280 <?php 244 281 if ( ! isset($page_links_total) ) … … 266 303 <input type="submit" id="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" /> 267 304 <?php wp_nonce_field('bulk-media'); ?> 268 <?php269 270 if ( ! is_singular() && ! isset($_GET['detached']) ) {271 $arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";272 273 $arc_result = $wpdb->get_results( $arc_query );274 275 $month_count = count($arc_result);276 277 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) : ?>278 <select name='m'>279 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>280 <?php281 foreach ($arc_result as $arc_row) {282 if ( $arc_row->yyear == 0 )283 continue;284 $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );285 286 if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )287 $default = ' selected="selected"';288 else289 $default = '';290 291 echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";292 echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";293 echo "</option>\n";294 }295 ?>296 </select>297 <?php endif; // month_count ?>298 299 <input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" />300 301 <?php } // ! is_singular ?>302 305 303 306 <?php if ( isset($_GET['detached']) ) { ?> … … 428 431 <table class="widefat" style="margin-top: .5em"> 429 432 <thead> 430 431 432 433 434 433 <tr> 434 <th scope="col"><?php _e('Comment') ?></th> 435 <th scope="col"><?php _e('Date') ?></th> 436 <th scope="col"><?php _e('Actions') ?></th> 437 </tr> 435 438 </thead> 436 439 <tbody id="the-comment-list" class="list:comment"> 437 440 <?php 438 439 441 foreach ($comments as $comment) 442 _wp_comment_row( $comment->comment_ID, 'detail', false, false ); 440 443 ?> 441 444 </tbody>
Note: See TracChangeset
for help on using the changeset viewer.