Suggestion Ajax Threads

Discussion in 'Community Matters' started by ChrisGrigg, Jan 18, 2019.

  1. ChrisGrigg

    ChrisGrigg Community Team Member Community Team Forum Sponsor

    6,417
    136
    245
    +194
    3
    -0
    Anyone in favor of the ajax thread option that xenforo has as an addon?
    It prevents the need to refresh when discussing on a topic, as the new reply will automatically pop up, allowing you to talk like a quick chat. I remember seeing it before, just have to find it on their resources again.

    Something like this addon, even though its no longer supported:
    https://xenforo.com/community/resources/th-live-threads.4141/
     
    Last edited: Jan 18, 2019
    • Like Like x 3
  2. Ajay

    Ajay I'm The Captain Now

    1,177
    151
    110
    +290
    22
    -0
    Yeah I'd actually like that..

    I got the notification that you quoted me in the thread as I was typing a reply, but couldn't see it until I refreshed which made me lose some of the reply I was working on lol.
     
    • Like Like x 2
  3. Daniel

    Daniel Package Team Leader Package Team

    2,749
    144
    185
    +177
    4
    -0
    I like the idea of this. It turns into a slightly more real time discussion that way.
     
    • Like Like x 1
  4. ChrisGrigg

    ChrisGrigg Community Team Member Community Team Forum Sponsor

    6,417
    136
    245
    +194
    3
    -0
    As well as giving members the feel of social media "wall" and being able to continue a conversation without interruption.
     
    • Like Like x 1
    • Agree Agree x 1
  5. Ajay

    Ajay I'm The Captain Now

    1,177
    151
    110
    +290
    22
    -0
    I think more forums need to actually go this route considering social media is somewhat the reason forums are dying lol.
     
    • Like Like x 1
  6. Jordan

    Jordan Valued Contributor Valued Contributor

    1,639
    404
    260
    +579
    21
    -0
    Odd, XenForo should present the option saying "A new reply" was posted if your on the same page. When clicked, it will load the post via ajax.
     
  7. Ajay

    Ajay I'm The Captain Now

    1,177
    151
    110
    +290
    22
    -0

    It used to appear about a month ago, but no longer does.
     
  8. Empire

    Empire Valued Contributor Valued Contributor

    20,116
    1,489
    320
    +2,131
    122
    -0
    I agree. This will make posting allot easy regards to being in a conversation. There was always am Ajax to and poi t but nothing like an post appearing from the woodworks. But then how.many active conversation on one thread we going to get at one time. Not very often buy agree this should be added and no question ask...
     
  9. Marie 1988 Forum

    Marie 1988 Forum Up-and-Coming Sensation

    339
    30
    50
    +34
    2
    -0
    This wouldn't be a bad idea.
     
  10. Azareal

    Azareal Paragon

    1,425
    89
    115
    +219
    9
    -0
    Question: Will it kill the server? If it pings the server once a second for every user, guest and member, then it might generate a lot of server load. It would be useful to know if the server can take it.
     
  11. Ghost

    Ghost Seasoned Veteran

    2,914
    17
    105
    +33
    0
    -0
    I have coded these before (similar to looking for new messages in a live chat window) and they are not that intense on resources, BUT it really depends on how many people are actively on a thread page & how many posts there are.
    To be effective, you're looking at a new SELECT (searching database) query every 5-10 seconds. If you have 200 visitors all in a thread, you're looking at around 200 SELECT queries every 5-10 seconds. Now, that is totally fine for a small forum. It can be slower & more resource heavy though with the more posts you have. In my experience searching a database of less than 1 million doesn't take too long if it's set up correctly & the query isn't too crazy (loads of parameters, string searches, etc). The query would basically be like this...

    SELECT columns FROM posts_table WHERE postid > 'the_last_post_displayed_in_that_thread' AND threadid = 'thread_id'

    That's not too crazy because the post ID column is a UNIQUE index in the database & we're not searching for anything crazy like this... "WHERE post_content LIKE '%long-string-of-text-here%' ", which can be resource intense & take a bit longer.

    It's something that you should definitely just test out if you want the answer. If there were 5-10 million posts, I would argue that it is an awful idea because then you really start to run into resource/load issues, but with a million or so posts it might actually be okay.

    Maybe set it up to load every 10+ seconds to be safe.
    Go into the database and find out how long it takes to run...
    SELECT * FROM posts_table WHERE thread_id = 159705 AND post_id > 'last-post-in-this-thread-id-goes-here'

    If that can run in a second or less, you won't have much to worry about at all.
    If that is running in 3+ seconds, be worried because it will be even longer with hundreds of people running that query on every thread. If turned off for guests & members only, it'll probably be fine though :)

    With the speed of a thread loading (from what I can see), I don't imagine there being too many load issues! I hope this helps
     
  12. Azareal

    Azareal Paragon

    1,425
    89
    115
    +219
    9
    -0
    A pubsub server would probably be best. The idea is that every-time a post is made, it'll push a message to the pubsub server, and then, the pubsub server will loop all of the users subscribed to that particular channel (ie currently connected to the topic) and will push it to them.

    Zero query solution. Because queries are slloooww.
    Instant updates. Instant changes. Instant deletes.

    But, it's PHP so might need to go for a query based solution. It might be just fast enough to be feasible.
     
  13. Kaynil

    Kaynil Valued Contributor Valued Contributor

    1,428
    356
    200
    +468
    5
    -0
    It seems like it was a feature we had and has stopped working. May be a bug. Was it a conscious decision to take away this functionality from Forum promotion?
    If this was working as it should do then it would be possible to keep real-time conversations without having to worry about finding more add-ons or coding one.

    And if this was taken off on purpose it'd be useful to learn why was the decision taken, as it would probably mean that live-threads might no be feasible.
     
  14. Azareal

    Azareal Paragon

    1,425
    89
    115
    +219
    9
    -0
    I think that one does appear, but only after you start typing up a post.
     
  15. Rick Ace

    Rick Ace Administrator Administrator

    3,002
    172
    130
    +288
    22
    -0
    There is one type of implementation in beta.

    https://xenforo.com/community/resources/live-content.6381/

     
  16. Azareal

    Azareal Paragon

    1,425
    89
    115
    +219
    9
    -0
  17. Rick Ace

    Rick Ace Administrator Administrator

    3,002
    172
    130
    +288
    22
    -0
    Well, this example was the only add-on I can find, and it describes a "single poller." I'm not quite sure what they mean by that. But without downloading the add-on, I'll never be able to tell lol. It is behind a paywall.
     
  18. DylRicho

    DylRicho #ForThePeople

    450
    48
    65
    +90
    8
    -0
    I can confirm that it does this.
     
  19. Rick Ace

    Rick Ace Administrator Administrator

    3,002
    172
    130
    +288
    22
    -0
    With Xenforo 2.1 on the horizon for FP, it really looks like the thread updates have been taken care of in my opinion. :) That is unless users want to see the entire post automatically update. But most sites including Twitter don't do that anyway.