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


PHP get_comment_date函数代码示例

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


在下文中一共展示了get_comment_date函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: commentlist

function commentlist($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
    <li id="li-comment-<?php 
    comment_ID();
    ?>
">
        <div id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class('comment_item clear');
    ?>
>
            <div class="comment_meta">Posted on <?php 
    printf(__('%1$s'), get_comment_date());
    ?>
 by <?php 
    printf(__('<cite class="fn">%s</cite>'), get_comment_author_link());
    ?>
</div>
            <div class="comment_text"><?php 
    comment_text();
    ?>
</div>
        </div>
<?php 
}
开发者ID:bidhanbaral,项目名称:fotodep_store,代码行数:29,代码来源:functions.php

示例2: 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

示例3: sun_comment

    function sun_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>
	<li class="comment" id="li-comment-<?php 
        comment_ID();
        ?>
">
	  <div>
      <?php 
        echo get_avatar($comment, $size = '60');
        ?>
      <div class="comment-meta">
        <span class="author"><?php 
        echo get_comment_author_link();
        ?>
</span>
        <span class="date">on <?php 
        echo get_comment_date() . ' ' . get_comment_time();
        ?>
</span>
        <span class="reply"><?php 
        comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
</span>
      </div>
      <div class="comment-body">
        <?php 
        comment_text();
        ?>
      </div>
<?php 
    }
开发者ID:ekudriashov,项目名称:sun-theme,代码行数:33,代码来源:comments-callback.php

示例4: sandbox_ping

function sandbox_ping($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
<li <?php 
    comment_class(sandbox_comment_class(false));
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
	<div class="comment-metadata">
		<?php 
    printf(__('By %1$s on %2$s at %3$s', 'sandbox'), get_comment_author_link(), get_comment_date(), get_comment_time());
    ?>
		<?php 
    edit_comment_link(__('(Edit)', 'sandbox'), ' ', '');
    ?>
	</div>
	<div class="comment-mod"><?php 
    if ($comment->comment_approved == '0') {
        _e('<em>Your trackback/pingback is awaiting moderation.</em>', 'sandbox');
    }
    ?>
</div>
	<?php 
    comment_text();
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:29,代码来源:comments.php

示例5: show_comment

function show_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>

  <li <?php 
    comment_class();
    ?>
 >
    <div class="avatar">
      <?php 
    echo get_avatar($comment, 70, $default = 'mystery');
    ?>
    </div>
    <div class="author">
      <?php 
    echo get_comment_author_link();
    ?>
    </div>
    <div class="comment-meta">
      <?php 
    printf('%1$s — %2$s', get_comment_date(), get_comment_time());
    ?>
    </div>
    <?php 
    comment_text();
    ?>
    <div class="reply">
      <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </div>
  </li>
<?php 
}
开发者ID:sfedorenko,项目名称:geekhub_frontend,代码行数:35,代码来源:comments.php

示例6: studiofolio_comment

<?php function studiofolio_comment($comment, $args, $depth) {
  $GLOBALS['comment'] = $comment; ?>
  <li <?php comment_class(); ?>>
    <article id="comment-<?php comment_ID(); ?>">
      <header class="comment-author vcard">
        <?php echo get_avatar($comment, $size = '32'); ?>
        <?php printf(__('<cite class="fn">%s</cite>', 'studiofolio'), get_comment_author_link()); ?>
        <time datetime="<?php echo comment_date('c'); ?>"><a href="<?php echo htmlspecialchars(get_comment_link($comment->comment_ID)); ?>"><?php printf(__('%1$s', 'studiofolio'), get_comment_date(),  get_comment_time()); ?></a></time>
        <?php edit_comment_link(__('(Edit)', 'studiofolio'), '', ''); ?>
      </header>

      <?php if ($comment->comment_approved == '0') : ?>
        <div class="alert alert-block fade in">
          <a class="close" data-dismiss="alert">&times;</a>
          <p><?php _e('Your comment is awaiting moderation.', 'studiofolio'); ?></p>
        </div>
      <?php endif; ?>

      <section class="comment">
        <?php comment_text() ?>
      </section>

      <?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth']))); ?>

    </article>
<?php } ?>
开发者ID:jackmachin,项目名称:bayer,代码行数:26,代码来源:comments.php

示例7: widget_lmee_by_talk

 function widget_lmee_by_talk($args)
 {
     extract($args);
     echo $before_widget;
     $lmee_popular_options = get_option('widget_lmee_popular');
     $title = '灌水区-这里很热闹';
     //设置默认的标题
     echo $before_title . $title . $after_title;
     $page_ID = 789;
     //用来作为公告栏的页面或者文章id
     $num = 5;
     //显示公告的条数
     echo '<ul class="by_talk">';
     $announcement = '';
     $comments = get_comments("number={$num}&post_id={$page_ID}");
     if (!empty($comments)) {
         $flg = 1;
         foreach ($comments as $comment) {
             if ($flg == 1) {
                 $li_title = $comment->comment_content;
                 if (similar_text($li_title, "<") > 0) {
                     //echo "is";
                     $start = stripos($li_title, "<");
                     //从前往后查找
                     $__li_title = strrev($li_title);
                     //反转字符串
                     $length = strlen($li_title) - $start - stripos($__li_title, ">");
                     $_li_title = substr_replace($li_title, "含引用", $start, $length);
                     $_li_html = substr_replace($li_title, "", $start, $length);
                     $announcement .= '<li class="by-talk-first"><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $_li_title . '" rel="nofollow" target="_blank">' . $_li_html . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 } else {
                     //echo "un";
                     $announcement .= '<li class="by-talk-first"><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $li_title . '" rel="nofollow" target="_blank">' . convert_smilies($comment->comment_content) . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 }
                 $flg++;
             } else {
                 $li_title = $comment->comment_content;
                 if (similar_text($li_title, "<") > 0) {
                     //echo "is";
                     $start = stripos($li_title, "<");
                     //从前往后查找
                     $__li_title = strrev($li_title);
                     //反转字符串
                     $length = strlen($li_title) - $start - stripos($__li_title, ">");
                     $_li_title = substr_replace($li_title, "含引用", $start, $length);
                     $_li_html = substr_replace($li_title, "", $start, $length);
                     $announcement .= '<li><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $_li_title . '" rel="nofollow" target="_blank">' . $_li_html . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 } else {
                     //echo "un";
                     $announcement .= '<li><a href="' . get_page_link($page_ID) . '#comment-' . $comment->comment_ID . '" title="' . $li_title . '" rel="nofollow" target="_blank">' . convert_smilies($comment->comment_content) . '</a><br /><span style="color:#999;text-align:right;">(' . get_comment_date('Y/m/d H:i', $comment->comment_ID) . ')</span></li><hr />';
                 }
             }
         }
     }
     //if ( empty($announcement) ) $announcement = '<li>还没有人灌水奥!</li>';
     echo $announcement;
     echo '</ul>';
     echo "<p style='text-align:right;'>[<a href='" . get_page_link($page_ID) . "#respond' rel='nofollow'>说两句</a>]</p>";
     echo $after_widget;
 }
开发者ID:uglmee,项目名称:kikiku.com,代码行数:60,代码来源:By-talk-for-lmee.php

示例8: et_custom_comments_display

    function et_custom_comments_display($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>
   <li <?php 
        comment_class();
        ?>
 id="li-comment-<?php 
        comment_ID();
        ?>
">
	   <div id="comment-<?php 
        comment_ID();
        ?>
" class="comment-body clearfix">			
			<div class="avatar-container">
				<?php 
        echo get_avatar($comment, $size = '56');
        ?>
				<span class="avatar-overlay"></span>
			</div> <!-- end .avatar-->
			
			<div class="comment-wrap clearfix">
				<div class="comment-meta commentmetadata"><?php 
        printf('<span class="fn">%s</span>', get_comment_author_link());
        ?>
 - <span class="comment-date"><?php 
        echo get_comment_date();
        ?>
</span> <?php 
        edit_comment_link(esc_html__('(Edit)', 'Modest'), '  ', '');
        ?>
</div>
				
				<?php 
        if ($comment->comment_approved == '0') {
            ?>
					<em class="moderation"><?php 
            esc_html_e('Your comment is awaiting moderation.', 'Modest');
            ?>
</em>
					<br />
				<?php 
        }
        ?>
				
				<div class="comment-content"><?php 
        comment_text();
        ?>
</div> <!-- end comment-content-->
				<?php 
        $et_comment_reply_link = get_comment_reply_link(array_merge($args, array('reply_text' => esc_attr__('Reply', 'Modest'), 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        if ($et_comment_reply_link) {
            echo '<div class="reply-container">' . $et_comment_reply_link . '</div>';
        }
        ?>
			</div> <!-- end comment-wrap-->
		</div> <!-- end comment-body-->	
<?php 
    }
开发者ID:nxtclass,项目名称:NXTClass-themes,代码行数:60,代码来源:comments.php

示例9: 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-author vcard">
                <?php echo get_avatar($comment, $size = '48', $default = '<path_to_url>'); ?>
            </div>
            
        <?php if ($comment->comment_approved == '0') : ?>
                <em><?php _e('Your comment is awaiting moderation.') ?></em>
                <br />
        <?php endif; ?>

                <div class="comment-meta commentmetadata">
                    <p class="comment_autor">
                        <?php printf(__('%s'), get_comment_author_link()) ?>
                    </p>
                    <p class="comment_date">
                        <?php printf(__('%1$s - %2$s'), get_comment_date('M j, Y'), get_comment_time()) ?>
                    </p>
                </div>
                
                <div class="comment_contet">
                    <?php comment_text() ?>

                       <?php edit_comment_link('editar', '<div class="editar reply">', '</div>'); ?>
                </div>

                 
        </div>
    </li>
    <?php
            }
开发者ID:rodolfospalenza,项目名称:blogrs,代码行数:35,代码来源:functions.php

示例10: convert

 function convert($comment, $thumb = 'thumbnail', $merge_post = false, $merge_author = false)
 {
     $date_format = get_option('date_format');
     $time_format = get_option('time_format');
     /**
      * add comment meta
      */
     if (!empty($this->meta)) {
         foreach ($this->meta as $key => $value) {
             $comment->{$value} = get_comment_meta($comment->comment_ID, $value, true);
         }
     }
     $comment->comment_content = wpautop(esc_attr($comment->comment_content));
     // comment link
     $comment->comment_link = get_permalink($comment->comment_post_ID);
     $comment->ID = $comment->comment_ID;
     $comment->id = $comment->comment_ID;
     $comment->avatar = get_avatar($comment->user_id, '33');
     unset($comment->comment_author_email);
     $comment->message_time = sprintf(__('on %s', 'messages-backend'), get_comment_date($date_format, $comment)) . '&nbsp;' . sprintf(__('at %s', 'messages-backend'), get_comment_date($time_format, $comment));
     $file_arr = get_comment_meta($comment->comment_ID, 'fre_comment_file', true);
     $comment->file_list = '';
     if (!empty($file_arr)) {
         $attachment = get_posts(array('post_type' => 'attachment', 'post__in' => $file_arr));
         ob_start();
         echo '<ul class="list-file-attack">';
         foreach ($attachment as $key => $file) {
             echo '<li><a target="_blank" href="' . $file->guid . '" class="attack-file"><i class="fa fa-paperclip"></i> ' . $file->post_title . '</a></li>';
         }
         echo '</ul>';
         $message_file = ob_get_clean();
         $comment->file_list = $message_file;
     }
     return $comment;
 }
开发者ID:linniepinski,项目名称:perssistant,代码行数:35,代码来源:messages.php

示例11: franz_comment_meta

/**
 * Comment meta
 */
function franz_comment_meta($comment)
{
    global $post;
    $meta = array();
    $meta['attr'] = array('class' => 'comment-attr', 'meta' => sprintf(__('%1$s on %2$s at %3$s', 'franz-josef'), '<span class="comment-author">' . franz_comment_author_link($comment->user_id) . '</span>', '<span class="comment-date">' . get_comment_date(), get_comment_time() . '</span>'));
    if ($comment->user_id === $post->post_author) {
        $meta['author'] = array('class' => 'author-cred label', 'meta' => __('Author', 'franz-josef'));
    }
    $meta = apply_filters('franz_comment_meta', $meta);
    if (!$meta) {
        return;
    }
    ?>
    <ul class="comment-meta col-md-9 col-xs-12">
        <?php 
    foreach ($meta as $item) {
        ?>
        <li class="<?php 
        echo esc_attr($item['class']);
        ?>
"><?php 
        echo $item['meta'];
        ?>
</li>
        <?php 
    }
    ?>
    </ul>
    <?php 
}
开发者ID:ravitechrlabs,项目名称:wordpress,代码行数:33,代码来源:comments.php

示例12: sandbox_10_ping

function sandbox_10_ping($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
<li <?php 
    comment_class(sandbox_comment_class(false));
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
	<div class="comment-author"><?php 
    printf(__('By %1$s on %2$s at %3$s', 'sandbox'), get_comment_author_link(), get_comment_date(), get_comment_time());
    edit_comment_link(__('Edit', 'sandbox'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
</div>
<?php 
    if ($comment->comment_approved == '0') {
        _e('\\t\\t\\t\\t\\t<span class="unapproved">Your trackback is awaiting moderation.</span>\\n', 'sandbox');
    }
    ?>
	<?php 
    comment_text();
}
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:25,代码来源:comments.php

示例13: garland_comment

function garland_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
<li <?php 
    comment_class(empty($args['has_children']) ? '' : 'parent');
    ?>
id="comment-<?php 
    comment_ID();
    ?>
">
	<div id="div-comment-<?php 
    comment_ID();
    ?>
">
	<span class="comment-author vcard">
	<?php 
    if ($args['avatar_size'] != 0) {
        echo get_avatar($comment, $args['avatar_size']);
    }
    ?>
	<?php 
    printf(__('<cite class="fn">%s</cite> Says:', 'kubrick'), get_comment_author_link());
    ?>
	</span>
	<?php 
    if ($comment->comment_approved == '0') {
        ?>
	<em><?php 
        _e('Your comment is awaiting moderation.', 'kubrick');
        ?>
</em>
	<?php 
    }
    ?>
	<br />

	<small class="comment-meta commentmetadata"><a href="#comment-<?php 
    comment_ID();
    ?>
" title=""><?php 
    printf(__('%1$s at %2$s', 'kubrick'), get_comment_date(), get_comment_time());
    ?>
</a> <?php 
    edit_comment_link(__('edit', 'kubrick'), '&nbsp;&nbsp;', '');
    ?>
</small>

	<?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,代码行数:60,代码来源:comments.php

示例14: jrd_comment

function jrd_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    //print_r($comment);
    /* Check if post is by Author for special styling */
    $isByAuthor = false;
    if ($comment->comment_author_email == get_the_author_meta('email')) {
        $isByAuthor = true;
    }
    ?>
  

<li class="clearfix">
    <div class="author">
        <h6><?php 
    echo $comment->comment_author;
    ?>
</h6>
        <p class="timestamp"><?php 
    printf(__('%1$s at %2$s'), get_comment_date('n/j/Y'), get_comment_time('g:ia'));
    ?>
</p>
    </div>
    <div class="commenttext">
        <?php 
    comment_text();
    ?>
    </div>
</li>

<?php 
}
开发者ID:jackrabbit-design,项目名称:itg,代码行数:32,代码来源:functions-comments.php

示例15: thematic_pings

function thematic_pings($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
    		<li id="comment-<?php 
    comment_ID();
    ?>
" class="<?php 
    thematic_comment_class();
    ?>
">
    			<div class="comment-author"><?php 
    printf(__('By %1$s on %2$s at %3$s', 'thematic'), get_comment_author_link(), get_comment_date(), get_comment_time());
    edit_comment_link(__('Edit', 'thematic'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
</div>
    <?php 
    if ($comment->comment_approved == '0') {
        _e('\\t\\t\\t\\t\\t<span class="unapproved">Your trackback is awaiting moderation.</span>\\n', 'thematic');
    }
    ?>
            <div class="comment-content">
    			<?php 
    comment_text();
    ?>
			</div>
<?php 
}
开发者ID:StudentLifeMarketingAndDesign,项目名称:krui-wp,代码行数:28,代码来源:discussion.php


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