本文整理汇总了PHP中comment_author_email_link函数的典型用法代码示例。如果您正苦于以下问题:PHP comment_author_email_link函数的具体用法?PHP comment_author_email_link怎么用?PHP comment_author_email_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comment_author_email_link函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: column_author
/**
* Custom column to render comment authors
*
* @param Object $comment Current comment
*/
public function column_author($comment)
{
?>
<strong><?php
comment_author();
?>
</strong><br />
<?php
$author_url = get_comment_author_url();
if (preg_match('|^https?://$|', $author_url)) {
$author_url = '';
}
// END if
$author_url_display = preg_replace('|https?://(www\\.)?|i', '', $author_url);
if (strlen($author_url_display) > 50) {
$author_url_display = substr($author_url_display, 0, 49) . '…';
}
// END if
if (!empty($author_url)) {
?>
<a href="<?php
echo esc_url($author_url);
?>
" title="<?php
echo esc_url($author_url);
?>
"><?php
esc_html($author_url_display);
?>
</a>
<?php
}
// END if
if ($this->user_can) {
if (!empty($comment->comment_author_email)) {
comment_author_email_link();
}
// END if
$args = array('s' => get_comment_author_IP(), 'mode' => 'detail');
?>
<br />
<a href="<?php
echo esc_url(add_query_arg($args, admin_url('edit-comments.php')));
?>
"><?php
echo esc_html(get_comment_author_IP());
?>
</a>
<?php
}
// END if
}
示例2: _wp_comment_list_item
function _wp_comment_list_item($id, $alt = 0)
{
global $authordata, $comment, $wpdb;
$id = (int) $id;
$comment =& get_comment($id);
$class = '';
$post = get_post($comment->comment_post_ID);
$authordata = get_userdata($post->post_author);
$comment_status = wp_get_comment_status($comment->comment_ID);
if ('unapproved' == $comment_status) {
$class .= ' unapproved';
}
if ($alt % 2) {
$class .= ' alternate';
}
echo "<li id='comment-{$comment->comment_ID}' class='{$class}'>";
?>
<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>
<?php
comment_text();
?>
<p><?php
comment_date(__('M j, g:i A'));
?>
— [
<?php
if (current_user_can('edit_post', $comment->comment_post_ID)) {
echo " <a href='comment.php?action=editcomment&c=" . $comment->comment_ID . "'>" . __('Edit') . '</a>';
echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
if ('none' != $comment_status && current_user_can('moderate_comments')) {
echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
}
echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', {$comment->comment_ID}, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";
}
$post = get_post($comment->comment_post_ID, OBJECT, 'display');
$post_title = wp_specialchars($post->post_title, 'double');
$post_title = '' == $post_title ? "# {$comment->comment_post_ID}" : $post_title;
?>
] — <a href="<?php
echo get_permalink($comment->comment_post_ID);
?>
"><?php
echo $post_title;
?>
</a></p>
</li>
<?php
}
示例3: _wp_comment_row
//.........这里部分代码省略.........
<div class="author-url"><?php echo attribute_escape( $comment->comment_author_url ); ?></div>
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
</div>
<?php
$actions = array();
if ( current_user_can('edit_post', $post->ID) ) {
$actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved vim-a' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
$actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved vim-u' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
if ( $comment_status ) { // not looking at all comments
if ( 'approved' == $the_comment_status ) {
$actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
unset($actions['approve']);
} else {
$actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved vim-a vim-destructive' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
unset($actions['unapprove']);
}
}
if ( 'spam' != $the_comment_status )
$actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1 vim-s vim-destructive' title='" . __( 'Mark this comment as spam' ) . "'>" . _c( 'Spam|verb' ) . '</a>';
$actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete vim-d vim-destructive'>" . __('Delete') . '</a>';
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a>';
$actions['quickedit'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\',\'edit\');return false;" class="vim-q" title="'.__('Quick Edit').'" href="#">' . __('Quick Edit') . '</a>';
if ( 'spam' != $the_comment_status )
$actions['reply'] = '<a onclick="commentReply.open(\''.$comment->comment_ID.'\',\''.$post->ID.'\');return false;" class="vim-r" title="'.__('Reply to this comment').'" href="#">' . __('Reply') . '</a>';
$actions = apply_filters( 'comment_row_actions', $actions, $comment );
$i = 0;
echo '<div class="row-actions">';
foreach ( $actions as $action => $link ) {
++$i;
( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
// Reply and quickedit need a hide-if-no-js span when not added with ajax
if ( ('reply' == $action || 'quickedit' == $action) && ! $from_ajax )
$action .= ' hide-if-no-js';
echo "<span class='$action'>$sep$link</span>";
}
echo '</div>';
}
echo '</td>';
break;
case 'author':
echo "<td $attributes><strong>"; comment_author(); echo '</strong><br />';
if ( !empty($author_url) )
echo "<a title='$author_url' href='$author_url'>$author_url_display</a><br />";
if ( current_user_can( 'edit_post', $post->ID ) ) {
if ( !empty($comment->comment_author_email) ) {
comment_author_email_link();
echo '<br />';
}
echo '<a href="edit-comments.php?s=';
comment_author_IP();
echo '&mode=detail';
if ( 'spam' == $comment_status )
echo '&comment_status=spam';
echo '">';
comment_author_IP();
echo '</a>';
} //current_user_can
echo '</td>';
break;
case 'date':
echo "<td $attributes>" . get_comment_date(__('Y/m/d \a\t g:ia')) . '</td>';
break;
case 'response':
if ( 'single' !== $mode ) {
if ( isset( $_comment_pending_count[$post->ID] ) ) {
$pending_comments = absint( $_comment_pending_count[$post->ID] );
} else {
$_comment_pending_count_temp = (array) get_pending_comments_num( array( $post->ID ) );
$pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID];
}
if ( current_user_can( 'edit_post', $post->ID ) ) {
$post_link = "<a href='" . get_edit_post_link($post->ID) . "'>";
$post_link .= get_the_title($post->ID) . '</a>';
} else {
$post_link = get_the_title($post->ID);
}
echo "<td $attributes>\n";
echo $post_link;
echo '<div class="response-links"><span class="post-com-count-wrapper">';
$pending_phrase = sprintf( __('%s pending'), number_format( $pending_comments ) );
if ( $pending_comments )
echo '<strong>';
comments_number("<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$post->ID' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
if ( $pending_comments )
echo '</strong>';
echo '</span> ';
echo "<a href='" . get_permalink( $post->ID ) . "'>#</a>";
echo '</div></td>';
}
}
}
echo "</tr>\n";
}
示例4: confirm
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> ";
if ( ('none' != $comment_status) && ($user_level >= 3) ) {
if ('approved' == wp_get_comment_status($comment->comment_ID)) {
echo " - <a href=\"post.php?action=unapprovecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Unapprove') . "</a> ";
} else {
echo " - <a href=\"post.php?action=approvecomment&p=".$post->ID."&comment=".$comment->comment_ID."\">" . __('Approve') . "</a> ";
}
}
echo "]";
} // end if any comments to show
?>
<br />
<strong>
<?php comment_author() ?>
(
<?php comment_author_email_link() ?>
/
<?php comment_author_url_link() ?>
)</strong> (IP:
<?php comment_author_IP() ?>
)
<?php comment_text() ?>
</li>
<!-- /comment -->
<?php //end of the loop, don't delete
} // end foreach
echo '</ol>';
}//end if comments
?>
<?php } ?>
示例5: get_comment_list_item
function get_comment_list_item($id, $alt = 0, $reply = false)
{
global $authordata, $comment, $wpdb, $user_identity, $user_email, $user_url;
get_currentuserinfo();
$id = (int) $id;
$comment =& get_comment($id);
$class = '';
$post = get_post($comment->comment_post_ID);
$authordata = get_userdata($post->post_author);
$comment_status = wp_get_comment_status($comment->comment_ID);
if (isset($_GET['replyid'])) {
$query = remove_query_arg('replyid');
} else {
$query = add_query_arg('replyid', $comment->comment_ID);
}
if ('unapproved' == $comment_status) {
$class .= ' unapproved';
}
if ($alt % 2) {
$class .= ' alternate';
}
echo "<li id='comment-{$comment->comment_ID}' class='{$class}'>";
?>
<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>
<?php
comment_text();
?>
<p><?php
comment_date(__('M j, g:i A'));
?>
— [
<?php
if (current_user_can('edit_post', $comment->comment_post_ID)) {
echo " <a href='comment.php?action=editcomment&c=" . $comment->comment_ID . "'>" . __('Edit') . '</a>';
echo ' | <a href="' . wp_nonce_url('comment.php?action=deletecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '" onclick="return deleteSomething( \'comment\', ' . $comment->comment_ID . ', \'' . js_escape(sprintf(__("You are about to delete this comment by '%s'.\n'Cancel' to stop, 'OK' to delete."), $comment->comment_author)) . "', theCommentList );\">" . __('Delete') . '</a> ';
if ('none' != $comment_status && current_user_can('moderate_comments')) {
echo '<span class="unapprove"> | <a href="' . wp_nonce_url('comment.php?action=unapprovecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'unapprove-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Unapprove') . '</a> </span>';
echo '<span class="approve"> | <a href="' . wp_nonce_url('comment.php?action=approvecomment&p=' . $comment->comment_post_ID . '&c=' . $comment->comment_ID, 'approve-comment_' . $comment->comment_ID) . '" onclick="return dimSomething( \'comment\', ' . $comment->comment_ID . ', \'unapproved\', theCommentList );">' . __('Approve') . '</a> </span>';
}
echo " | <a href=\"" . wp_nonce_url("comment.php?action=deletecomment&dt=spam&p=" . $comment->comment_post_ID . "&c=" . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment-as-spam', {$comment->comment_ID}, '" . js_escape(sprintf(__("You are about to mark as spam this comment by '%s'.\n'Cancel' to stop, 'OK' to mark as spam."), $comment->comment_author)) . "', theCommentList );\">" . __('Spam') . "</a> ";
echo " | <a href='" . $query . "' onclick=' return addReplyForm(\"" . get_option('siteurl') . "/wp-content/plugins/soc-comments/soc-comments-post.php\"," . $id . "," . $comment->comment_post_ID . ",\"" . $user_identity . "\",\"" . $user_email . "\",\"" . $user_url . "\",\"" . wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) . "\",\"" . add_query_arg('ajax', '1') . "\")' >" . __('Reply') . " </a>";
}
$post = get_post($comment->comment_post_ID);
$post_title = wp_specialchars($post->post_title, 'double');
$post_title = '' == $post_title ? "# {$comment->comment_post_ID}" : $post_title;
?>
] — <a href="<?php
echo get_permalink($comment->comment_post_ID);
?>
"><?php
echo $post_title;
?>
</a></p>
<div id="com-<?php
echo $comment->comment_ID;
?>
" >
<?php
if (true == $reply) {
?>
<?php
if ('open' == $post->comment_status) {
?>
<form action="<?php
echo get_option('siteurl');
?>
/wp-comments-post.php" method="POST" id="comment-reply-form">
//.........这里部分代码省略.........
示例6: while
<a name="comments"></a>
<p><b><font color="#ff3300">::</font> comments</b></p>
<?php
while ($rowc = mysql_fetch_object($resultc)) {
$commentdata = get_commentdata($rowc->comment_ID);
?>
<!-- comment -->
<p>
<b><?php
comment_author();
?>
( <?php
comment_author_email_link();
?>
/ <?php
comment_author_url_link();
?>
)</b> (IP: <?php
comment_author_IP();
?>
)
<br />
<?php
comment_text();
?>
<br />
<?php
comment_date('Y/m/d');
示例7: _e
<h2><?php _e('Moderation Queue') ?></h2>
<form name="approval" action="moderation.php" method="post">
<?php wp_nonce_field('moderate-comments') ?>
<input type="hidden" name="action" value="update" />
<ol id="the-list" class="commentlist">
<?php
$i = 0;
foreach($comments as $comment) {
++$i;
$comment_date = mysql2date(get_settings("date_format") . " @ " . get_settings("time_format"), $comment->comment_date);
$post_title = $wpdb->get_var("SELECT post_title FROM $wpdb->posts WHERE ID='$comment->comment_post_ID'");
if ($i % 2) $class = 'class="alternate"';
else $class = '';
echo "\n\t<li id='comment-$comment->comment_ID' $class>";
?>
<p><strong><?php _e('Name:') ?></strong> <?php comment_author_link() ?> <?php if ($comment->comment_author_email) { ?>| <strong><?php _e('E-mail:') ?></strong> <?php comment_author_email_link() ?> <?php } if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) { ?> | <strong><?php _e('URI:') ?></strong> <?php comment_author_url_link() ?> <?php } ?>| <strong><?php _e('IP:') ?></strong> <a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php comment_author_IP() ?>"><?php comment_author_IP() ?></a> | <strong><?php _e('Date:') ?></strong> <?php comment_date(); ?></p>
<?php comment_text() ?>
<p><?php
echo '<a href="post.php?action=editcomment&comment='.$comment->comment_ID.'">' . __('Edit') . '</a> | ';?>
<a href="<?php echo get_permalink($comment->comment_post_ID); ?>"><?php _e('View Post') ?></a> |
<?php
echo " <a href=\"" . wp_nonce_url("post.php?action=deletecomment&p=".$comment->comment_post_ID."&comment=".$comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . "\" onclick=\"return deleteSomething( 'comment', $comment->comment_ID, '" . __("You are about to delete this comment.\\n"Cancel" to stop, "OK" to delete.") . "' );\">" . __('Delete just this comment') . "</a> | "; ?> <?php _e('Bulk action:') ?>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-approve" value="approve" /> <label for="comment-<?php echo $comment->comment_ID; ?>-approve"><?php _e('Approve') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-spam" value="spam" /> <label for="comment-<?php echo $comment->comment_ID; ?>-spam"><?php _e('Spam') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-delete" value="delete" /> <label for="comment-<?php echo $comment->comment_ID; ?>-delete"><?php _e('Delete') ?></label>
<input type="radio" name="comment[<?php echo $comment->comment_ID; ?>]" id="comment-<?php echo $comment->comment_ID; ?>-nothing" value="later" checked="checked" /> <label for="comment-<?php echo $comment->comment_ID; ?>-nothing"><?php _e('Defer until later') ?></label>
</p>
</li>
<?php
}
示例8: the_comment
/**
* Displays a single comment
*/
function the_comment($comment, $args, $depth)
{
global $current_user, $userdata;
// Get current user
get_currentuserinfo();
$GLOBALS['comment'] = $comment;
// Deleting editorial comments is not enabled for now for the sake of transparency. However, we could consider
// EF comment edits (with history, if possible). P2 already allows for edits without history, so even that might work.
// Pivotal ticket: https://www.pivotaltracker.com/story/show/18483757
//$delete_url = esc_url( wp_nonce_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID", "delete-comment_$comment->comment_ID" ) );
$actions = array();
$actions_string = '';
// Comments can only be added by users that can edit the post
if (current_user_can('edit_post', $comment->comment_post_ID)) {
$actions['reply'] = '<a onclick="editorialCommentReply.open(\'' . $comment->comment_ID . '\',\'' . $comment->comment_post_ID . '\');return false;" class="vim-r hide-if-no-js" title="' . __('Reply to this comment', 'edit-flow') . '" href="#">' . __('Reply', 'edit-flow') . '</a>';
$sep = ' ';
$i = 0;
foreach ($actions as $action => $link) {
++$i;
// Reply and quickedit need a hide-if-no-js span
if ('reply' == $action || 'quickedit' == $action) {
$action .= ' hide-if-no-js';
}
$actions_string .= "<span class='{$action}'>{$sep}{$link}</span>";
}
}
?>
<li id="comment-<?php
echo esc_attr($comment->comment_ID);
?>
" <?php
comment_class(array('comment-item', wp_get_comment_status($comment->comment_ID)));
?>
>
<?php
echo get_avatar($comment->comment_author_email, 50);
?>
<div class="post-comment-wrap">
<h5 class="comment-meta">
<?php
printf(__('<span class="comment-author">%1$s</span><span class="meta"> said on %2$s at %3$s</span>', 'edit-flow'), comment_author_email_link($comment->comment_author), get_comment_date(get_option('date_format')), get_comment_time());
?>
</h5>
<div class="comment-content"><?php
comment_text();
?>
</div>
<p class="row-actions"><?php
echo $actions_string;
?>
</p>
</div>
</li>
<?php
}
示例9: comment_author_url
" /></td>
<td><a href="<?php
comment_author_url();
?>
"><?php
comment_author();
?>
</a></td>
<td><?php
comment_author_email_link('email');
?>
</td>
<td><?php
echo trim_string($comment->comment_content, 50);
?>
</td>
<td><a href="http://ws.arin.net/cgi-bin/whois.pl?queryinput=<?php
comment_author_IP();
?>
示例10: _wp_comment_row
//.........这里部分代码省略.........
}
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>" . __('Edit') . '</a>';
$actions['quickedit'] = '<a onclick="commentReply.open(\'' . $comment->comment_ID . '\',\'' . $post->ID . '\',\'edit\');return false;" class="vim-q" title="' . __('Quick Edit') . '" href="#">' . __('Quick Edit') . '</a>';
if ('spam' != $the_comment_status) {
$actions['reply'] = '<a onclick="commentReply.open(\'' . $comment->comment_ID . '\',\'' . $post->ID . '\');return false;" class="vim-r" title="' . __('Reply to this comment') . '" href="#">' . __('Reply') . '</a>';
}
}
$actions = apply_filters('comment_row_actions', $actions, $comment);
$i = 0;
echo '<div class="row-actions">';
foreach ($actions as $action => $link) {
++$i;
('approve' == $action || 'unapprove' == $action) && 2 === $i || 1 === $i ? $sep = '' : ($sep = ' | ');
// Reply and quickedit need a hide-if-no-js span when not added with ajax
if (('reply' == $action || 'quickedit' == $action) && !$from_ajax) {
$action .= ' hide-if-no-js';
} elseif ($action == 'untrash' && $the_comment_status == 'trash') {
if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true)) {
$action .= ' approve';
} else {
$action .= ' unapprove';
}
}
echo "<span class='{$action}'>{$sep}{$link}</span>";
}
echo '</div>';
}
echo '</td>';
break;
case 'author':
echo "<td {$attributes}><strong>";
comment_author();
echo '</strong><br />';
if (!empty($author_url)) {
echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />";
}
if ($user_can) {
if (!empty($comment->comment_author_email)) {
comment_author_email_link();
echo '<br />';
}
echo '<a href="edit-comments.php?s=';
comment_author_IP();
echo '&mode=detail';
if ('spam' == $comment_status) {
echo '&comment_status=spam';
}
echo '">';
comment_author_IP();
echo '</a>';
}
//current_user_can
echo '</td>';
break;
case 'date':
echo "<td {$attributes}>" . get_comment_date(__('Y/m/d \\a\\t g:ia')) . '</td>';
break;
case 'response':
if ('single' !== $mode) {
if (isset($_comment_pending_count[$post->ID])) {
$pending_comments = absint($_comment_pending_count[$post->ID]);
} else {
$_comment_pending_count_temp = (array) get_pending_comments_num(array($post->ID));
$pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID];
}
if ($user_can) {
$post_link = "<a href='" . get_edit_post_link($post->ID) . "'>";
$post_link .= get_the_title($post->ID) . '</a>';
} else {
$post_link = get_the_title($post->ID);
}
echo "<td {$attributes}>\n";
echo '<div class="response-links"><span class="post-com-count-wrapper">';
echo $post_link . '<br />';
$pending_phrase = sprintf(__('%s pending'), number_format($pending_comments));
if ($pending_comments) {
echo '<strong>';
}
comments_number("<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>');
if ($pending_comments) {
echo '</strong>';
}
echo '</span> ';
echo "<a href='" . get_permalink($post->ID) . "'>#</a>";
echo '</div>';
if ('attachment' == $post->post_type && ($thumb = wp_get_attachment_image($post->ID, array(80, 60), true))) {
echo $thumb;
}
echo '</td>';
}
break;
default:
echo "<td {$attributes}>\n";
do_action('manage_comments_custom_column', $column_name, $comment->comment_ID);
echo "</td>\n";
break;
}
}
echo "</tr>\n";
}
示例11: column_author
/**
* Render the author column HTML
*
* @param object $comment
*/
function column_author($comment)
{
global $comment_status;
$author_url = get_comment_author_url();
if ('http://' == $author_url) {
$author_url = '';
}
$author_url_display = preg_replace('|http://(www\\.)?|i', '', $author_url);
if (strlen($author_url_display) > 50) {
$author_url_display = substr($author_url_display, 0, 49) . '…';
}
echo "<strong>";
comment_author();
echo '</strong><br />';
if (!empty($author_url)) {
echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />";
}
if ($this->user_can) {
if (!empty($comment->comment_author_email)) {
comment_author_email_link();
echo '<br />';
}
// Base link for current screen
$link = add_query_arg('page', 'reviews', 'admin.php');
echo '<a href="' . esc_url($link) . '&s=';
comment_author_IP();
echo '&mode=detail';
if ('spam' == $comment_status) {
echo '&comment_status=spam';
}
echo '">';
comment_author_IP();
echo '</a>';
}
}
示例12: _wp_comment_row
//.........这里部分代码省略.........
if ('trash' != $the_comment_status) {
$actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . esc_attr__('Edit comment') . "'>" . __('Edit') . '</a>';
$actions['quickedit'] = '<a onclick="commentReply.open(\'' . $comment->comment_ID . '\',\'' . $post->ID . '\',\'edit\');return false;" class="vim-q" title="' . esc_attr__('Quick Edit') . '" href="#">' . __('Quick Edit') . '</a>';
if ('spam' != $the_comment_status) {
$actions['reply'] = '<a onclick="commentReply.open(\'' . $comment->comment_ID . '\',\'' . $post->ID . '\');return false;" class="vim-r" title="' . esc_attr__('Reply to this comment') . '" href="#">' . __('Reply') . '</a>';
}
}
$actions = apply_filters('comment_row_actions', array_filter($actions), $comment);
$i = 0;
echo '<div class="row-actions">';
foreach ($actions as $action => $link) {
++$i;
('approve' == $action || 'unapprove' == $action) && 2 === $i || 1 === $i ? $sep = '' : ($sep = ' | ');
// Reply and quickedit need a hide-if-no-js span when not added with ajax
if (('reply' == $action || 'quickedit' == $action) && !$from_ajax) {
$action .= ' hide-if-no-js';
} elseif ($action == 'untrash' && $the_comment_status == 'trash' || $action == 'unspam' && $the_comment_status == 'spam') {
if ('1' == get_comment_meta($comment_id, '_wp_trash_meta_status', true)) {
$action .= ' approve';
} else {
$action .= ' unapprove';
}
}
echo "<span class='{$action}'>{$sep}{$link}</span>";
}
echo '</div>';
}
echo '</td>';
break;
case 'author':
echo "<td {$attributes}><strong>";
comment_author();
echo '</strong><br />';
if (!empty($author_url)) {
echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />";
}
if ($user_can) {
if (!empty($comment->comment_author_email)) {
comment_author_email_link();
echo '<br />';
}
echo '<a href="edit-comments.php?s=';
comment_author_IP();
echo '&mode=detail';
if ('spam' == $comment_status) {
echo '&comment_status=spam';
}
echo '">';
comment_author_IP();
echo '</a>';
}
//current_user_can
echo '</td>';
break;
case 'date':
echo "<td {$attributes}>" . get_comment_date(__('Y/m/d \\a\\t g:ia')) . '</td>';
break;
case 'response':
if ('single' !== $mode) {
if (isset($_comment_pending_count[$post->ID])) {
$pending_comments = absint($_comment_pending_count[$post->ID]);
} else {
$_comment_pending_count_temp = (array) get_pending_comments_num(array($post->ID));
$pending_comments = $_comment_pending_count[$post->ID] = $_comment_pending_count_temp[$post->ID];
}
if ($user_can) {
$post_link = "<a href='" . get_edit_post_link($post->ID) . "'>";
$post_link .= get_the_title($post->ID) . '</a>';
} else {
$post_link = get_the_title($post->ID);
}
echo "<td {$attributes}>\n";
echo '<div class="response-links"><span class="post-com-count-wrapper">';
echo $post_link . '<br />';
$pending_phrase = esc_attr(sprintf(__('%s pending'), number_format($pending_comments)));
if ($pending_comments) {
echo '<strong>';
}
comments_number("<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p={$post->ID}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . _x('%', 'comment count') . '</span></a>');
if ($pending_comments) {
echo '</strong>';
}
echo '</span> ';
echo "<a href='" . get_permalink($post->ID) . "'>#</a>";
echo '</div>';
if ('attachment' == $post->post_type && ($thumb = wp_get_attachment_image($post->ID, array(80, 60), true))) {
echo $thumb;
}
echo '</td>';
}
break;
default:
echo "<td {$attributes}>\n";
do_action('manage_comments_custom_column', $column_name, $comment->comment_ID);
echo "</td>\n";
break;
}
}
echo "</tr>\n";
}
示例13: get_comment_row
function get_comment_row($comment_id, $comment_status, $checkbox = true)
{
global $comment, $post;
$comment = get_comment($comment_id);
$post = get_post($comment->comment_post_ID);
$authordata = get_userdata($post->post_author);
if (current_user_can('edit_post', $post->ID)) {
$post_link = sprintf('<a href="%1$s">%2$s</a>', get_comment_link(), get_the_title($comment->comment_post_ID));
$edit_link = sprintf('<a class="row-title" href="%1$s" title="%2$s">%3$s</a>', add_query_arg(array('c' => $comment->comment_ID, 'page' => 'flagged-comments'), get_option('siteurl') . '/wp-admin/'), $this->__('Edit comment'), get_comment_author());
} else {
$post_link = get_the_title($comment->comment_post_ID);
$edit_link = get_comment_author();
}
$author_url = get_comment_author_url();
if ('http://' == $author_url) {
$author_url = '';
}
$author_url_display = $author_url;
if (strlen($author_url_display) > 50) {
$author_url_display = substr($author_url_display, 0, 49) . '...';
}
$ptime = date('G', strtotime($comment->comment_date));
if (abs(time() - $ptime) < 86400) {
$ptime = sprintf($this->__('%s ago'), human_time_diff($ptime));
} else {
$ptime = mysql2date($this->__('Y/m/d \\a\\t g:i A'), $comment->comment_date);
}
$url_args = array('c' => $comment->comment_ID, 'p' => $comment->comment_post_ID, 'page' => 'flagged-comments');
$base_url = get_option('siteurl') . '/wp-admin/comment.php';
$delete_url = add_query_arg(array_merge($url_args, array('action' => 'deletecomment', '_wpnonce' => wp_create_nonce("delete-comment_{$comment->comment_ID}"))), $base_url);
$approve_url = add_query_arg(array_merge($url_args, array('action' => 'approvecomment', '_wpnonce' => wp_create_nonce("approve-comment_{$comment->comment_ID}"))), $base_url);
$unapprove_url = add_query_arg(array_merge($url_args, array('action' => 'unapprovecomment', '_wpnonce' => wp_create_nonce("unapprove-comment_{$comment->comment_ID}"))), $base_url);
$spam_url = add_query_arg('dt', 'spam', $delete_url);
$unflag_url = add_query_arg(array_merge($url_args, array('action' => 'unflagcomment', '_wpnonce' => wp_create_nonce("unflag-comment_{$comment->comment_ID}"))), get_option('siteurl') . '/wp-admin/edit-comments.php');
?>
<tr id="comment-<?php
echo $comment->comment_ID;
?>
" class='unapproved'>
<?php
if ($checkbox) {
?>
<td class="check-column"><?php
if (current_user_can('edit_post', $comment->comment_post_ID)) {
?>
<input type="checkbox" name="unflag-comments[]" value="<?php
comment_ID();
?>
" />
<?php
}
?>
</td>
<?php
}
?>
<td class="comment">
<p class="comment-author"><strong><?php
echo $edit_link;
?>
</strong><br />
<?php
if (!empty($author_url)) {
?>
<a href="<?php
echo $author_url;
?>
"><?php
echo $author_url_display;
?>
</a> |
<?php
}
?>
<?php
if (current_user_can('edit_post', $post->ID)) {
?>
<?php
if (!empty($comment->comment_author_email)) {
?>
<?php
comment_author_email_link();
?>
|
<?php
}
?>
<a href="edit-comments.php?s=<?php
comment_author_IP();
?>
&mode=detail"><?php
comment_author_IP();
?>
</a>
<?php
}
//current_user_can
?>
</p>
//.........这里部分代码省略.........
示例14: column_author
/**
*
* @global string $comment_status
*
* @param object $comment
*/
public function column_author($comment)
{
global $comment_status;
$author_url = get_comment_author_url();
if ('http://' == $author_url) {
$author_url = '';
}
$author_url_display = preg_replace('|http://(www\\.)?|i', '', $author_url);
if (strlen($author_url_display) > 50) {
$author_url_display = substr($author_url_display, 0, 49) . '…';
}
echo "<strong>";
comment_author();
echo '</strong><br />';
if (!empty($author_url)) {
echo "<a title='{$author_url}' href='{$author_url}'>{$author_url_display}</a><br />";
}
if ($this->user_can) {
if (!empty($comment->comment_author_email)) {
comment_author_email_link();
echo '<br />';
}
$author_ip = get_comment_author_IP();
if ($author_ip) {
$author_ip_url = add_query_arg(array('s' => $author_ip, 'mode' => 'detail'), 'edit-comments.php');
if ('spam' == $comment_status) {
$author_ip_url = add_query_arg('comment_status', 'spam', $author_ip_url);
}
printf('<a href="%s">%s</a>', esc_url($author_ip_url), $author_ip);
}
}
}
示例15: get_commentdata
$wxcvbn_c++;
$commentdata = get_commentdata($rowc->comment_ID);
?>
<a name="c<?php
comment_ID();
?>
"></a>
<!-- comment -->
<p>
<b><?php
comment_author();
?>
<?php
comment_author_email_link("email", " - ", "");
comment_author_url_link("url", " - ", "");
?>
</b>
<br />
<?php
comment_text();
?>
<br />
<?php
comment_date();
?>
@ <?php
comment_time();
?>
</p>