<?php use_helper('Javascript') ?>
<?php $baseLink = 'entry/showlike?entry_id='.$entry_id ?>
<div id="feedback">
  <?php if ($tblblogentry->getEntryType() == 2): ?>
    Số lượt thích:
  <?php else: ?>
    <b>Số lượt thích:</b>
  <?php endif; ?>

  <?php echo $likeNum ?> người
  <?php if ($likeNum > 0): ?>
    <?php if ($showAllLike): ?>
      gồm: <?php echo link_to_remote('<<', array('update'=>'feedback', 'url'=>$baseLink)) ?>
      <div style="margin-top:5px">
        <?php foreach ($tblblogentry->getLikeList() as $tbllike): ?>
          <?php $tbluser = TbluserPeer::retrieveByPk($tbllike->getElUser()); ?>
          <div class="userinfo">
            <?php echo $tbluser->getObject()->getHtmlName(true); ?>
            <br/>lúc <?php echo $tbllike->getElDate('H:i d/m/Y'); ?>
          </div>
        <?php endforeach; ?>
      </div>
      <hr/>
    <?php else: ?>
      <?php $etcLink = link_to_remote('...', array('update'=>'feedback', 'url'=>$baseLink.'&all=1')) ?>
      (<?php echo ($liked? 'bạn'.($likeNum>1? ' với ': ''): '').$tblblogentry->getObject()->getLikeLink($etcLink) ?>)
      <br/>
    <?php endif; ?>
  <?php else: ?>
    <br/>
  <?php endif; ?>
  <?php if ($sf_user->isAuthenticated()): ?>
    <?php $likeUrl = 'entry/updatelike?entry='.$entry_id.'&user='.blogStore::$userId.'&like='.($liked? 0: 1) ?>
    <?php $label = $liked? 'Bỏ thích': '<b>Thích</b>'; ?>
    <?php echo link_to_remote($label, array('update'=>'feedback', 'url'=>$likeUrl)) ?>
  <?php endif; ?>
</div>
