how to create a view that shows blogs count for a user? I want to create a view that list out the following fields


User name
User email
Discussion count
Blog count


I created the view and add the User: Name and User: Email in the fields but it shows me the duplicate users and Also I have no idea about how to add the discussion count and blog count to the view.

I have created the view of node type.
Any help?
I'm going to take a stab at answering this. Create a view where:

Under Fields you select the User name, email and User:Uid. Then add a custom field.
Under the custom field write a query in Value:

&lt;?php $result = db_result(db_query("SELECT COUNT(nid) FROM node where uid='%s' and type='blog'",$data-&gt;users_uid)); 
echo $result;
?&gt;


This query find the number of posts written by each user.

Under filters choose Node:type = 'content type used to store profiles'
(as you want to count the number of blogs of every user who has a profile).