ACPS - Ajax Continuous Post Scrolling (Facebook Styles) (Partially Hook!)

Started by Hj Ahmad Rasyid Hj Ismail, July 26, 2014, 09:12:32 PM

Previous topic - Next topic

Hj Ahmad Rasyid Hj Ismail

Link to Mod

ACPS - Ajax Continuous Post Scrolling

- For SMF 2.0.x
- Partially hook with only display template file modification.
- Based on Emanuale Tips

1. Please do your own backup though every installation is backed up automatically.
2. This mod will try to used ajax to display your post with continous scrolling like in FB / Facebook Styles.
3. Instead of using pagination i.e. by clicking the page number, you can simply scroll down until the end of the posts.
4. However, this mod has it caveat i.e. depending on your forum server, it may break if the posts are more than 500 or so.
5. For that you have to find and install Emanuales limit topic length mod.
6. Once installed, refresh your post display page and it should work immediately.
7. You can test it in lower SMF 2.0.x version too as it should work just fine. ;)


Thank you for using/testing it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep Emanuale's name and author's link if it is in here somewhere. ;)

 

#Change Logs

@Version 1.0.2
- Converted to partialy using hook for SMF 2.0.x.

@Version 1.0.1
- Disable ajax inline / quick modify for scrolling posts added by ajax. It does not work anyway.
- Give user option to disable default ajax inline / quick modify so that it will look cleaner.

@Version 1.0.0
- Only Admins See Load Time Initial Release.

Biology Forums

Quote from: ahrasis on July 26, 2014, 09:12:32 PM
Link to Mod

ACPS: Ajax Continuous Post Scrolling (Facebook Styles)
Based on Emanuale's Tips

1. Please do your own backup though every installation is backed up automatically.
2. This mod will try to used ajax to display your post with continous scrolling like in FB / Facebook Styles.
3. Instead of using pagination i.e. by clicking the page number, you can simply scroll down until the end of the posts.
4. However, this mod has it caveat i.e. depending on your forum server, it may break if the posts are more than 500 or so.
5. For that you have to find and install Emanuale's Limit Topic Length mod.
6. Once installed, refresh your post display page and it should work immediately.
7. You can test it in lower SMF 2.0.x version too as it should work just fine. ;)
8. Will try to port this to SMF 1.1.x as well, later.


Thank you for using it.


Yours friendly,
Abu Fahim Ismail.

BSD License. Feel free to modify accordingly but keep Emanuale's name and author's link if it is in here somewhere. ;)

 

Thank you for #8, the porting to 1.x. Quick question though, does this totally eliminate pagination in thread view? Like, could I click page 3, for example, and then the auto-scrolling starts from page 3?

Douglas

Has this been tested on large forums (let's call this 2 million posts or more, I'm eying a 7.5 million post forum for this Mod right now) to see what kind of a performance hit it does?

How does it handle new replies since last visit to that thread (either via the link at the top to "Show all new replies since your last visit" or the "New" icon next to the subject on the topics listing page).
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Hj Ahmad Rasyid Hj Ismail

Shuban, it should work even if you are not in the first page.

Douglas, it has never been tested on big forums. What I did was merely packaging this mod. The caveat is in #4 and its solution (temporary i guess) is in #5. The original post of this tips is also linked in the OP.

Douglas

Before I can even consider implementing this on Hogville (7.5+ million posts), someone would need to do some performance testing to see how much of a resource hit it would be on servers. I am *very* interested in this Mod, but cannot risk testing it on Hogville (we don't have a test environment that can simulate day to day activities).
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Arantor

There's almost no-one qualified to do such performance testing.

Honestly though, at a glance, I would suggest that performance is not significantly more arduous than normal paging through topics since it appears to simply mirror grabbing the next page and only grabbing the content it wants. The only real difference is that you'll have the requests very slightly closer together than you might otherwise.

But that's an opinion without actually even testing it, just skim-reading the code and based on what I remember of the original thread.

Just be glad you're not field testing Discourse, that will nail your server to the wall on performance. Even a modest site requires a VPS, minimum 1GB RAM.

Douglas

Quote from: ‽ on July 30, 2014, 12:35:58 PMJust be glad you're not field testing Discourse, that will nail your server to the wall on performance. Even a modest site requires a VPS, minimum 1GB RAM.
I need to update the Big Boards stuff for Hogville's configuration, but at last count, we were up to 12 boxes (six of them are web servers). ;)
Doug Hazard
* Full Stack (Web) Developer for The Catholic Diocese of Richmond
(20+ Diocesan sites, 130+ Church sites & 24 School sites)
* Sports Photographer and Media Personality
* CFB Historian
* Tech Admin for one 1M+ post, one 2M+ post and one 10M+ post sites (last two are powered by multiple servers)
* WordPress Developer (Junkie / Guru / Maven / whatever)

Arantor

Yeah but a forum of 50-60k posts should not require a VPS, right? A forum just starting out should not automatically require a VPS, right? ;)

I would wonder if there aren't ways to improve performance; I know I found at least one bug in 2.0 that meant a query could be saved on the vast majority of topic views, fo example. (Fixed in 2.1, not included in a mainline patch because it's pretty fragile to fix as a patch as it requires a lot of moving around)

David111567

Will this work in PM and all other areas of the website as well?  Example... sayyyy...SMF Articles?

Hj Ahmad Rasyid Hj Ismail

No. It is meant for display (post) page only. May be I'll try to port it to other page like pm, message index, etc... Later, that is. For the time being, let's see whether there is any problem while running this mod that is known or unknown to us. ;)

David111567

Quote from: ahrasis on July 31, 2014, 04:35:06 AM
No. It is meant for display (post) page only. May be I'll try to port it to other page like pm, message index, etc... Later, that is. For the time being, let's see whether there is any problem while running this mod that is known or unknown to us. ;)

Sounds good. Thanks.

It's a very cool concept.... I'll try the mod on my website.

Kimmie

I like this mod. Found an issue that may need addressing though.

Example: Thread has 3 pages. When scrolling down, it will populate all posts in the entire thread (that part works great).

When someone makes a reply, lets say they want to go back through and read previous posts - you have to go back and click on page 1 or page 2 to get to those posts. Scrolling up only takes you to the top of page 3 and none of the posts before that repopulate  (they go away once you submit a post).

Is there any way to fix this?  Such as having it work both up and down?



Hj Ahmad Rasyid Hj Ismail

Yes. For the time being it will not scroll up to the first post and will just scroll down to the end of the post.

It do not need a fix, since it is not reported as broken, but it features may be added as per your suggestion.

Kimmie

Quote from: ahrasis on August 15, 2014, 12:55:35 AM
Yes. For the time being it will not scroll up to the first post and will just scroll down to the end of the post.

It do not need a fix, since it is not reported as broken, but it features may be added as per your suggestion.


Ok I just assumed that it would work both ways. I didn't really consider that a feature, but more so a  common sense thing that folks would want it. Just let me know when you update it with this, and I will reinstall the mod. Being able to scroll both ways is why I was going to use it. I want to do away with "pages" period.

Arantor

Doing away with pages has so many side issues it really isn't funny, unless your threads are all really short (like no more than 3 pages)

Biology Forums

Quote from: ‽ on August 15, 2014, 01:11:33 PM
Doing away with pages has so many side issues it really isn't funny, unless your threads are all really short (like no more than 3 pages)

You never know, some people might have a mod installed that restricts the number of replies that can be made for a thread. This mod could come in handy, and can be further developed to fix all the small issues. I see potential here, good work, ahrasis.

Arantor

Trust me, I've tried infinite scrolling on threads from 1 post to 13000 posts in a single thread... it is terrible in usability terms, the longer the thread, the worse it gets.

Biology Forums

Quote from: ‽ on August 15, 2014, 04:42:49 PM
Trust me, I've tried infinite scrolling on threads from 1 post to 13000 posts in a single thread... it is terrible in usability terms, the longer the thread, the worse it gets.

I can picture that, it would be a disaster, but that's something the mod author or others can find a fix for, or a trick. I think pagination should be incorporated along side this mod, so that if someone wants to start reading on page 8, they can click page 8 and the infinite scroll begins from there.

The disqus script seen on many blogs nowadays does a good job in letting the reader know that new comments have been made in real time. Not sure if this mod models that, but it would be cool if it did.

Arantor

The thing is, Disqus runs on a much heavier stack than most hosts, because the heavy load of trying to do that...

Let's just put it this way: I know a forum that does infinite scrolling and the live updating you're talking about. A 50,000 post forum that requires an expensive VPS just for a smallish number of users.

Biology Forums

I hear yeah, not worth it.

Is it an SMF forum? If so, I would like to see it...

Arantor

No, it's not, it's Discourse. Discourse requires a minimum of a VPS.

Hj Ahmad Rasyid Hj Ismail

Indeed this could cause heavier load on server especially if you simply wanna scroll and need data to be loaded each time once it reach bottom (or top in the case of going back to earlier post).

Similarly, IMO, if you simply wanna go to the other pages and clicking the page number, data still need to be loaded each time the page is opened.

IMO ajax supposedly decrease page load if it is doing less processing if compared to full page load. Time can be delayed and loading gif can be used. Or may be already loaded data can be cached too?

I am no coder but with my limitation, I suppose the suggestion for ajax continuous post scrolling to both directions is still workable.

Arantor

The load requirement on SMF for 'a slice of a topic' is not significantly different for 'a slice of the topic with menu cruft attached' which is all the difference really is here.

What you will have to consider as a real problem, though, is what happens in a long thread when you start to have hundreds of posts on offer at once, with the dozens of DOM elements per post. Other solutions for infinite scrolling unload some of these from the browser to avoid them consuming insane amounts of resources, others don't - and of those (in which category this mod is), they will eventually crash the browser if a suitably long thread is loaded.

Most of the mechanics of infinite scroll for usability are geared around 'the latest content' where you're using infiniteness to go backwards in time (cf. Facebook, Twitter) so that loading the next slice is something you're simply less and less inclined to do in practice. The full impact on usability is so badly understood it's not even funny.

I would strongly suggest you spend time observing Discourse installations to see how infinite scrolling really doesn't work for threads of any real length.

Hj Ahmad Rasyid Hj Ismail

Actually, this time, I don't get you at all. In the OP I have already mentioned the caveat discussed regarding this. The best, for the time being, is to limit number of posts per topic to 500.

Plus I dont agree that on facebook it is only used to go to the latest content only. It is for both older and newer posts. I am a frequent user of it, I definitely knows how it works.

The only thing is, it is similar to pagination in SMF for older posts where you have to press the link to load more older posts, and you need to do this several times, until it comes to the first post.

If I want it to, instead of scrolling it back to earlier post, I may also decide to simply change the pagination similar to that, to trick user to go back to the past via what actually is the original SMF pagination but in different looks.

But definitely, loading is loading. And you didn't honestly response why ajax supposedly decrease page load if it is doing less processing if compared to full page load in this case.

Kimmie

With this mod installed the ajax modifier in each post no longer works. I assume it is from this mod because since installing it, these have not worked.

Have you had anyone else mention this problem?

Hj Ahmad Rasyid Hj Ismail

So far that I have tested in in fresh plain vanilla SMF, it works harmoniously. I will test that again just to make sure.

By the way, can you share how did you install the mod so we can see where it goes wrong?

Hj Ahmad Rasyid Hj Ismail

You were right, Kimmie. This mod do cause failure in ajax inline modify. I am not so sure why function initQuickModify () is not working as it should be. I'll further test and see how can this can be resolved.

If this cannot be resolved, notice will be given to this mod user as inline modify will be simply disabled while using this mod.

Hj Ahmad Rasyid Hj Ismail

Updated.

#Version 1.0.1
- Disable ajax inline / quick modify for scrolling posts added by ajax. It does not work anyway.
- Give user option to disable default ajax inline / quick modify so that it will look cleaner.

Kimmie

Quote from: ahrasis on August 19, 2014, 03:03:54 AM
Updated.

#Version 1.0.1
- Disable ajax inline / quick modify for scrolling posts added by ajax. It does not work anyway.
- Give user option to disable default ajax inline / quick modify so that it will look cleaner.


Thanks.  Please try and get this working though. All my moderators use this modifier.

Hj Ahmad Rasyid Hj Ismail

It wasn't going to be an easy fix since I know other ajax mods also suffers the same consequence. I will try though, if I am not so busy.

You can still use default Ajax Quick / Inline Modify by disabling this mod in Mod Settings page or not disabling default Ajax Quick / Inline Modify. The later allows you to use default Ajax Quick / Inline Modify but for posts under its own page.

I might also look into ways on how to permit your moderator to disable this mod if allowed by admin. (This option is more easier to me).

Again, thank you again for seeing this problem and highlighted it.

Kimmie

Sounds good. Thanks for your hard work. Much appreciated. :)

Hj Ahmad Rasyid Hj Ismail

Updated!

#Change Logs

@Version 1.0.2
- Converted to partialy using hook for SMF 2.0.x.

lahmfan

Hey
I love this mod! its working great on our forum .. I have one question for you, i am using the "like post" mod on my forum http://custom.simplemachines.org/mods/index.php?mod=3708 and the "like button" doesnt show when i scroll down, it will show, however, if i click on the page. would you know what could be the problem?

Advertisement: