WordPress.org

Ready to get started?Download WordPress

Forums

Threaded comments hack - 0.72 (45 posts)

  1. Laughinglizard
    Member
    Posted 10 years ago #

    This is the original hack from Dodo for b2, converted (the insides are completely different) to work well with WordPress 0.72. You can see it at work on my blog:
    http://dinki.mine.nu/weblog/index.php?p=429&more=1&c=1
    Test it out, make lots of comments, see what you think. I have made the instructions as simple and lucid as possible. If you have any questions, post on here or email me. You might have to tweak your CSS to suit yourself. I have tested the installation in both IE and Moz and it looks all right. :-P Let me know what you think!
    Here is the link to the hack
    Peace

  2. labellissima
    Member
    Posted 10 years ago #

    I got it working for my online journal. Thanks so much for this hack! See it in action:
    http://bellissima-x.com/index.php?p=111&c=1#comments

  3. Laughinglizard
    Member
    Posted 10 years ago #

    Fixed a linking problem that I had left out. Should be part of the hack tutorial now.

  4. bbommarito
    Member
    Posted 10 years ago #

    Does anyone know if this hack will still work with the newest CVS version? I think it's at 1.0 Pre-Alpha 1 or something like that.

  5. mtanner
    Member
    Posted 10 years ago #

    I installed the hack but it doesn't seem to be working. I get no error messages, but all my replays just show up as another post. Check the support forums seems to be no aswer to this problem. I'm using wordpres 0.72.
    http://vain.info/index.php?p=4&c=1#comments

  6. Laughinglizard
    Member
    Posted 10 years ago #

    mtanner, it seems to work fine. In order for the comments to be threaded, your commenter has to reply to the comment above. I would make the "reply to this comment" bold or a different color to make it stand out a little. Hope this helps.

  7. mtanner
    Member
    Posted 10 years ago #

    Thanks LaughingLizard
    Doh, I just figured out that I need to click on the "reply" link on the original comment. I'll follow your advice and make that stand out more. My next question is... In my reply it says "This is a reply to #(the number of the comment)" is there a way to change that to the commenters name or the post number?

  8. Anonymous
    Unregistered
    Posted 10 years ago #

    Is this using a recursive formula, or the dual-index containment formula? Recursion can get quite nasty =\

  9. mtanner
    Member
    Posted 10 years ago #

    sorry here

  10. mtanner
    Member
    Posted 10 years ago #

    This works Beautifully, here's to Promoting Peace and Brotherhood! Thanks

  11. kodefendant
    Member
    Posted 10 years ago #

    Yes, I love this hack. Question, how would I make a more prominent indent for the replies to each individual comment? As it is now, it's rather slight.

  12. Laughinglizard
    Member
    Posted 10 years ago #

    Look at the CSS modification towards the end of the tutorial. It reads:
    #commentswithin {
    min-width: 100px;
    margin-left: 10px;
    }
    Increase the margin-left to anything you think is fit. And thanks again for your positive feedback!

  13. IcEr5K
    Member
    Posted 10 years ago #

    I like the hack. :)
    However, I think the hack would have been better if the following was implemented:
    - comments enclosed in box in alternating colors
    what i mean is kinda like what they have here at the wp forums. each comment is either the tint or the shade of the color that they have picked to be the background for each post.
    - comments are linked by a line
    instead of having comments indented right below each other, i think there should also be a line to connect comments to each other to show which comments were in reply to which.\
    of course, these are just suggestions. thanks for the conversion.

  14. Laughinglizard
    Member
    Posted 10 years ago #

    Look at my website. I have the alternating colors somewhat implemented. If you like it I could share the code changes. I have left it up to the person using this hack to make those changes

  15. Laughinglizard
    Member
    Posted 10 years ago #

    This is what the b2 motor in my b2comments.php looks like.
    <ol id="comments">
    <?php $postAlternate = "odd"; ?>
    <?php
    // this line is WordPress' motor, do not delete it.
    if ($comments) {
    foreach ($comments as $comment) {
    ?>
    <p id="comment-<?php comment_ID() ?>">
    <div class="<?php echo $postAlternate; ?>">
    ">
    <?php comment_text() ?>
    <cite><?php comment_type(); ?> by <?php comment_author_link() ?> <?php comment_date() ?> @ "><?php comment_time() ?>  ')" title="reply to this comment" target="_self">Reply to this comment
    </cite>
    <? global $comment; dodos_thread($comment->comment_ID); ?>
    </div>
    <?php if ($postAlternate=="even")
    $postAlternate="odd";
    else
    $postAlternate="even"; ?>
    <?php } // end for each comment
    } else { // this is displayed if there are no comments so far
    ?>

  16. No comments yet.
  17. <?php } ?>

  • Anonymous
    Unregistered
    Posted 10 years ago #

    HELP!!!!
    What the hell have I done wrong..?
    When I try to comment I get this error:
    SQL/DB Error --
    [Unknown column 'comment_approved' in 'field list']
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 125
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 126
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 127
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 129
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 130
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 131
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 132
    Warning: Cannot modify header information - headers already sent by (output started at /home/tankgreen/proliferations/b2-include/wp-db.php:96) in /home/tankgreen/proliferations/b2comments.post.php on line 137
    And then every comment ever made on my site appears on entries that do not have any real comments...
    Help!
    http://proliferations.tankgreen.com

  • Anonymous
    Unregistered
    Posted 10 years ago #

    okay... what ever i did, and i have no idea, is fixed now. :)

  • Anonymous
    Unregistered
    Posted 10 years ago #

    okay, i do have one question though - why are my comments now backwards? meaning why are the newest ones at the top instead of the bottom? (excluding the ones that are replying to specific comments obviously!!!)
    otherwise, i love it, thanks!

  • mrlarter
    Member
    Posted 10 years ago #

    does this work for version 1.0?

  • labellissima
    Member
    Posted 10 years ago #

    @mrlarter: Yes, it does work for version 1.0. I've recently upgraded my 0.72 to 1.0 and my threaded comments hack still work.

  • labellissima
    Member
    Posted 10 years ago #

    I tried to go to the zip file and it times out for me, too. I have no idea if there was an upgraded hack for 1.0. I think the only difference was the filenames because they were renamed. When I upgraded, I did a re-hack, though. I did the same thing listed in the instructions from the old zip file I have and applied it to the renamed file corresponding to the old filename.
    On the alternating colors, there's a thread about that somewhere in the forum. :) I hope I helped...

  • presto
    Member
    Posted 10 years ago #

    Laughing Lizard:
    I was able to download the zip file. I did the updates and got no change to the program. I sent you an e-mail explaining what I did. Please respond back both via e-mail and the forum and thanks in advance for your help.
    presto

  • labellissima
    Member
    Posted 10 years ago #

    I upgraded from 1.0 to 1.01 then I noticed that the replies show up twice -- one as the reply (indented) and another as a plain comment (not indented). I wonder why...

  • Laughinglizard
    Member
    Posted 10 years ago #

    I dont see it on your site. Do you still have that problem? What did you do to fix it? (for everyone's benefit)

  • labellissima
    Member
    Posted 10 years ago #

    LL, the problem's still there, here's a screenshot. What do I do now? :(

  • Laughinglizard
    Member
    Posted 10 years ago #

    I see now. I know it works with 1.0 I will have to look through the 1.01 code. Give me a few.

  • Laughinglizard
    Member
    Posted 10 years ago #

    I dont see too much of a problem. Make sure all the parts of the hack still exist in your code. My hack instructions have been modified for 1.0+ Especially, I would make sure this line exists in your wp-comments.php:
    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = '$id' AND comment_reply_ID = '0' AND comment_approved = '1' ORDER BY comment_date");
    and this line exists in your wp-comments-post.php:
    $wpdb->query("INSERT INTO $tablecomments
    (comment_ID, comment_post_ID, comment_reply_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_content, comment_approved)
    VALUES
    ('0', '$comment_post_ID', '$comment_reply_ID', '$author', '$email', '$url', '$user_ip', '$now', '$comment', '$approved')
    ");

  • labellissima
    Member
    Posted 10 years ago #

    Thanks so much, LL. :) It's ok now.

  • debra
    Member
    Posted 10 years ago #

    Hi LL. Tiny correction, because it took me forever to track down this one little thing. :) In this post: http://wordpress.org/support/index.php?action=vthread&forum=10&topic=1319&page=0#post-14 you have #commentswithin, but in your zip file's .txt you have .commentswithin. It's minor but the # versus the . means that all my CSS changes wouldn't take effect. You might want to update the zip file.
    This is the one hack I've been dying for so I'm so thankful to you all for doing this!!!

  • debra
    Member
    Posted 10 years ago #

    labellissima: could you tell me how you got the box around the main comments as well as the nested ones? I'm not sure where to do that. Currently I have some borders defined in my #commentswithin, but they look goofy and the regular comments look extra goofy. I'd *really* like it to look like yours! :D Thanks!!

  • 12

    Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.