MyBB Community Forums

Full Version: How can I display top trending post in MyBB portal
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to display trending post
How can I do that on Portal
There is no option in the MyBB for your desire.

What trends do you prefer displaying? Most replied threads or most vieved for example?
Then you can achieve this by modifying PHP code and the SQL inside, doing a modification of ORDER BY statement, e.g.:
- order by views
- order by replies
instead of standard latest posts

If you want real trends within time periods (e.g. most views within last hour), it is much more code modification.

You need to edit PHP file(s) at all.

How can I display order by view
Please i need the tutorial
./portal.php (v1.8.21)

1) For the "Latest Threads" box:
Go to "Latest discussions" code beginning on line 367 and find the SQL statement some lines below...
"ORDER BY t.views DESC" will show the threads with most views.

2) For the main latest post list:
Go to "Latest forum discussions" code beginning on line 444 and find the SQL in line 510...
- In SELECT add "t.views" to the list of fields
- "ORDER BY t.views" will show the threads with most views.

Be aware with code changing when you're not familiar with PHP. Make a backup of this file before.