本文整理汇总了PHP中get_comment_ID函数的典型用法代码示例。如果您正苦于以下问题:PHP get_comment_ID函数的具体用法?PHP get_comment_ID怎么用?PHP get_comment_ID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_comment_ID函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: comment
protected function comment($comment, $depth, $args)
{
// разметка каждого комментария, без закрывающего </li>!
$classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : '');
// берем стандартные классы комментария и если коммент пренадлежит автору поста добавляем класс author-comment
echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n";
// родительский тэг комментария с классами выше и уникальным id
echo '<div id="comment-' . get_comment_ID() . '">' . "\n";
// элемент с таким id нужен для якорных ссылок на коммент
echo get_avatar($comment, 64) . "\n";
// покажем аватар с размером 64х64
echo '<p class="meta">Автор: ' . get_comment_author() . "\n";
// имя автора коммента
//echo ' '.get_comment_author_email(); // email автора коммента
echo ' ' . get_comment_author_url();
// url автора коммента
echo ' <br>Добавлено ' . get_comment_date('F j, Y') . ' в ' . get_comment_time() . "\n";
// дата и время комментирования
if ('0' == $comment->comment_approved) {
echo '<em class="comment-awaiting-moderation">Ваш комментарий будет опубликован после проверки модератором.</em>' . "\n";
}
// если комментарий должен пройти проверку
comment_text() . "\n";
// текст коммента
$reply_link_args = array('depth' => $depth, 'reply_text' => 'Ответить', 'login_text' => 'Вы должны быть залогинены');
echo get_comment_reply_link(array_merge($args, $reply_link_args));
// выводим ссылку ответить
echo '</div>' . "\n";
// закрываем див
}
开发者ID:Ivan26ru,项目名称:gp-wp,代码行数:30,代码来源:functions.php
示例2: start_el
function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0)
{
$depth++;
$GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment;
if (!empty($args['callback'])) {
call_user_func($args['callback'], $comment, $args, $depth);
return;
}
extract($args, EXTR_SKIP);
?>
<li id="comment-<?php
comment_ID();
?>
" <?php
comment_class('media comment-' . get_comment_ID());
?>
>
<?php
//include(locate_template('view/loop/comment.php'));
?>
<?php
include locate_template('comment.php');
?>
<?php
}
开发者ID:riesurya,项目名称:DeVioPlayground,代码行数:27,代码来源:DeVioPlaygroundPro_Main_Functions.php
示例3: check_follow
function check_follow($matches)
{
#support of "meta=follow" option for admins. disabled by default to minify processing.
if (!$this->options['dont_mask_admin_follow']) {
return false;
}
$id = array(get_comment_ID(), get_the_ID());
//it is either page or post
if ($id[0]) {
$this->debug_info('It is a comment. id ' . $id[0]);
} elseif ($id[1]) {
$this->debug_info('It is a page. id ' . $id[1]);
}
$author = false;
if ($id[0]) {
$author = get_comment_author($id[0]);
} else {
if ($id[1]) {
$author = get_the_author_meta('ID');
}
}
if (!$author) {
$this->debug_info('it is neither post or page, applying usual rules');
} elseif (user_can($author, 'manage_options') && (stripos($matches[0], 'rel="follow"') !== FALSE || stripos($matches[0], "rel='follow'") !== FALSE)) {
$this->debug_info('This link has a follow atribute and is posted by admin, not masking it.');
#wordpress adds rel="nofollow" by itself when posting new link in comments. get rid of it! Also, remove our follow attibute - it is unneccesary.
return str_ireplace(array('rel="follow"', "rel='follow'", 'rel="nofollow"'), '', $matches[0]);
} else {
$this->debug_info('it does not have rel follow or is not posted by admin, masking it');
}
return false;
}
开发者ID:Hevix,项目名称:hevix,代码行数:32,代码来源:wp-noexternallinks-parser.php
示例4: comment
protected function comment($comment, $depth, $args)
{
// each comment markup, without </li>!
$classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : '');
// get typical wp comment classes and if comment belong post autor add "author-comment" class
echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n";
// parent tag with classes and uniq id
echo '<div id="comment-' . get_comment_ID() . '">' . "\n";
// anchor element with this id need to anchor links on comments works
echo get_avatar($comment, 64) . "\n";
// show avatar with size 64x64 px
echo '<p class="meta">Posted by: ' . get_comment_author() . "\n";
// comment autor name
echo ' ' . get_comment_author_email();
// comment autor email
echo ' ' . get_comment_author_url();
// comment autor url
echo ' On ' . get_comment_date('F j, Y') . ' at ' . get_comment_time() . '</p>' . "\n";
// date and time of comment creating
if ('0' == $comment->comment_approved) {
echo '<em class="comment-awaiting-moderation">Your comment is awaiting moderation</em>' . "\n";
}
// if comment is not approved notify of it
comment_text() . "\n";
// display comment text
$reply_link_args = array('depth' => $depth, 'reply_text' => 'Reply on it', 'login_text' => 'You must be logged to post comments');
echo get_comment_reply_link(array_merge($args, $reply_link_args));
// display reply link
echo '</div>' . "\n";
// anchor element end
}
开发者ID:seredniy,项目名称:clean-wp-template,代码行数:31,代码来源:functions.php
示例5: dsq_render_single_comment
function dsq_render_single_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li id="dsq-comment-<?php
echo (int) get_comment_ID();
?>
">
<div id="dsq-comment-header-<?php
echo (int) get_comment_ID();
?>
" class="dsq-comment-header">
<cite id="dsq-cite-<?php
echo (int) get_comment_ID();
?>
">
<?php
if (comment_author_url()) {
?>
<a id="dsq-author-user-<?php
echo (int) get_comment_ID();
?>
" href="<?php
echo esc_url(get_comment_author_url());
?>
" target="_blank" rel="nofollow"><?php
echo esc_html(get_comment_author());
?>
</a>
<?php
} else {
?>
<span id="dsq-author-user-<?php
echo (int) get_comment_ID();
?>
"><?php
echo esc_html(get_comment_author());
?>
</span>
<?php
}
?>
</cite>
</div>
<div id="dsq-comment-body-<?php
echo (int) get_comment_ID();
?>
" class="dsq-comment-body">
<div id="dsq-comment-message-<?php
echo (int) get_comment_ID();
?>
" class="dsq-comment-message"><?php
wp_filter_kses(comment_text());
?>
</div>
</div>
</li>
<?php
}
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:59,代码来源:comments.php
示例6: render_comment_meta_box
function render_comment_meta_box($post)
{
// create a nonce field
wp_nonce_field('my_comment_meta_box_nonce', 'comment_meta_box_nonce');
$comment_id = get_comment_ID();
?>
<style>
#namediv h3 label {
vertical-align: baseline;
}
#comments-meta table {
width: 100%;
}
#comments-meta td.first {
white-space: nowrap;
width: 10px;
}
#comments-meta input {
width: 98%;
}
#comments-meta p {
margin: 10px 0;
}
</style>
<div class="inside">
<table class="form-table editcomment" id="comments-meta">
<tbody>
<tr>
<td class="first">Párrafo Index:</td>
<td><input type="text" id="parrafo_index" value="<?php
echo comment_get_custom_field('parrafo_index', $comment_id);
?>
" size="30" name="parrafo_index"></td>
</tr>
<tr>
<td class="first">
Tipo de Comentario:</td>
<td><input type="text" id="tipo_comentario" value="<?php
echo comment_get_custom_field('tipo_comentario', $comment_id);
?>
" size="30" name="tipo_comentario"></td>
</tr>
<tr>
<td class="first">
Texto Seleccionado:</td>
<td><input type="text" id="tipo_comentario" value='<?php
echo comment_get_custom_field('highlight_span_info', $comment_id);
?>
' size="30" name="tipo_comentario"></td>
</tr>
</tbody>
</table>
</div>
<?php
}
开发者ID:TeamGobApp,项目名称:gob247,代码行数:59,代码来源:functions-dos.php
示例7: start_el
function start_el(&$output, $comment, $depth, $args, $id = 0)
{
$depth++;
$GLOBALS['comment_depth'] = $depth;
$GLOBALS['comment'] = $comment;
if (!empty($args['callback'])) {
call_user_func($args['callback'], $comment, $args, $depth);
return;
}
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class('media comment-' . get_comment_ID());
?>
>
<?php
echo get_avatar($comment, $size = '64');
?>
<div class="media-body">
<h4 class="media-heading"><?php
echo get_comment_author_link();
?>
</h4>
<time datetime="<?php
echo comment_date('c');
?>
"><a href="<?php
echo htmlspecialchars(get_comment_link($comment->comment_ID));
?>
"><?php
printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time());
?>
</a></time>
<?php
edit_comment_link(__('(Edit)', 'roots'), '', '');
?>
<?php
if ($comment->comment_approved == '0') {
?>
<div class="alert">
<?php
_e('Your comment is awaiting moderation.', 'roots');
?>
</div>
<?php
}
?>
<?php
comment_text();
?>
<?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
<?php
}
开发者ID:rakeshtembhurne,项目名称:roots,代码行数:58,代码来源:comments.php
示例8: thematic_commentmeta
function thematic_commentmeta($print = TRUE)
{
$content = '<div class="comment-meta">' . sprintf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'thematic'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
if (get_edit_comment_link()) {
$content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment'), __('Edit', 'thematic'));
}
$content .= '</div>' . "\n";
return $print ? print apply_filters('thematic_commentmeta', $content) : apply_filters('thematic_commentmeta', $content);
}
开发者ID:StudentLifeMarketingAndDesign,项目名称:krui-wp,代码行数:9,代码来源:discussion-extensions.php
示例9: parse_lists_in_comment
public function parse_lists_in_comment($content, $comment = null)
{
$this->post_ID = '';
$this->comment_ID = get_comment_ID();
$content = wp_kses_post($content);
// we need to this this here because we removed the wp_kses_post filter in o2_Comment_List_Creator __construct
$this->user_can_edit_object = $this->current_user_can_edit_checklist('comment', $this->comment_ID);
return $this->parse_lists($content);
}
开发者ID:BE-Webdesign,项目名称:o2,代码行数:9,代码来源:load.php
示例10: ldc_dislike_counter_c
function ldc_dislike_counter_c($text = "dislikes: ", $post_id = NULL)
{
global $comment;
if (empty($post_id)) {
$post_id = get_comment_ID();
}
$ldc_return = "<span class='ldc-ul_cont' onclick=\"alter_ul_post_values(this,'{$post_id}','c_dislike')\" >" . $text . "<img src=\"" . plugins_url('images/down.png', __FILE__) . "\" />(<span>" . get_post_ul_meta($post_id, "c_dislike") . "</span>)</span>";
return $ldc_return;
}
开发者ID:Omuze,项目名称:barakat,代码行数:9,代码来源:ldclite-function.php
示例11: chaostheory_comment
function chaostheory_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li id="comment-<?php
comment_ID();
?>
" <?php
comment_class();
?>
>
<div id="div-comment-<?php
comment_ID();
?>
">
<ul class="comment-meta">
<li class="comment-author vcard">
<div class="comment-avatar"><?php
if ($args['avatar_size'] != 0) {
echo get_avatar($comment, $args['avatar_size']);
}
?>
</div>
<span class="fn"><?php
comment_author_link();
?>
</span></li>
<?php
printf(__('<li>Posted %1$s at %2$s</li> <li><a href="%3$s" title="Permalink to this comment">Permalink</a></li>', 'chaostheory'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
?>
<li><?php
edit_comment_link(__('(Edit)', 'chaostheory'), ' ', '');
?>
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</li>
</ul>
<div class="comment-content">
<?php
if ($comment->comment_approved == '0') {
?>
<span class="unapproved"><?php
_e('Your comment is awaiting moderation.', 'chaostheory');
?>
</span><?php
}
?>
<?php
comment_text();
?>
</div>
</div>
<?php
}
开发者ID:kevinreilly,项目名称:mendelements.com,代码行数:56,代码来源:functions.php
示例12: start_lvl
function start_lvl(&$output, $depth = 0, $args = array())
{
$GLOBALS['comment_depth'] = $depth + 1;
?>
<!-- <ul <?php
comment_class('media unstyled comment-' . get_comment_ID());
?>
> -->
<?php
}
开发者ID:blueset,项目名称:theme-gn,代码行数:10,代码来源:comments.php
示例13: hmn_cp_the_comment_author_karma
/**
* Displays the author karma.
*/
function hmn_cp_the_comment_author_karma()
{
if (class_exists('CommentPopularity\\HMN_Comment_Popularity')) {
$hmn_cp_obj = CommentPopularity\HMN_Comment_Popularity::get_instance();
$author_karma = $hmn_cp_obj->get_comment_author_karma(get_comment_author_email(get_comment_ID()));
if (isset($author_karma)) {
echo '<small class="user-karma">(User Karma: ' . esc_html($author_karma) . ')</small>';
}
}
}
开发者ID:zakaria340,项目名称:critique,代码行数:13,代码来源:helpers.php
示例14: cleanyetibasic_commentmeta
/**
* Create comment meta
*
* Located in discussion.php
*
* Override: childtheme_override_commentmeta <br>
* Filter: cleanyetibasic_commentmeta
*/
function cleanyetibasic_commentmeta($print = TRUE)
{
$content = '<div class="comment-meta">' . sprintf(_x('Posted %s at %s', 'Posted {$date} at {$time}', 'cleanyetibasic'), get_comment_date(), get_comment_time());
$content .= ' <span class="meta-sep">|</span> ' . sprintf('<a href="%1$s" title="%2$s">%3$s</a>', '#comment-' . get_comment_ID(), __('Permalink to this comment', 'cleanyetibasic'), __('Permalink', 'cleanyetibasic'));
if (get_edit_comment_link()) {
$content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment', 'cleanyetibasic'), __('Edit', 'cleanyetibasic'));
}
$content .= '</div>' . "\n";
return $print ? print apply_filters('cleanyetibasic_commentmeta', $content) : apply_filters('cleanyetibasic_commentmeta', $content);
}
开发者ID:shoaibik,项目名称:clean-yeti-basic,代码行数:18,代码来源:discussion-extensions.php
示例15: remove_post_author_weburl
/**
* Remove post author URL
*
* @since 1.0.0
* @access public
* @return string remove the author's url from comment post
*/
function remove_post_author_weburl($return)
{
global $comment, $post;
if (!is_admin()) {
$author = get_comment_author(get_comment_ID());
return $author;
} else {
return $return;
}
}
开发者ID:nupods,项目名称:provost-web-functionality,代码行数:17,代码来源:class-pw-remove-post-author-url.php
示例16: smittenkitchen_comment_classes
/**
* Adds the custom CSS classes to the comments
*/
function smittenkitchen_comment_classes($classes)
{
if ($sk_madethis = get_comment_meta(get_comment_ID(), 'sk_madethis', true)) {
$classes[] = 'i-made-this';
}
if ($sk_question = get_comment_meta(get_comment_ID(), 'sk_question', true)) {
$classes[] = 'i-have-a-question';
}
return $classes;
}
开发者ID:a8cteam51,项目名称:smittenkitchen,代码行数:13,代码来源:comment-extras.php
示例17: comment_add_at_parent
function comment_add_at_parent($comment_text)
{
$comment_ID = get_comment_ID();
$comment = get_comment($comment_ID);
if ($comment->comment_parent) {
$parent_comment = get_comment($comment->comment_parent);
$comment_text = '<a href="#comment-' . $comment->comment_parent . '">@' . $parent_comment->comment_author . '</a> ' . $comment_text;
}
return $comment_text;
}
开发者ID:alongbao,项目名称:Lion,代码行数:10,代码来源:base.php
示例18: sandbox_comment
function sandbox_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class(sandbox_comment_class(false));
?>
id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
">
<div class="vcard">
<?php
if ($args['avatar_size'] != 0) {
echo get_avatar($comment, $args['avatar_size']);
}
?>
<div class="comment-author fn"><?php
comment_author_link();
?>
</div>
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<span class="unapproved"><?php
_e('Your comment is awaiting moderation.', 'sandbox');
?>
</span><?php
}
?>
<div class="comment-meta">
<?php
printf(__('Posted %1$s at %2$s <span class="metasep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'sandbox'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
?>
<? edit_comment_link(__('(Edit)', 'sandbox'), ' ', ''); ?>
</div>
<?php
comment_text();
?>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
<?php
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:55,代码来源:comments.php
示例19: mo_comments_list
/**
* [mo_comments_list description]
* @param [type] $comment [description]
* @param [type] $args [description]
* @param [type] $depth [description]
* @return [type] [description]
*/
function mo_comments_list($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
global $commentcount, $wpdb, $post;
if (!$commentcount) {
//初始化楼层计数器
$comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = {$post->ID} AND comment_type = '' AND comment_approved = '1' AND !comment_parent");
$cnt = count($comments);
//获取主评论总数量
$page = get_query_var('cpage');
//获取当前评论列表页码
$cpp = get_option('comments_per_page');
//获取每页评论显示数量
if (ceil($cnt / $cpp) == 1 || $page > 1 && $page == ceil($cnt / $cpp)) {
$commentcount = $cnt + 1;
//如果评论只有1页或者是最后一页,初始值为主评论总数
} else {
$commentcount = $cpp * $page + 1;
}
}
echo '<li ';
comment_class();
echo ' id="comment-' . get_comment_ID() . '">';
//楼层
if (!($parent_id = $comment->comment_parent)) {
echo '<span class="comt-f">';
printf('#%1$s', --$commentcount);
echo '</span>';
}
//头像
echo '<div class="comt-avatar">';
echo _get_the_avatar($user_id = $comment->user_id, $user_email = $comment->comment_author_email);
echo '</div>';
//内容
echo '<div class="comt-main" id="div-comment-' . get_comment_ID() . '">';
// echo str_replace(' src=', ' data-src=', convert_smilies(get_comment_text()));
comment_text();
if ($comment->comment_approved == '0') {
echo '<span class="comt-approved">待审核</span>';
}
echo '<div class="comt-meta"><span class="comt-author">' . get_comment_author_link() . '</span>';
echo _get_time_ago($comment->comment_date);
if ($comment->comment_approved !== '0') {
$replyText = get_comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
// echo str_replace(' href', ' href="javascript:;" data-href', $replyText );
if (strstr($replyText, 'reply-login')) {
echo preg_replace('# class="[\\s\\S]*?" href="[\\s\\S]*?"#', ' class="signin-loader" href="javascript:;"', $replyText);
} else {
echo preg_replace('# href=[\\s\\S]*? onclick=#', ' href="javascript:;" onclick=', $replyText);
}
}
echo '</div>';
echo '</div>';
}
开发者ID:yszar,项目名称:linuxwp,代码行数:61,代码来源:mo_comments_list.php
示例20: wpbx_comment
function wpbx_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
$commenter = get_comment_author_link();
if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
$commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
} else {
$commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
}
$avatar_email = get_comment_author_email();
$avatarURL = get_bloginfo('template_directory');
$avatar = str_replace("class='avatar", "class='avatar", get_avatar($avatar_email, 40, $default = $avatarURL . '/images/gravatar-blank.jpg'));
?>
<li <?php
comment_class();
?>
id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
">
<div class="comment-author vcard">
<?php
echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
?>
</div>
<div class="comment-meta">
<?php
printf(__('%1$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'wpbx'), get_comment_date('j M Y', '', '', false), get_comment_time(), '#comment-' . get_comment_ID());
edit_comment_link(__('Edit', 'wpbx'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
?>
<span class="reply-link">
<span class="meta-sep">|</span> <?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</span>
</div>
<?php
if ($comment->comment_approved == '0') {
_e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'wpbx');
}
?>
<div class="comment-content"><?php
comment_text();
?>
</div>
</div>
<?php
}
开发者ID:hqro,项目名称:Rush_WP,代码行数:54,代码来源:functions.php
注:本文中的get_comment_ID函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论