コード例 #1
0
ファイル: edit-comments.php プロジェクト: nxtclass/NXTClass
echo esc_attr($nxt_list_table->get_pagination_arg('per_page'));
?>
" />
<input type="hidden" name="_page" value="<?php 
echo esc_attr($nxt_list_table->get_pagination_arg('page'));
?>
" />

<?php 
if (isset($_REQUEST['paged'])) {
    ?>
	<input type="hidden" name="paged" value="<?php 
    echo esc_attr(absint($_REQUEST['paged']));
    ?>
" />
<?php 
}
?>

<?php 
$nxt_list_table->display();
?>
</form>
</div>

<div id="ajax-response"></div>

<?php 
nxt_comment_reply('-1', true, 'detail');
nxt_comment_trashnotice();
include './admin-footer.php';
コード例 #2
0
ファイル: dashboard.php プロジェクト: nxtclass/NXTClass
/**
 * Display recent comments dashboard widget content.
 *
 * @since 2.5.0
 */
function nxt_dashboard_recent_comments()
{
    global $nxtdb;
    if (current_user_can('edit_posts')) {
        $allowed_states = array('0', '1');
    } else {
        $allowed_states = array('1');
    }
    // Select all comment types and filter out spam later for better query performance.
    $comments = array();
    $start = 0;
    $widgets = get_option('dashboard_widget_options');
    $total_items = isset($widgets['dashboard_recent_comments']) && isset($widgets['dashboard_recent_comments']['items']) ? absint($widgets['dashboard_recent_comments']['items']) : 5;
    while (count($comments) < $total_items && ($possible = $nxtdb->get_results("SELECT * FROM {$nxtdb->comments} c LEFT JOIN {$nxtdb->posts} p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT {$start}, 50"))) {
        foreach ($possible as $comment) {
            if (count($comments) >= $total_items) {
                break;
            }
            if (in_array($comment->comment_approved, $allowed_states) && current_user_can('read_post', $comment->comment_post_ID)) {
                $comments[] = $comment;
            }
        }
        $start = $start + 50;
    }
    if ($comments) {
        ?>

		<div id="the-comment-list" class="list:comment">
<?php 
        foreach ($comments as $comment) {
            _nxt_dashboard_recent_comments_row($comment);
        }
        ?>

		</div>

<?php 
        if (current_user_can('edit_posts')) {
            ?>
			<?php 
            _get_list_table('nxt_Comments_List_Table')->views();
        }
        nxt_comment_reply(-1, false, 'dashboard', false);
        nxt_comment_trashnotice();
    } else {
        ?>

	<p><?php 
        _e('No comments yet.');
        ?>
</p>

<?php 
    }
    // $comments;
}
コード例 #3
0
ファイル: meta-boxes.php プロジェクト: nxtclass/NXTClass
/**
 * Display comments for post.
 *
 * @since 2.8.0
 *
 * @param object $post
 */
function post_comment_meta_box($post)
{
    global $nxtdb, $post_ID;
    $total = $nxtdb->get_var($nxtdb->prepare("SELECT count(1) FROM {$nxtdb->comments} WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
    if (1 > $total) {
        echo '<p>' . __('No comments yet.') . '</p>';
        return;
    }
    nxt_nonce_field('get-comments', 'add_comment_nonce', false);
    $nxt_list_table = _get_list_table('nxt_Post_Comments_List_Table');
    $nxt_list_table->display(true);
    ?>
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php 
    echo $total;
    ?>
);return false;"><?php 
    _e('Show comments');
    ?>
</a> <img class="waiting" style="display:none;" src="<?php 
    echo esc_url(admin_url('images/nxtspin_light.gif'));
    ?>
" alt="" /></p>
<?php 
    $hidden = get_hidden_meta_boxes('post');
    if (!in_array('commentsdiv', $hidden)) {
        ?>
		<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php 
        echo $total;
        ?>
, 10);});</script>
<?php 
    }
    nxt_comment_trashnotice();
}