Phpbb: How to list the most/least viewed topics
Two mysql SELECT queries using select on "topic_views" column will show the most or the least viewed articles in the forum.
List most viewed articles in phpbb forum:
Code:
SELECT topic_id,topic_title,from_unixtime(topic_last_post_time) AS Post_date ,topic_views FROM phpbb_topics WHERE (topic_approved='1' AND topic_reported='0') ORDER BY topic_views DESC LIMIT 0, 40;
List most viewed articles in phpbb forum:
Code:
SELECT topic_id,topic_title,from_unixtime(topic_last_post_time) AS Post_date ,topic_views FROM phpbb_topics WHERE (topic_approved='1' AND topic_reported='0') ORDER BY topic_views ASC LIMIT 0, 40;