当前位置: 首页>>代码示例>>PHP>>正文


PHP get_comment_author_IP函数代码示例

本文整理汇总了PHP中get_comment_author_IP函数的典型用法代码示例。如果您正苦于以下问题:PHP get_comment_author_IP函数的具体用法?PHP get_comment_author_IP怎么用?PHP get_comment_author_IP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_comment_author_IP函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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) . '&hellip;';
        }
        // 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) . '&hellip;';
     }
     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


注:本文中的get_comment_author_IP函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。