Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: ormuz on December 03, 2017, 11:07:02 AM

Title: Display one topic?
Post by: ormuz on December 03, 2017, 11:07:02 AM
how can I achieve something like this:

- Have a predefined list of topics
- Show the amount of these topics to display (like one topic)
- Display them randomly
- Have a layout (output) similar to the boardnews block (subject, content, user, avatar, read more, etc)

Any ideas, suggestions?
Title: Re: Display one topic?
Post by: Gluz on December 03, 2017, 09:09:06 PM
Make a custom PHP block, in it make an array with all the IDs of the topics you want to show.

Randomize n number of indexes from that array (n = the number you want to display).

Load the ID from the first message from that topics. (it's a fairy easy query using $smcFunc)

There is a SSI function to load posts from an array of posts IDs.