NP_LatestComments 1.6

Post your new plugins here!
User avatar
Red Dalek
Posts: 212
Joined: Sun Dec 12, 2004 10:39 pm
Location: London, UK
Contact:

Postby Red Dalek » Sun Jan 06, 2008 12:24 pm

Hi Runetek,

You can download a copy from me: http://dominicself.co.uk/downloads/NP_LatestComments.zip
User avatar
tlucente
Posts: 82
Joined: Wed May 03, 2006 2:30 am
Location: Lima, Ohio, United States
Contact:

Re: LatestComments download link

Postby tlucente » Sun Jan 06, 2008 7:36 pm

Runetek wrote:Hi all,
LatestComments download link on http://wakka.xiffy.nl/latestcomments is not working...

Thx for checking!


The link is in this thread a few messages back.
Freedom is a gift from Providence, not a political grant from government.
User avatar
tlucente
Posts: 82
Joined: Wed May 03, 2006 2:30 am
Location: Lima, Ohio, United States
Contact:

Working with BB Code?

Postby tlucente » Wed Jan 23, 2008 6:03 am

Any chance this will ever work with the BB code plugin? That plugin works for the comments but in the latest comments, you see the BB code. I don't know if there is an easy fix for that.
Freedom is a gift from Providence, not a political grant from government.
User avatar
admun
Nucleus Guru
Nucleus Guru
Posts: 4088
Joined: Mon Oct 20, 2003 2:57 am
Location: San Francisco, CA, USA
Contact:

Re: Working with BB Code?

Postby admun » Wed Jan 23, 2008 5:47 pm

tlucente wrote:Any chance this will ever work with the BB code plugin? That plugin works for the comments but in the latest comments, you see the BB code. I don't know if there is an easy fix for that.

There is NP_Smiley support for this pluginalready. I think it's doable, the bb code plugin need to support PreCommen event.
User avatar
tlucente
Posts: 82
Joined: Wed May 03, 2006 2:30 am
Location: Lima, Ohio, United States
Contact:

Re: Working with BB Code?

Postby tlucente » Fri May 16, 2008 8:26 am

admun wrote:
tlucente wrote:Any chance this will ever work with the BB code plugin? That plugin works for the comments but in the latest comments, you see the BB code. I don't know if there is an easy fix for that.

There is NP_Smiley support for this pluginalready. I think it's doable, the bb code plugin need to support PreCommen event.


Just noticed another conflict with BB code. When a person puts a link in their comment, it screws up the link to the comment from latest comment.

Not sure if there is a fix for that. Any suggestions?
Freedom is a gift from Providence, not a political grant from government.
PakTrik
Posts: 89
Joined: Wed May 07, 2008 11:05 am

NP_latestcomments 1.83

Postby PakTrik » Fri Jul 18, 2008 9:06 pm

This line

Code: Select all

$out = str_replace("%l", $IndexURL.$itemlink."#c", $out);


brings me to the first reaction in an item.

This line

Code: Select all

$out = str_replace("%l", $IndexURL.$itemlink."#".$row->cnumber, $out);


just brings me to the top of the itempage and not to the desired reaction.

Can somebody explain?

Thanks in advance
ftruscot
Nucleus Guru
Nucleus Guru
Posts: 7430
Joined: Wed Feb 22, 2006 6:19 pm
Location: Massachusetts
Contact:

Postby ftruscot » Fri Jul 18, 2008 9:34 pm

The second one will only work if you've done this step in the configuration:
6. Add anchor tag in the detailed item template (under comments body): <a name=<%commentid%> ></a> after say “<h4 class=”c_userlink“><%userlink%> wrote:</h4>”

That puts an anchor on the item page for each comment number, making the link created by the second bit of code match an anchor on the page.
PakTrik
Posts: 89
Joined: Wed May 07, 2008 11:05 am

NP_latestcomments 1.83

Postby PakTrik » Sat Jul 19, 2008 9:49 am

Hi Ftruscot,

Thank you very much for the solution. Now indeed it works.

Many thanks!

greetz,
mikalele
Posts: 15
Joined: Thu Aug 10, 2006 8:41 am

Postby mikalele » Wed Mar 25, 2009 1:54 pm

I'd like this plugin to show users avatars (from NP_Profile). I guess i'd need to edit the code of the plugin then!? I obviousy can't call the avatar from the plugin options.

Any hints on how i could try to do it?
PakTrik
Posts: 89
Joined: Wed May 07, 2008 11:05 am

Postby PakTrik » Fri Sep 11, 2009 8:06 pm

Using this plugin I nopticed the same strange behavior as already described in other postings here. But until now no solution is given.

On my blog BBCode is allowed. So some users like to put text in their comments in italics. The plugin works fine and puts the latest comment on top of the list and respects the italics. But in IE the next four comments suddenly change completely in italics although the cosde is not in their comments. Really annoying. This happens only in IE, no problem in Firefox or Chrome)

If the comments in italics drops to comment 5 or 6 suddenly the italics disappear and are replaced by the code "i.../i (brackets omitted for this message) If this behavior would be consistent I could live with it.
The same happens with other code like links. The linkcide is respected as long as the comment is on 1st to 5th place but on the sixth place, suddenly the code appears as [url=http://....] (This happens all three browsers that I use.)

I do hope someone has a solution for this problem.

Thanks in advance for looking into this.

Greetz,


Rork
Posts: 10
Joined: Tue Sep 28, 2010 12:08 pm
Contact:

Postby Rork » Tue Sep 28, 2010 12:35 pm

I didn't read trough all the post but would propose a few changes:

- Maximum length for the title also
- Make appending dots to the short authors name optional
- Add template variables for the short as well as complete author/comment/title
- Add a message if no comments are made

Like everybody I'd like to have implemented this last week when I needed it. Luckily I'm able to write code so I did. You can find the code on Pastebin (expires 28 oktober 2010). I'm not sure these changes are wanted or what the exact procedure is to update a plugin that is not my own (I'll read up to that). The primary thing holding me back is the change of template variables. I would be happy to make it as an official release and edit the wiki page (after I cleaned up the code some more). I'll also try to read up a bit on this threat and see if I can implement other proposed features.

The following template variables can be used:
%l = link including anchor to comments
%L = link to post [new]
%p = Short post title
%P = Complete post title [!changed!]
%c = Short Comment
%C = Complete comment [new]
%u = Short author name
%U = Long author name [new]
%t = Time of comment

Extra settings are:
- Length of the title
- Use ... in short author name or not
- Text to show when no comments are present.

I would also propose to remove the option to force the short author names, using separate template variables for short and long author names makes this option unnecessary.

Comments on the (proposed) changes and my code are most welcome.
User avatar
WillyP
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH
Contact:

Postby WillyP » Wed Sep 29, 2010 11:56 am

You could always add it to the wiki as an alternate version... that is to leave the original in place and add your code below it, with an explanation as to the differences between them.
PakTrik
Posts: 89
Joined: Wed May 07, 2008 11:05 am

NP_LatestComments

Postby PakTrik » Thu Sep 30, 2010 7:45 am

@Rork

Thank you very much for adapting this plugin. Thanks to your work I got rid of a lot of garbled characters in this plugin. Also the wrong formatting was applied in the plugin. It has been an annoyance since long time; again THX!

I suggest to remove ASAP the prior plugin from the wiki; the results are below expectations.
Rork
Posts: 10
Joined: Tue Sep 28, 2010 12:08 pm
Contact:

Postby Rork » Wed Oct 20, 2010 1:08 pm

Yeah, but it's not like a complete different version either, just an extension.

Anyway I've uploaded the new version: NP_LatestComments
User avatar
WillyP
Nucleus Guru
Nucleus Guru
Posts: 872
Joined: Sun Aug 30, 2009 3:29 am
Location: Pembroke, NH
Contact:

Postby WillyP » Thu Oct 21, 2010 1:20 pm

Cool! I'm going to check this out later.
User avatar
tlucente
Posts: 82
Joined: Wed May 03, 2006 2:30 am
Location: Lima, Ohio, United States
Contact:

You Tube videos

Postby tlucente » Sun May 01, 2011 10:52 pm

When someone posts a YouTube video in the comments, the video appears in the lastest comments sidebar at the same full size.

Is there anyway to either have it not appear or better yet appear at a reduced size that will nicely fit in the sidebar?
Freedom is a gift from Providence, not a political grant from government.
Rork
Posts: 10
Joined: Tue Sep 28, 2010 12:08 pm
Contact:

Postby Rork » Tue May 03, 2011 4:57 pm

Can you link me to a topic that has a youtube video in the comments so that I can check what code is being used?
User avatar
tlucente
Posts: 82
Joined: Wed May 03, 2006 2:30 am
Location: Lima, Ohio, United States
Contact:

Postby tlucente » Tue May 03, 2011 9:06 pm

http://www.lucente.org/blog/item/2011/0 ... ition#8448

I removed the video and replaced it with a link. Do you need me to put the video back in? I am using the BB code plugin that allows YouTube videos in comments.
Freedom is a gift from Providence, not a political grant from government.
Rork
Posts: 10
Joined: Tue Sep 28, 2010 12:08 pm
Contact:

Re: You Tube videos

Postby Rork » Sat Oct 08, 2011 12:28 pm

tlucente wrote:When someone posts a YouTube video in the comments, the video appears in the lastest comments sidebar at the same full size.

Is there anyway to either have it not appear or better yet appear at a reduced size that will nicely fit in the sidebar?


Sorry for the delay, I released a new version of NP_LatestComments that adds support for NP_BBCode. Showing comments in markup is optional, images and youtube movies can be replaced by plain text. I didn't see a way to resize the them to fit the comment width.

Other changes:
- support for different odd / even comments
- fixed a bug in breaking a comment at word end, now checks if the comment is broken at wordend already.

I did some testing on a private install and just installed it on my own system (which doesn't use BBCode), there might be bugs left, please post them if you find any.
cathayan
Posts: 28
Joined: Sun Aug 17, 2003 9:35 am
Location: Beijing, China
Contact:

NP_LatestComments broke after upgrade to 3.65

Postby cathayan » Sun Apr 07, 2013 2:05 pm

NucleusCMS 3.65
NP_LatestComments 1.85
PHP 5.3.22
MySQL 5.5.30-cll (5.5.30)

error: PHP Fatal error: Cannot pass parameter 2 by reference in /home/public_html/blog/nucleus/plugins/NP_LatestComments.php on line 260

anyone can give a look into it?

Return to “Plugin Development”