<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/
?>
<?php 
  $item = $this->item;
  $class = $this->class;
  $viewer = $this->viewer();
  $viewer_id = $viewer->getIdentity();
  $isFavourite = Engine_Api::_()->getDbTable('favourites', 'core')->isFavourite(array('resource_type' => $item->getType(), 'resource_id' => $item->getIdentity())); 
?>
<?php if(!empty($viewer_id)): ?>
  <a href="javascript:;" class="content_favourite favourite_<?php echo $item->getType(); ?>_<?php echo $item->getIdentity(); ?> <?php echo $class; ?> <?php echo ($isFavourite)  ? 'button_active' : '' ?>"  data-id="<?php echo $item->getIdentity() ; ?>" data-type="<?php echo $item->getType() ; ?>"><i class="fa fa-heart"></i><span><?php echo $item->favourite_count; ?></span></a>
<?php endif; ?>