Advertisement:

Author Topic: Display one topic?  (Read 203 times)

Offline ormuz

  • Full Member
  • ***
  • Posts: 677
Display one topic?
« 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?

Offline Gluz

  • Native Language Support Specialist
  • Sr. Member
  • *
  • Posts: 964
  • Gender: Male
Re: Display one topic?
« Reply #1 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.

Need help with PHP, HTML, CSS, Themes or MODs?

Quote
Think in spanish, habla en ingl├ęs.