Location: PHPKode > projects > Teampopor > teampopor-0.5/teampopor/modules/message/comments.tpl.php
<?php
/**
 * .comments
 * arguments: $message
 */

$network = network_load($message->nid);
?>
<div class="comments<?php print $message->comment_count ? '' : ' hide' ?>">
  <ul>
    <?php if ($message->like_count > 0) { ?>
    <li class="likers">
      <p>
        <?php
        $result = db_query_range('SELECT * FROM {likes} WHERE mid=%d ORDER BY created DESC', $message->mid, 0, 2);
        $likes = array();
        while ($like = db_fetch_object($result)) {
          like_prepare($like);
          $likes[] = $like;
        }
        ?>
        <?php if ($message->like_count == 1) { ?>
        <?php print t('!user like this', array('!user' => l($likes[0]->user->name, 'network/' . $network->nid . '/profile/' . $likes[0]->user->uid . '/messages'))) ?>
        <?php } else if ($message->like_count == 2) { ?>
        <?php print t('!user1 and !user2 like this', array('!user1' => l($likes[0]->user->name, 'network/' . $network->nid . '/profile/' . $likes[0]->user->uid . '/messages'), '!user2' => l($likes[1]->user->name, 'network/' . $network->nid . '/profile/' . $likes[1]->user->uid . '/messages'))) ?>
        <?php } else { ?>
        <?php print t('!user1, !user2 and @others like this', array('!user1' => l($likes[0]->user->name, 'network/' . $network->nid . '/profile/' . $likes[0]->user->uid . '/messages'), '!user2' => l($likes[1]->user->name, 'network/' . $network->nid . '/profile/' . $likes[1]->user->uid . '/messages'), '@others' => l(t('@count others', array('@count' => $message->like_count - 2))))) ?>
        <?php } ?>
      </p>
    </li>
    <?php } ?>
    <?php if ($message->comment_count > 2) { ?>
    <li class="seemore debug">
      <p>
        <a href=""><?php print t('Show %count more comments', array('%count' => $message->comment_count - 2)) ?></a>
      </p>
    </li>
    <?php } ?>
    <?php if ($message->comment_count > 0) { ?>
      <?php $result = db_query_range("SELECT * FROM {messages} WHERE thread_mid = %d ORDER BY created DESC", $message->mid, 0, 2); ?>
      <?php
      $comments = array();
      while ($comment = db_fetch_object($result)) {
        message_prepare($comment);
        $comments[] = $comment;
      }
      ?>
      <?php while($comment = array_pop($comments)) { ?>
      <li>
        <a title="<?php print $comment->user->name ?>" href="<?php print url('network/' . $network->nid . '/profile/' . $message->user->uid . '/messages') ?>">
          <img class="feed-photo" width="40" height="40" alt="<?php print $comment->user->name ?>" src="<?php print url($message->user->picture) ?>">
        </a>
        <p>
          <?php print theme('miniprofile', $comment->user) ?>
          <q><?php print $comment->body ?></q>
          <span class="nus-timestamp"><?php print t('%ago ago', array('%ago' => format_interval(time() - $comment->created, 1))) ?></span>
        </p>
      </li>
      <?php } ?>
    <?php } ?>
  </ul>

  <div class="form mini">
    <?php print get_form('comment_form', $message) ?>
  </div>
</div>
Return current item: Teampopor