Customizing SMF > SMF Coding Discussion

Sort topics by the most recent online appeareance of a poster to the oldest

(1/1)

f00ty:
Hi,

I was wondering has anyone done the following:

Arranged topics by the most recent online appearance of the poster. So for example, those users who are online, those topics would be at the top of the list. After them, the user who has been offline the smallest amount of time, and then the next user with the second smallest offline time at the moment etc.

Is this even possible to achieve? And if it is, of course how, and would it be resource hog?

MrPhil:
Are you talking about ordering topics within a board, or posts within a topic? In the former case, would it be by the topic starter who determines the order? So, even if I was last logged on 3 years ago and just got back on line, the topic(s) I started would jump to the top? Would this apply to everyone and not just me?

Is it possible? Sure, with a big enough hammer (i.e., enough code) anything is possible. Would it be a resource hog? It could be. Assuming the "last_login" timestamp was updated when I logged in, you could select last_login as one of the data fields, and sort on that (descending order). That shouldn't be too much of a resource hog. Note that someone who signed on after me and has since signed off would probably be listed ahead of me. To force currently signed on members to the top would probably require a second pass on the all the data (as a large matrix, or at least an indexing array pointing to the total data). All the posts or topics (and associated member data) would have to be held in memory at once, rather than 15 or 20 at a time, so this resorting could be done. So, yes, it would certainly be slower. Whether it would be unacceptably slow, I don't know.

If this is for posts within a topic, there's the problem of the continuity (responses readable in order) being destroyed. If this is for topics within a board, based on most recent login or time online of the starting poster, that wouldn't be a problem.

How would you envision this ordering to be useful?

f00ty:
Yes, just like you described:

--- Quote ---So, even if I was last logged on 3 years ago and just got back on line, the topic(s) I started would jump to the top? Would this apply to everyone and not just me?
--- End quote ---

It's ok even it wouldn't work perfectly, it would be nice if it would just bump the the topics started by user after logout to the top.

My idea is to get rid of "bump" posts in board where people could search company for themselves. Also it would be cool, if the users could filter out the topics by users who haven't been online for example in one week, two weeks, etc. and topics which doesn't have attachment in it (picture). But since I'm not a web coder, I'm not sure what I can do without using months or years to it. So I'm looking the simplest way to improve this kind of service by sorting topics by who has been online recently, so it would be easier to search company and see who have been online recently.

If someone has a better idea how to help the process I described, ideas are warmly welcome.

f00ty:
Ok, I tried simply to put /?sort=last_login after the board name, but I cannot figure out what is the logic behind the results after then. Any tips what I could try to get better results? As said, I'm not a web coder, so any help is appreciated.

Navigation

[0] Message Index

Go to full version