Make WordPress Core

Changeset 8288


Ignore:
Timestamp:
07/08/2008 08:00:15 PM (18 years ago)
Author:
mdawaffe
Message:

crazyhorse: comments on this post meta box

Location:
branches/crazyhorse/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/crazyhorse/wp-admin/edit-form-advanced.php

    r8287 r8288  
    111111
    112112?>
     113<p class="meta-options">
     114    <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label>
     115</p>
    113116<p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
    114117<p><?php _e('Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress blogs they&#8217;ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
     
    117120    echo $pings;
    118121}
    119 add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
     122add_meta_box('trackbacksdiv', __('Trackbacks and Pings'), 'post_trackback_meta_box', 'post', 'normal', 'core');
    120123
    121124function post_custom_meta_box($post) {
     
    142145
    143146function post_comment_status_meta_box($post) {
     147    global $wpdb, $post_ID;
    144148?>
    145149<input name="advanced_view" type="hidden" value="1" />
    146 <p><label for="comment_status" class="selectit">
    147 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
    148 <?php _e('Allow Comments') ?></label></p>
    149 <p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>
    150 <p><?php _e('These settings apply to this post only. &#8220;Pings&#8221; are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
    151 <?php
    152 }
    153 add_meta_box('commentstatusdiv', __('Comments &amp; Pings'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
     150<p class="meta-options">
     151    <label for="comment_status" class="selectit"> <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /><?php _e('Allow comments on this post') ?></label>
     152</p>
     153<?php
     154
     155
     156    if ( !$post_ID || $post_ID < 0 )
     157        return;
     158
     159    if ( !$comments = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved != 'spam' ORDER BY comment_date", $post_ID) ) )
     160        return;
     161
     162    // Make sure comments, post, and post_author are cached
     163//  update_comment_cache($comments);
     164?>
     165
     166<table class="widefat">
     167<thead>
     168    <tr>
     169        <th scope="col"><?php _e('Comments') ?></th>
     170        <th scope="col"><?php _e('Submitted') ?></th>
     171    </tr>
     172</thead>
     173<tbody id="the-comment-list" class="list:comment">
     174<?php
     175    foreach ($comments as $comment)
     176        _wp_comment_row( $comment, 'single', false, false );
     177?>
     178</tbody>
     179</table>
     180
     181
     182<?php
     183
     184
     185
     186}
     187add_meta_box('commentstatusdiv', __('Comments on this Post'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
    154188
    155189function post_password_meta_box($post) {
  • branches/crazyhorse/wp-admin/edit.php

    r8140 r8288  
    249249  <tr>
    250250    <th scope="col"><?php _e('Comment') ?></th>
    251     <th scope="col"><?php _e('Date') ?></th>
    252     <th scope="col"><?php _e('Actions') ?></th>
     251    <th scope="col"><?php _e('Submitted') ?></th>
    253252  </tr>
    254253</thead>
     
    256255<?php
    257256    foreach ($comments as $comment)
    258         _wp_comment_row( $comment->comment_ID, 'detail', false, false );
     257        _wp_comment_row( $comment->comment_ID, 'single', false, false );
    259258?>
    260259</tbody>
  • branches/crazyhorse/wp-admin/includes/template.php

    r8287 r8288  
    742742<?php endif; ?>
    743743    <td class="comment">
    744     <?php if ( 'detail' == $mode ) comment_text(); ?>
     744    <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?>
    745745    <p class="comment-author"><strong><?php comment_author(); ?></strong> |
    746746    <?php if ( !empty($author_url) ) : ?>
     
    785785    </td>
    786786    <td><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td>
     787<?php if ( 'single' !== $mode ) : ?>
    787788    <td>
    788789    "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br/>
    789790    <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?>
    790     </td>
     791    </td>
     792<?php endif; ?>
    791793  </tr>
    792794    <?php
  • branches/crazyhorse/wp-admin/wp-admin.css

    r8287 r8288  
    14921492}
    14931493
    1494 #the-comment-list td.comment p {
    1495     margin-left: 8px;
    1496 }
    1497 
    14981494#the-comment-list .check-column {
    14991495    padding-top: 8px;
     
    16461642    margin: 0;
    16471643}
     1644
     1645p.meta-options {
     1646    border: 1px solid;
     1647    padding: 1em .5em;
     1648}
Note: See TracChangeset for help on using the changeset viewer.