本文整理汇总了PHP中get_comment_author_IP函数的典型用法代码示例。如果您正苦于以下问题:PHP get_comment_author_IP函数的具体用法?PHP get_comment_author_IP怎么用?PHP get_comment_author_IP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_comment_author_IP函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: mystique_ip2c_comment_class
function mystique_ip2c_comment_class($class)
{
if (get_mystique_option('comment_author_country')) {
$flag = @mystique_get_flag(get_comment_author_IP());
if (!empty($flag['code'])) {
$class[] = ' country-' . $flag['code'];
}
}
return $class;
}
开发者ID:nottombrown,项目名称:vlab,代码行数:10,代码来源:ip2country.php
示例2: 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
}
开发者ID:kgneil,项目名称:bsocial-comments,代码行数:57,代码来源:class-bsocial-comments-feedback-table.php
示例3: 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);
}
}
}
开发者ID:northmedia,项目名称:WordPress,代码行数:38,代码来源:class-wp-comments-list-table.php
示例4: _ex
/* translators: comment type radio button */
_ex('Pending', 'adjective');
?>
</label><br />
<label class="spam"><input type="radio"<?php
checked($comment->comment_approved, 'spam');
?>
name="comment_status" value="spam" /><?php
/* translators: comment type radio button */
_ex('Spam', 'adjective');
?>
</label>
</div>
<?php
if ($ip = get_comment_author_IP()) {
?>
<div class="misc-pub-section misc-pub-comment-author-ip">
<?php
_e('IP address:');
?>
<strong><a href="<?php
echo esc_url(sprintf('http://whois.arin.net/rest/ip/%s', $ip));
?>
"><?php
echo esc_html($ip);
?>
</a></strong>
</div>
<?php
}
开发者ID:Nancers,项目名称:Snancy-Website-Files,代码行数:31,代码来源:edit-form-comment.php
示例5: get_recent_comments
function get_recent_comments($pAllowedStatuses, $pCount)
{
if (!function_exists('get_comment_author_url')) {
include_once WPINC . '/comment-template.php';
}
$allComments = array();
foreach ($pAllowedStatuses as $status) {
$params = array('status' => $status);
if (0 !== $pCount) {
$params['number'] = $pCount;
}
$comments = get_comments($params);
if (is_array($comments)) {
foreach ($comments as $comment) {
$post = get_post($comment->comment_post_ID);
$outComment = array();
$outComment['id'] = $comment->comment_ID;
$outComment['status'] = wp_get_comment_status($comment->comment_ID);
$outComment['author'] = $comment->comment_author;
$outComment['author_url'] = get_comment_author_url($comment->comment_ID);
$outComment['author_ip'] = get_comment_author_IP($comment->comment_ID);
$outComment['author_email'] = $email = apply_filters('comment_email', $comment->comment_author_email);
if (!empty($outComment['author_email']) && '@' !== $outComment['author_email']) {
$outComment['author_email'] = '<a href="mailto:' . $outComment['author_email'] . '">' . $outComment['author_email'] . '</a>';
}
$outComment['postId'] = $comment->comment_post_ID;
$outComment['postName'] = $post->post_title;
$outComment['comment_count'] = $post->comment_count;
$outComment['content'] = $comment->comment_content;
$outComment['dts'] = strtotime($comment->comment_date_gmt);
$allComments[] = $outComment;
}
}
}
return $allComments;
}
开发者ID:jexmex,项目名称:mainwp-child,代码行数:36,代码来源:class-mainwp-child.php
示例6: comment_author_ratings_filter
function comment_author_ratings_filter($comment_text)
{
global $comment, $comment_authors_ratings;
$output = '';
if (!is_feed() && !is_admin()) {
if (get_comment_type() == 'comment') {
$post_ratings_images = '';
$ratings_image = get_option('postratings_image');
$ratings_max = intval(get_option('postratings_max'));
$ratings_custom = intval(get_option('postratings_customrating'));
$comment_author = get_comment_author();
$comment_author_rating = intval($comment_authors_ratings[$comment_author]);
if ($comment_author_rating == 0) {
$comment_author_rating = intval($comment_authors_ratings[get_comment_author_IP()]);
}
if ($comment_author_rating != 0) {
// Display Rated Images
if ($ratings_custom && $ratings_max == 2) {
if ($comment_author_rating > 0) {
$comment_author_rating = '+' . $comment_author_rating;
}
}
$image_alt = sprintf(__('%s gives a rating of %s', 'wp-postratings'), $comment_author, $comment_author_rating);
$post_ratings_images = get_ratings_images_comment_author($ratings_custom, $ratings_max, $comment_author_rating, $ratings_image, $image_alt);
}
$output .= '<div class="post-ratings-comment-author">';
if ($post_ratings_images != '') {
$output .= get_comment_author() . ' ratings for this post: ' . $post_ratings_images;
} else {
$output .= get_comment_author() . ' did not rate this post.';
}
$output .= '</div>';
}
}
return $comment_text . $output;
}
开发者ID:rkb09,项目名称:wp-postratings,代码行数:36,代码来源:wp-postratings.php
示例7: comment_row_actions
/**
* Comments page modification
*/
public function comment_row_actions($actions, $comment_id)
{
$ip = get_comment_author_IP($comment_id);
if (!empty($ip)) {
$actions[] = '<a href="#ip=' . urlencode($ip) . '" class="w3tc_cloudflare_ip_check">CloudFlare IP score</a>';
}
return $actions;
}
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:11,代码来源:Extension_CloudFlare_Plugin_Admin.php
示例8: CID_get_comment_flag_without_template
function CID_get_comment_flag_without_template()
{
$ip = get_comment_author_IP();
return CID_get_flag_without_template($ip);
}
开发者ID:hzlzh,项目名称:Show-Useragent,代码行数:5,代码来源:country.php
示例9: comment_author_IP
/**
* Display the IP address of the author of the current comment.
*
* @since 0.71
*
* @param int $comment_ID ID of the comment for which to print the author's IP
* address. Default current comment.
*/
function comment_author_IP($comment_ID = 0)
{
echo get_comment_author_IP($comment_ID);
}
开发者ID:richardbota,项目名称:WordPress-Theme-Development-with-Bootstrap,代码行数:12,代码来源:comment-template.php
示例10: mytheme_comment
function mytheme_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="li-comment-<?php
comment_ID();
?>
">
<div id="comment-<?php
comment_ID();
?>
">
<div class="comment-listCon">
<div class="comment-info">
<?php
echo get_avatar($comment, 48);
//アバター画像
?>
<?php
printf(__('<span class="admin">名前:<cite class="fn comment-author">%s</cite></span> '), get_comment_author_link());
//投稿者の設定
?>
<span class="comment-datetime">投稿日:<?php
printf(__('%1$s at %2$s'), get_comment_date('Y/m/d(D)'), get_comment_time('H:i:s'));
//投稿日の設定
?>
</span>
<span class="comment-id">
ID:<?php
//IDっぽい文字列の表示(あくまでIDっぽいものです。)
$ip01 = get_comment_author_IP();
//書き込んだユーザーのIPアドレスを取得
$ip02 = get_comment_date('jn');
//今日の日付
$ip03 = ip2long($ip01);
//IPアドレスの数値化
$ip04 = $ip02 * $ip03;
//ip02とip03を掛け合わせる
echo mb_substr(sha1($ip04), 2, 9);
//sha1でハッシュ化、頭から9文字まで出力
//echo mb_substr(base64_encode($ip04), 2, 9); //base64でエンコード、頭から9文字まで出力
?>
</span>
<span class="comment-reply">
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</span>
<span class="comment-edit"><?php
edit_comment_link(__('Edit'), ' ', '');
//編集リンク
?>
</span>
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<em><?php
_e('Your comment is awaiting moderation.');
?>
</em>
<?php
}
?>
<div class="comment-text"></div>
<?php
comment_text();
//コメント本文
?>
<?php
//返信機能は不要なので削除
?>
</div>
</div>
<?php
}
开发者ID:musashi0128,项目名称:wordpress,代码行数:80,代码来源:comment.php
示例11: row
/**
* Returns reports table row
*
* @param object $item
*
* @return string
*/
protected function row($item)
{
$author_info = html('strong', get_comment_author($item->get_id())) . '<br />';
$author_email = get_comment_author_email($item->get_id());
if (!empty($author_email)) {
$author_info .= html_link('mailto:' . $author_email, $author_email) . '<br />';
}
$author_info .= get_comment_author_IP($item->get_id());
$cells = array($author_info, get_comment_text($item->get_id()), get_comment_date('', $item->get_id()), '<span class="delete ui-icon ui-icon-circle-minus"></span>');
return html('tr id="report-' . $item->get_id() . '"', array(), $this->cells($cells));
}
开发者ID:kalushta,项目名称:darom,代码行数:18,代码来源:metabox.php
示例12: open_get_avatar
function open_get_avatar($avatar, $id_or_email = '', $size = '80', $default = '')
{
global $comment;
$comment_ip = '';
if ($id_or_email && is_object($id_or_email)) {
$id_or_email = $id_or_email->user_id;
if (is_user_logged_in() && current_user_can('manage_options')) {
$comment_ip = get_comment_author_IP();
}
}
if ($id_or_email) {
$open_type = get_user_meta($id_or_email, 'open_type', true);
}
if ($id_or_email && $open_type) {
$open_id = get_user_meta($id_or_email, 'open_id', true);
if ($open_type == 'qq') {
if (osop('QQ_AKEY')) {
$out = 'http://q.qlogo.cn/qqapp/' . osop('QQ_AKEY') . '/' . $open_id . '/100';
}
//40
} elseif ($open_type == 'sina') {
$out = 'http://tp3.sinaimg.cn/' . $open_id . '/180/1.jpg';
//50
} elseif ($open_type == 'douban') {
$out = 'http://img3.douban.com/icon/ul' . $open_id . '.jpg';
//u
} elseif ($open_type == 'xiaomi') {
$out = 'http://avatar.bbs.miui.com/data/avatar/' . substr(strlen($open_id) <= 8 ? '0' . $open_id : $open_id, 0, -6) . '/' . substr($open_id, -6, -4) . '/' . substr($open_id, -4, -2) . '/' . substr($open_id, -2) . '_avatar_middle.jpg';
//eggs broken
} else {
$out = get_user_meta($id_or_email, 'open_img', true);
}
if (isset($open_id) && isset($out)) {
return "<img alt='' ip='{$comment_ip}' src='{$out}' class='avatar avatar-{$size}' width='{$size}' />";
}
}
if (preg_match('/gravatar\\.com/', $avatar) && osop('extend_gravatar_disabled', 1)) {
$default = plugins_url('/images/gravatar.png', __FILE__);
$avatar = "<img alt='' ip='{$comment_ip}' src='{$default}?s={$size}' class='avatar avatar-{$size}' width='{$size}' />";
}
return $avatar;
}
开发者ID:xxf1995,项目名称:alphaV,代码行数:42,代码来源:open-social.php
示例13: get_comment_link
<div id="preview-action">
<a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
</div>
<div class="clear"></div>
</div>
<div id="misc-publishing-actions">
<fieldset class="misc-pub-section misc-pub-comment-status" id="comment-status-radio">
<legend class="screen-reader-text"><?php _e( 'Comment status' ); ?></legend>
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ _ex('Approved', 'adjective') ?></label><br />
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ _ex('Pending', 'adjective') ?></label><br />
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ _ex('Spam', 'adjective'); ?></label>
</fieldset>
<?php if ( $ip = get_comment_author_IP() ) : ?>
<div class="misc-pub-section misc-pub-comment-author-ip">
<span aria-hidden="true"><?php _e( 'IP address:' ); ?></span> <strong><a href="<?php echo esc_url( sprintf( 'http://whois.arin.net/rest/ip/%s', $ip ) ); ?>"> <span class="screen-reader-text"><?php _e( 'IP address:' ); ?> </span><?php echo esc_html( $ip ); ?></a></strong>
</div>
<?php endif; ?>
<div class="misc-pub-section curtime misc-pub-curtime">
<?php
/* translators: Publish box date format, see http://php.net/date */
$datef = __( 'M j, Y @ H:i' );
$stamp = __('Submitted on: <b>%1$s</b>');
$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
?>
<span id="timestamp"><?php printf( $stamp, $date ); ?></span>
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
<div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0); ?></div>
开发者ID:ShankarVellal,项目名称:WordPress,代码行数:31,代码来源:edit-form-comment.php
示例14: fs_add_comment_flag
function fs_add_comment_flag($link)
{
$FS_PATH = fs_get_firestats_path();
if (!$FS_PATH) {
return;
}
require_once $FS_PATH . '/php/ip2country.php';
$ip = get_comment_author_IP();
$code = fs_ip2c($ip);
if (!$code) {
return $link;
}
return $link . ' ' . fs_get_country_flag_url($code);
}
开发者ID:alx,项目名称:blogsfera,代码行数:14,代码来源:firestats-wordpress.php
示例15: comment_author_IP
function comment_author_IP()
{
echo get_comment_author_IP();
}
开发者ID:robertlange81,项目名称:Website,代码行数:4,代码来源:comment-functions.php
示例16: show_user_rating
function show_user_rating()
{
global $txt_product_rating;
/*
Show rating of comment author
*/
//global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
global $wpdb, $post, $user_ID, $ratings_image;
$out = " - " . $txt_product_rating . ': ';
$cdate = get_comment_date();
$cip = get_comment_author_IP($comment->comment_ID);
//echo "Post: - UserID: $user_ID - IP: $cip - Date: $cdate<br>";
$pid = get_the_ID();
$postratings_where = "AND rating_postid = {$pid}";
//$postratings_logs = $wpdb->get_results("SELECT * FROM $wpdb->ratings WHERE 1=1 $postratings_where ORDER BY $postratings_sortby $postratings_sortorder LIMIT $offset, $postratings_log_perpage");
$postratings_logs = $wpdb->get_results("SELECT * FROM {$wpdb->ratings} WHERE 1=1 {$postratings_where}");
//print "HIER";
//print_r($wpdb);
if ($postratings_logs) {
foreach ($postratings_logs as $postratings_log) {
$postratings_date = mysql2date(sprintf(__('%s', 'wp-postratings'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $postratings_log->rating_timestamp));
$postratings_rating = intval($postratings_log->rating_rating);
$postratings_ip = $postratings_log->rating_ip;
if ($postratings_date == $cdate) {
if ($postratings_ip == $cip) {
/*
echo "Found!<br>";
echo "<p>
PRD: $postratings_date<br>";
echo "Rating: $postratings_rating<br>
IP: $postratings_ip<br> -<br>";
*/
$ratings_max = 5;
for ($j = 1; $j <= $ratings_max; $j++) {
if ($j <= $postratings_rating) {
$out .= '<img src="' . plugins_url('wp-postratings/images/stars_crystal/rating_on.' . RATINGS_IMG_EXT) . '" alt="' . sprintf(_n('User Rate This Post %s Star', 'User Rate This Post %s Stars', $postratings_rating, 'wp-postratings'), $postratings_rating) . __(' Out Of ', 'wp-postratings') . $ratings_max . '" title="' . sprintf(_n('User Rate This Post %s Star', 'User Rate This Post %s Stars', $postratings_rating, 'wp-postratings'), $postratings_rating) . __(' Out Of ', 'wp-postratings') . $ratings_max . '" class="post-ratings-image" />';
} else {
$out .= '<img src="' . plugins_url('wp-postratings/images/stars_crystal/rating_off.' . RATINGS_IMG_EXT) . '" alt="' . sprintf(_n('User Rate This Post %s Star', 'User Rate This Post %s Stars', $postratings_rating, 'wp-postratings'), $postratings_rating) . __(' Out Of ', 'wp-postratings') . $ratings_max . '" title="' . sprintf(_n('User Rate This Post %s Star', 'User Rate This Post %s Stars', $postratings_rating, 'wp-postratings'), $postratings_rating) . __(' Out Of ', 'wp-postratings') . $ratings_max . '" class="post-ratings-image" />';
}
}
$found = 1;
}
}
if ($found == 1) {
return $out;
}
}
}
}
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:49,代码来源:comment-template.php
示例17: comment_author_IP
/**
* Display the IP address of the author of the current comment.
*
* @since 0.71
* @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object.
*
* @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address.
* Default current comment.
*/
function comment_author_IP($comment_ID = 0)
{
echo esc_html(get_comment_author_IP($comment_ID));
}
开发者ID:qaryas,项目名称:qaryas_site,代码行数:13,代码来源:comment-template.php
示例18: get_rating_id
function get_rating_id($comment_id)
{
$found_id = 0;
/*
get rating-id of comment author
*/
//global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $user_identity, $overridden_cpage;
global $wpdb, $post, $user_ID;
$cdate = get_comment_date('', $comment_id);
$cip = get_comment_author_IP($comment_id);
//echo "Post: - UserID: $user_ID - IP: $cip - Date: $cdate<br>";
$pid = get_the_ID();
$postratings_where = "AND rating_postid = {$pid}";
//$postratings_logs = $wpdb->get_results("SELECT * FROM $wpdb->ratings WHERE 1=1 $postratings_where ORDER BY $postratings_sortby $postratings_sortorder LIMIT $offset, $postratings_log_perpage");
$postratings_logs = $wpdb->get_results("SELECT * FROM {$wpdb->ratings} WHERE 1=1 {$postratings_where}");
//print "HIER";
//print_r($wpdb);
if ($postratings_logs) {
$found = 0;
foreach ($postratings_logs as $postratings_log) {
if ($found == 0) {
$postratings_date = mysql2date(sprintf(__('%s', 'wp-postratings'), get_option('date_format'), get_option('time_format')), gmdate('Y-m-d H:i:s', $postratings_log->rating_timestamp));
$postratings_rating = intval($postratings_log->rating_rating);
$postratings_ip = $postratings_log->rating_ip;
$postratings_id = $postratings_log->rating_id;
if ($postratings_date == $cdate) {
if ($postratings_ip == $cip) {
/*echo "Found!<br>";
echo "<p>
PRD: $postratings_date<br>";
echo "Rating: $postratings_rating<br>
ID: $postratings_id<br>
IP: $postratings_ip<br> -<br>";
*/
$found_id = $postratings_id;
$found = 1;
}
}
}
}
}
return $found_id;
}
开发者ID:cptpike,项目名称:linuxhardwareguide,代码行数:43,代码来源:lhg_functions.php
示例19: column_author
/**
*
* @global string $comment_status
*
* @param object $comment
*/
public function column_author($comment)
{
global $comment_status;
$author_url = get_comment_author_url($comment);
$author_url_display = untrailingslashit(preg_replace('|^http(s)?://(www\\.)?|i', '', $author_url));
if (strlen($author_url_display) > 50) {
$author_url_display = wp_html_excerpt($author_url_display, 49, '…');
}
echo "<strong>";
comment_author($comment);
echo '</strong><br />';
if (!empty($author_url_display)) {
printf('<a href="%s">%s</a><br />', esc_url($author_url), esc_html($author_url_display));
}
if ($this->user_can) {
if (!empty($comment->comment_author_email)) {
/* This filter is documented in wp-includes/comment-template.php */
$email = apply_filters('comment_email', $comment->comment_author_email, $comment);
if (!empty($email) && '@' !== $email) {
printf('<a href=\'mailto:%1$s\'>%1$s</a><br />', $email);
}
}
$author_ip = get_comment_author_IP($comment);
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);
}
}
}
开发者ID:hpilevar,项目名称:WordPress,代码行数:38,代码来源:class-wp-comments-list-table.php
示例20: body_cell
function body_cell($key, $value, $i)
{
global $comment, $lg_gallery;
// set global $comment so we can use WordPress functions
$comment = $this->items[$i];
$comment_ID = $comment->comment_ID;
// in this table we only shows approved comments
$comment_status = 'approve';
$pending_comments = 0;
switch ($key) {
case 'author':
$author_url = get_comment_author_url();
$cell = '<td class="author column-author">';
$cell .= sprintf('<strong> %s %s </strong><br />', get_avatar($comment, 32), get_comment_author($comment));
if (current_user_can('moderate_comments')) {
if (!empty($comment->comment_author_email)) {
$cell .= get_comment_author_email_link() . '<br />';
}
$cell .= sprintf('<a href="edit-comments.php?s=%s&mode=detail">%s</a>', get_comment_author_IP($comment), get_comment_author_IP($comment));
}
$cell .= '</td>';
break;
case 'comment':
$approve_nonce = esc_html('_wpnonce=' . wp_create_nonce("approve-comment_{$comment_ID}"));
$del_nonce = esc_html('_wpnonce=' . wp_create_nonce("delete-comment_{$comment_ID}"));
$postID = $lg_gallery->get_option('gallery_id');
$cell = '<td class="comment column-comment">';
$filevar = isset($comment->filevar) ? $comment->filevar : '';
$uri = trailingslashit($lg_gallery->get_option('gallery_prev'));
if ('TRUE' != $lg_gallery->get_option('use_permalinks')) {
$comment_url = add_query_arg('file', $filevar, $uri);
} else {
$comment_url = trailingslashit($uri . $filevar);
}
$comment_url .= '#comment-' . $comment_ID;
$cell .= '<div class="submitted-on">';
$cell .= sprintf(__('Submitted on <a href="%1$s">%2$s - %3$s</a>'), esc_url($comment_url), get_comment_date(get_option('date_format')), get_comment_date(get_option('time_format')));
$cell .= sprintf('<p>%s</p>', apply_filters('comment_text', get_comment_text($comment), $comment));
if (current_user_can('moderate_comments')) {
$cell .= '<div class="row-actions">';
$cell .= sprintf('<span class="unapprove"><a href="%s" class="delete:the-comment-list:comment-%s:e7e7d3:action=dim-comment&new=unapproved vim-u vim-destructive" title="%s">%s</a> | </span>', esc_url("comment.php?action=unapprovecomment&p={$postID}&c={$comment_ID}&{$approve_nonce}"), $comment_ID, esc_attr__('Unapprove this comment'), __('Unapprove'));
$cell .= sprintf('<span class="edit"><a href="comment.php?action=editcomment&c=%s" title="%s">%s</a> | </span>', $comment_ID, esc_attr__('Edit comment'), __('Edit'));
$cell .= sprintf('<span class="spam"><a href="%s" class="delete:the-comment-list:comment-%s::spam=1 vim-s vim-destructive" title="%s">%s</a> | </span>', esc_url("comment.php?action=spamcomment&p={$postID}&c={$comment_ID}&{$del_nonce}"), $comment_ID, esc_attr__('Mark this comment as spam'), _x('Spam', 'verb'));
$cell .= sprintf('<span class="trash"><a href="%s" class="delete:the-comment-list:%s::trash=1 delete vim-d vim-destructive" title="%s">%s</a></span>', esc_url("comment.php?action=trashcomment&p={$postID}&c={$comment_ID}&{$del_nonce}"), $comment_ID, esc_attr__('Move this comment to the trash'), _x('Trash', 'verb'));
}
$cell .= '</td>';
break;
case 'response':
$cell = '<td class="response column-response">';
$edit_title = esc_html__('Gallery', 'lazyest-gallery');
$edit_url = admin_url('admin.php?page=lazyest-filemanager&folder=');
$filevar = isset($comment->filevar) ? stripslashes(rawurldecode($comment->filevar)) : $lg_gallery->commentor->get_file_by_comment_id($comment_ID);
$preview = $lg_gallery->get_option('gallery_prev');
$class = 'alignright';
$img_src = trailingslashit($lg_gallery->plugin_url) . 'images/folders.png';
$img_alt = __('Icon', 'lazyest-gallery');
$img_title = __('Click to View', 'lazyest-gallery');
$img_id = 0;
$img_class = 'lg';
if ('' !== $filevar) {
$edit_url .= $lg_gallery->is_folder($filevar) ? lg_nice_link($filevar) : lg_nice_link(dirname($filevar));
if ($lg_gallery->is_folder($filevar)) {
$folder = new LazyestFolder($filevar);
$folder->open();
$edit_title = $folder->title();
$preview = $folder->uri();
$img_src = trailingslashit($lg_gallery->plugin_url) . 'images/folder-icon.png';
$img_id = $folder->id;
}
if ($lg_gallery->is_image($filevar)) {
$folder = new LazyestFolder(dirname($filevar));
$image = $folder->single_image(basename($filevar), 'thumbs');
$edit_url .= '#' . $image->form_name();
$edit_title = $image->title();
$onclick = $image->on_click();
$preview = $onclick['href'];
$class .= ' ' . $onclick['class'];
$img_src = $image->src();
if ('TRUE' == $lg_gallery->get_option('async_cache') && !file_exists($image->loc())) {
$img_class = 'lg_ajax';
}
$img_alt = $image->alt();
$img_id = $image->id;
}
}
$cell .= '<div class="response-links"><span class="post-com-count-wrapper">';
$cell .= sprintf('<a href="%s">%s</a><br />', $edit_url, $edit_title);
$cell .= sprintf('<a href="admin.php?page=lazyest-filemanager&edit=comments&file=%s" title="%s" class="post-com-count"><span class="comment-count">%s</span></a>', $filevar, esc_attr(__('0 pending')), $lg_gallery->commentor->count_comments($img_id));
$cell .= '</div>';
$cell .= sprintf('<a target="_blank" href="%s" class="alignright"><img width="32" height="32" src="%s" alt="%s" title="%s" class="%s" /></a>', $preview, $img_src, $img_alt, $img_title, $img_class);
$cell .= "</td>\n";
break;
}
return $cell;
}
开发者ID:slavam,项目名称:adult-childhood,代码行数:95,代码来源:tables.php
注:本文中的get_comment_author_IP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论