Example #1
0
 /**
  * The favorite count
  */
 public function favoriteCount()
 {
     global $post;
     $count = new FavoriteCount();
     echo '<strong>' . __('Total Favorites', 'simplefavorites') . ':</strong> ';
     echo $count->getCount($post->ID);
     echo '<input type="hidden" name="simplefavorites_count" value="' . $count->getCount($post->ID) . '">';
 }
Example #2
0
/**
* Get the Favorite Total Count for a Post
* @param $post_id int, defaults to current post
* @param $site_id int, defaults to current blog/site
* @return html
*/
function get_favorites_count($post_id = null, $site_id = null)
{
    if (!$post_id) {
        $post_id = get_the_id();
    }
    $count = new FavoriteCount();
    return $count->getCount($post_id, $site_id);
}
Example #3
0
 /**
  * Get the number of Anonymous Users who have favorited the post
  */
 public function anonymousCount()
 {
     $total_count = $this->favorite_count->getCount($this->post_id, $this->site_id);
     $registered_count = count($this->getUsers());
     return $total_count - $registered_count;
 }