• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_comment_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: emailSender

 /**
  * send email
  */
 public function emailSender($email_data, $wc_new_comment_id, $subject, $message)
 {
     global $wp_rewrite;
     $comment = get_comment($wc_new_comment_id);
     $curr_post = get_post($comment->comment_post_ID);
     $curr_post_author = get_userdata($curr_post->post_author);
     if ($email_data['email'] == $curr_post_author->user_email) {
         if (get_option('moderation_notify') && !$comment->comment_approved) {
             return;
         } else {
             if (get_option('comments_notify') && $comment->comment_approved) {
                 return;
             }
         }
     }
     $wc_new_comment_content = $comment->comment_content;
     $permalink = get_comment_link($wc_new_comment_id);
     $unsubscribe_url = !$wp_rewrite->using_permalinks() ? get_permalink($comment->comment_post_ID) . "&" : get_permalink($comment->comment_post_ID) . "?";
     $unsubscribe_url .= "subscribeAnchor&wpdiscuzSubscribeID=" . $email_data['id'] . "&key=" . $email_data['activation_key'] . '&#wc_unsubscribe_message';
     $message .= "<br/><br/><a href='{$permalink}'>{$permalink}</a>";
     $message .= "<br/><br/>{$wc_new_comment_content}";
     $message .= "<br/><br/><a href='{$unsubscribe_url}'>" . $this->optionsSerialized->phrases['wc_unsubscribe'] . "</a>";
     $headers = array();
     $content_type = apply_filters('wp_mail_content_type', 'text/html');
     $from_name = apply_filters('wp_mail_from_name', get_option('blogname'));
     $from_email = apply_filters('wp_mail_from', get_option('admin_email'));
     $headers[] = "Content-Type:  {$content_type}; charset=UTF-8";
     $headers[] = "From: " . $from_name . " <" . $from_email . "> \r\n";
     wp_mail($email_data['email'], $subject, $message, $headers);
 }
开发者ID:tuanlibra,项目名称:thptxuanang,代码行数:33,代码来源:class.WpdiscuzEmailHelper.php


示例2: zws_comment_mail_notify

/**
 * WordPress评论回复邮件提醒防垃圾评论版
 * 作者:露兜
 * 博客:http://www.ludou.org/
 */
function zws_comment_mail_notify($comment_id, $comment_status)
{
    // 评论必须经过审核才会发送通知邮件
    if ($comment_status !== 'approve' && $comment_status !== 1) {
        return;
    }
    $comment = get_comment($comment_id);
    if ($comment->comment_parent != '0') {
        $parent_comment = get_comment($comment->comment_parent);
        // 邮件接收者email
        $to = trim($parent_comment->comment_author_email);
        // 邮件标题
        $subject = '您收到来自[' . get_option("blogname") . ']的动态消息';
        // 邮件内容,自行修改,支持HTML
        $message = '
<div style="border:1px solid #AAAAAA;background:#f5f5f5;line-height:35px;padding:20px;border-radius:8px;font-size: 14px;width:600px;margin:0 auto;">
      <h2 style="background:#52b8cb;color:#f5f5f5;font-size:16px;line-height:20px;text-shadow:1px 1px 5px #b1b1b1;font-weight:normal;padding:10px;">您在 <font style="font-weight:700;"> ' . get_option('blogname') . '</font> 的评论有新回复啦!</h2>
      <p><font color="#52b8cb">' . $parent_comment->comment_author . '</font> 童鞋,你曾经在《' . get_the_title($comment->comment_post_ID) . '》留言说:</p> 
      <p style="background-color: #DDD;padding:5px 8px;margin:5px 15px;text-indent:2em;">' . $parent_comment->comment_content . '</p> 
      <p><font color="#52b8cb">' . $comment->comment_author . '</font> 给你的回应是:</p> 
      <p style="background-color: #DDD;padding:5px 8px;margin:5px 15px;text-indent:2em;">' . $comment->comment_content . '</p> 
      <p>猛击这里:<a href="' . htmlspecialchars(get_comment_link($comment->comment_parent)) . '"><font color="#52b8cb">查看完整评论</font></a>, 欢迎再次访问<a href="' . home_url() . '"><font color="#52b8cb">' . get_option('blogname') . '</font></a></p>
      <p>(此邮件由系统自动发送,请勿回复)</p> 
    </div>';
        $message_headers = "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n";
        // 不用给不填email的评论者和管理员发提醒邮件
        if ($to != '' && $to != get_bloginfo('admin_email')) {
            @wp_mail($to, $subject, $message, $message_headers);
        }
    }
}
开发者ID:nooldey,项目名称:WordPress-theme-BooDing,代码行数:36,代码来源:mailnotify.php


示例3: reverie_comments

function reverie_comments($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 = '40');
    ?>
				<?php 
    printf(__('<cite class="fn">%s</cite>', 'reverie'), 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', 'reverie'), get_comment_date(), get_comment_time());
    ?>
</a></time>
				<?php 
    edit_comment_link(__('(Edit)', 'reverie'), '', '');
    ?>
			</header>
			
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
       			<div class="notice">
					<p class="bottom"><?php 
        _e('Your comment is awaiting moderation.', 'reverie');
        ?>
</p>
          		</div>
			<?php 
    }
    ?>
			
			<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:Paulf-999,项目名称:HollyFry.com,代码行数:60,代码来源:comments.php


示例4: widget

 /**
  * widget function.
  *
  * @see WP_Widget
  *
  * @param array $args
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     global $comments, $comment;
     if ($this->get_cached_widget($args)) {
         return;
     }
     ob_start();
     $number = !empty($instance['number']) ? absint($instance['number']) : $this->settings['number']['std'];
     $comments = get_comments(array('number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product'));
     if ($comments) {
         $this->widget_start($args, $instance);
         echo '<ul class="product_list_widget">';
         foreach ((array) $comments as $comment) {
             $_product = wc_get_product($comment->comment_post_ID);
             $rating = intval(get_comment_meta($comment->comment_ID, 'rating', true));
             $rating_html = $_product->get_rating_html($rating);
             echo '<li><a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">';
             echo $_product->get_image();
             echo $_product->get_title() . '</a>';
             echo $rating_html;
             printf('<span class="reviewer">' . _x('by %1$s', 'by comment author', 'woocommerce') . '</span>', get_comment_author());
             echo '</li>';
         }
         echo '</ul>';
         $this->widget_end($args);
     }
     $content = ob_get_clean();
     echo $content;
     $this->cache_widget($args, $content);
 }
开发者ID:bitoncoin,项目名称:woocommerce,代码行数:38,代码来源:class-wc-widget-recent-reviews.php


示例5: widget

 function widget($args, $instance)
 {
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = $this->id;
     }
     $output = '';
     $title = !empty($instance['title']) ? $instance['title'] : __('Recent Comments');
     $title = apply_filters('widget_title', $title, $instance, $this->id_base);
     $number = !empty($instance['number']) ? absint($instance['number']) : 5;
     if (!$number) {
         $number = 5;
     }
     $comments = get_comments(apply_filters('widget_comments_args', array('number' => $number, 'status' => 'approve', 'post_status' => 'publish')));
     $output .= $args['before_widget'];
     if ($title) {
         $output .= $args['before_title'] . $title . $args['after_title'];
     }
     $output .= '<ul id="recentcomments">';
     if (is_array($comments) && $comments) {
         $post_ids = array_unique(wp_list_pluck($comments, 'comment_post_ID'));
         _prime_post_caches($post_ids, strpos(get_option('permalink_structure'), '%category%'), false);
         foreach ((array) $comments as $comment) {
             $title = get_the_title($comment->comment_post_ID);
             $output .= '<li class="recentcomments"><i class="fa fa-comments">&nbsp;</i> ';
             $output .= sprintf(_x('%1$s on %2$s', 'widgets'), '<span class="comment-author-link"><strong> ' . get_comment_author_link($comment) . '</strong></span>', '<br><a href="' . esc_url(get_comment_link($comment)) . '">' . $title . '</a>');
             $output .= '</li>';
         }
     }
     $output .= '</ul>';
     $output .= $args['after_widget'];
     echo $output;
 }
开发者ID:de190909,项目名称:WPTest,代码行数:32,代码来源:class-extend-recent-comments-widget.php


示例6: widget

 /**
  * widget function.
  *
  * @see WP_Widget
  * @access public
  * @param array $args
  * @param array $instance
  * @return void
  */
 public function widget($args, $instance)
 {
     global $comments, $comment, $woocommerce;
     if ($this->get_cached_widget($args)) {
         return;
     }
     ob_start();
     extract($args);
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     $number = absint($instance['number']);
     $comments = get_comments(array('number' => $number, 'status' => 'approve', 'post_status' => 'publish', 'post_type' => 'product'));
     if ($comments) {
         echo $before_widget;
         if ($title) {
             echo $before_title . $title . $after_title;
         }
         echo '<ul class="product_list_widget">';
         foreach ((array) $comments as $comment) {
             $_product = get_product($comment->comment_post_ID);
             $rating = intval(get_comment_meta($comment->comment_ID, 'rating', true));
             $rating_html = $_product->get_rating_html($rating);
             echo '<li><a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">';
             echo $_product->get_image();
             echo $_product->get_title() . '</a>';
             echo $rating_html;
             printf('<span class="reviewer">' . _x('by %1$s', 'by comment author', 'woocommerce') . '</span>', get_comment_author());
             echo '</li>';
         }
         echo '</ul>';
         echo $after_widget;
     }
     $content = ob_get_clean();
     echo $content;
     $this->cache_widget($args, $content);
 }
开发者ID:chhavinav,项目名称:fr.ilovejuice,代码行数:44,代码来源:class-wc-widget-recent-reviews.php


示例7: geo_mashup_comment_default

/**
 * Template callback for GeoMashupQuery::list_comments()
 *
 * Use the newer form of template, where the individual comment template goes in 
 * a function that matches the callback argument to list_comments
 *
 * @since 1.3
 * @access public
 * @package GeoMashup
 *
 * @param object $comment The comment to display
 * @param array $args Arguments from wp_list_comments
 * @param mixed $depth Nested depth
 */
function geo_mashup_comment_default($comment, $args, $depth)
{
    // Enable the WordPress comment functions
    GeoMashupQuery::set_the_comment($comment);
    // From here to the closing curly brace should look like a familiar template
    ?>
	<div id="div-comment-<?php 
    comment_ID();
    ?>
" class="<?php 
    comment_class('');
    ?>
">
		<div class="comment-author vcard">
		<?php 
    printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link());
    ?>
		</div>
		<div class="comment-meta commentmetadata">
			<a href="<?php 
    echo esc_html(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
    ?>
</a>
		</div>
		<?php 
    comment_text();
    ?>

	</div>
<?php 
}
开发者ID:amgxyz,项目名称:interactive-geo-trail-map,代码行数:48,代码来源:comment.php


示例8: trigger

 /**
  * trigger function.
  *
  * @access public
  * @return void
  */
 function trigger($comment, $message)
 {
     global $woothemes_sensei, $sensei_email_data;
     $this->comment = $comment;
     $this->message = $message;
     $this->commenter = get_userdata($comment->user_id);
     $original_sender = get_post_meta($this->message->ID, '_sender', true);
     $this->original_sender = get_user_by('login', $original_sender);
     $original_receiver = get_post_meta($this->message->ID, '_receiver', true);
     $this->original_receiver = get_user_by('login', $original_receiver);
     $content_type = get_post_meta($this->message->ID, '_posttype', true);
     $content_id = get_post_meta($this->message->ID, '_post', true);
     $content_title = get_the_title($content_id);
     $comment_link = get_comment_link($comment);
     // Construct data array
     $sensei_email_data = apply_filters('sensei_email_data', array('template' => $this->template, 'heading' => $this->heading, 'commenter_name' => $this->commenter->display_name, 'message' => $this->comment->comment_content, 'comment_link' => $comment_link, 'content_title' => $content_title, 'content_type' => $content_type), $this->template);
     // Set recipient
     if ($this->commenter->user_login == $original_sender) {
         $this->recipient = stripslashes($this->original_receiver->user_email);
     } else {
         $this->recipient = stripslashes($this->original_sender->user_email);
     }
     // Send mail
     $woothemes_sensei->emails->send($this->recipient, $this->subject, $woothemes_sensei->emails->get_content($this->template));
 }
开发者ID:AlecBeltrami,项目名称:sensei,代码行数:31,代码来源:class-woothemes-sensei-email-new-message-reply.php


示例9: efreetant_comments

function efreetant_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
  <div id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class('comment');
    ?>
>
    <article  class="comment">
      <header class="comment-author">
        <?php 
    $bgauthemail = get_comment_author_email();
    ?>
        <img data-gravatar="http://www.gravatar.com/avatar/<?php 
    echo md5($bgauthemail);
    ?>
?s=40" class="avatar" height="40" width="40" src="<?php 
    echo get_template_directory_uri();
    ?>
/images/nothing.gif" />
        <?php 
    printf(__('<cite class="fn">%1$s</cite> %2$s', 'efreetanttheme'), get_comment_author_link(), edit_comment_link(__('(Edit)', 'efreetanttheme'), '  ', ''));
    ?>
        <time datetime="<?php 
    echo comment_time('Y-m-j');
    ?>
"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    comment_time(__('F jS, Y', 'efreetanttheme'));
    ?>
 </a></time>
     </header>
      <?php 
    if ($comment->comment_approved == '0') {
        ?>
        <div class="alert alert-info">
          <p><?php 
        _e('Your comment is awaiting moderation.', 'efreetanttheme');
        ?>
</p>
        </div>
      <?php 
    }
    ?>
      <section class="comment_content">
        <?php 
    comment_text();
    ?>
      </section>
      <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
    </article>
<?php 
}
开发者ID:efreetant,项目名称:stellar,代码行数:60,代码来源:functions.php


示例10: stormbringer_comments

function stormbringer_comments($comment, $args, $depth) {
  $GLOBALS['comment'] = $comment; ?>
	<li <?php comment_class('media'); ?>>
    <div class="pull-left">
      <div class="comment-avatar vcard">
        <?php echo get_avatar($comment,apply_filters('stormbringer_author_bio_avatar_size', 100) ); ?>
      </div>
    </div>
    <!-- /.comment-avatar -->
    <div class="media-body">
      <div class="comment-message">
        <?php printf(__('<h4 class="media-heading">%s</h4>','stormbringer'), get_comment_author_link()) ?>
        <?php edit_comment_link(__('Edit','stormbringer'),'<span class="edit-comment btn btn-info"><span class="glyphicon glyphicon-pencil"></span>','</span>') ?>

        <?php if ($comment->comment_approved == '0') : ?>
          <div class="alert-message success">
            <p><?php _e('Your comment is awaiting moderation.','stormbringer') ?></p>
          </div>
        <?php endif; ?>

        <?php comment_text() ?>

        <time datetime="<?php echo comment_time('c'); ?>"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><?php comment_time(esc_attr__( 'F j, Y', 'stormbringer' )); ?> <?php _e('at', 'stormbringer'); ?> <?php comment_time(esc_attr__( 'H:i', 'stormbringer' )); ?> </a></time>

      </div>
    </div>
    <!-- /.comment-message	-->

    <!-- </li> is added by wordpress automatically -->
<?php
}
开发者ID:nicomollet,项目名称:stormbringer,代码行数:31,代码来源:comments.php


示例11: test_default_comments_page_oldest_last_page_should_have_cpage

 /**
  * @ticket 34068
  */
 public function test_default_comments_page_oldest_last_page_should_have_cpage()
 {
     update_option('default_comments_page', 'oldest');
     update_option('comments_per_page', 2);
     $found = get_comment_link($this->comments[1]);
     $this->assertContains('cpage=3', $found);
 }
开发者ID:rclilly,项目名称:wordpress-develop,代码行数:10,代码来源:getCommentLink.php


示例12: column_comment

    /**
     * Custom column to output info on the comment the feedback is attached to
     *
     * @param Object $comment Current comment
     */
    public function column_comment($comment)
    {
        global $comment_status;
        $post = get_post();
        // Feedback comments aren't displayed on the front end individually but as counts on the actual comments so we link to the parent
        $comment_url = esc_url(get_comment_link($comment->comment_parent));
        if ($this->user_can) {
            $del_nonce = esc_html('_wpnonce=' . wp_create_nonce("delete-comment_{$comment->comment_ID}"));
            $approve_nonce = esc_html('_wpnonce=' . wp_create_nonce("approve-comment_{$comment->comment_ID}"));
            $url = "comment.php?c={$comment->comment_ID}";
            $trash_url = esc_url($url . "&action=trashcomment&{$del_nonce}");
        }
        // END if
        echo '<div class="submitted-on">';
        /* translators: 2: comment date, 3: comment time */
        printf(__('Submitted on <a href="%1$s">%2$s at %3$s</a>'), $comment_url, get_comment_date(__('Y/m/d')), get_comment_date(get_option('time_format')));
        echo '</div>';
        comment_text();
        if ($this->user_can) {
            // There's only one valid action for feedback comments
            ?>
			<div class="row-actions">
				<span class="trash">
					<a href="<?php 
            echo esc_url($trash_url);
            ?>
" class="delete vim-d vim-destructive" title="Move this comment to the trash">Trash</a>
				</span>
			</div>
			<?php 
        }
    }
开发者ID:kgneil,项目名称:bsocial-comments,代码行数:37,代码来源:class-bsocial-comments-feedback-table.php


示例13: 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 = '40');
    ?>
			<?php 
    /* printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) */
    ?>
			<cite class="fn"><?php 
    comment_author_link();
    ?>
</cite>
			<span class="comment-meta commentmetadata"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
    ?>
</a><?php 
    edit_comment_link(__('(Edit)'), '  ', '');
    ?>
</span>
			
		</div>
		<?php 
    if ($comment->comment_approved == '0') {
        ?>
		<em class="approved"><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
		<br />
		<?php 
    }
    ?>
		<?php 
    comment_text();
    ?>
		<div class="reply">
			<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
		</div>
	</div>
<?php 
}
开发者ID:normalhh,项目名称:zwwtheme.old,代码行数:60,代码来源:functions.php


示例14: do_search

 /**
  * The search function
  *
  * @return array of results
  */
 protected function do_search()
 {
     global $wpdb;
     $commentsresults = array();
     if (isset($wpdb->base_prefix)) {
         $_prefix = $wpdb->base_prefix;
     } else {
         $_prefix = $wpdb->prefix;
     }
     $options = $this->options;
     $searchData = $this->searchData;
     $s = $this->s;
     $_s = $this->_s;
     if ($options['set_incomments'] && count($_s) > 0) {
         $like = "lower({$wpdb->comments}.comment_content) REGEXP '" . implode('|', $_s) . "'";
         $querystr = "\r\n      \t\tSELECT \r\n            {$wpdb->comments}.comment_ID as id,\r\n            {$wpdb->comments}.comment_post_ID as post_id,\r\n            {$wpdb->comments}.user_id as user_id,\r\n            {$wpdb->comments}.comment_content as content,\r\n            'comment' as content_type,\r\n            {$wpdb->comments}.comment_date as date\r\n      \t\tFROM {$wpdb->comments}\r\n      \t\tWHERE\r\n          ({$wpdb->comments}.comment_approved=1)\r\n          AND\r\n          (" . $like . ")\r\n      \t\tORDER BY {$wpdb->comments}.comment_ID DESC\r\n      \t\tLIMIT " . $searchData['maxresults'];
         //var_dump($querystr);
         $commentsresults = $wpdb->get_results($querystr, OBJECT);
         if (is_array($commentsresults)) {
             foreach ($commentsresults as $k => $v) {
                 $commentsresults[$k]->link = get_comment_link($v->id);
                 $commentsresults[$k]->author = get_comment_author($v->id);
                 $commentsresults[$k]->title = wd_substr_at_word($commentsresults[$k]->content, 40) . "...";
             }
         }
     }
     $this->results = $commentsresults;
     return $commentsresults;
 }
开发者ID:Artgorae,项目名称:wp-artgorae,代码行数:34,代码来源:search_comments.class.php


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


示例16: get_recent_comments

function get_recent_comments($args)
{
    global $wpdb, $comments, $comment;
    extract($args, EXTR_SKIP);
    $themePath = get_bloginfo('template_url');
    $imageLink = '<h2>Популярные записи</h2>';
    $options = get_option('widget_recent_comments');
    $title = empty($options['title']) ? __($imageLink) : apply_filters('widget_title', $options['title']);
    if (!($number = (int) $options['number'])) {
        $number = 5;
    } else {
        if ($number < 1) {
            $number = 1;
        } else {
            if ($number > 15) {
                $number = 15;
            }
        }
    }
    if (!($comments = wp_cache_get('recent_comments', 'widget'))) {
        $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' ORDER BY comment_date_gmt DESC LIMIT {$number}");
        wp_cache_add('recent_comments', $comments, 'widget');
    }
    echo $before_widget;
    echo $before_title . $title . $after_title;
    echo '<ul id="recentcomments">';
    if ($comments) {
        foreach ((array) $comments as $comment) {
            echo '<li class="recentcomments">' . sprintf(__('%2$s'), get_comment_author_link(), '<a href="' . get_comment_link($comment->comment_ID) . '">' . get_the_title($comment->comment_post_ID) . '</a>') . '</li>';
        }
    }
    echo '</ul>';
    echo $after_widget;
}
开发者ID:boltogriz,项目名称:blog-cook,代码行数:34,代码来源:functions.php


示例17: bro_comment

/**
 * Custom comments template.
 *
 * @package Impact WordPress Theme
 * @since 1.0
 * @author AJ Clarke : http://wpexplorer.com
 * @copyright Copyright (c) 2012, AJ Clarke
 * @link http://wpexplorer.com
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/
function bro_comment($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 <?php 
    if ($comment->comment_approved == '0') {
        echo 'pending-comment';
    }
    ?>
 bro-cf">
            <div class="comment-details">
                <?php 
    if (get_avatar($comment)) {
        ?>
                <div class="comment-avatar">
                    <?php 
        echo get_avatar($comment, $size = '50');
        ?>
                </div>
                <?php 
    }
    ?>
                <section class="comment-author vcard">
                    <?php 
    printf(__('<cite class="author">%s</cite>'), get_comment_author_link());
    ?>
                    <span class="comment-date"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"> &middot; <?php 
    echo get_comment_date();
    ?>
</a></span>
                    <span class="reply"><?php 
    comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'bromine'), 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</span>
                </section>
                <section class="comment-content">
                    <div class="comment-text">
                        <?php 
    comment_text();
    ?>
                    </div>
                </section>
            </div>
        </div>
<?php 
}
开发者ID:supravatweb,项目名称:wordpress,代码行数:69,代码来源:comments.php


示例18: widget

    function widget($args, $instance)
    {
        global $wpdb, $comments, $comment;
        extract($args, EXTR_SKIP);
        $title = apply_filters('widget_title', empty($instance['title']) ? __('My Recent Comments', 'my_framework') : $instance['title']);
        if (!($number = (int) $instance['number'])) {
            $number = 5;
        } else {
            if ($number < 1) {
                $number = 1;
            } else {
                if ($number > 15) {
                    $number = 15;
                }
            }
        }
        $comment_len = 100;
        if (!($comments = wp_cache_get('recent_comments', 'widget'))) {
            $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_approved = '1' and comment_type not in ('pingback','trackback') ORDER BY comment_date_gmt DESC LIMIT 15");
            wp_cache_add('recent_comments', $comments, 'widget');
        }
        $comments = array_slice((array) $comments, 0, $number);
        ?>
		<?php 
        echo $before_widget;
        ?>
			<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
			<ul id="recentcomments"><?php 
        if ($comments) {
            foreach ((array) $comments as $comment) {
                ?>
			<li class="recentcomments">
			<?php 
                echo strip_tags(substr(apply_filters('get_comment_text', $comment->comment_content), 0, $comment_len));
                if (strlen($comment->comment_content) > $comment_len) {
                    echo '...';
                }
                ?>
			<br />
			<?php 
                echo __('by', 'my_framework') . '&nbsp;' . sprintf(_x('%1$s on %2$s', 'widgets'), get_comment_author_link(), '<a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . get_the_title($comment->comment_post_ID) . '</a>');
                ?>
            
            
		
			</li>
            
            <?php 
            }
        }
        ?>
</ul>
		<?php 
        echo $after_widget;
    }
开发者ID:sangikumar,项目名称:IP,代码行数:59,代码来源:my-comment-widget.php


示例19: py_comments

function py_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
  <li <?php 
    comment_class();
    ?>
>
    <article class="callout" id="comment-<?php 
    comment_ID();
    ?>
">
      <header class="comment-author">
        <?php 
    echo get_avatar($comment, $size = '96', $default = get_template_directory_uri() . ' /img/yeti-avatar.png');
    ?>
        <div class="author-meta">
          <?php 
    printf(__('<cite class="fn">%s</cite>', 'projectyeti'), get_comment_author_link());
    ?>
          <time datetime="<?php 
    echo comment_date('c');
    ?>
"><a href="<?php 
    echo esc_url(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    printf(__('%1$s', 'projectyeti'), get_comment_date(), get_comment_time());
    ?>
</a></time>
          <?php 
    edit_comment_link(__('(Edit)', 'projectyeti'), '', '');
    ?>
        </div>
      </header>
      <?php 
    if ($comment->comment_approved == '0') {
        ?>
        <div class="notice">
        <p class="bottom"><?php 
        _e('Your comment is awaiting moderation.', 'projectyeti');
        ?>
</p>
          </div>
      <?php 
    }
    ?>
      <div class="comment">
        <?php 
    comment_text();
    ?>
      </div>
      <footer><?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</footer>
    </article>
<?php 
}
开发者ID:markmcwilliams,项目名称:Project-Yeti,代码行数:59,代码来源:comments.php


示例20: joints_comments

function joints_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
	<li <?php 
    comment_class('panel');
    ?>
>
		<article id="comment-<?php 
    comment_ID();
    ?>
" class="clearfix large-12 columns">
			<header class="comment-author">
				<?php 
    // create variable
    $bgauthemail = get_comment_author_email();
    ?>
				<?php 
    printf(__('<cite class="fn">%s</cite>', 'jointstheme'), get_comment_author_link());
    ?>
 on
				<time datetime="<?php 
    echo comment_time('Y-m-j');
    ?>
"><a href="<?php 
    echo htmlspecialchars(get_comment_link($comment->comment_ID));
    ?>
"><?php 
    comment_time(__(' F jS, Y - g:ia', 'jointstheme'));
    ?>
 </a></time>
				<?php 
    edit_comment_link(__('(Edit)', 'jointstheme'), '  ', '');
    ?>
			</header>
			<?php 
    if ($comment->comment_approved == '0') {
        ?>
				<div class="alert alert-info">
					<p><?php 
        _e('Your comment is awaiting moderation.', 'jointstheme');
        ?>
</p>
				</div>
			<?php 
    }
    ?>
			<section class="comment_content clearfix">
				<?php 
    comment_text();
    ?>
			</section>
			<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
		</article>
	<!-- </li> is added by WordPress automatically -->
<?php 
}
开发者ID:nusserstudios,项目名称:JointsWP,代码行数:59,代码来源:comments.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_comment_list函数代码示例发布时间:2022-05-15
下一篇:
PHP get_comment_id_fields函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap