Extension: Goto Latest Comment *Supports Paginated Comments*
Posted: 02 February 2009 07:43 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

Greetings,

This will automatically scroll the page down to the last comment after it has been posted.  It also supports pagination of comments.

Installation Instructions
1.  Download the extension and place it in it’s correct spot.
2. Enable the extension
3. Put {last_comment} inside your {exp:comment:entries} tagpair towards the top. Just under the opening tag would be the best spot. This variable will be replaced with the anchor tag so wherever you put this variable will be where the anchor tag will be.
4. Enjoy smile

Versions
v1.5 - I’ve changed the name of the class to Goto_latest_comment to make more sense which means you’ll have to delete the ext.goto_last_comment file out of your extensions folder.  This new version will remove any hooks out of your extensions table that aren’t being used anymore.

Best Regards,
cody

File Attachments
ext.goto_latest_comment.zip  (File Size: 3KB - Downloads: 267)
 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 02 February 2009 07:46 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRank
Total Posts:  3218
Joined  05-13-2004

Very nice will use this shortly.

 Signature 

Recent version: EE 2.4.0 | 2.x Bug Tracker | How to Post a Support Request | Version Upgrade | 2.4.0 Change Log

on twitter @CS_sean

Profile
 
 
Posted: 06 February 2009 04:30 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  295
Joined  05-07-2006

*koff* Scroll to new comment extension *koff*

wink

 Signature 

The Watchmaker Project | My EE add-ons | Follow me on Twitter

Profile
 
 
Posted: 06 February 2009 05:35 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

hmm…well it looks like it’s just two different ways to do the same thing smile.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 12 March 2009 01:03 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

Updated extension and am now hosting it on GitHub.  Please check original post.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 16 April 2009 07:18 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
RankRank
Total Posts:  277
Joined  12-12-2007

Thanks for posting this extension.  I would love to use this extension, but so far no luck.  Here is the error message I am getting:

Notice: Undefined index: comment_id in ... extensions/ext.goto_last_comment.php on line 143

Any idea what is going wrong?
Jules

P.S I am using Weever, in case that makes a difference.

Profile
 
 
Posted: 06 June 2009 03:17 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1135
Joined  02-02-2007

Hi,

Goto Last Comment has the same bug, as Scroll to last comment extension.

I described that bug here.

 Signature 

Full list of add-ons here

Child Categories
Browser Sniff
Category Id
Entries Number

Profile
 
 
Posted: 06 June 2009 05:19 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  295
Joined  05-07-2006

Hi Laisvunas - I can’t replicate the bug you described in the comments on my site; whenever I submit a second comment immediately after a first one, the redirect works as expected.

 Signature 

The Watchmaker Project | My EE add-ons | Follow me on Twitter

Profile
 
 
Posted: 22 July 2009 02:52 PM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  10
Joined  09-29-2006

The same bug appears with paginated comments page…

I mean several times :D

Is there any workaround with that?

Profile
 
 
Posted: 23 July 2009 07:24 PM   [ Ignore ]   [ # 9 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008
Laisvunas - 06 June 2009 07:17 AM

Hi,

Goto Last Comment has the same bug, as Scroll to last comment extension.

I described that bug here.

Umm…no, I never had this problem.

Anyways, the first post has been updated with the latest version which supports pagination now.  I’ve also removed hook and used a javascript to change the return URL so I could support pagination.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 02 August 2009 06:44 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  331
Joined  02-05-2009

I’ve run into a couple of headscratchers regrading this extension. One I’ve managed to clear up, but other’s still got me confused.

First, it seems there’s a conflict of sorts with LG .htaccess Generator, which adds a trailing slash to urls that don’t end with a file extension.

This ends up combining w/ Goto Latest Comment to create urls like:

http://www.mysite.com/local/comments/greatstory//P15/#latest_comment 

which doesn’t lead anywhere, of course.

A quick addition to .htaccess (after the LG rule that adds the slash) fixes this:

# Remove double slashes // to fix Goto Latest Comment/LG .htaccess Generator conflict
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L] 

So that’s solved.

Make sure, if you’re using this fix, to make it in the LG .htaccess Generator settings, not just in your file, or it’ll be overwritten soon enough.

The one I can’t figure out is how the #latestcomment anchor is supposed to get added. I get urls that are looking for that anchor, but it’s not in my code to be found. So, while a commentor ends up on the correct page, which is nice, there’s no scrolling to the comment.

Any ideas what I’m doing wrong here?


thx!

Edit: A quick look at Win IE7 and I’m seeing urls that don’t include the anchor at all. Pagination works, but certainly not scrolling.

 Signature 

TucsonSentinel.com - we’re watching Tucson

Profile
 
 
Posted: 02 August 2009 10:56 PM   [ Ignore ]   [ # 11 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

I’m very sorry you were having all these problems!! :(.

Regarding LG .htaccess Generator, your right, I didn’t take into account for that.  I’ll look into it some more and try to make a fix for that.

As for your second point, totally my fault!! I forgot to add the instructions to the forum when I moved this extension from GitHub to this thread.  Please read them above.  You’ve got to add a special EE Variable inside your comments block.

Again, so sorry :(.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 03 August 2009 12:04 AM   [ Ignore ]   [ # 12 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  331
Joined  02-05-2009
MeanStudios - 03 August 2009 02:56 AM

I’m very sorry you were having all these problems!! :(.

Regarding LG .htaccess Generator, your right, I didn’t take into account for that.  I’ll look into it some more and try to make a fix for that.

As for your second point, totally my fault!! I forgot to add the instructions to the forum when I moved this extension from GitHub to this thread.  Please read them above.  You’ve got to add a special EE Variable inside your comments block.

Again, so sorry :(.

No problem at all!

This is a really great extension, and works like a charm now that I’ve got that variable in there ; )

I’ve got a neat little system going here now - a combo of your Goto Latest Comment, the quote/reply system from DigitalNoon that I hacked to play nicely w/ Rockatee’s Live Comment Preview and html_buttons. I created a new comments_html_buttons function, so I can play around with adding in image and video features.

Rounding things off is LG Quarantine.

I’m thinking about trying to incorporate the Encouraged Commentary response links - can you tell I got into this comment system I’m building?

Thanks to you, MeanStudios, and everyone else who comes up with such great code!

 Signature 

TucsonSentinel.com - we’re watching Tucson

Profile
 
 
Posted: 03 August 2009 12:53 AM   [ Ignore ]   [ # 13 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

Wow, what a concatenation of comment mods :D.
No worries dude, I’m glad at least one person found this useful heh.

Let me know when you’ve got a finished product smile.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 03 September 2009 06:15 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  331
Joined  02-05-2009

A bit of a tweak I made to this extension:

We’re showing the latest 3 comments at the bottom of an entry page, with a comment form. When someone submits, we wanted them to go to the latest comment on the comments pages, which we’re showing in a different template.

Mark Bowen’s Comment Redirect conflicts with this extension, so that option doesn’t work.

So, in ext.goto_latest_comment.php, around line 131, I added this to change the return url:

$ret_url str_replace("report""comments"$ret_url); 

report is the template that shows the entry, comments would be - logically enough - the template that shows all of the comments - adjust to your template structure and season to taste.

Don’t know if it’d matter if it were before or after

$ret_url preg_replace("#/P\d+#i"''$ret_url); 

I put it before.

Hope that helps somebody out there….

 Signature 

TucsonSentinel.com - we’re watching Tucson

Profile
 
 
Posted: 03 September 2009 06:25 PM   [ Ignore ]   [ # 15 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  417
Joined  11-17-2008

Ya, I see where my extension wouldn’t work too well with Mark’s smile
I guess I could just add a setting for the extension to point to a different template on submit but I don’t want to step on Mark’s toes smile.

What you did is just fine, doesn’t matter where it happens.

 Signature 

- cody

Plugins: AJAX Pagination | AJAX Comments
Extensions: jQuery Quick Save (updated) | Goto Latest Comment
FieldTypes: MS Img Saver
MeanStudios.com

Profile
 
 
Posted: 07 December 2009 12:25 PM   [ Ignore ]   [ # 16 ]  
Grad Student
Rank
Total Posts:  40
Joined  07-22-2009

Does this work with AJAX comments?

When I have this enabled it seems to load the whole page again within the comments container.

Profile
 
 
Posted: 08 December 2009 05:46 AM   [ Ignore ]   [ # 17 ]  
Grad Student
Rank
Total Posts:  40
Joined  07-22-2009

bump?

Profile