Esempio n. 1
0
function add_reply_to_comment($userid, $commentid, $content)
{
    validate_user_id($userid);
    validate_comment_id($commentid);
    $con = db_connect();
    $content = mysql_real_escape_string($content);
    $postid = post_parent($commentid);
    $sql = "INSERT INTO comments (user, postparent, parent, content, posttime) VALUES ({$userid}, {$postid}, {$commentid}, '{$content}', NOW())";
    $success = mysql_query($sql);
    db_close($con);
    return get_comment_id($userid, $postid, $commentid, $content);
}
function dialogue_expand_children($children, $pid, $post)
{
    if (count($children) > 0) {
        ob_start();
        $cmold = $GLOBALS['comment'];
        foreach ($children as $comment) {
            $GLOBALS['comment'] = $comment;
            dialogue_comment_div(get_comment_id(), $pid, $post);
        }
        $GLOBALS['comment'] = $cmold;
        $res = "<ul>" . ob_get_contents() . "</ul>";
        ob_end_clean();
        return $res;
    } else {
        return "";
    }
}
Esempio n. 3
0
/**
 * function thesis_commenet_meta()
 *
 * Display comment meta information, including author, author link, and time posted.
 *
 * @since 1.2
 * @uses thesis_avatar()
 */
function thesis_comment_meta($comment_number)
{
    global $thesis;
    $comment_link_before = '<a href="#comment-' . get_comment_id() . '" title="Permalink to this comment" rel="nofollow">';
    $comment_link_after = '</a>';
    if ($thesis['display']['comments']['numbers']) {
        $comment_num = '						<span class="comment_num">' . $comment_link_before . $comment_number . $comment_link_after . '</span>' . "\n";
        $comment_time = '<span class="comment_time">' . sprintf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) . '</span>';
    } else {
        $comment_time = '<span class="comment_time">' . $comment_link_before . sprintf(__('%1$s at %2$s'), get_comment_date(), get_comment_time()) . $comment_link_after . '</span>';
    }
    thesis_avatar($thesis['display']);
    echo $comment_num;
    echo '						<span class="comment_author">' . get_comment_author_link() . '</span> ' . $comment_time;
    if ($thesis['display']['admin']['edit_comment']) {
        edit_comment_link(__('edit', 'thesis'), ' <span class="edit_comment">[', ']</span>');
    }
    echo "\n";
}
    /**
     * Output a single comment.
     *
     * @access protected
     * @since 3.6.0
     *
     * @see wp_list_comments()
     *
     * @param object $comment Comment to display.
     * @param int $depth Depth of comment.
     * @param array $args An array of arguments.
     */
    protected function comment($comment, $depth, $args)
    {
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'div-comment';
        }
        ?>
        <<?php 
        echo $tag;
        comment_class($this->has_children ? 'parent' : '');
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
        <?php 
        if ('div' != $args['style']) {
            ?>
        <div id="div-comment-<?php 
            comment_ID();
            ?>
" class="comment-body">
    <?php 
        }
        ?>
        <div class="comment-author vcard">
            <?php 
        if (0 != $args['avatar_size']) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
            <?php 
        printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link());
        ?>
        </div>
        <?php 
        if ('0' == $comment->comment_approved) {
            ?>
        <em class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.');
            ?>
</em>
        <br/>
    <?php 
        }
        ?>

        <div class="comment-meta commentmetadata"><a
                href="<?php 
        echo esc_url(get_comment_link($comment->comment_ID, $args));
        ?>
">
                <?php 
        /* translators: 1: date, 2: time */
        printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
        ?>
</a><?php 
        edit_comment_link(__('(Edit)'), '&nbsp;&nbsp;', '');
        ?>
        </div>

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

        <?php 
        comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="reply">', 'after' => '</div>')));
        ?>

        <?php 
        if ('div' != $args['style']) {
            ?>
        </div>
    <?php 
        }
        ?>
        <?php 
    }
Esempio n. 5
0
/**
 * Retrieve the text of a comment.
 *
 * @since  4.0.4
 * @global int    $comment_depth
 * @param  array  $args   Arguments.
 * @return string $output Comment's text.
 */
function cherry_get_the_post_comment_text($args)
{
    global $comment_depth;
    ob_start();
    comment_text(get_comment_id(), array_merge($args, array('add_below' => 'div-comment', 'depth' => $comment_depth, 'max_depth' => get_option('thread_comments_depth') ? get_option('thread_comments_depth') : -1)));
    $comment_text = ob_get_contents();
    ob_end_clean();
    /**
     * Filter the text of a comment.
     *
     * @since 4.0.4
     * @param string $comment_text Comment's text.
     * @param array  $args         Arguments.
     */
    return apply_filters('cherry_get_the_post_comment_text', $comment_text, $args);
}
<?php

defined('ABSPATH') or die('This file can not be loaded directly.');
global $comment_ids;
$comment_ids = array();
foreach ($comments as $comment) {
    if (get_comment_type() == "comment") {
        $comment_ids[get_comment_id()] = ++$comment_i;
    }
}
if (!comments_open()) {
    return;
}
$my_email = get_bloginfo('admin_email');
$str = "SELECT COUNT(*) FROM {$wpdb->comments} WHERE comment_post_ID = {$post->ID} AND comment_approved = '1' AND comment_type = '' AND comment_author_email";
$count_t = $post->comment_count;
date_default_timezone_set(PRC);
$closeTimer = (strtotime(date('Y-m-d G:i:s')) - strtotime(get_the_time('Y-m-d G:i:s'))) / 86400;
?>
<div id="respond" class="no_webshot">
	<?php 
if (get_option('comment_registration') && !is_user_logged_in()) {
    ?>
	<h3 class="queryinfo">
		<?php 
    printf('您必须 <a href="%s">登录</a> 才能发表评论!', wp_login_url(get_permalink()));
    ?>
	</h3>
	<?php 
} elseif (get_option('close_comments_for_old_posts') && $closeTimer > get_option('close_comments_days_old')) {
    ?>
Esempio n. 7
0
        /**
         * Output a single comment.
         *
         * @access protected
         * @since 3.6.0
         *
         * @see wp_list_comments()
         *
         * @param object $comment Comment to display.
         * @param int    $depth   Depth of comment.
         * @param array  $args    An array of arguments.
         */
        protected function comment($comment, $depth, $args)
        {
            if ('div' == $args['style']) {
                $tag = 'div';
                $add_below = 'comment';
            } else {
                $tag = 'li';
                $add_below = 'div-comment';
            }
            ?>
					<<?php 
            echo $tag;
            ?>
 <?php 
            comment_class(empty($args['has_children']) ? '' : 'parent');
            ?>
 id="comment-<?php 
            comment_ID();
            ?>
">
					<?php 
            if ('div' != $args['style']) {
                ?>
					<div id="div-comment-<?php 
                comment_ID();
                ?>
" class="comment-body">
						<?php 
            }
            ?>
                        
                        
                        <div class="comment-author vcard">
                            <?php 
            if (0 != $args['avatar_size']) {
                echo get_avatar($comment, $args['avatar_size']);
            }
            ?>
                            
                            <div class="comment-author-details">
                                <?php 
            printf(__('<h6 class="no-margin-padding">%s</h6>'), get_comment_author_link());
            ?>
                                <div class="comment-meta commentmetadata"><a href="<?php 
            echo esc_url(get_comment_link($comment->comment_ID, $args));
            ?>
">
                                <?php 
            /* translators: 1: date, 2: time */
            printf(__('%1$s at %2$s', 'candy'), get_comment_date('M j, Y'), get_comment_time('G:i'));
            ?>
</a><?php 
            edit_comment_link(__('(Edit)', 'candy'), '&nbsp;&nbsp;', '');
            ?>
                            </div>
                        
                        </div>
					</div>
                    
                    
					<?php 
            if ('0' == $comment->comment_approved) {
                ?>
					<em class="comment-awaiting-moderation"><?php 
                _e('Your comment is awaiting moderation.', 'candy');
                ?>
</em>
					<br />
					<?php 
            }
            ?>
			
					
			
					<?php 
            comment_text(get_comment_id(), array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
            ?>
			
					<div class="reply">
						<?php 
            comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
            ?>
					</div>
					<?php 
            if ('div' != $args['style']) {
                ?>
					</div>
					<?php 
            }
            ?>
			<?php 
        }
    /**
     * Output a single comment.
     *
     * @access protected
     * @since 3.6.0
     *
     * @see wp_list_comments()
     *
     * @param object $comment Comment to display.
     * @param int    $depth   Depth of comment.
     * @param array  $args    An array of arguments.
     */
    protected function comment($comment, $depth, $args)
    {
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'div-comment';
        }
        ?>
		<<?php 
        echo $tag;
        ?>
 <?php 
        comment_class($this->has_children ? 'parent' : '', $comment);
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
		<?php 
        if ('div' != $args['style']) {
            ?>
		<div id="div-comment-<?php 
            comment_ID();
            ?>
" class="comment-body">
		<?php 
        }
        ?>
		<div class="comment-author vcard">
			<div class="row">
				<div class="col-xs-3 col-sm-3 col-md-3 col-lg-2">
					<?php 
        if (0 != $args['avatar_size']) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
				</div>	
				<div class="col-xs-3 col-sm-3 col-md-3 col-lg-10 text-left">
							<?php 
        printf(__('<span class="fn">%s</span>'), get_comment_author_link($comment));
        ?>
							<div class="comment-meta commentmetadata">
								<span class="comment-time"><?php 
        echo get_comment_time('g:i A');
        ?>
</span>
								<span class="comment-date"><?php 
        echo get_comment_date('j F Y', $comment);
        ?>
</span>
								<?php 
        /* translators: 1: comment date, 2: comment time */
        // printf( __( '%1$s at %2$s' ), get_comment_date( '', $comment ),  get_comment_time() );
        ?>
							</div>
							<?php 
        if ('0' == $comment->comment_approved) {
            ?>
							<em class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.');
            ?>
</em>
							<br />
							<?php 
        }
        ?>

							

							<div class="comment-text"><?php 
        comment_text(get_comment_id(), array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
														<?php 
        edit_comment_link(__('(Редактировать)'), '&nbsp;&nbsp;', '');
        ?>
							<ul class="vote">
								<li class="upvote">
									<a href="#"><img src="<?php 
        echo get_template_directory_uri();
        ?>
/images/upvote.png"></a>
									<span>12</span>
								</li>
								<li class="downvote">
									<a href="#"><img src="<?php 
        echo get_template_directory_uri();
        ?>
/images/downvote.png"></a>
									<span>2</span>
								</li>
							</ul>
							</div>
							<?php 
        comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="reply text-right">', 'after' => '</div>')));
        ?>

							<?php 
        if ('div' != $args['style']) {
            ?>
				</div>
			</div>
		</div>
		</div>
		<?php 
        }
    }
    public static function _render_comment($comment, $args, $depth)
    {
        $tag = 'li';
        $add_below = 'comment';
        if (1 < $depth) {
            $tag = 'div';
        }
        ?>
		<<?php 
        echo $tag;
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
" <?php 
        comment_class('media', $comment);
        ?>
>
			<?php 
        if (('pingback' === $comment->comment_type || 'trackback' === $comment->comment_type) && $args['short_ping']) {
            ?>
				<div class="media-body">
					<h4><?php 
            _e('Pingback:', 'wp-starter-theme');
            ?>
 <?php 
            comment_author_link($comment);
            ?>
</h4>
					<div class="comment-metadata">
						<?php 
            edit_comment_link(__('Edit Pingback', 'wp-starter-theme'), '<span class="edit-pingback">', '</span>');
            ?>
					</div>
			<?php 
        } else {
            ?>
				<?php 
            if (0 != $args['avatar_size']) {
                ?>
					<div class="media-left">
						<?php 
                if (get_comment_author_url($comment)) {
                    ?>
							<a href="<?php 
                    comment_author_url($comment);
                    ?>
" rel="external nofollow">
								<?php 
                    echo get_avatar($comment, $args['avatar_size']);
                    ?>
							</a>
						<?php 
                } else {
                    ?>
							<span>
								<?php 
                    echo get_avatar($comment, $args['avatar_size']);
                    ?>
							</span>
						<?php 
                }
                ?>
					</div>
				<?php 
            }
            ?>
				<div class="media-body">
					<?php 
            if ('0' == $comment->comment_approved) {
                ?>
						<div class="alert alert-info">
							<p><?php 
                _e('Your comment is awaiting moderation.', 'wp-starter-theme');
                ?>
</p>
						</div>
					<?php 
            }
            ?>
					<?php 
            TemplateTags::the_comment_meta($comment, $add_below, $depth, $args['max_depth']);
            ?>
					<div class="comment-content">
						<?php 
            comment_text(get_comment_id(), array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
            ?>
					</div>
			<?php 
        }
        ?>
		<?php 
    }
Esempio n. 10
0
    /**
     * Custom callback for the comment item.
     */
    function milkit_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        extract($args, EXTR_SKIP);
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'div-comment';
        }
        ?>

		<<?php 
        echo esc_attr($tag);
        ?>
 <?php 
        comment_class(empty($args['has_children']) ? 'parent' : '');
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
" itemscope="itemscope" itemtype="http://schema.org/Comment">
			<?php 
        if ('div' != $args['style']) {
            ?>
			<div id="div-comment-<?php 
            comment_ID();
            ?>
" class="comment-body">
			<?php 
        }
        ?>
			<span class="comment-author">
				<?php 
        if (0 != $args['avatar_size']) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
				<?php 
        printf(__('<cite itemprop="author">%s</cite>'), get_comment_author_link());
        ?>
			</span>

			<?php 
        $time_string = '<time class="entry-date published" itemprop="datePublished" datetime="%1$s">%2$s</time>';
        $time_string = sprintf($time_string, esc_attr(get_comment_date('c')), esc_html(get_comment_date('M j, Y')));
        ?>

			<span class="comment-meta commentmetadata">
				<a href="<?php 
        echo esc_url(get_comment_link($comment->comment_ID, $args));
        ?>
"><?php 
        echo $time_string;
        ?>
</a>
				<?php 
        edit_comment_link(__('(Edit)', 'milkit'), '', '');
        ?>
			</span>

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

			<div class="comment-text" itemprop="text">
				<?php 
        comment_text(get_comment_id(), array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
			</div>

			<?php 
        comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="reply">', 'after' => '</div>')));
        ?>

			<?php 
        if ('div' != $args['style']) {
            ?>
			</div>
			<?php 
        }
        ?>

		<?php 
    }
Esempio n. 11
0
    function materialist_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case 'pingback':
            case 'trackback':
                // Display trackbacks differently than normal comments.
                ?>
	<li <?php 
                comment_class();
                ?>
 id="comment-<?php 
                comment_ID();
                ?>
">
		<p><?php 
                _e('Pingback:', 'materialist');
                ?>
 <?php 
                comment_author_link();
                ?>
 <?php 
                edit_comment_link(__('(Edit)', 'materialist'), '<span class="edit-link">', '</span>');
                ?>
</p>
	<?php 
                break;
            default:
                // Proceed with normal comments.
                global $post;
                ?>
	<li <?php 
                comment_class();
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
		<div id="comment-<?php 
                comment_ID();
                ?>
" class="comment-body">
			<div class="comment-author vcard">
				<?php 
                if (0 != $args['avatar_size']) {
                    echo get_avatar($comment, $args['avatar_size']);
                }
                ?>
				<?php 
                printf(__('<cite class="fn">%s</cite>'), get_comment_author_link());
                ?>
			</div>

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

			<div class="comment-meta commentmetadata">
				<a href="<?php 
                echo esc_url(get_comment_link($comment->comment_ID, $args));
                ?>
">
				<?php 
                echo get_comment_date();
                ?>
				</a>

				<?php 
                edit_comment_link(__('| Edit', 'materalist'), '&nbsp;', '');
                ?>
			</div>

			<?php 
                comment_text(get_comment_id(), array_merge($args, array('add_below' => 'comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
                ?>

			<div class="reply">
				<?php 
                comment_reply_link(array_merge($args, array('add_below' => 'comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<div class="reply">', 'after' => '</div>')));
                ?>
			</div><!-- .reply -->
		</div><!-- #comment-## -->
	<?php 
                break;
        }
        // end comment_type check
    }
Esempio n. 12
0
function mytheme_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
  <div class="acommentmsg" data-id="<?php 
    comment_ID();
    ?>
" id="comment-<?php 
    comment_ID();
    ?>
">
    <div class="fl clistavatar"><?php 
    echo get_avatar($comment, $size = '50');
    ?>
</div>
	<div class="fr" style="font-size:20px;color:#f78585;"><?php 
    global $comment_ids;
    $comment_floor = $comment_ids[get_comment_id()];
    echo $comment_floor . '#';
    ?>
</div>
    <div class="clistcontent" style="margin-left:60px;">
      <div class="athead"><span class="light"><?php 
    echo get_comment_author_link();
    ?>
</span><?php 
    echo get_comment_date() . get_comment_time();
    ?>
 <span class="light"><?php 
    comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
</span></div>
      <div class="atcontent">
        <div class="replycontent"><?php 
    comment_text();
    if ($comment->comment_approved == '0') {
        echo '<font color="#f60"><b>您的评论正在审核!</b></font>';
    }
    ?>
</div>
        </div>
    </div>
  </div>
<?php 
}
    /**
     * Output a single comment.
     *
     * @access protected
     * @since 3.6.0
     *
     * @see wp_list_comments()
     *
     * @param object $comment Comment to display.
     * @param int    $depth   Depth of comment.
     * @param array  $args    An array of arguments.
     */
    protected function comment($comment, $depth, $args)
    {
        /** @var $ext_instance FW_Extension_FeedBack_Stars */
        $ext_instance = fw()->extensions->get('feedback-stars');
        if (file_exists($ext_instance->locate_view_path('listing-review-html5'))) {
            fw_render_view($ext_instance->locate_view_path('listing-review'), array('comment' => $comment, 'depth' => $depth, 'args' => $args, 'has_children' => $this->has_children, 'stars_number' => $ext_instance->get_max_rating(), 'rate' => get_comment_meta($comment->comment_ID, $ext_instance->field_name, true)), false);
            return;
        }
        if ('div' == $args['style']) {
            $tag = 'div';
            $add_below = 'comment';
        } else {
            $tag = 'li';
            $add_below = 'div-comment';
        }
        ?>
		<<?php 
        echo $tag;
        ?>
 <?php 
        comment_class($this->has_children ? 'parent' : '');
        ?>
 id="comment-<?php 
        comment_ID();
        ?>
">
		<?php 
        if ('div' != $args['style']) {
            ?>
			<div id="div-comment-<?php 
            comment_ID();
            ?>
" class="comment-body">
		<?php 
        }
        ?>
		<div class="comment-author vcard">
			<?php 
        if (0 != $args['avatar_size']) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>
			<?php 
        echo '<cite class="fn">' . get_comment_author_link() . '</cite> <span class="says">' . __('says', 'fw') . ':</span>';
        ?>
		</div>
		<?php 
        if ('0' == $comment->comment_approved) {
            ?>
			<em class="comment-awaiting-moderation"><?php 
            _e('Your comment is awaiting moderation.', 'fw');
            ?>
</em>
			<br />
		<?php 
        }
        ?>

		<div class="comment-meta commentmetadata"><a href="<?php 
        echo esc_url(get_comment_link($comment->comment_ID, $args));
        ?>
">
				<?php 
        /* translators: 1: date, 2: time */
        printf(__('%1$s at %2$s', 'fw'), get_comment_date(), get_comment_time());
        ?>
</a><?php 
        edit_comment_link(__('(Edit)', 'fw'), '&nbsp;&nbsp;', '');
        ?>
		</div>

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

		<div class="reply">
			<?php 
        comment_reply_link(array_merge($args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth'])));
        ?>
		</div>
		<?php 
        if ('div' != $args['style']) {
            ?>
			</div>
		<?php 
        }
        ?>
	<?php 
    }
Esempio n. 14
0
    /**
     * Template for comments and pingbacks.
     *
     * Used as a callback by wp_list_comments() for displaying the comments.
     */
    function obscure_comment($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        switch ($comment->comment_type) {
            case '':
                ?>
	<li <?php 
                comment_class();
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
		<div id="comment-<?php 
                comment_ID();
                ?>
">
		<div class="comment-info clearfix">
            <div class="comment-avatar clearfix">
                <?php 
                echo get_avatar($comment, 48);
                ?>
            </div><!-- .comment-author .vcard -->
    
            <div class="comment-meta commentmetadata">
            	<span class="comment-author vcard"><?php 
                comment_author_link();
                ?>
</span>
                <?php 
                /* translators: 1: date, 2: time, 3: permalink */
                printf(__('%1$s at %2$s | <a href="#comment-%3$s">Permalink</a> | ', 'obscure'), get_comment_date(), get_comment_time(), get_comment_id());
                comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
                ?>
            </div><!-- .comment-meta .commentmetadata -->
        </div>

		<div class="comment-body"><?php 
                comment_text();
                ?>
</div>
        <?php 
                if ($comment->comment_approved == '0') {
                    ?>
			<em><?php 
                    _e('Your comment is awaiting moderation.', 'obscure');
                    ?>
</em>
			<br />
		<?php 
                }
                ?>
	</div><!-- #comment-##  -->

	<?php 
                break;
            case 'pingback':
            case 'trackback':
                ?>
	<li class="post pingback">
    	<div id="comment-<?php 
                comment_ID();
                ?>
">
        	<div class="comment-info clearfix">
            	<div class="comment-body">
					<p><?php 
                _e('Pingback:', 'obscure');
                ?>
 <?php 
                comment_author_link();
                edit_comment_link(__('(Edit)', 'obscure'), ' ');
                ?>
</p>
				</div>
            </div>
		</div>
	<?php 
                break;
        }
    }
Esempio n. 15
0
function add_quote_button_filter($output) {

	global $user_ID;
	if (get_option('comment_registration') && !$user_ID) {
		
		return $output;
		
	} else if (!is_feed() && comments_open()) {

		$commentID = get_comment_id();

		if (function_exists('mcecomment_init')) {
			$mce = ", true";
		} else {
			$mce = ", false";
		}

		// quote link
		$button = "";
		$button .= '</a>&nbsp;&nbsp;';
		$button .= '<span id="name'.get_comment_ID().'" style="display: none;">'.get_comment_author().'</span>';
		$button .= '<a class="comment_quote_link" ';
		$button .= 'href="javascript:void(null)" ';
		$button .= 'title="' . __('Click here or select text to quote comment', 'quote-comments'). '" ';
		
		if( get_option('quote_comments_author') == true ) {
			$button .= 'onmousedown="quote(\'' . get_comment_ID() .'\', document.getElementById(\'name'.get_comment_ID().'\').innerHTML, \'comment\',\'div-comment-'. get_comment_ID() .'\''. $mce .');';
		} else {
			$button .= 'onmousedown="quote(\'' . get_comment_ID() .'\', null, \'comment\',\'div-comment-'. get_comment_ID() .'\''. $mce .');';
		}
		
		$button .= 'try { addComment.moveForm(\'div-comment-'.get_comment_ID().'\', \''.get_comment_ID().'\', \'respond\', \''.get_the_ID().'\'); } catch(e) {}; ';
		$button .= 'return false;">';
		$button .= "" . get_option('quote_comments_title') . "";
		
		
		// reply link
		if (get_option('quote_comments_replylink') == true) {
			$button .= '</a>&nbsp;&nbsp;';
			$button .= '<a class="comment_reply_link" href="javascript:void(null)" ';
			$button .= 'title="' . __('Click here to respond to author', 'quote-comments'). '" ';
			$button .= 'onmousedown="inlinereply(\'' . get_comment_ID() .'\', document.getElementById(\'name'.get_comment_ID().'\').innerHTML, \'comment\',\'div-comment-'. get_comment_ID() .'\''. $mce .');';
			$button .= 'try { addComment.moveForm(\'div-comment-'.get_comment_ID().'\', \''.get_comment_ID().'\', \'respond\', \''.get_the_ID().'\'); } catch(e) {}; ';
			$button .= 'return false;">';
			$button .= "" . get_option('quote_comments_replytitle') . "";
		}
		
		// close anchor link if body text
		if (get_option('quote_comments_pluginhook') == "get_comment_text") {
			$button .= "</a>";
		}



		if (comments_open() && have_comments() && get_comment_type() != "pingback" && get_comment_type() != "trackback") {
			return($output . $button);
		}

	
	} else {
	
		return($output . $button);
	
	}



}
Esempio n. 16
0
    function outdoor_comment_template($comment, $args, $depth)
    {
        $GLOBALS['comment'] = $comment;
        // End php code
        ?>

        <li <?php 
        comment_class('');
        ?>
 id="li-comment-<?php 
        comment_ID();
        ?>
">
            <div id="comment-<?php 
        comment_ID();
        ?>
">
                <?php 
        if (0 != $args['avatar_size']) {
            echo get_avatar($comment, $args['avatar_size']);
        }
        ?>

                <div class="meta">
                    <?php 
        printf(__('<cite class="fn">%s</cite>'), get_comment_author());
        ?>
                    <?php 
        /* translators: 1: date, 2: time */
        printf(__('<time> &nbsp;&mdash; &nbsp; %1$s at %2$s</time>'), get_comment_date(), get_comment_time());
        edit_comment_link(__('(Edit)'), '&nbsp;&nbsp;', '');
        ?>
                    <?php 
        comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '', 'after' => '')));
        ?>
                </div>

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

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

            </div>

    <?php 
        // Start php code
    }