예제 #1
0
function wplms_unit_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();
    ?>
" data-id="<?php 
    comment_ID();
    ?>
">
      <div id="div-comment-<?php 
    comment_ID();
    ?>
" class="unit-comment-body">
          <div class="unit-comment-author vcard">
              <?php 
    if ($args['avatar_size'] != 0) {
        if (function_exists('bp_core_fetch_avatar')) {
            echo bp_core_fetch_avatar(array('item_id' => $comment->user_id, 'type' => 'thumb'));
        }
    }
    ?>
          </div>
          <div class="unit-comment-text">
          <?php 
    echo '<cite class="fn">' . bp_core_get_user_displayname($comment->user_id) . '</cite>';
    ?>
           <div class="unit-comment-meta commentmetadata">
                <?php 
    if (current_user_can('edit_posts')) {
        ?>
  <a href="<?php 
        echo htmlspecialchars(get_comment_link($comment->comment_ID));
        ?>
"><?php 
    }
    $time_passed = human_time_diff(get_comment_time('U'), current_time('timestamp'));
    printf(__('%s ago', 'vibe'), $time_passed);
    if (current_user_can('edit_posts')) {
        ?>
</a><?php 
    }
    ?>
          </div>
          <?php 
    if ($comment->comment_approved == '0') {
        ?>
          <em class="comment-awaiting-moderation"><?php 
        _e('Your comment is awaiting moderation.');
        ?>
</em>
          <?php 
    }
    ?>
              <?php 
    $mycomment = get_comment_text();
    //$crayon = '<pre class="lang:html toolbar:always mark:1">' . $mycomment . '</pre>';
    // Add Crayon to content
    echo CrayonWP::highlight($mycomment);
    ?>
              <div class="reply" data-parent="<?php 
    comment_ID();
    ?>
">
                 <a ><?php 
    _e('REPLY', 'vibe');
    ?>
</a>
              </div>
          </div>
      </div>
  </li>
<?php 
}