count articles by author

Public

count articles by author according by node url

Get raw version
php
  1. $uid = $view->result[0]->node_uid;
  2. //print $uid;
  3.  
  4. $query = new EntityFieldQuery;
  5.  
  6. $count = $query->entityCondition('entity_type', 'node')
  7. ->entityCondition('bundle', 'ns_article')
  8. ->propertyCondition('status', 1) // Getting published nodes only.
  9. ->propertyCondition('uid', $uid)
  10. ->count()
  11. ->execute();
  12.  
  13. print $count . ' articles from this user';