Real Time Comments Revisted - Again

Alext T told me to take this to the forum so here it is.  While Boonex spends resources on Chat+ the issue that has been push time and again goes ignored; real time comments.  My members are not interested in chat rooms, they are interested in real time comments and have been since 2011 and I brought this issue up when I first started Boonex.  At the time I was just learning the platform and still too much in the dark to make an assessment.

All comments on Boonex are handled by the same comment engine; so real time comments in one area will automatically be applied site wide.  Now here is the kicker; comments are already ajaxed.  So why in the name of Hades has Boonex ignored requestions for real time comments going back years?  My guess on this is the hit on shared hosting.  So, you make it so it is turned off by default.

Real time comments just means loading in the comments every x seconds so that if the person is on the comment page, they see the new comments appear automatically.  You want to see how comments are ajaxed?  Log into your site on a second computer, make a comment and then go to the other computer and change the per page setting and guess what, you will see your new comment appear without having to reload the whole page.  The comment section is ajaxed.  The developers comments in the code states it is ajaxed.

There will need to be a few things.  One is a manual pause switch to pause real time comments.  The other is the reply to comments.  When replying to a comment, the editor opens below the comment in the comment box; so if the comment box is refreshed, it would close the editor and the person won't be able to make a reply to a comment.  It would be nice if the pause would automatically kick in if the editor is loaded in the comments section but members could click on the pause button for this issue.

So come on Boonex, chat rooms are OK but real time comments is really where it is these days.  Look at the number of comments you will see on posts out on the net, sometime they will number in the high thousands. Just recently I saw over five thousand comments left on a post in just a couple of days.

Geeks, making the world a better place
Quote · 2 Aug 2016

I totally agree.

While adding chat+ is still on my to-do list, I'm much more interested in real-time comments. That is what my visitors/members do most often... they comment, and comment, and comment.

Quote · 2 Aug 2016

I have been looking into this.

Getting closer.

However, you need to keep the following in mind. The more real time updates you add to a site, the slower the site will get. If you have a lot of users online on your site at the same time, you may find this feature will put a extra load on the server. Not recommend for use on inexpensive low end shared servers. Busy sites may find this feature will kick the server in the gut knocking the wind out of it.

https://www.deanbassett.com
Quote · 3 Aug 2016

Not for shared hosting!  In fact, could get your account suspended.

 

Will be interesting to see how it does on my dedi.which sits idling for the most part.  However, this could attract more users to the site which would increase the load.  Of course more users to the site would mean increase revenue which then can be used to buy a better server.

Geeks, making the world a better place
Quote · 3 Aug 2016

To add auto-refresh of comments add the following code (<script>...</script> part) to templates/base/cmts_main.html (or the same file in your template folder):

 

    __js_code__

    <script>
        var a = '__html_id__'.split("-", 2);
        var sCmtsClassName = 'oCmts' + a[0].charAt(0).toUpperCase() + a[0].slice(1) + a[1];
        setInterval(function () {
            if ($('#cmts-box-__html_id__ form:visible > input[name=CmtParent][value=0]') && (!$('#cmts-box-__html_id__ .cmt-text-post').size() || !$('#cmts-box-__html_id__ .cmt-text-post').val().length) && !$('#cmts-box-__html_id__ form:visible > input[name=CmtParent]:not([value=0])').size())
                window[sCmtsClassName]._getCmts($('a[name=cmta-__html_id__]'), 0, function () {});
        }, 20000);
    </script>
</div>

20000 - means refresh every 20 seconds

Rules → http://www.boonex.com/terms
Quote · 4 Aug 2016

That solution has a drawback; it basically destroys and reloads the comments and thus the page is jumping around..  If nothing else, is it possible to check first for new comments and if none, then don't refresh the comments box.  As it stands now, it refreshes even if there are no new comments.

Geeks, making the world a better place
Quote · 5 Apr 2017

 

That solution has a drawback; it basically destroys and reloads the comments and thus the page is jumping around..  If nothing else, is it possible to check first for new comments and if none, then don't refresh the comments box.  As it stands now, it refreshes even if there are no new comments.

There is no easy solution to implement such reload 

Rules → http://www.boonex.com/terms
Quote · 5 Apr 2017

I see Boonex waste a lot of time and effort in adding worthless things to Dolphin over the years but have done nothing about seamless real time comments.  I was on Multiply before it crashed and burned and they had real time seamless comments.  If you want to get people flocking to Dolphin and UNA, add seamless real time comments and advertise it.  You will get customers.

Geeks, making the world a better place
Quote · 25 Apr 2017

We are implementing alternative way for comments in UNA with realtime updates, this feature will gradually will be added to Dolphin as well.

Rules → http://www.boonex.com/terms
Quote · 30 Apr 2017

 

We are implementing alternative way for comments in UNA with realtime updates, this feature will gradually will be added to Dolphin as well.

 I should add that this new "thing" is not just about comments. We will be announcing it very shortly (any day now). 

Heart Head Hands
Quote · 30 Apr 2017

 

 

We are implementing alternative way for comments in UNA with realtime updates, this feature will gradually will be added to Dolphin as well.

 I should add that this new "thing" is not just about comments. We will be announcing it very shortly (any day now). 

It is now October and we are still waiting for this "any day now" announcement.

Also, once again I am being hounded by my members to have real time comments.  I have spent some time on it but the way the comment system is currently implemented, I am not sure.

Geeks, making the world a better place
Quote · 2 Oct 2017

Just went to UNA.io and I did not see real time comments in place.

Boonex, stop all work on UNA and LEAP and get real time comments in place and then you would have a product you could really sell.  FaceBook has real time comments and I have seen real time comments on other platforms.  Add real time comments to the next release of Dolphin Pro and advertise it and you will get buyers.

Geeks, making the world a better place
Quote · 2 Oct 2017

 

Completely agree. I think it is something fundamental that takes a long time to delay.

Quote · 3 Oct 2017

I agree with you, but you cite the problem well. UNA is making a leap forward this year, and during this time Dolphin is forsaken. I think it's hard to move on the two in parallel, I think the problem is right there.

Boonex has now users UNA and/or Dolphin, I think it will be complicated to disconcert both parties. Maybe I'm wrong, but it seems not.

Just went to UNA.io and I did not see real time comments in place.

Boonex, stop all work on UNA and LEAP and get real time comments in place and then you would have a product you could really sell.  FaceBook has real time comments and I have seen real time comments on other platforms.  Add real time comments to the next release of Dolphin Pro and advertise it and you will get buyers.

 

Baloo
Quote · 4 Oct 2017

When you are on the page with the comment block; you can leave a comment and it instantly shows up on the page while you are on the page.  Leave a reply to a comment and it will add that reply below the comment.  Both are done without destroying the whole comment block and reloading it  There is no moving around of the page; it is nice and smooth.

What we want is for the same thing to happen when you are simply viewing the comments.  If another member leaves a comment, it should do the same action as it did for the person leaving the comment.

AlexT, give me a code answer; detailed, of why the Boonex Dolphin Comment code can not do what other comment code; such as a wordpress plugin.  Are you saying you lack the skill to do this coding?  I don't think so, I think you have the knowledge and that Boonex, Andrew, AlexT, don't want to spend the effort to have this real time comment system; which would be a good selling point as FaceSucks has already moved to this.

Geeks, making the world a better place
Quote · 5 Oct 2017

I am really looking forward to Alex's answer on this.

Geeks, making the world a better place
Quote · 7 Oct 2017

Actually, when comments are in real time, it isn't comments system, it's chat. 

What we did in UNA (and going to do the same for Dolphin) is to be able to use chat block instead of comments block. 

Rules → http://www.boonex.com/terms
Quote · 9 Oct 2017

I figured out why the page is jumping.  The comments code prints "loading" as the comments are loading.  Since I am running it on a fast dedi, that "loading" statement pops in and out quickly and thus cause the jump in the page as everything gets pushed down temporary.  OK, if I remove the loading being printed that should solve the page jump issue.

However, pagination doesn't work because when the comments are reloaded, it jumps back to the first page.  For now I have a pause button so one can stop the loading of new comments.  The same hold trues for the number per page, if you change that, it will revert back to the default value on the next reload of the comments block.

Of course Boonex will not spend any time on this because they would rather spend it on things that the community doesn't want.

Geeks, making the world a better place
Quote · 11 Oct 2017

 

Actually, when comments are in real time, it isn't comments system, it's chat. 

What we did in UNA (and going to do the same for Dolphin) is to be able to use chat block instead of comments block.

What?  Is this done like a proper comment section or is it done like a proper chat section?  Was this Andrew's idea?  It is a bad idea whoever made it.  As I have said before, if the crap of UNA gets into Dolphin Pro, I am out of here and will no longer support the platform.  UNA is horrible as a platform; which is OK, I don't have to use it.  However, I am using Dolphin Pro and have a vested interest in It.  I am just hoping that it does not become the dung pile that is UNA.

Geeks, making the world a better place
Quote · 11 Oct 2017

What is needed is for the per page to be sticky; so that if comments are reloaded it does not change the per page setting.  I noticed that order is sticky.  Once you set the order, even if the comments are refreshed, that does not change.  Perhaps Alex you will be so kind as to help with making the order sticky so that if comments are refresh it does not revert back to the default.

Geeks, making the world a better place
Quote · 11 Oct 2017

At least on the profile comments, the per view from the sys_objects_cmts table has no affect.  That select list is controlling the number of comments to show per page and that is not actually coded; you have to hunt for the key and see where in hell it is being added to the page.  Then there is the thing about being on a different page, I need for it to pause the live comments when you are not on the first page.  Of course since code is through 20 different files it is not easy to find and of course there is no documentation on any of this.

Geeks, making the world a better place
Quote · 12 Oct 2017

The possible solution to retain 'start' and 'per_page' values is to store last ones, then when comments are reloaded, it can use last values, something like this:

BxDolCmts.prototype._getCmts = function (e, iCmtParentId, onLoad, iStart, iPerPage)
{
    var $this = this;
    var oData = this._getDefaultActions();
    oData['action'] = 'CmtsGet';
    oData['CmtParent'] = iCmtParentId;    
    oData['CmtOrder'] = this._sOrder;
    if(iStart) {
        oData['CmtStart'] = iStart;
        $this._iStartLast = iStart;
    } else if ($this._iStartLast) {
        oData['CmtStart'] = $this._iStartLast;
    }
    if(iPerPage) {
        oData['CmtPerPage'] = iPerPage;
        $this._iPerPageLast = iPerPage;
    } else if ($this._iPerPageLast) {
        oData['CmtPerPage'] = $this._iPerPageLast;
    }

    ...

It isn't tested, so actual code maybe a bit different.

You don't have to install Dolphin 7.3.4 if you have no time to test it now.

Rules → http://www.boonex.com/terms
Quote · 12 Oct 2017

 

The possible solution to retain 'start' and 'per_page' values is to store last ones, then when comments are reloaded, it can use last values, something like this:

BxDolCmts.prototype._getCmts = function (e, iCmtParentId, onLoad, iStart, iPerPage)
{
    var $this = this;
    var oData = this._getDefaultActions();
    oData['action'] = 'CmtsGet';
    oData['CmtParent'] = iCmtParentId;    
    oData['CmtOrder'] = this._sOrder;
    if(iStart) {
        oData['CmtStart'] = iStart;
        $this._iStartLast = iStart;
    } else if ($this._iStartLast) {
        oData['CmtStart'] = $this._iStartLast;
    }
    if(iPerPage) {
        oData['CmtPerPage'] = iPerPage;
        $this._iPerPageLast = iPerPage;
    } else if ($this._iPerPageLast) {
        oData['CmtPerPage'] = $this._iPerPageLast;
    }

    ...

It isn't tested, so actual code maybe a bit different.

You don't have to install Dolphin 7.3.4 if you have no time to test it now.

Yes, this looks very much as what I have been studying.  Thanks for the guidance. I have poured though the code the last few days and I have learned a great deal about the comments engine.

Geeks, making the world a better place
Quote · 14 Oct 2017

The final part of the problem is the expand all.  When the comments are refreshed, it goes back to the default value as well.  The actual state of the checkbox does not change.  The checkbox acts as a toggle switch showing and hiding replies to comments.

Geeks, making the world a better place
Quote · 14 Oct 2017

in which file you make the modifications. I would like to help and try this improvement

 

Quote · 15 Oct 2017

 

in which file you make the modifications. I would like to help and try this improvement

 

Go back through, it is mentioned where to make the changes; some is in the template file where you add in the script to refresh.  In the last one, that is in the BxDolCmts.js file located in /inc/js/classes or somewhat like that.

Geeks, making the world a better place
Quote · 15 Oct 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.