Hi,

I'm new here so take it easy on me!

I'm working on a small project at the minute which, for the main part, is a site where users can post recipes and other users are able to 'like' and comment on these.

The part I'm struggling with is I want there to be a running total of how many 'likes' users have received on all combined recipes they have posted. For example:

User A has posted 7 recipes and has recieved a total number of 16 'likes' for the the combined 7 individual recipes, I want to display this somewhere on user A's profile for other users to see.

I'm not an expert in coding, only HTML, CSS and very, very basic Javascript and PHP so if you answer involes code an explanation for a dummy would be apreciated...

Thanks in advance

Comments

pixelsweatshop’s picture

This is pretty straight forward using the flag and views module. While I cannot give you a step by step as it will take up the better part of my day, I can point you in the right direction.

Use flag for the like button. Then using views base table "content" add a contextual filter to the uid in the URL (add author of content), then turn on aggregation to create a count of number of likes.