Example #1
6
 protected function comment($comment, $depth, $args)
 {
     // each comment markup, without </li>!
     $classes = implode(' ', get_comment_class()) . ($comment->comment_author_email == get_the_author_meta('email') ? ' author-comment' : '');
     // get typical wp comment classes and if comment belong post autor add "author-comment" class
     echo '<li id="li-comment-' . get_comment_ID() . '" class="' . $classes . '">' . "\n";
     // parent tag with classes and uniq id
     echo '<div id="comment-' . get_comment_ID() . '">' . "\n";
     // anchor element with this id need to anchor links on comments works
     echo get_avatar($comment, 64) . "\n";
     // show avatar with size 64x64 px
     echo '<p class="meta">Posted by: ' . get_comment_author() . "\n";
     // comment autor name
     echo ' ' . get_comment_author_email();
     // comment autor email
     echo ' ' . get_comment_author_url();
     // comment autor url
     echo ' On ' . get_comment_date('F j, Y') . ' at ' . get_comment_time() . '</p>' . "\n";
     // date and time of comment creating
     if ('0' == $comment->comment_approved) {
         echo '<em class="comment-awaiting-moderation">Your comment is awaiting moderation</em>' . "\n";
     }
     // if comment is not approved notify of it
     comment_text() . "\n";
     // display comment text
     $reply_link_args = array('depth' => $depth, 'reply_text' => 'Reply on it', 'login_text' => 'You must be logged to post comments');
     echo get_comment_reply_link(array_merge($args, $reply_link_args));
     // display reply link
     echo '</div>' . "\n";
     // anchor element end
 }
    function dsq_render_single_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>
		<li id="dsq-comment-<?php 
        echo (int) get_comment_ID();
        ?>
">
			<div id="dsq-comment-header-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-header">
				<cite id="dsq-cite-<?php 
        echo (int) get_comment_ID();
        ?>
">
					<?php 
        if (comment_author_url()) {
            ?>
						<a id="dsq-author-user-<?php 
            echo (int) get_comment_ID();
            ?>
" href="<?php 
            echo esc_url(get_comment_author_url());
            ?>
" target="_blank" rel="nofollow"><?php 
            echo esc_html(get_comment_author());
            ?>
</a>
					<?php 
        } else {
            ?>
						<span id="dsq-author-user-<?php 
            echo (int) get_comment_ID();
            ?>
"><?php 
            echo esc_html(get_comment_author());
            ?>
</span>
					<?php 
        }
        ?>
				</cite>
			</div>
			<div id="dsq-comment-body-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-body">
				<div id="dsq-comment-message-<?php 
        echo (int) get_comment_ID();
        ?>
" class="dsq-comment-message"><?php 
        wp_filter_kses(comment_text());
        ?>
</div>
			</div>
		</li>
		<?php 
    }
Example #3
1
 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";
     // закрываем див
 }
        function start_el(&$output, $comment, $depth = 0, $args = array(), $id = 0)
        {
            $depth++;
            $GLOBALS['comment_depth'] = $depth;
            $GLOBALS['comment'] = $comment;
            if (!empty($args['callback'])) {
                call_user_func($args['callback'], $comment, $args, $depth);
                return;
            }
            extract($args, EXTR_SKIP);
            ?>

  <li id="comment-<?php 
            comment_ID();
            ?>
" <?php 
            comment_class('media comment-' . get_comment_ID());
            ?>
>
    <?php 
            //include(locate_template('view/loop/comment.php'));
            ?>
    <?php 
            include locate_template('comment.php');
            ?>
  <?php 
        }
Example #5
0
function render_comment_meta_box($post)
{
    // create a nonce field
    wp_nonce_field('my_comment_meta_box_nonce', 'comment_meta_box_nonce');
    $comment_id = get_comment_ID();
    ?>
    
	<style>

	#namediv h3 label {
		vertical-align: baseline;
	}
	#comments-meta table {
		width: 100%;
	}
	#comments-meta td.first {
		white-space: nowrap;
		width: 10px;
	}
	#comments-meta input {
		width: 98%;
	}
	#comments-meta p {
		margin: 10px 0;
	}
    </style>    
    <div class="inside">
    <table class="form-table editcomment" id="comments-meta">
        <tbody>
        <tr>
            <td class="first">Párrafo Index:</td>
            <td><input type="text" id="parrafo_index" value="<?php 
    echo comment_get_custom_field('parrafo_index', $comment_id);
    ?>
" size="30" name="parrafo_index"></td>
        </tr>
        <tr>
            <td class="first">
            Tipo de Comentario:</td>
            <td><input type="text" id="tipo_comentario" value="<?php 
    echo comment_get_custom_field('tipo_comentario', $comment_id);
    ?>
" size="30" name="tipo_comentario"></td>
        </tr>
        
        <tr>
            <td class="first">
            Texto Seleccionado:</td>
            <td><input type="text" id="tipo_comentario" value='<?php 
    echo comment_get_custom_field('highlight_span_info', $comment_id);
    ?>
' size="30" name="tipo_comentario"></td>
        </tr>
        </tbody>
    </table>
    </div>

<?php 
}
Example #6
0
    function start_el(&$output, $comment, $depth, $args, $id = 0)
    {
        $depth++;
        $GLOBALS['comment_depth'] = $depth;
        $GLOBALS['comment'] = $comment;
        if (!empty($args['callback'])) {
            call_user_func($args['callback'], $comment, $args, $depth);
            return;
        }
        extract($args, EXTR_SKIP);
        ?>

  <li <?php 
        comment_class('media comment-' . get_comment_ID());
        ?>
>
    <?php 
        echo get_avatar($comment, $size = '64');
        ?>
    <div class="media-body">
      <h4 class="media-heading"><?php 
        echo get_comment_author_link();
        ?>
</h4>
      <time datetime="<?php 
        echo comment_date('c');
        ?>
"><a href="<?php 
        echo htmlspecialchars(get_comment_link($comment->comment_ID));
        ?>
"><?php 
        printf(__('%1$s', 'roots'), get_comment_date(), get_comment_time());
        ?>
</a></time>
      <?php 
        edit_comment_link(__('(Edit)', 'roots'), '', '');
        ?>

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

      <?php 
        comment_text();
        ?>
      <?php 
        comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
  <?php 
    }
Example #7
0
 public function parse_lists_in_comment($content, $comment = null)
 {
     $this->post_ID = '';
     $this->comment_ID = get_comment_ID();
     $content = wp_kses_post($content);
     // we need to this this here because we removed the wp_kses_post filter in o2_Comment_List_Creator __construct
     $this->user_can_edit_object = $this->current_user_can_edit_checklist('comment', $this->comment_ID);
     return $this->parse_lists($content);
 }
Example #8
0
function ldc_dislike_counter_c($text = "dislikes: ", $post_id = NULL)
{
    global $comment;
    if (empty($post_id)) {
        $post_id = get_comment_ID();
    }
    $ldc_return = "<span class='ldc-ul_cont' onclick=\"alter_ul_post_values(this,'{$post_id}','c_dislike')\" >" . $text . "<img src=\"" . plugins_url('images/down.png', __FILE__) . "\" />(<span>" . get_post_ul_meta($post_id, "c_dislike") . "</span>)</span>";
    return $ldc_return;
}
 function thematic_commentmeta($print = TRUE)
 {
     $content = '<div class="comment-meta">' . sprintf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'thematic'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment'), __('Edit', 'thematic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('thematic_commentmeta', $content) : apply_filters('thematic_commentmeta', $content);
 }
function chaostheory_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
<li id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class();
    ?>
>
	<div id="div-comment-<?php 
    comment_ID();
    ?>
">
	<ul class="comment-meta">
		<li class="comment-author vcard">
		<div class="comment-avatar"><?php 
    if ($args['avatar_size'] != 0) {
        echo get_avatar($comment, $args['avatar_size']);
    }
    ?>
</div>
		<span class="fn"><?php 
    comment_author_link();
    ?>
</span></li>
		<?php 
    printf(__('<li>Posted %1$s at %2$s</li> <li><a href="%3$s" title="Permalink to this comment">Permalink</a></li>', 'chaostheory'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
    ?>
 <li><?php 
    edit_comment_link(__('(Edit)', 'chaostheory'), ' ', '');
    ?>
 <?php 
    comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</li>
	</ul>
	<div class="comment-content">
		<?php 
    if ($comment->comment_approved == '0') {
        ?>
<span class="unapproved"><?php 
        _e('Your comment is awaiting moderation.', 'chaostheory');
        ?>
</span><?php 
    }
    ?>
		<?php 
    comment_text();
    ?>
	</div>
	</div>
<?php 
}
 /**
  * Remove post author URL
  *
  * @since  1.0.0
  * @access public
  * @return string remove the author's url from comment post
  */
 function remove_post_author_weburl($return)
 {
     global $comment, $post;
     if (!is_admin()) {
         $author = get_comment_author(get_comment_ID());
         return $author;
     } else {
         return $return;
     }
 }
 /**
  * Create comment meta
  * 
  * Located in discussion.php
  * 
  * Override: childtheme_override_commentmeta <br>
  * Filter: cleanyetibasic_commentmeta
  */
 function cleanyetibasic_commentmeta($print = TRUE)
 {
     $content = '<div class="comment-meta">' . sprintf(_x('Posted %s at %s', 'Posted {$date} at {$time}', 'cleanyetibasic'), get_comment_date(), get_comment_time());
     $content .= ' <span class="meta-sep">|</span> ' . sprintf('<a href="%1$s" title="%2$s">%3$s</a>', '#comment-' . get_comment_ID(), __('Permalink to this comment', 'cleanyetibasic'), __('Permalink', 'cleanyetibasic'));
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s" title="%2$s">%3$s</a></span>', get_edit_comment_link(), __('Edit comment', 'cleanyetibasic'), __('Edit', 'cleanyetibasic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('cleanyetibasic_commentmeta', $content) : apply_filters('cleanyetibasic_commentmeta', $content);
 }
Example #13
0
function comment_add_at_parent($comment_text)
{
    $comment_ID = get_comment_ID();
    $comment = get_comment($comment_ID);
    if ($comment->comment_parent) {
        $parent_comment = get_comment($comment->comment_parent);
        $comment_text = '<a href="#comment-' . $comment->comment_parent . '">@' . $parent_comment->comment_author . '</a> ' . $comment_text;
    }
    return $comment_text;
}
/**
 * Adds the custom CSS classes to the comments
*/
function smittenkitchen_comment_classes($classes)
{
    if ($sk_madethis = get_comment_meta(get_comment_ID(), 'sk_madethis', true)) {
        $classes[] = 'i-made-this';
    }
    if ($sk_question = get_comment_meta(get_comment_ID(), 'sk_question', true)) {
        $classes[] = 'i-have-a-question';
    }
    return $classes;
}
Example #15
0
    function start_lvl(&$output, $depth = 0, $args = array())
    {
        $GLOBALS['comment_depth'] = $depth + 1;
        ?>
    <!-- <ul <?php 
        comment_class('media unstyled comment-' . get_comment_ID());
        ?>
> -->
    <?php 
    }
Example #16
0
/**
 * Displays the author karma.
 */
function hmn_cp_the_comment_author_karma()
{
    if (class_exists('CommentPopularity\\HMN_Comment_Popularity')) {
        $hmn_cp_obj = CommentPopularity\HMN_Comment_Popularity::get_instance();
        $author_karma = $hmn_cp_obj->get_comment_author_karma(get_comment_author_email(get_comment_ID()));
        if (isset($author_karma)) {
            echo '<small class="user-karma">(User Karma: ' . esc_html($author_karma) . ')</small>';
        }
    }
}
Example #17
0
function sandbox_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    extract($args, EXTR_SKIP);
    ?>
<li <?php 
    comment_class(sandbox_comment_class(false));
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
	<div id="div-comment-<?php 
    comment_ID();
    ?>
">
	<div class="vcard">
	<?php 
    if ($args['avatar_size'] != 0) {
        echo get_avatar($comment, $args['avatar_size']);
    }
    ?>
	<div class="comment-author fn"><?php 
    comment_author_link();
    ?>
</div>
	</div>
	<?php 
    if ($comment->comment_approved == '0') {
        ?>
<span class="unapproved"><?php 
        _e('Your comment is awaiting moderation.', 'sandbox');
        ?>
</span><?php 
    }
    ?>
	<div class="comment-meta">
		<?php 
    printf(__('Posted %1$s at %2$s <span class="metasep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'sandbox'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
    ?>
 <? edit_comment_link(__('(Edit)', 'sandbox'), ' ', ''); ?>

	</div>
	<?php 
    comment_text();
    ?>

	<div class="reply">
		<?php 
    comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
	</div>
	</div>
<?php 
}
Example #18
0
function wpbx_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $commenter = get_comment_author_link();
    if (ereg('<a[^>]* class=[^>]+>', $commenter)) {
        $commenter = ereg_replace('(<a[^>]* class=[\'"]?)', '\\1url ', $commenter);
    } else {
        $commenter = ereg_replace('(<a )/', '\\1class="url "', $commenter);
    }
    $avatar_email = get_comment_author_email();
    $avatarURL = get_bloginfo('template_directory');
    $avatar = str_replace("class='avatar", "class='avatar", get_avatar($avatar_email, 40, $default = $avatarURL . '/images/gravatar-blank.jpg'));
    ?>
	<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
		<div id="div-comment-<?php 
    comment_ID();
    ?>
">
			<div class="comment-author vcard">
				<?php 
    echo $avatar . ' <span class="fn n">' . $commenter . '</span>';
    ?>
			</div>
			<div class="comment-meta">
				<?php 
    printf(__('%1$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'wpbx'), get_comment_date('j M Y', '', '', false), get_comment_time(), '#comment-' . get_comment_ID());
    edit_comment_link(__('Edit', 'wpbx'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
				<span class="reply-link">
					<span class="meta-sep">|</span> <?php 
    comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
				</span>
			</div>

			<?php 
    if ($comment->comment_approved == '0') {
        _e("\t\t\t\t\t<span class='unapproved'>Your comment is awaiting moderation.</span>\n", 'wpbx');
    }
    ?>

			<div class="comment-content"><?php 
    comment_text();
    ?>
</div>
		</div>
<?php 
}
Example #19
0
    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;
        }
    }
Example #20
0
/**
 * [mo_comments_list description]
 * @param  [type] $comment [description]
 * @param  [type] $args    [description]
 * @param  [type] $depth   [description]
 * @return [type]          [description]
 */
function mo_comments_list($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    global $commentcount, $wpdb, $post;
    if (!$commentcount) {
        //初始化楼层计数器
        $comments = $wpdb->get_results("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = {$post->ID} AND comment_type = '' AND comment_approved = '1' AND !comment_parent");
        $cnt = count($comments);
        //获取主评论总数量
        $page = get_query_var('cpage');
        //获取当前评论列表页码
        $cpp = get_option('comments_per_page');
        //获取每页评论显示数量
        if (ceil($cnt / $cpp) == 1 || $page > 1 && $page == ceil($cnt / $cpp)) {
            $commentcount = $cnt + 1;
            //如果评论只有1页或者是最后一页,初始值为主评论总数
        } else {
            $commentcount = $cpp * $page + 1;
        }
    }
    echo '<li ';
    comment_class();
    echo ' id="comment-' . get_comment_ID() . '">';
    //楼层
    if (!($parent_id = $comment->comment_parent)) {
        echo '<span class="comt-f">';
        printf('#%1$s', --$commentcount);
        echo '</span>';
    }
    //头像
    echo '<div class="comt-avatar">';
    echo _get_the_avatar($user_id = $comment->user_id, $user_email = $comment->comment_author_email);
    echo '</div>';
    //内容
    echo '<div class="comt-main" id="div-comment-' . get_comment_ID() . '">';
    // echo str_replace(' src=', ' data-src=', convert_smilies(get_comment_text()));
    comment_text();
    if ($comment->comment_approved == '0') {
        echo '<span class="comt-approved">待审核</span>';
    }
    echo '<div class="comt-meta"><span class="comt-author">' . get_comment_author_link() . '</span>';
    echo _get_time_ago($comment->comment_date);
    if ($comment->comment_approved !== '0') {
        $replyText = get_comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        // echo str_replace(' href', ' href="javascript:;" data-href', $replyText );
        if (strstr($replyText, 'reply-login')) {
            echo preg_replace('# class="[\\s\\S]*?" href="[\\s\\S]*?"#', ' class="signin-loader" href="javascript:;"', $replyText);
        } else {
            echo preg_replace('# href=[\\s\\S]*? onclick=#', ' href="javascript:;" onclick=', $replyText);
        }
    }
    echo '</div>';
    echo '</div>';
}
 /**
  * Create comment meta
  * 
  * Located in discussion.php
  * 
  * Override: childtheme_override_commentmeta <br>
  * Filter: thematic_commentmeta
  */
 function thematic_commentmeta($print = true)
 {
     $content = '<div class="comment-meta">';
     $content .= '<time datetime="' . get_comment_time('c') . '">';
     $content .= sprintf(_x('Posted %s at %s', 'Posted {$date} at {$time}', 'thematic'), get_comment_date(), get_comment_time());
     $content .= '</time>';
     $content .= ' <span class="meta-sep">|</span> ' . sprintf('<a href="%1$s">%2$s</a>', '#comment-' . get_comment_ID(), __('Permalink', 'thematic'));
     if (get_edit_comment_link()) {
         $content .= sprintf(' <span class="meta-sep">|</span><span class="edit-link"> <a class="comment-edit-link" href="%1$s">%2$s</a></span>', get_edit_comment_link(), __('Edit', 'thematic'));
     }
     $content .= '</div>' . "\n";
     return $print ? print apply_filters('thematic_commentmeta', $content) : apply_filters('thematic_commentmeta', $content);
 }
Example #22
0
function pstl_comment_text($comment = '')
{
    global $pstl_comments_count;
    $options = get_option('pstl');
    $pstl_comments_count++;
    if ($pstl_comments_count == $pstl_comments_number) {
        $comment .= $options['comment_last'];
    }
    if (get_comment_ID() == $_GET['cid']) {
        return $comment . $options['comment_after'];
    }
    return $comment;
}
Example #23
0
    function wpbpcomments($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        ?>

        <li id="comment-<?php 
        comment_ID();
        ?>
" <?php 
        comment_class();
        ?>
>
            <article>
                <div>
                    <?php 
        echo get_avatar(get_comment_author_email(get_comment_ID()), $size = '100');
        ?>
                </div>
                <div>
                    <?php 
        printf(__('<h5 class="comment-author post-title">%1$s</h5>', 'wpbp'), get_comment_author_link());
        ?>
                    <time datetime="<?php 
        echo comment_time('Y-m-j');
        ?>
" class="block-image text-push">
                            <?php 
        comment_time(__('F jS, Y', 'wpbp'));
        ?>
                    </time>
                    <?php 
        comment_text();
        ?>
                </div>
                <?php 
        if ($comment->comment_approved == '0') {
            ?>
                    <p class="awaiting-approval xxs-text vm0"><?php 
            _e('Your comment is awaiting moderation.', 'wpbp');
            ?>
</p>
                <?php 
        }
        ?>

                <?php 
        comment_reply_link(array_merge(array('reply_text' => __('Reply to ', 'wpbp') . get_comment_author()), array('depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
            </article>
        <?php 
    }
 /**
  *
  *
  * @since  1.0.0
  * @access public
  * @param
  * @return void
  */
 public function customThemeComment($comment, $args, $depth)
 {
     echo '<li id="comment-';
     echo get_comment_ID();
     echo '" ';
     echo $this->commentClass();
     echo '>';
     echo '<section>';
     echo $this->author($comment);
     echo $this->commentTime($comment);
     echo $this->editLink();
     echo $this->comment($comment);
     echo $this->replyLink($args, $depth);
     echo '</section>';
 }
Example #25
0
function springloaded_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
<li <?php 
    comment_class();
    ?>
 id="comment-<?php 
    comment_ID();
    ?>
">
			<div class="comment-gravatar">
				<?php 
    echo get_avatar($comment, 30);
    ?>
			</div>
			<div class="comment-body">
				<div class="comment-head">
					<p><?php 
    printf(__('Posted by %1$s on <a href="#comment-%2$s">%3$s at %4$s</a>'), get_comment_author_link(), get_comment_ID(), get_comment_date(), get_comment_time());
    edit_comment_link('edit', '&nbsp;&nbsp;', '');
    ?>
</p>
					<?php 
    if ($comment->comment_approved == '0') {
        ?>
						<p><em><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em></p>
					<?php 
    }
    ?>
				</div>
				<div class="comment-text">
					<?php 
    comment_text();
    ?>
					<p><?php 
    echo comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ''));
    ?>
</p>
				</div>
			</div>
		</li>
<?php 
}
Example #26
0
function custom_comments($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    $GLOBALS['comment_depth'] = $depth;
    ?>
        <li id="comment-<?php 
    comment_ID();
    ?>
" <?php 
    comment_class();
    ?>
>
                <div class="comment-author vcard"><?php 
    commenter_link();
    ?>
</div>
                <div class="comment-meta"><?php 
    printf(__('Posted %1$s at %2$s <span class="meta-sep">|</span> <a href="%3$s" title="Permalink to this comment">Permalink</a>', 'your-theme'), get_comment_date(), get_comment_time(), '#comment-' . get_comment_ID());
    edit_comment_link(__('Edit', 'your-theme'), ' <span class="meta-sep">|</span> <span class="edit-link">', '</span>');
    ?>
</div>

	       		<div class="comment-content">
	                	<?php 
    comment_text();
    ?>
	                </div>

                <?php 
    // echo the comment reply link
    if ($args['type'] == 'all' || get_comment_type() == 'comment') {
        comment_reply_link(array_merge($args, array('reply_text' => __('Reply', 'your-theme'), 'login_text' => __('Log in to reply.', 'your-theme'), 'depth' => $depth, 'before' => '<div class="comment-reply-link">', 'after' => '</div>')));
    }
    ?>

  				<?php 
    if ($comment->comment_approved == '0') {
        _e("\t\t\t\t\t<span class='info'>Your comment is awaiting moderation.</span>\n", 'your-theme');
    }
    ?>



<?php 
}
 /**
  * @param $text
  * @param $comment
  * @param $args
  *
  * @return string
  */
 public function _filter_backend_listing_add_rating($text, $comment, $args)
 {
     do {
         if (!$this->accept_stars($comment->comment_post_ID) || !is_admin()) {
             break;
         }
         if ($rating = intval(get_comment_meta(get_comment_ID(), $this->field_name, true))) {
             $html = '<div class="wrap-rating back-end-listing"><span class="rating-title">' . __('Rating:', 'fw') . '</span><div class="fw-stars-rating">';
             for ($i = 1; $i <= $this->get_max_rating(); $i++) {
                 $voted = $i <= $rating ? ' voted' : '';
                 $html .= '<span class="fa fa-star' . $voted . '" data-vote="' . $i . '"></span>';
             }
             $html .= '</div></div>';
             $text = $html . $text;
         }
     } while (false);
     return $text;
 }
Example #28
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;
}
Example #29
0
/**
 * wp_ulike_comments function for comments like/unlike display
 *
 * @author       	Alimir	 	
 * @since           1.6
 * @updated         2.3
 * @return			String
 */
function wp_ulike_comments($arg)
{
    //global variables
    global $wp_ulike_class, $wp_user_IP;
    $CommentID = get_comment_ID();
    $comment_meta = get_comment_meta($CommentID, '_commentliked', true);
    $get_like = $comment_meta != '' ? $comment_meta : 0;
    $return_userID = $wp_ulike_class->get_reutrn_id();
    $theme_class = wp_ulike_get_setting('wp_ulike_comments', 'theme');
    if (wp_ulike_get_setting('wp_ulike_comments', 'only_registered_users') != '1' or wp_ulike_get_setting('wp_ulike_comments', 'only_registered_users') == '1' && is_user_logged_in()) {
        $data = array("id" => $CommentID, "user_id" => $return_userID, "user_ip" => $wp_user_IP, "get_like" => $get_like, "method" => 'likeThisComment', "setting" => 'wp_ulike_comments', "type" => 'post', "table" => 'ulike_comments', "column" => 'comment_id', "key" => '_commentliked', "cookie" => 'comment-liked-');
        //call wp_get_ulike function from class-ulike calss
        $counter = $wp_ulike_class->wp_get_ulike($data);
        $counter = str_replace('<span class="count-box">0</span>', '<span class="count-box" style="display: none">0</span>', $counter);
        $wp_ulike = '<div id="wp-ulike-comment-' . $CommentID . '" class="wpulike ' . $theme_class . '">';
        $wp_ulike .= '<div class="counter">' . $counter . '</div>';
        $wp_ulike .= '</div>';
        $wp_ulike .= $wp_ulike_class->get_liked_users($CommentID, 'ulike_comments', 'comment_id', 'wp_ulike_comments');
        if ($arg == 'put') {
            return $wp_ulike;
        } else {
            echo $wp_ulike;
        }
    } else {
        if (wp_ulike_get_setting('wp_ulike_comments', 'only_registered_users') == '1' && !is_user_logged_in()) {
            $login_type = wp_ulike_get_setting('wp_ulike_general', 'login_type');
            if ($login_type == "button") {
                $template = $wp_ulike_class->get_template($CommentID, 'likeThisComment', $get_like, 1, 0);
                if (wp_ulike_get_setting('wp_ulike_general', 'button_type') == 'image') {
                    return '<div id="wp-ulike-comment-' . $CommentID . '" class="wpulike ' . $theme_class . '"><div class="counter">' . $template['login_img'] . '</div></div>';
                } else {
                    return '<div id="wp-ulike-comment-' . $CommentID . '" class="wpulike ' . $theme_class . '"><div class="counter">' . $template['login_text'] . '</div></div>';
                }
            } else {
                return '<p class="alert alert-info fade in" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>' . __('You need to login in order to like this comment: ', WP_ULIKE_SLUG) . '<a href="' . wp_login_url(get_permalink()) . '"> ' . __('click here', WP_ULIKE_SLUG) . ' </a></p>';
            }
        }
    }
    //end only_registered_users condition
}
Example #30
-9
 function check_follow($matches)
 {
     #support of "meta=follow" option for admins. disabled by default to minify processing.
     if (!$this->options['dont_mask_admin_follow']) {
         return false;
     }
     $id = array(get_comment_ID(), get_the_ID());
     //it is either page or post
     if ($id[0]) {
         $this->debug_info('It is a comment. id ' . $id[0]);
     } elseif ($id[1]) {
         $this->debug_info('It is a page. id ' . $id[1]);
     }
     $author = false;
     if ($id[0]) {
         $author = get_comment_author($id[0]);
     } else {
         if ($id[1]) {
             $author = get_the_author_meta('ID');
         }
     }
     if (!$author) {
         $this->debug_info('it is neither post or page, applying usual rules');
     } elseif (user_can($author, 'manage_options') && (stripos($matches[0], 'rel="follow"') !== FALSE || stripos($matches[0], "rel='follow'") !== FALSE)) {
         $this->debug_info('This link has a follow atribute and is posted by admin, not masking it.');
         #wordpress adds rel="nofollow" by itself when posting new link in comments. get rid of it! Also, remove our follow attibute - it is unneccesary.
         return str_ireplace(array('rel="follow"', "rel='follow'", 'rel="nofollow"'), '', $matches[0]);
     } else {
         $this->debug_info('it does not have rel follow or is not posted by admin, masking it');
     }
     return false;
 }