How? Comment post form on the bottom in timeline

Comments posted on the photos and video modules appear top down, oldest to newest with the post form on bottom.  Looks like it is parsing cmts_main.html to do this.

 

Comments posted on the timeline are much fancier (thank you) but I'd rather replicate the method above, top down, oldest to newest with the post form (comment) on the bottom.  I'm close but tired of trying to find out how the comment order is being rendered.  Evidently it is dynamically building the html code.  If you know where to swap the paginate code so it's before the post form code, you would be quite an amazing person today should you share knowledge of how to make this particular tweak.

 

Quote · 14 Feb 2015

It is a simple fix, one that I got when I first started using Dolphin.  I will either find the link to the topic or pull it out from my code.  Also, you can have replies automatically shown without having to click on expand replies.

Geeks, making the world a better place
Quote · 15 Feb 2015

view this: http://www.boonex.com/forums/?action=goto&search=1#topic/New-comments-left-go-to-bottom-.htm

Geeks, making the world a better place
Quote · 15 Feb 2015

Mmmm, I may have given an answer to a question not asked.  Exactly what is it you want to do?

Geeks, making the world a better place
Quote · 15 Feb 2015

Thank you for your response.  I'm messing around with 7.15 and I only see 1 oParent.find statement in that cmts.js file which is: oParent.find('.cmt-no').remove().

I suppose there has been an update. That aside for a moment, how I would like my timeline to behave is and to explain my topic question a bit better:

  • New Topics listed with newest entry (most recent) on top - which is what the Timeline module does as expected.
  • Comments for a specific Topic should be listed chronologically, oldest to newest.  Granted, it's a subjective call.  In my opinion:
    •  Whoever wrote the code followed email logic, meaning that typically whoever is replying to an email is already familiar with the message history and prefers the latest response to be at the top.  This saves time because the reader doesn't have to scroll through history to get to the latest response. But...
    • Timeline logic should assume there are net new people reading the thread for the first time so they need context, meaning they need to read what was written previous to help better understand what the last response could mean.  Even if it's only the last 4 or 5 comments of 20 for example.
      • People tend to read top to bottom, not scroll down to the bottom and read up to the newest response. Except for email threads. Ha.
      • And once the reader has context from the comment history and wishes to respond, the Post form should be right there underneath that last comment - not have to scroll back up to the top of the comment thread to type in their thoughts.
The Timeline user experience as shipped is not wrong by any means. I prefer the user to have a Timeline experience as I described above :).  My reformed question is, How can I have the comment history appear oldest to newest and have the New Post form appear under the last comment?

I've played with Dolphin off and on for several years now mostly to learn PHP.  I'm just now starting to look at how the Timeline works. I really appreciate anyone that shares her (or his) knowledge when I ask my questions. Thank you very much.
Quote · 15 Feb 2015

Thanks GG. Using that cmts.js file you were talking about, I got the sorting done like I want.  And it turns out I was just overlooking  <div class="cmt-reply"></div> in the comments.html wall module file. That's where the post form loads and I just moved that div to where I wanted it.  That one was easy. Sheesh. But...

 

So how the heck do I make the comments visible on load instead of having to click on the 'comments' button if some comments already exist?

Quote · 15 Feb 2015

 


So how the heck do I make the comments visible on load instead of having to click on the 'comments' button if some comments already exist?

That may be done the same way as for comments on the profile or videos, photos, etc.  This was the solution that Alex gave for the profile comments but that may be different in the timeline.  For profile comments I kept looking in the javascript and it was in the code creating html markup.  The following was for general comments on the site:

Please test extensively the following modification, if this works good we will include it in the upcoming version.

1) Change the following (near ~80 line in templates/base/scripts/BxBaseCmtsView.php file):

$sRet = '<ul class="cmts">';

to:

$sRet = '<ul class="cmts ' . ($iCmtsParentId ? 'cmts-margin' : '') . '">';

2) Then change the following (near ~117 line in the same file):

$sRet .= '</div></li>';

to:

$sRet .= '</div>';
if (true && $r['cmt_replies']) {
    $sRet .= $this->getComments ($r['cmt_id'], $sCmtOrder);
}
$sRet .= '</li>'; 

 

Particularly it maybe problems with a lot of replies for one comment, so it would be great to have some feedback on how it works in such situation, and if it is acceptable or not.

Geeks, making the world a better place
Quote · 15 Feb 2015

Interesting.  For grins I applied the code tweak as provided but there is no change in display behavior.

I'm pretty sure it's initializing a Display attribute as "none" somewhere and the following code in that basecmtsview file simply toggles display to "block" or "none" (firing off the function show/hide replies in BxDolCmts.js):

$sContentShow = _t((isset($a['cmt_type']) && $a['cmt_type'] == 'comment' ? '_Show N comments' : '_Show N replies'), $a['cmt_replies']);

$sContentHide = _t((isset($a['cmt_type']) && $a['cmt_type'] == 'comment' ? '_Hide N comments' : '_Hide N replies'), $a['cmt_replies']);

$sRet = '';

$sRet .= '<a class="cmt-replies-show" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.toggleCmts(this, \'' . $a['cmt_id'] . '\'); return false;">' . $sContentShow . '</a>';

$sRet .= '<a class="cmt-replies-hide" href="javascript:void(0)" onclick="' . $this->_sJsObjName . '.toggleCmts(this, \'' . $a['cmt_id'] . '\'); return false;">' . $sContentHide . '</a>';

Right? It's just where is initializing the display:none?  I guess I could cheat and put in my own OnLoad function call to set the toggle to display:block but since I'm using this as a learning tool, I'd rather try to figure out how it was done as shipped.

Then again, maybe displaying all comments on load is much more complex. :)  My next goal is to count the number of comments posted on a given topic and if they exceed let's say 10, then those older comments from #11 on would collapse and could only be seen if someone clicked on that toggle code.

But first, I really would like to know how to set the Reply section to show all on page load.

I'll take a closer look at the code tweak you sent so I can try to learn what you are trying to teach me. heh heh.

-g

Quote · 16 Feb 2015

I thought maybe they used a similar method; you can always ask Anton or Alex, they maybe can give insight.

Of course you need to clean the caches if you forgot.

Geeks, making the world a better place
Quote · 16 Feb 2015
 
 
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.