We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46886
    • 1,154 Posts
    In the discuss system settings, there is a value for "Enable Hot Threads" and also "Sticky" threads. I want to know more about how to implement them. The documentation is a little sparse on this issue.

    We already have a tool kindly provided by mintnl to push contents (in that case, recent posts) onto other pages, and that tool should work for multiple database calls. There also should be other calls that are interesting, like most comments, most views, and so on. Its just database calls, right?

    I did find this info about the database of discuss:
    replies 	integer (10) 	Amount of replies on the thread.
    views 	integer (10) 	Amount of views on the thread.


    This looks very much like what I want, to be able to serve up on my front page a short list of the threads with most replies and with most views. But what would the code look like?

    EDIT: Here is the link to the intro to the discuss db: http://rtfm.modx.com/extras/revo/discuss/discuss.database-model and here is the whole db schema, which should hold the answer to this question https://github.com/modxcms/Discuss/blob/develop/_build/schema/discuss.mysql.schema.xml

    This question has been answered by gormytorysh. See the first response.

    [ed. note: nuan88 last edited this post 9 years, 10 months ago.]
    • discuss.answer
      • 46220
      • 66 Posts
      As far as I can see the Hot Thread status is achieved by 10 replies by default, so not much else to do to implement it. The sticky threads, you can do when you open a thread (the one you would like to set to sticky) and in the bottom of your screen there are a few options (move, remove thread, mark as spam, lock, pin), if you are marked and logged in as administrator/moderator. The pin option is the sticky option if I am not mistaken.

      In http://forums.modx.com/thread/91207/popular-threads-and-featured-threads#dis-post-500007 I provided with a code how to display threads with the most posts and it could also work for most views etc. just by using the discuss database. I don't know what part of the code you can leave out (sorry, still don't know php) or can alter some more to make it more to your pleasings, but it is a basis.