Auto ”load more” activity stream items when scroll reaches the bottom of the page
-
Hi! I’m trying to emulate facebook “auto-load-more” activity, that when the user scroll down to almost the bottom of the activity stream page, more items are automatically added at the bottom of all and so on.
Below is another comment of mine with the code for you to apply on your site. I’ve accomplished the feature but yet didn’t have the time to make it a plugin, so, you’ll have to copy/paste the code on your site for now…
-
Inactive
I could help on this, but I will have to do it in my spare time because I am pretty busy. I propose making it a premium plugin because it would help the future development. @juanmaguerrero whoever told you to stick the preloader.gif where you specified is wrong. It should always have its own folder in the plugin for instance wp-content/plugins/ bp-auto-load-activity/includes/preloader.gif. You should never save the preloader.gif to buddypress because updates will muck it up. That is my two cents worth anyhow!
In fact the entire modifications (not only the preloader.gif) are made in the not-ideally-correct way, since all will be gone with any update. I’m asking for help since weeks ago on https://buddypress.org/community/groups/creating-extending/forum/topic/help-at-making-a-plugin-how-to-replace-bp-code/ and now on buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-can-i-make-a-custom-activity-loop-into-a-plugin-that-will-replace-the-default-one/ if I can manage to solve that automation I have all the code ready to pack as a plugin with a lot of improvements. @shawn38 do you know how to get this done?
InactiveReally as small as the loop is anyway you should just create a function that will check if activity-loop.php is present and if so it will overide that activity-loop.php with the complete activity-loop.php file you include with the plugin. Think of how child themes override the bp-default theme. Its kinda the same process.
@juanmaguerrero — the activity-loop is part of the theme, and even if possible, it wouldn’t be appropriate for a plugin to replace it en-masse.
Different themes may implement different activity-loops (different markup, etc.) — so, your code (as a plugin) couldn’t possibly replace successfully in all possible cases.
If it’s not possible to implement your plugin hooking onto pre-existing actions, then perhaps it’s not appropriate as a plugin, and better released as a code snippet, or as part of a new theme.
@shawn38 that is exactly what I was looking for for the last month… Would you like to drop me an email to juanmaguerrero.com and have a nice chat about the possibilities of making this an other great plugins I have in mind? Thanks for all!
Hi, @rogercoathup I missed your comment previously. In our case I modify the activity loop and any other plugin or theme will have the same activity loop as the default one, just with the modification my plugin is installed to do, meaning that if the user wants the activity loop not modified my way will never install my plugin in the first place. It’s for auto loading activity items and removing the “load more button”. It would be crazy to think that the user would install this plugin ando other that uses that button xD and no filter instead… Also, with every “bp-default” theme upgrade/new BP version, I would update the plugin (will took me two minutes to do that
I tried it again on the new buddy press theme and the last WP it works and it’s awesome.
Sadly neither your function nor the regular Load More buttons work on Opera and that’s pretty sad to meInactiveIt doesn’t work with mobile either so maybe its best to leave it as a snippet.
Hi @nhoullet, all, the script is not meant to work on all mobile platforms since it uses a pixel to calculate the height of the window. Also, remember that the script posted is only the “alpha version” and I plan to make a plugin with the latest code refactoring and all. I will let you know when I have it finished. BTW, the opera issue is surely related to CSS (style/design) are you using the latest version? thanks all
Inactive@juanmaguerrero What we need to do is provide CSS stylsheets that will provide for people who are not using a computer. The main fault in the code right now is there is no provision if the browser cant render it and that means no one has a way to see old activity if their preferred browser will not render the code. It should revert back to the default functionality if it can’t render the autoload function. I am on vacation now so I can’t spend much time on this at the moment but we can iron this out when I get home!
Great, @shawn38, enjoy your vacations and when you come back I guess we’ll make something pretty neat Thanks for the help
Hello, there are news about this plugin? it exist? thank you!
hello,
The plugin project is dead?
thank you.
Hi, I’m working on launching a new bp plugins / themes site soon, there will appear the “auto load more activity on scroll” plugin. Thanks for your patience. Regards,
-JM
@juanmaguerrero I just made a working beta version of the BP Auto Load Activity plugin. You get the main credit. It needs some minor work which is explained in the readme.txt under notes. Let me know if you want a copy to work on for improvement. Whenever you get done you can upload it to the repository because I don’t really want the responsibility of updating it. Thanks!
oh, @bphelp that’s just awesome! I had made lots of improvements to the code, could you send me a copy of what you made to juanmaguerrerocom {at} gmail.com?
I had a lot of work recently but I wanted to made a plugin anyone could use with this. Maybe if it’s good we can certainly upload it, and I would be glad if we appear both as authors 🙂
Thanks a lot!!
Cheers
Ok Look for it in your mail in about 3 minutes! 🙂
If anyone would like to try out this plugin here is a link. Its a beta and its not perfect and needs some work, and I am not a great coder or an expert by any means but from my test it works from WP 3.2.1 BP 1.5.1 up to WP 3.5.1 and BP 1.7b1.
If you can improve this plugin then please share it here. Please see the notes section in the readme.txt. Thanks and enjoy!
http://www.mediafire.com/download.php?u6oos92g344485fOops sorry wrong link, here is the right one!
http://www.mediafire.com/download.php?8flb60tcc4e5vlcGreat Job! 🙂
@bphelp the file is gone?
@omgbud The plugin is alive and well but is in a beta, I spent several hours on this the code running as a BP plugin. The link is expired because I don’t feel I thought things through enough and I had a moment of clarity so I would like to discuss it more with @juanmaguerrero. I don’t think it would be asking much for a donation to help with further development, better features, and better support. @modemlooper requires a donation now for the buddysuite plugin so in all fairness to me and @juanmaguerrero then we should also get compensated for our time because it can be frustrating at times and make you somewhat resentful. As far as I can see it took over a year for this plugin to come to light when other people that said it could not be done. Well I done it and it just works. I will let you know when a stable version is ready but most likely you will have to contribute a few bucks to get your hands on it. Sorry and thanks!
@juanmaguerrero, @sbrajesh Has also created a cool activity auto load plugin. Great job @sbrajesh! http://buddydev.com/plugins/bp-activity-autoloader/
Well, this is truly a good work, but there’s a few things that still are missing. For example, Facebook does not wait for the user to reach the actual bottom, else he would have to wait for the items to load and have nothing to see for a while (depending on your server speed). Also with this system it is preferable to load a lot more activity items than the default number (study what Facebook exactly does and you’ll see what I mean).
I hope this can be a good point of reference for improving. The code I gave in this thread is already doing that so you can take a look. Another thing, you should use throttling for avoiding several simultaneous requests that may load your server’s speed.
Keep on the good job!
@juanmaguerrero Your right it is not as good as the one we did because it lacks the smoothness. I don’t like scrolling to the bottom and having to wait. I guess our plugin is a bit better but I have a lot of respect for @sbrajesh never the less and he is capable of making this just as good so I think I will bow down because I don’t wanna get involved with a showdown between you guys! Sorry!
- The topic ‘Auto ”load more” activity stream items when scroll reaches the bottom of the page’ is closed to new replies.