Only fill this in if you're a spammer huh? Your name :
Your email :
Your message :
Mar
11th
2007

Nested comments

Posted in : Plugins & Widgets

I finally found the time to finish off the nested comments plugin. If you fancy having a pre-release play with it you can find it here. Please note : it has a known problem - when you preview a comment it "forgets" which comment it's a reply to. This is caused by the fact that the core redirects through htsrv when creating a preview and doesn't pass on the plugins parameter. I'm working on it ;) *solved : zip file update 12th March*

Unlike most of our plugins this one also involves some code in your skins _feedback.php, not a lot though so don't worry. First find this segment of code and add the new bit :-

PHP:

<?php
    $CommentList = & new CommentList0implode(','$type_list), array('published'), $Item->ID'''ASC' );
    <span style="color:red">// Nested comments part 1 of 3</span>
    <span style="color:red">$Plugins->call_by_code'amNestCmnt'array() );</span>

The next piece of code can go anywhere in the comment loop and will spit out a "reply to this comment" link

PHP:

<?php
            // Nested comments part 2 of 3
            if ( $Item->can_commentNULL ) )
            {
                echo '<p class="replyTo"><a href="'.url_add_param$Item->get_permanent_url(), 'am_nestCmnt_reply_to='.$Comment->ID ).'#bComment_form_id_'.$Item->ID.'">Reply to <span>comment '.$Comment->ID.' by </span>'.$Comment->get_author_name().'</a></p>';
            }
            ?>

The final bit of code is just a demonstration of how to use the comment depth to indent your comments

PHP:

// Nested comments part 3 of 3
        <div class="bComment"<span style="color:red"><?php echo ( isset( $Comment->depth ) ? ' style="margin-left:'.( $Comment->depth 2).'em"' '' );?></span>>

And that's pretty much it. The plugin should work in all 1.8.x and 1.9.x versions, let me know if you manage to break it ;)
¥

Trackback URL (right click and copy shortcut/link location)

Trackback url for this post
Note : This trackback url is time limited so use it within 30 minutes or the SpamHound will snarl at you.

http://waffleson.co.uk/z/?k=36412602633103238a87a669bdb59219250534bb823c8dde6

Replied on : 03/12/07 @ 11:00 am #1

Nice work, but what does it actualy do ? :oops:

What should we do with spammers? You want to play with them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 13909 by ¥åßßå

Replied on : 03/12/07 @ 12:02 pm #2

It means that if you click "reply to Yabba" and then make a comment it'll "subset" it below the comment that you are replying to ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 07/24/07 @ 01:10 pm #3

prova2

What should we do with spammers? You want to play with them
 
 
Gary users avatar

Posts : 334

Joined : 04/04/05

Reply to comment 13910 by Gary

Replied on : 03/12/07 @ 12:34 pm #4

Cool, I will have a look now by posting a comment.

Gz

What should we do with spammers? You want to play with them

Blog-a-doodle-do :D  http://garysblog.co.uk

 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 13911 by ¥åßßå

Replied on : 03/12/07 @ 12:58 pm #5

Of course, it helps if you click the "reply to" link ;)

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 
Gary users avatar

Posts : 334

Joined : 04/04/05

Reply to comment 13912 by Gary

Replied on : 03/12/07 @ 02:16 pm #6

I could of sworn that I did :)

What should we do with spammers? You want to play with them

Blog-a-doodle-do :D  http://garysblog.co.uk

 
 

Replied on : 07/24/07 @ 01:10 pm #7

prova

What should we do with spammers? You want to play with them
 
 

Replied on : 08/31/07 @ 08:09 pm #8

Just testing what nested comments look like :)

What should we do with spammers? You want to play with them
 
 

Replied on : 09/16/07 @ 02:44 pm #9

Can't wait to get this upgraded for b2evo-v2 :p



What should we do with spammers? You want to play with them
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14241 by ¥åßßå

Replied on : 09/16/07 @ 03:31 pm #10

I assume that means it doesn't work in 2.0 :p

¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 09/16/07 @ 03:43 pm #11

Haven't tested actually. Most of the v1.x plugins I tried is not working for v2a1, or is not working 100% as was intended.. So I marked all plugins not to work for v2 :p hehe.. especially since 'nothing is final' yet.

^_^

Har.. it's 11pm here, Monday again tomorrow.. back to day job :/



What should we do with spammers? You want to Burn them! They're witches and warlocks!!
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14243 by ¥åßßå

Replied on : 09/16/07 @ 03:51 pm #12

Give it another 7 hours and I'll be in the same position ;)

btw, I noticed the following error on your blog ( top right corner )

Notice: Array to string conversion in /[path]/inc/_core/_misc.funcs.php on line 298
Array



¥

What should we do with spammers? You want to play with them

I may have opened the door, but you entered of your own free will

 
 

Replied on : 10/15/07 @ 03:32 pm #13

hey... so I installed the plugin, but I am having problems.

when i go to enter a new comment, it inserts it as a nested comment instead of starting a new comment thread on the post.

any help would be appreciated...
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14353 by ¥åßßå

Replied on : 10/15/07 @ 04:41 pm #14

Hi Dave,

The only problem I know of with the plugin at present is if you're running b2evo 2.0.x and preview your comment ( the plugin currently "forgets" the nesting )

You shouldn't be having problems with 1.10.2. The comments should only get nested if you click "reply to aaaaaa", if you just fill in the comment box and press send then it ends up un-nested ( like yours is on this thread )

¥

I may have opened the door, but you entered of your own free will

 
 

Replied on : 10/15/07 @ 05:03 pm #15

The comments should only get nested if you click "reply to aaaaaa", if you just fill in the comment box and press send then it ends up un-nested ( like yours is on this thread )

hmmm... i think it has something to do with the spacing in the "bcomment" code that does the indentation. it is placing the comments in the correct place in terms of order, but it keeps indenting them further in even if I start a new thread.

you can see an example here.

any ideas?

thanks for the help.
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14358 by ¥åßßå

Replied on : 10/15/07 @ 07:00 pm #16

Hi Dave,
Without sounding funny, if you cure the validation errors on your website then you'll probably find this works as planned.

If you still have a problem after that ( or if you need help with curing them ) then just give me a shout ;)

¥

I may have opened the door, but you entered of your own free will

 
 

Replied on : 10/15/07 @ 10:31 pm #17

You weren't sounding funny... I know that some my code sucks right now.

So I went back and fixed the validation errors... but that didn't work. Then my b2e guru Danny told me that the feedback form had probably been changed since I edited mine, and to get a new feedback.php and re-edit it. And that worked.

So it is all better now - thanks!
 
 

Replied on : 01/16/08 @ 08:01 am #18

Does this send the original poster a reply when someone "Replies to" them?
 
 

Replied on : 01/16/08 @ 08:03 am #19

Just testing
 
 

Replied on : 01/16/08 @ 08:04 am #20

Ha - sorry, just saw the tic box. By ticking the box, do you get all replies to the post or only reply's to your comment?
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14522 by ¥åßßå

Replied on : 01/16/08 @ 10:22 am #21

You should get all replies to the post ;)

¥

I may have opened the door, but you entered of your own free will

 
 

Replied on : 04/04/08 @ 11:14 am #22

Will this be updated for b2evo 2.x ?
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14629 by ¥åßßå

Replied on : 04/04/08 @ 04:41 pm #23

This blog runs 2.x ;)

¥

I may have opened the door, but you entered of your own free will

 
 

Replied on : 04/04/08 @ 09:55 pm #24

Ah, I see.

So the stupidity is mine and mine alone :oops:
 
 

Replied on : 04/08/08 @ 06:42 pm #25

Help! :(

This plugin emitted the following error on my blog:

Notice: Trying to get property of non-object in /home/poluani/public_html/pandu/blog/plugins/am_nested_comments_plugin/_am_nested_comments.plugin.php on line 108

I'm using the latest b2evo, btw.
 
 
¥åßßå users avatar

Posts : 845

Joined : 10/05/05

Location : 127.0.0.1

Reply to comment 14638 by ¥åßßå

Replied on : 04/09/08 @ 09:25 am #26

Line 108 is a blank line, so it's a smidge hard to get an error there, but based on the area of the plugin code that you're having the error I'd guess that you have the 1st piece of code in the wrong place.

¥

I may have opened the door, but you entered of your own free will

 
 

Leave a comment

Your email address will not be displayed on this site.
Your URL will be displayed.
About you

Just fill in the bits you want, none of it is required



Your email address will only be used to send you adverts for viagra and rolex watches.



(Line breaks become <br />)
Leave a comment
Code:
=> :!: :?: :idea: :) :D :p B) ;) :> :roll: :oops: :| :-/ :( >:( :'( |-| :>> ;D :)) 88| :lalala: :crazy: >:XX :o