News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

A page with the first and last message of the last updated topics

Started by Mimmi, April 09, 2017, 04:51:58 PM

Previous topic - Next topic

Mimmi

Using SMF 2.0.13

I would like a mod that shows me all the latest topics and posts, like a feed of posts. I'll try to explain what I think I need to do with the database:

1. Get the id_topic of the 15 newest post in messages-table. Rinse the list of duplicates. Store it as an array or individual variables.

2. From the topics-table: Get the id_first_msg and id_last_msg of the topics matching one of the id-s in the list. (If first and last are the same then delete the first.)

3. From the message-table: Get all the message-info where the id matching the first or the last and SORT by the last.

Display the result in a page where the topic with the highest last-id comes first:
For each topic found in #2:
SUBJECT of first message
   BODY of first message
   ....
       BODY of last message (if id is different than id of first message.
Next subject...

Are there already anything like this? If not, is this possible? And: where should I start, should I duplicate one of the files in Sources and edit that?

I appreciate any hints!

P.s. Users should just see those topics they have access to.
Forum-junkie and still a newbie in the world of administrating php etc... Volunteers in reproductive rights. http://www.liv-laga.no/

MrFox

Hi

Maybe you can use simpleportal

this is great to implement for such extra functionality

Kindred

your_array=ssi_recentTopics(15, null, null, array)

process the results of that
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: