コード例 #1
0
ファイル: comment.php プロジェクト: cjhgithub/ctheme
function aurelius_comment($comment, $args, $depth)
{
    $GLOBALS['comment'] = $comment;
    ?>
    
<li class="comment-item" id="li-comment-<?php 
    comment_ID();
    ?>
">
	<div class="head-image">
    <?php 
    if (function_exists('get_avatar') && get_option('show_avatars')) {
        echo get_avatar($comment, 48);
        // 头像尺寸为48
    }
    ?>
	</div>
	<div class="comment-content" id="comment-<?php 
    comment_ID();
    ?>
">
		<div class="comment-info">
			<div class="comment-author-name"><?php 
    echo get_comment_author_link();
    get_author_class($comment->comment_author_email, $comment->user_id);
    if (user_can($comment->user_id, 1)) {
        echo "<a title='博主' class='vip'></a>";
    }
    ?>
</div>
			<div class="comment-text">
				<?php 
    if ($comment->comment_approved == '0') {
        ?>
                    <em>改评论正在审核!</em><br />
                <?php 
    }
    ?>
                <?php 
    comment_text();
    ?>
			</div>
			<span class="comment-time"><?php 
    echo get_comment_time('Y-m-d H:i');
    ?>
</span>
			<?php 
    comment_reply_link(array_merge($args, array('reply_text' => '回复', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
    ?>
			<?php 
    edit_comment_link('修改');
    ?>
            <?php 
    if (is_user_logged_in()) {
        $url = get_bloginfo('url');
        echo '<a id="delete-' . $comment->comment_ID . '" href="' . wp_nonce_url("{$url}/wp-admin/comment.php?action=deletecomment&amp;p=" . $comment->comment_post_ID . '&amp;c=' . $comment->comment_ID, 'delete-comment_' . $comment->comment_ID) . '"" >删除</a>';
    }
    ?>
  
            <a href="javascript:;" data-action="comment_like" data-id="<?php 
    echo $comment->comment_ID;
    ?>
" class="comment-like <?php 
    if (isset($_COOKIE['c_comment_like' . $comment->comment_ID])) {
        echo 'done';
    }
    ?>
">顶 <span class="count"><?php 
    echo get_comment_like($comment->comment_ID);
    ?>
</span></a>
            <a href="javascript:;" data-action="comment_dislike" data-id="<?php 
    echo $comment->comment_ID;
    ?>
" class="comment-dislike <?php 
    if (isset($_COOKIE['c_comment_dislike' . $comment->comment_ID])) {
        echo 'done';
    }
    ?>
">踩 <span class="count"><?php 
    echo get_comment_dislike($comment->comment_ID);
    ?>
</span></a>
			
		</div>
	</div>
  
  <!-- 
    </li> 
    -->
  
  <?php 
}
コード例 #2
0
ファイル: comments.php プロジェクト: RobertDuy/demo_to_client
        ?>
						
                                       </p>
                                        <div class="block-tool">
                							<span class="like_comment_div">
				                                <a href="javascript:;" class="like_btn btn-like-cm" id="like_comment_id-<?php 
        echo $comment->comment_ID;
        ?>
">Thích</a>
                                                <input type="hidden" id="comment_layout" value="<?php 
        echo $comment->comment_ID;
        ?>
">
                                            </span>
                							<span class="like_number"><?php 
        echo get_comment_like($comment->comment_ID);
        ?>
</span>
                						</div>
				                    </dd>
		                          </dl>
			
			                     </li>
                        
                        <?php 
    }
    ?>
				            <!--li>
				                <dl>
					               <dd>
                						<div class="top">