I've been trying to create a solution to this for some time now, and have been to the ends of the internet and back, maybe I missed something.
What I am trying to do is sort the product collection in the category list or grid view by product view count (sort by Popularity). I've looked into
Mage_Reports_Model_Resource_Report_Collection but I don't think this will achieve what I am trying to do here. Is there a filterable product attribute that I can create that will allow this type of sorting? Or should I look at overriding
Mage_Catalog_Block_Product_List_Toolbar? Or maybe there's another way to do this that I haven't thought of yet.
As far as I understand
getAvailableOrders() will get a list of allowed sort orders based on what is set in the Admin panel, but I can't quite figure it out from there.