News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Display one topic?

Started by ormuz, December 03, 2017, 11:07:02 AM

Previous topic - Next topic

ormuz

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?

Gluz

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.


Advertisement: