public function get_dados($postID = false, $tipo_data = false)
 {
     $pautas = '';
     $comments = '';
     if ($postID === false) {
         $pautas = delibera_get_pautas_em();
         $comments = delibera_wp_get_comments();
     } else {
         $pautas = array(get_post($postID));
         $comments = delibera_wp_get_comments(array('post_id' => $postID));
     }
     $events = array();
     foreach ($pautas as $pauta) {
         $data = strtotime($pauta->post_date_gmt);
         if (!array_key_exists($data, $events)) {
             $events[$data] = array();
         }
         $events[$data][] = array('type' => 'pauta', 'title' => get_the_title($postID), 'body' => apply_filters('the_content', $pauta->post_content), 'date_event' => $data);
     }
     foreach ($comments as $comment) {
         $data = strtotime($comment->comment_date_gmt);
         if (!array_key_exists($data, $events)) {
             $events[$data] = array();
         }
         $events[$data][] = array('type' => 'comment-' . get_comment_meta($comment->comment_ID, "delibera_comment_tipo", true), 'title' => "@" . $comment->comment_author, 'body' => apply_filters('comment_text', get_comment_text($comment->comment_ID)), 'date_event' => $data);
     }
     ksort($events, SORT_NUMERIC);
     return $this->filtrar($events, $tipo_data);
 }
Beispiel #2
0
function mydesign($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $users = get_users();
    ?>
        <li id="comment-<?php 
    echo comment_id();
    ?>
" class="compost">
             <?php 
    // ユーザーIDを引っ張る
    foreach ($users as $user) {
        //echo $user->display_name.'<br />';
        //echo get_comment_author();
        if ($user->display_name == get_comment_author()) {
            break;
        }
    }
    ?>
                <span class="trick_rounded-img icon_image" style="background: url(<?php 
    echo ps_get_user_profile_image_src($user->ID, 'standard');
    ?>
) no-repeat center center; width: 50px; height: 50px;></span>
				<span class="trick_thumbnail_Image">
					<?php 
    ps_user_profile_image($user->ID, 'thumbnail');
    ?>
				</span>
                <?php 
    ?>
            <div class="commentarea">
            	<?php 
    //改行表示
    $commentstr = '<p>' . get_comment_text() . '</p>';
    $commentstr = preg_replace("/\n/", "<br />", $commentstr);
    echo $commentstr;
    //comment_text();
    ?>
            
            </div>
            
            <p class="cominfo">
                <?php 
    comment_date();
    ?>
                <?php 
    comment_time();
    ?>
                |
                <?php 
    comment_author_link();
    ?>
                <?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'reply_text' => '返信', 'before' => ' | ', 'after' => '')));
    ?>
            </p> 
        </li>

<?php 
}
Beispiel #3
0
    function ap_comment($comment)
    {
        $GLOBALS['comment'] = $comment;
        ?>
		<li <?php 
        comment_class();
        ?>
 id="li-comment-<?php 
        comment_ID();
        ?>
">
			<article id="comment-<?php 
        comment_ID();
        ?>
" class="comment">
				<div class="ap-avatar">
					<a href="<?php 
        echo ap_user_link($comment->user_id);
        ?>
">
					<?php 
        echo get_avatar($comment, ap_opt('avatar_size_qcomment'));
        ?>
					</a>
				</div>
				<div class="comment-content">
					<?php 
        if ('0' == $comment->comment_approved) {
            ?>
						<p class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.', 'ap');
            ?>
</p>
					<?php 
        }
        ?>
										
					<p class="ap-comment-texts">
						<?php 
        echo get_comment_text();
        ?>
						<?php 
        printf(' - <time datetime="%1$s">%2$s %3$s</time>', get_comment_time('c'), ap_human_time(get_comment_time('U')), __('ago', 'ap'));
        ?>
					</p>
					<div class="comment-meta">
						<?php 
        if (ap_user_can_edit_comment(get_comment_ID())) {
            echo '<a class="comment-edit-btn" href="#" data-button="ap-edit-comment" data-args="' . get_comment_ID() . '-' . wp_create_nonce('comment-' . get_comment_ID()) . '"><i class="aicon-pencil"></i> ' . __('Edit', 'ap') . '</a>';
        }
        if (ap_user_can_delete_comment(get_comment_ID())) {
            echo '<a class="comment-delete-btn" href="#" data-button="ap-delete-comment" data-confirm="' . __('Are you sure? It cannot be undone!', 'ap') . '" data-args="' . get_comment_ID() . '-' . wp_create_nonce('delete-comment-' . get_comment_ID()) . '"><i class="aicon-close"></i> ' . __('Delete', 'ap') . '</a>';
        }
        ?>
					</div>					
				</div>
			</article>
		<?php 
    }
Beispiel #4
0
function codeless_custom_comment($comment, $args, $depth)
{
    ?>
                <div class="comment <?php 
    if ($depth == 1) {
        echo 'span12';
    } else {
        echo 'span11 offset1';
    }
    ?>
">
                    
                            <dl class="dl-horizontal">
                                <dt>
                                    <?php 
    echo get_avatar($comment, '64');
    ?>
    
                                </dt>
                                <dd>
					                <span class="author"><a href=""><?php 
    echo get_comment_author_link($comment);
    ?>
</a></span>
                                    <ul>
                                       
                                        <li><span><?php 
    comment_date('M j Y', $comment);
    ?>
</span></li>
                                        <li><span><?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</span></li>
                                        <li><span> <?php 
    edit_comment_link();
    ?>
</span></li>
                                    </ul>
                                    <div class="comment_text">
                                        <?php 
    echo get_comment_text($comment);
    ?>
                                            <?php 
    if ($comment->comment_approved == '0') {
        ?>
                                                    <span>Your comment is awaiting moderation.</span>
                                            <?php 
    }
    ?>
  
                                    </div>     
                                </dd>
                            </dl> 
                </div>
 <?php 
}
 public function get_fields_for_render()
 {
     $entry_id = $this->comment->comment_ID;
     $post_id = $this->comment->comment_post_ID;
     $avatar_size = apply_filters('liveblog_entry_avatar_size', self::default_avatar_size);
     $comment_text = get_comment_text($entry_id);
     $css_classes = implode(' ', get_comment_class('', $entry_id, $post_id));
     $entry = array('entry_id' => $entry_id, 'post_id' => $post_id, 'css_classes' => $css_classes, 'content' => self::render_content($comment_text, $this->comment), 'original_content' => apply_filters('liveblog_before_edit_entry', $comment_text), 'avatar_size' => $avatar_size, 'avatar_img' => get_avatar($this->comment->comment_author_email, $avatar_size), 'author_link' => get_comment_author_link($entry_id), 'entry_date' => get_comment_date(get_option('date_format'), $entry_id), 'entry_time' => get_comment_date(get_option('time_format'), $entry_id), 'timestamp' => $this->get_timestamp(), 'is_liveblog_editable' => WPCOM_Liveblog::is_liveblog_editable());
     return $entry;
 }
    function st_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'comment':
                global $st_Settings;
                ?>

						<li id="comment-<?php 
                comment_ID();
                ?>
" class="comment">
	
							<?php 
                $avatar_size = '0' != $comment->comment_parent ? 50 : 75;
                $comment_author = get_the_author_meta('user_email') == $comment->comment_author_email ? ' bypostauthor' : '';
                $comment_level = '0' == $comment->comment_parent ? ' class="comment-holder comment-top-level' . $comment_author . '"' : ' class="comment-holder comment-low-level' . $comment_author . '"';
                $out = '<div' . $comment_level . '>';
                // Gravatar
                $out .= '<div class="avatar-box">' . get_avatar($comment, $avatar_size) . '</div>';
                $out .= '<div class="comment-box">';
                // Author name
                $out .= '<div class="comment-author" id="author-' . get_comment_ID() . '">' . get_comment_author_link() . '</div>';
                // Date
                $out .= '<div class="comment-date">';
                if (!empty($st_Settings['nice_time']) && $st_Settings['nice_time'] == 'yes' && function_exists('st_niceTime')) {
                    $out .= st_niceTime(get_comment_date('c', get_comment_ID()));
                } else {
                    $out .= get_comment_date() . ' ' . __('at', 'strictthemes') . ' ' . get_comment_time();
                }
                $out .= '</div>';
                // Comment
                $out .= wpautop(get_comment_text());
                if (comments_open()) {
                    // Reply/Cancel links
                    $out .= '<span class="reply non-selectable">' . '<a title="' . get_comment_ID() . '" class="quick-reply" href="' . get_permalink() . '?replytocom=' . get_comment_ID() . '#respond">' . __('Reply', 'strictthemes') . '</a>' . '<a class="quick-reply-cancel none" href="#">' . __('Cancel', 'strictthemes') . '</a>' . '</span>';
                }
                // Edit link
                if (current_user_can('manage_options')) {
                    $out .= ' - <a href="' . get_edit_comment_link() . '">' . __('Edit', 'strictthemes') . '</a>';
                }
                // Pre-moderation
                if ($comment->comment_approved == '0') {
                    $out .= '<p><em class="comment-awaiting-moderation">' . __('Your comment is awaiting moderation.', 'strictthemes') . '</em></p>';
                }
                $out .= '<div class="quick-holder" id="quick-holder-' . get_comment_ID() . '"></div></div><div class="clear"><!-- --></div>';
                // .comment-box
                $out .= '</div>';
                // .$comment_level
                $out .= '<div class="clear"><!-- --></div>';
                echo $out;
                break;
        }
    }
 public static function render($comment, $args, $depth)
 {
     self::set_context($comment);
     // Note that WordPress closes the div for you, do not close it here!
     // https://codex.wordpress.org/Function_Reference/wp_list_comments
     printf('<div class="%s">', implode(' ', get_comment_class(self::base_classes($comment), $comment, $comment->comment_post_ID)));
     $comment_actions = '';
     if (comments_open($comment->comment_post_ID)) {
         $comment_actions = html('a', array('class' => 'reply-link', 'href' => sprintf('mailto:{{{reply_to_comment_%s}}}?subject=%s', $comment->comment_ID, rawurlencode(sprintf(__('Reply to %s', 'Postmatic'), $comment->comment_author)))), html('img', array('src' => 'https://s3-us-west-2.amazonaws.com/postmatic/assets/icons/reply.png', 'width' => '13', 'height' => '8')), __('Reply', 'Postmatic'));
     }
     echo html('div class="comment-header"', get_avatar($comment), html('div class="author-name"', get_comment_author_link($comment->comment_ID)), html('div class="comment-body"', apply_filters('comment_text', get_comment_text($comment->comment_ID), $comment), $comment_actions));
 }
function wordpress_plugin_comments($comments)
{
    wp_enqueue_script('newscript', plugins_url('wp_jquery.js', __FILE__));
    $comments = get_comment_text();
    if (strlen($comments) > get_option('option1')) {
        $comment_court = substr($comments, get_option('option1'), strlen($comments));
        $comment_court = "<span id='texte'>" . ($comment_court .= "</span>");
        $comment = substr($comments, 0, get_option('option1'));
        return "<span id='text'>" . $comment . "</span>" . ($comment_court .= ' <a href="" id="cacher">(Hide)</a> <a href="" id="montrer">(Read More)</a>');
    } else {
        return $comments;
    }
}
function skillcrush_comments($comment, $args, $depth)
{
    $comment = '<li class="comment">';
    $comment .= '<header class="comment-head">';
    $comment .= '<span class="comment-author">' . get_comment_author() . '</span>';
    $comment .= '<span class="comment-meta">' . get_comment_date('m/d/Y') . '&emsp;|&emsp;' . get_comment_reply_link(array('depth' => $depth, 'max_depth' => 5)) . '</span>';
    $comment .= '</header>';
    $comment .= '<div class="comment-body">';
    $comment .= '<p>' . get_comment_text() . '</p>';
    $comment .= '</div>';
    $comment .= '</li>';
    echo $comment;
}
 function widget($args, $instance)
 {
     global $comments, $comment;
     $cache = wp_cache_get('tm_recent_comments', 'widget');
     if (!is_array($cache)) {
         $cache = array();
     }
     if (!isset($args['widget_id'])) {
         $args['widget_id'] = $this->id;
     }
     if (isset($cache[$args['widget_id']])) {
         echo $cache[$args['widget_id']];
         return;
     }
     $d = get_option('date_format');
     extract($args, EXTR_SKIP);
     $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;
     $number_char = !empty($instance['number_char']) ? absint($instance['number_char']) : 50;
     if (!$number) {
         $number = 5;
     }
     $comments = get_comments(apply_filters('widget_comments_args', array('number' => $number, 'status' => 'approve', 'post_status' => 'publish')));
     $output .= $before_widget;
     if ($title) {
         $output .= $before_title . $title . $after_title;
     }
     $output .= '<ul id="tm_recentcomments">';
     if ($comments) {
         // Prime cache for associated posts. (Prime post term cache if we need it for permalinks.)
         $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) {
             $num_char = get_comment_text($comment->comment_ID);
             $len = strlen($num_char);
             if ($len > $number_char) {
                 $num_char = substr($num_char, 0, $number_char) . '...';
             }
             $output .= '<li class="tm_recentcomments"><a class="cm-avatar" href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . get_avatar($comment, 60, '', get_the_author()) . '</a>' . sprintf(_x('%1$s  %2$s', 'widgets'), '<div class="info_rc"><a href="' . esc_url(get_comment_link($comment->comment_ID)) . '">' . $num_char . '</a>', '<p><span>' . get_comment_author_link()) . '</span>' . get_comment_date($d, $comment->comment_ID) . '' . __(' at ', 'cactusthemes') . '' . get_comment_time() . '</p></div></li>';
         }
     }
     $output .= '</ul>';
     $output .= $after_widget;
     echo $output;
     $cache[$args['widget_id']] = $output;
     wp_cache_set('tm_recent_comments', $cache, 'widget');
 }
Beispiel #11
0
 public static function getComments($postId, $args = array())
 {
     $args['post_id'] = $postId;
     $comments = get_comments($args);
     if (is_array($comments)) {
         $result = array();
         foreach ($comments as $comment) {
             $params = array('comment_content' => get_comment_text($comment), 'comment_author' => get_comment_author($comment), 'avatar' => self::getAvatar($comment), 'authorLink' => get_comment_author_link($comment));
             $comment_object_var = get_object_vars($comment);
             $comment_params = $params + $comment_object_var;
             $result[] = new Comment($comment_params);
         }
         return CommentDataHelper::buildCommentTree($result);
     } else {
         return null;
     }
 }
Beispiel #12
0
function thema_comment($comment)
{
    $reactie = '';
    $reactie .= '<div class="reactie-item clearfix" id="reactie-' . get_comment_ID() . '">';
    $reactie .= '<div class="reactie-meta clearfix">';
    $reactie .= '<span class="reactie-door">';
    $reactie .= get_comment_author();
    $reactie .= '</span>';
    $reactie .= '<span class="reactie-datum">';
    $reactie .= get_comment_date("j F Y") . ' om ' . get_comment_date("G:i") . '</span>';
    $reactie .= '</div>';
    $reactie .= '<div class="reactie-inhoud">';
    $reactie .= get_avatar($comment, 80);
    $reactie .= get_comment_text();
    $reactie .= '</div>';
    $reactie .= '</div>';
    print $reactie;
}
Beispiel #13
0
function cws_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>

			<li class="comment" id="div-comment-<?php 
    comment_ID();
    ?>
">
				<div class="comment-body">
					<?php 
    echo get_avatar($comment, '47');
    ?>
					<div class="comment-text">
						<div class="comment-author"><?php 
    printf(__('%s', 'happykids'), get_comment_author_link());
    ?>
</div>
						<div class="comment-entry"><?php 
    echo strip_tags(get_comment_text());
    ?>
</div>
						<div class="comment-meta">

						<?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'reply_text' => '<span class="color_accent">' . multitranslate(__('Reply', 'happykids'), "_comments_reply", false) . '</span>', 'max_depth' => $args['max_depth'])));
    ?>
						<?php 
    edit_comment_link('<span class="comment_edit_span">' . multitranslate(__('Edit', 'happykids'), "_comments_edit", false) . '</span>');
    ?>

						<?php 
    printf(__('%1$s at %2$s', 'happykids'), get_comment_date(), get_comment_time());
    ?>
						</div><!--/ comment-meta -->
					</div><!--/ comment-text -->
					<div class="kids_clear"></div>
				</div>
<?php 
}
 /**
  * Get list of events. There's filter `slack_get_events`
  * to extend available events that can be notified to
  * Slack.
  */
 public function get_events()
 {
     return apply_filters('slack_get_events', array('post_published' => array('action' => 'transition_post_status', 'description' => __('When a post is published', 'slack'), 'default' => true, 'message' => function ($new_status, $old_status, $post) {
         $notified_post_types = apply_filters('slack_event_transition_post_status_post_types', array('post'));
         if (!in_array($post->post_type, $notified_post_types)) {
             return false;
         }
         if ('publish' !== $old_status && 'publish' === $new_status) {
             $excerpt = has_excerpt($post->ID) ? apply_filters('get_the_excerpt', $post->post_excerpt) : wp_trim_words(strip_shortcodes($post->post_content), 55, '&hellip;');
             return sprintf('New post published: *<%1$s|%2$s>* by *%3$s*' . "\n" . '> %4$s', get_permalink($post->ID), get_the_title($post->ID), get_the_author_meta('display_name', $post->post_author), $excerpt);
         }
     }), 'post_pending_review' => array('action' => 'transition_post_status', 'description' => __('When a post needs review', 'slack'), 'default' => false, 'message' => function ($new_status, $old_status, $post) {
         $notified_post_types = apply_filters('slack_event_transition_post_status_post_types', array('post'));
         if (!in_array($post->post_type, $notified_post_types)) {
             return false;
         }
         if ('pending' !== $old_status && 'pending' === $new_status) {
             $excerpt = has_excerpt($post->ID) ? apply_filters('get_the_excerpt', $post->post_excerpt) : wp_trim_words(strip_shortcodes($post->post_content), 55, '&hellip;');
             return sprintf('New post needs review: *<%1$s|%2$s>* by *%3$s*' . "\n" . '> %4$s', admin_url(sprintf('post.php?post=%d&action=edit', $post->ID)), get_the_title($post->ID), get_the_author_meta('display_name', $post->post_author), $excerpt);
         }
     }), 'new_comment' => array('action' => 'wp_insert_comment', 'priority' => 999, 'description' => __('When there is a new comment', 'slack'), 'default' => false, 'message' => function ($comment_id, $comment) {
         $comment = is_object($comment) ? $comment : get_comment(absint($comment));
         $post_id = $comment->comment_post_ID;
         $notified_post_types = apply_filters('slack_event_wp_insert_comment_post_types', array('post'));
         if (!in_array(get_post_type($post_id), $notified_post_types)) {
             return false;
         }
         $post_title = get_the_title($post_id);
         $comment_status = wp_get_comment_status($comment_id);
         // Ignore spam.
         if ('spam' === $comment_status) {
             return false;
         }
         return sprintf('<%1$s|New comment> by *%2$s* on *<%3$s|%4$s>* (_%5$s_)' . "\n" . '>%6$s', admin_url("comment.php?c={$comment_id}&action=editcomment"), $comment->comment_author, get_permalink($post_id), $post_title, $comment_status, preg_replace("/\n/", "\n>", get_comment_text($comment_id)));
     })));
 }
function comment_text()
{
    echo apply_filters('comment_text', get_comment_text());
}
Beispiel #16
0
/**
 * 9IPHP <Comments List> in the theme.
 * 评论列表
 *
 * @version 1.0
 * @package Specs
 * @copyright 2014 all rights reserved
 *
 *
 */
function specs_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 class="comment-wrap" id="comment-<?php 
    comment_ID();
    ?>
">
        <div class="comment-author pull-left">
        <?php 
    if ($args['avatar_size'] != 0) {
        echo get_avatar($comment, $args['avatar_size']);
    }
    ?>
        </div>
        <div class="comment-body">
            <h4>
                <?php 
    printf('<cite class="fn">%1$s %2$s</cite>', get_comment_author_link(), $comment->user_id === get_queried_object()->post_author ? '<small class="label label-primary">博主</small>' : '');
    ?>
                <span class="comment-date">
                    <?php 
    printf(__('%1$s'), get_comment_date("Y/m/d H:i"));
    ?>
                </span>
            </h4>
            <?php 
    if ($comment->comment_approved == '0') {
        ?>
                <p class="comment-awaiting-moderation text-danger"><?php 
        echo "您的评论正在等待审核";
        ?>
</p>
            <?php 
    }
    ?>
            <p>
                <?php 
    if ($comment->comment_parent) {
        // 如果存在父级评论
        $comment_parent_href = get_comment_ID($comment->comment_parent);
        $comment_parent = get_comment($comment->comment_parent);
        ?>
                <span class="comment-to plr">@</span>
                <span class="reply-comment-author">
                    <a href="#comment-<?php 
        echo $comment_parent_href;
        ?>
" title="<?php 
        echo specs_string_cut(strip_tags(apply_filters('the_content', $comment_parent->comment_content)), 100);
        ?>
">
                        <?php 
        echo $comment_parent->comment_author;
        ?>
                    </a>
                </span>
                <?php 
    }
    ?>
                <?php 
    echo convert_smilies(get_comment_text());
    ?>
            </p>

            <div class="reply clearfix">
                <?php 
    comment_reply_link(array_merge($args, array('reply_text' => '<div class="label label-danger pull-right">回复</div>', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
            </div>

        </div>
    </div>
<?php 
}
Beispiel #17
0
/**
 * Display the current comment content for use in the feeds.
 *
 * @package WordPress
 * @subpackage Feed
 * @since 1.0.0
 * @uses apply_filters() Calls 'comment_text_rss' filter on comment content.
 * @uses get_comment_text()
 */
function comment_text_rss()
{
    $comment_text = get_comment_text();
    $comment_text = apply_filters('comment_text_rss', $comment_text);
    echo $comment_text;
}
        function widget($args, $instance)
        {
            extract($args);
            global $wpdb;
            // call global for use in function
            $title_recent = empty($instance['title_recent']) ? __('Latest News', 'wpdance') : $instance['title_recent'];
            $title_comment = empty($instance['title_comment']) ? __('Comments', 'wpdance') : $instance['title_comment'];
            $num_recent = empty($instance['num_recent']) ? 5 : absint($instance['num_recent']);
            $num_comment = empty($instance['num_comment']) ? 5 : absint($instance['num_comment']);
            $thumbnail_width = 60;
            $thumbnail_height = 60;
            $_thumb_size = array(60, 60);
            echo $before_widget;
            wp_reset_query();
            //add_image_size('tabs-post-thumbnail',$thumbnail_width,$thumbnail_height,true);
            ?>
		<div class="container-tabs">
			<div id="tabs-post-sidebar" class="tabs-post-sidebar">
				<ul class="nav nav-tabs wd-widget-multitabs">
					<li class="first"><a href="#recent-tab"><span><span><?php 
            echo esc_attr($title_recent);
            ?>
</span></span></a></li>
					<li class="last"><a href="#comment-tab"><span><span><?php 
            echo esc_attr($title_comment);
            ?>
</span></span></a></li>     				
				</ul>
			

				<!-- Recent Tab -->
				<div class="tab-content">
				
					<?php 
            $r = new WP_Query(array('posts_per_page' => $num_recent, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
            ?>
					<div id="recent-tab" class="tab-post-content tab-pane">
					<div class='top-left'><div class='top-right'></div></div>
						<?php 
            if ($r->have_posts()) {
                $i = 0;
                ?>
						<div class="contentcenter">
						<ul class="recent-post-list tabs-post-list">
						<?php 
                while ($r->have_posts()) {
                    global $post;
                    $r->the_post();
                    ?>
									<li <?php 
                    if ($i == 0) {
                        echo "class='first'";
                    } else {
                        if ($i == $r->post_count - 1) {
                            echo "class='last'";
                        }
                    }
                    ?>
>
										<div class="image">
											<a class="thumbnail" href="<?php 
                    the_permalink();
                    ?>
">
												<?php 
                    if (has_post_thumbnail()) {
                        the_post_thumbnail('prod_tini_thumb', array('title' => esc_attr(get_the_title()), 'alt' => esc_attr(get_the_title())));
                    }
                    ?>
											</a>
											<span class="shadow"></span>
										</div>
										<div class="content">
											<p class="title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></p>
											<span class="wpt-author-time">
												<span class="author"><i class="icon-user custom-icon"></i><?php 
                    the_author();
                    ?>
</span>
												<span class="time"><i class="icon-calendar custom-icon"></i><?php 
                    the_time(get_option('date_format'));
                    ?>
</span>
												<span class="comment-number"><i class="icon-comments-alt custom-icon"></i><?php 
                    comments_number('0 Comments', '1 Comment', '% Comments');
                    ?>
</span>
											</span>
										</div>
									</li>
						<?php 
                    $i++;
                }
                ?>
						</ul>
						</div>
						<?php 
            }
            ?>
						<?php 
            wp_reset_query();
            ?>
						<div class='bot-left'><div class='bot-right'></div></div>
					</div><!-- End #recent-tab -->

					<!-- Comment Tab -->
					<?php 
            $recent_comments = get_comments(array('number' => $num_comment, 'status' => 'approve'));
            ?>
					<div id="comment-tab" class="tab-post-content tab-pane">
					<div class='top-left'><div class='top-right'></div></div>
					<?php 
            if (count($recent_comments)) {
                $i = 0;
                ?>
	<div class="contentcenter">
						<ul class="tabs-comments-list">
						<?php 
                foreach ($recent_comments as $comment) {
                    $GLOBALS['comment'] = $comment;
                    switch ($comment->comment_type) {
                        case '':
                            $class = "";
                            if ($i == 0) {
                                $class .= "first ";
                            }
                            if (++$i == count($recent_comments)) {
                                $class .= "last";
                            }
                            ?>
									<li <?php 
                            if ($class) {
                                echo "class='{$class}'";
                            }
                            ?>
>
										<div class="avarta"><a href="<?php 
                            comment_link();
                            ?>
"><?php 
                            echo get_avatar($comment, 58, get_bloginfo('template_url') . '/images/mycustomgravatar.png');
                            ?>
</a></div>
										<div class="detail">
											<div class="comment-author vcard">
												<?php 
                            printf(__('%s', 'wpdance'), sprintf('<cite class="fn"><a href="%1$s" rel="external nofollow" class="url">%2$s</a></cite>', get_comment_author_url(), get_comment_author()));
                            ?>
:
											</div><!-- .comment-author .vcard -->
											<blockquote class="comment-body"><?php 
                            echo string_limit_words(get_comment_text(), 10);
                            ?>
</blockquote>
											<div class="comment-meta"><span><?php 
                            _e("in", "wpdance");
                            ?>
 <a href="<?php 
                            echo esc_url(get_permalink($comment->comment_post_ID));
                            ?>
"><?php 
                            echo esc_attr(get_the_title($comment->comment_post_ID));
                            ?>
</a></span></div>
										</div>
									</li>
								<?php 
                            break;
                        case 'pingback':
                        case 'trackback':
                            break;
                    }
                    ?>
						<?php 
                }
                ?>
						</ul>
						</div>
					<?php 
            }
            ?>
					<?php 
            wp_reset_query();
            ?>
					<div class='bot-left'><div class='bot-right'></div></div>
					</div><!-- End #comment-multi-tab -->
				</div>
			</div>
		</div>
		
		
  
			<?php 
            $rand_id = rand();
            $random_id = "accordion-" . $rand_id;
            ?>
			<div class="accordion-tabs wd-widget-multitabs-accordion" id="<?php 
            echo $random_id;
            ?>
" style="display:none;">
				
				<div class="accordion-group">
					<div class="accordion-heading">
						<a class="accordion-toggle" href="#collapseTwo-<?php 
            echo $rand_id;
            ?>
" data-parent="#<?php 
            echo $random_id;
            ?>
" data-toggle="collapse"><span><span><?php 
            echo esc_attr($title_recent);
            ?>
</span></span></a>
					</div>
					<div class="accordion-body collapse" id="collapseTwo-<?php 
            echo $rand_id;
            ?>
">
						<div class="accordion-inner">
						</div>
					</div>
				</div>

				<div class="accordion-group">
					<div class="accordion-heading">
						<a class="accordion-toggle" href="#collapseThree-<?php 
            echo $rand_id;
            ?>
" data-parent="#<?php 
            echo $random_id;
            ?>
" data-toggle="collapse"><span><span><?php 
            echo esc_attr($title_comment);
            ?>
</span></span></a>
					</div>
					<div class="accordion-body collapse" id="collapseThree-<?php 
            echo $rand_id;
            ?>
">
						<div class="accordion-inner">
						</div>
					</div>
				</div>
			</div>	
			
			<script type="text/javascript">
			//<![CDATA[
				 jQuery(function() {
					var windowWidth = jQuery(window).width();	
					jQuery( ".tabs-post-sidebar" ).tabs({ fx: { opacity: 'toggle', duration:'slow'} }).addClass( "ui-tabs-vertical ui-helper-clearfix" );						
					jQuery(window).resize(function() {
						windowWidth = jQuery(window).width();
						if( jQuery.browser.msie &&  parseInt( jQuery.browser.version, 10 ) == 7 ){
							jQuery.debounce(1000, function() {
								if(windowWidth >=200 && windowWidth <= 768){
									jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){
										recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html();
										cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html();
										jQuery(value).find('#collapseTwo-<?php 
            echo $rand_id;
            ?>
').children().html(recentHtml);
										jQuery(value).find('#collapseThree-<?php 
            echo $rand_id;
            ?>
').children().html(cmtHtml);
										jQuery(value).siblings('.container-tabs').hide();
										jQuery(value).show().collapse({
											toggle : false
										});
									});
								}else if( windowWidth >= 768 ){
									jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){
										jQuery(value).hide().siblings('.container-tabs').show();
									});
									
								}
							});
						}else{
							if(windowWidth >=200 && windowWidth <= 768){
								jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){
									recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html();
									cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html();
									jQuery(value).find('#collapseTwo-<?php 
            echo $rand_id;
            ?>
').children().html(recentHtml);
									jQuery(value).find('#collapseThree-<?php 
            echo $rand_id;
            ?>
').children().html(cmtHtml);
									jQuery(value).siblings('.container-tabs').hide();
									jQuery(value).show().collapse({
										toggle : false
									});
								});
							}else if( windowWidth >= 768 ){
								jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){
									jQuery(value).hide().siblings('.container-tabs').show();
									//jQuery("#right-sidebar").css("height","auto");
								});
								
							}
						}
						

					});

					
					if(windowWidth >=200 && windowWidth <= 768){
						jQuery(".widget_multitab > .accordion-tabs").each(function(index,value){
							recentHtml = jQuery(value).siblings('.container-tabs').find('#recent-tab').html();
							cmtHtml = jQuery(value).siblings('.container-tabs').find('#comment-tab').html();
							jQuery(value).find('#collapseTwo-<?php 
            echo $rand_id;
            ?>
').children().html(recentHtml);
							jQuery(value).find('#collapseThree-<?php 
            echo $rand_id;
            ?>
').children().html(cmtHtml);
							jQuery(value).siblings('.container-tabs').hide();
							jQuery(value).show().collapse({
								toggle : false
							});
						});
					}	
					
				 });
			//]]>	 
			</script>
		

	<?php 
            echo $after_widget;
        }
Beispiel #19
0
/**
 * Displays comment texts. Mainly used for applying `comment_text` filter
 * on messages, tasks and to-do's comments.
 *
 * @since 0.1
 * @param type $comment_ID
 * @return string
 */
function cpm_comment_text($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    return apply_filters('comment_text', get_comment_text($comment_ID), $comment);
}
Beispiel #20
0
/**
 * Display the current comment content for use in the feeds.
 *
 * @since 1.0.0
 */
function comment_text_rss()
{
    $comment_text = get_comment_text();
    /**
     * Filter the current comment content for use in a feed.
     *
     * @since 1.5.0
     *
     * @param string $comment_text The content of the current comment.
     */
    $comment_text = apply_filters('comment_text_rss', $comment_text);
    echo $comment_text;
}
Beispiel #21
0
            <span class="tieudehoanthiendanhgia">Vui lòng hoàn thành đánh giá của bạn</span>
            <ul>
                <li>
                    Khóa học này có đáp ứng đầy đủ các nhu cầu của bạn hay không?
                </li>
                <li>
                    Bạn cảm thấy chất lượng khóa học này như thế nào?
                </li>
                <li>
                    Bạn cảm thấy giảng viên như thế nào?
                </li>
            </ul>
            <?php 
if ($idrating) {
    echo '<input type="text" class="tieudedanhgia" placeholder="Tiêu đề đánh giá" value="' . get_comment_meta($idrating, 'review_title', true) . '">';
    echo '<textarea rows="4" class="noidungdanhgia" placeholder="Nội dung đánh giá">' . get_comment_text($idrating) . '</textarea>';
    echo '<div class="noidungxulydanhgia">';
    echo '<span data-course="' . $course_id . '" data-id="' . $idrating . '" class="btn btn-primary capnhatdanhgia">Cập Nhật Đánh Giá</span>';
    echo '<a href="#" data-course="' . $course_id . '" data-id="' . $idrating . '" class="xoadanhgia">Xóa đánh giá của bạn</a>';
    echo '<p class="loadingcapnhatdanhgia anpopupthongtinkhoahoc"><i class="icon-refresh glyphicon-refresh-animate"></i>Đang cập nhật...</p>';
    echo '</div>';
} else {
    echo '<input type="text" class="tieudedanhgia" placeholder="Tiêu đề đánh giá">';
    echo '<textarea class="noidungdanhgia" rows="4" placeholder="Nội dung đánh giá"></textarea>';
    echo '<div class="noidungxulydanhgia">';
    echo '<span data-id="' . $course_id . '" class="btn btn-primary danhgiakhoahoc">Đánh Giá</span>';
    echo '<p class="loadingdanhgia anpopupthongtinkhoahoc"><i class="icon-refresh glyphicon-refresh-animate"></i>Đang lưu...</p>';
    echo '</div>';
}
?>
Beispiel #22
0
    ?>

                <?php 
    if ('0' == $comment->comment_approved) {
        ?>
                    <p class="alert alert-danger comment-awaiting-moderation"><?php 
        st_the_language('your_comment_is_awaiting_moderation');
        ?>
</p>
                <?php 
    }
    ?>
                <div class="comment-content">
                    <?php 
    $max_string = 200;
    $text = get_comment_text();
    echo TravelHelper::add_read_more($text, $max_string);
    ?>
                </div>

                <div class="<?php 
    /*if($max_string<strlen($text))*/
    echo 'booking-item-review-more-content';
    ?>
">
                    <?php 
    do_action('st_review_more_content', $comment_id);
    ?>
                    <?php 
    do_action('st_review_stats_' . get_post_type() . '_content', $comment_id);
    ?>
Beispiel #23
0
    public static function comments_callback($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        $tag = 'div';
        $add_below = 'comment';
        $classes = array();
        $comment_parent_class = empty($args['has_children']) ? null : 'parent';
        $divide_line = empty($args['has_children']) ? '<div class="cl-blog-line-com"></div>' : null;
        if ($comment_parent_class) {
            $classes[] = $comment_parent_class;
        }
        $classes[] = 'marg25';
        ?>
        <div <?php 
        comment_class($classes);
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">

            <?php 
        echo get_avatar($comment, 80);
        ?>
            <div class="comm_name">
                <?php 
        echo get_comment_author();
        ?>
 <span>- <?php 
        echo get_comment_date('j F Y');
        ?>
 <?php 
        edit_comment_link(__('Edit', 'grandway'), '  ', '');
        ?>
 <?php 
        comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
</span>
            </div>

            <?php 
        if ($comment->comment_approved == '0') {
            ?>
                <i class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.', 'grandway');
            ?>
</i>
            <?php 
        }
        ?>

            <p class="text_cont com_top"><?php 
        echo get_comment_text();
        ?>
</p>

        </div>

        <?php 
        echo wp_kses($divide_line, array('div' => array('class' => array())));
    }
    /**
     * Template for comments and pingbacks.
     *
     * To override this walker in a child theme without modifying the comments template
     * simply create your own tfuse_comment(), and that function will be used instead.
     *
     * Used as a callback by wp_list_comments() for displaying the comments.
     *
     */
    function tfuse_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'pingback':
            case 'trackback':
                ?>
    <li class="post pingback">
       <a name="comment-<?php 
                comment_ID();
                ?>
"></a>
        <div id="li-comment-<?php 
                comment_ID();
                ?>
" class="comment-container comment-body clearfix">
            <p><?php 
                _e('Pingback:', 'tfuse');
                ?>
 <?php 
                comment_author_link();
                ?>
                <span class="comment-date"><?php 
                comment_date();
                ?>
</span>
                <?php 
                comment_text();
                ?>
        </div><?php 
                break;
            default:
                ?>
    <li <?php 
                comment_class();
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
            <a name="comment-<?php 
                comment_ID();
                ?>
"></a>

            <article class="comment-body" id="li-comment-<?php 
                comment_ID();
                ?>
">

                <div class="comment-avatar">
                    <?php 
                echo get_avatar($comment, 70);
                ?>
                </div>

                <div class="comment-aside">

                    <div class="comment-meta">
                        <span class="comment-author"><a href=""><?php 
                comment_author_link();
                ?>
</a></span>
                        <span class="comment-date"><?php 
                comment_date();
                ?>
</span> |
                        <?php 
                comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
                ?>
                    </div>

                    <div class="comment-content">
                         <?php 
                echo get_comment_text();
                ?>
               
                    </div>
                    <?php 
                if ($comment->comment_approved == '0') {
                    ?>
                        <p class='unapproved'><?php 
                    _e('Your comment is awaiting moderation.', 'tfuse');
                    ?>
</p>
                        <br />
                    <?php 
                }
                ?>
                </div>
                <!-- /.comment-head -->
                <div class="clear"></div>
                <div id="comment-<?php 
                comment_ID();
                ?>
"></div>
                <div class="clear"></div>

            </article><!-- /.comment-container -->
    <?php 
                break;
        }
    }
Beispiel #25
0
    function widget($args, $instance)
    {
        global $comments, $comment;
        $cache = wp_cache_get('widget_recent_comments', 'widget');
        if (!is_array($cache)) {
            $cache = array();
        }
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        if (isset($cache[$args['widget_id']])) {
            echo $cache[$args['widget_id']];
            return;
        }
        extract($args, EXTR_SKIP);
        $output = '';
        $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Comments', 'wpdance') : $instance['title'], $instance, $this->id_base);
        if (empty($instance['number']) || !($number = absint($instance['number']))) {
            $number = 5;
        }
        $count = 0;
        $comments = get_comments(array('number' => $number, 'status' => 'approve', 'post_type' => 'post', 'post_status' => 'publish'));
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        echo '<div id="recentcomments">';
        if ($comments) {
            foreach ((array) $comments as $comment) {
                $count++;
                ?>
				<div class="recentcomments_custom <?php 
                if ($count == 1) {
                    echo " first";
                }
                if ($count == count($comments)) {
                    echo " last";
                }
                ?>
">
					<div class="detail123">
						<?php 
                $comment_count = wp_count_comments($comment->comment_post_ID)->total_comments;
                if ($comment_count < 10) {
                    $comment_count = '0' . $comment_count;
                }
                ?>
						<span class="recent_comments_count"><?php 
                echo esc_html($comment_count);
                ?>
<span class="comment_count_detail"></span></span>
						<span class="comment-meta"><?php 
                _e("comment by", "wpdance");
                ?>
 <a href="<?php 
                echo esc_url($comment->comment_author_url);
                ?>
"><?php 
                echo esc_html($comment->comment_author);
                ?>
</a> </span>
						<h3 class="post_title"><a title="<?php 
                echo esc_attr($comment->post_title);
                ?>
" href="<?php 
                echo get_permalink($comment->comment_post_ID);
                ?>
"><?php 
                echo esc_html($comment->post_title);
                ?>
</a></h3>
						<blockquote class="comment-body"><?php 
                echo string_limit_words(get_comment_text(), 10);
                ?>
</blockquote>
					</div>
				</div>
				<?php 
            }
        }
        echo '</div>';
        $output .= $after_widget;
        echo $output;
        $cache[$args['widget_id']] = $output;
        wp_cache_set('widget_recent_comments', $cache, 'widget');
    }
Beispiel #26
0
    wp_update_comment($commentdata);
} else {
    $comment_id = wp_new_comment($commentdata);
}
$comment = get_comment($comment_id);
if (!$user->ID) {
    $comment_cookie_lifetime = apply_filters('comment_cookie_lifetime', 30000000);
    setcookie('comment_author_' . COOKIEHASH, $comment->comment_author, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
    setcookie('comment_author_email_' . COOKIEHASH, $comment->comment_author_email, time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
    setcookie('comment_author_url_' . COOKIEHASH, esc_url($comment->comment_author_url), time() + $comment_cookie_lifetime, COOKIEPATH, COOKIE_DOMAIN);
}
$comment_depth = 1;
$tmp_c = $comment;
while ($tmp_c->comment_parent != 0) {
    $comment_depth++;
    $tmp_c = get_comment($tmp_c->comment_parent);
}
echo '<li ';
comment_class();
echo ' id="comment-' . get_comment_ID() . '">';
echo '<div class="comt-avatar">' . MBT_get_the_avatar($comment->comment_author_email, '36') . '</div>';
echo '<div class="comt-main" id="div-comment-' . get_comment_ID() . '">';
echo get_comment_text();
if ($comment->comment_approved == '0') {
    echo '<span class="comt-approved">您的评论正在排队审核中,请稍后!</span><br />';
}
echo '<div class="comt-meta">';
echo '<span class="comt-author">' . get_comment_author_link() . '</span>';
echo get_comment_time('m-d H:i');
echo '</div>';
echo '</div>';
/**
 * Display the text of the current comment.
 *
 * @since 0.71
 *
 * @see Walker_Comment::comment()
 *
 * @param int $comment_ID ID of the comment for which to print the text. Default 0.
 * @param array $args Optional. An array of arguments. Default empty array. Default empty.
 */
function comment_text($comment_ID = 0, $args = array())
{
    $comment = get_comment($comment_ID);
    $comment_text = get_comment_text($comment_ID, $args);
    /**
     * Filter the text of a comment to be displayed.
     *
     * @since 1.2.0
     *
     * @see Walker_Comment::comment()
     *
     * @param string $comment_text Text of the current comment.
     * @param object $comment The comment object.
     * @param array $args An array of arguments.
     */
    echo apply_filters('comment_text', $comment_text, $comment, $args);
}
Beispiel #28
0
function ap_reputation_get_info($event, $action_id)
{
    switch ($event) {
        case 'question':
            $info = sprintf(__('%sAsked %s', 'ap'), '<span class="ap-reputation-event">', '</span><a href="' . get_permalink($action_id) . '">' . get_the_title($action_id) . '</a>');
            break;
        case 'answer':
            $info = sprintf(__('%sAnswered %s', 'ap'), '<span class="ap-reputation-event">', '</span><a href="' . get_permalink($action_id) . '">' . get_the_title($action_id) . '</a>');
            break;
        case 'comment':
            $info = sprintf(__('%sCommented %s', 'ap'), '<span class="ap-reputation-event">', '</span><a href="' . get_comment_link($action_id) . '">' . get_comment_text($action_id) . '</a>');
            break;
        case 'selecting_answer':
            $info = sprintf(__('%sSelected answer %s', 'ap'), '<span class="ap-reputation-event">', '</span><a href="' . get_permalink($action_id) . '">' . get_the_title($action_id) . '</a>');
            break;
        case 'vote_up':
            $info = sprintf(__('%sUp vote %s %s', 'ap'), '<span class="ap-reputation-event">', '</span>' . get_post_type($action_id), '<a href="' . get_permalink($action_id) . '">' . get_the_title($action_id) . '</a>');
            break;
        case 'vote_down':
            $info = sprintf(__('%sDown vote %s %s', 'ap'), '<span class="ap-reputation-event">', '</span>' . get_post_type($action_id), '<a href="' . get_permalink($action_id) . '">' . get_the_title($action_id) . '</a>');
            break;
        case 'voted_down':
            $info = sprintf(__('%sDown voted %s', 'ap'), '<span class="ap-reputation-event">', '</span>' . get_post_type($action_id));
            break;
        case 'best_answer':
            $info = sprintf(__('%sBest answer %s', 'ap'), '<span class="ap-reputation-event">', '</span>' . get_post_type($action_id));
            break;
        default:
            $info = apply_filters('ap_reputation_info_event', $event, $action_id);
            break;
    }
    return apply_filters('ap_reputation_info', $info, $event, $action_id);
}
/**
 * Displays the text of the current comment.
 *
 * @since 0.71
 * @uses apply_filters() Passes the comment content through the 'comment_text' hook before display
 * @uses get_comment_text() Gets the comment content
 *
 * @param int $comment_ID The ID of the comment for which to print the text. Optional.
 */
function comment_text($comment_ID = 0)
{
    $comment = get_comment($comment_ID);
    echo apply_filters('comment_text', get_comment_text($comment_ID), $comment);
}
Beispiel #30
0
function uppsite_get_comment()
{
    global $comment;
    return array('comment_ID' => get_comment_ID(), 'post_id' => get_the_ID(), 'isApproved' => $comment->comment_approved == '0' ? "false" : "true", 'permalink' => get_permalink(), 'comment_date' => get_comment_date('', 0), 'unix_time' => get_comment_date('U', 0), 'comment_content' => get_comment_text(0), 'comment_author' => uppsite_get_comment_member(get_comment_ID()));
}