Need help writing a 'Most Popular' module filter

arcadeicons

Member
On my home page I want to show small modules for 'Most Popular Game' and 'Most Active User', its a simple 'most records' filter from my master scoreboard but I can't work out how to order an item by most entries.
 
I don't think there's anything built in to help you.

Typically what I do for "dashboard" type reporting like that is either write some code by hand in Sourcerer, or I create a view in MySQL to give me the info I want, and build a Fabrik list on that view.

So if you main table as two joins, game_id and user_id, and you want to have two views that show the most popular games and users ... run this in phpMyAdmin to create a MySQL view ...

CREATE VIEW popular_games AS SELECT id, game_id, COUNT(*) AS game_count FROM mytable GROUP BY game_id

... that would give you a view giving you the grouped counts. You can then create a Fabrik list from this view. Set the ordering on the list to be game_count. Set the game_id element to be a join to your game table.

Obviously modify the table and field names to suit.

Then repeat that for the user element, creating another view for the most popular user.

-- hugh
 
Thank you very much for your patience and help, I'll have to digest this a bit so I understand what is happening, but hey I get to learn new things :)
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top