alex sysoef
Get weekly Blogging eZine plus Free, INSTANT access to "Profitable Blogging For Newbies" ($17 Value)

10362Blog Subscribers
15447Twitter Followers
expert wordpress

Fixing Brians Threaded Comments Plugin

Brians Threaded Comments Plugin is perhaps the most popular among the WordPress blog users due to functionality it provides and a huge enhancement to standard comments system that comes with WordPress. Problem is – the plugin is Not Well Supported and has quite a few bugs.

In fact if you simply decide to use what is provided you will run into quite a few issues and since the plugin is hard to customize if you are not a programmer it might be more problems then one can handle. Well fear not – I have spent a few hours of researching, fixing and testing and want to present you with resulting file. Now you too can have Brians Threaded Comments on your blog, minus all the issues…

As always I want to make a disclaimer here. What is presented below is currently used on my blog and fully tested but I can’t guarantee for 100% it will work on yours. Before doing ANYTHING – make sure to backup current comments.php file that comes with your blog theme.

This post assumes that you are working with latest officially available version of the Brians Threaded Comments Plugin – 1.5.12. I have not tested previous version and have no clue if this tutorial will work for you or not. Before doing anything else – install that version…

Everything below provided AS IS. Take it or leave it at your own risk and please don’t ask for support.

Brians Threaded Comments Problem List

In this section I want to outline the issues I have fixed following multiple guidelines I have found on the net and provide a link to original authors, where available to give them credit for addressing it.

1. Fixing Brians Threaded Comments “Cancel” Issue – was provided on John Chow blog and while John provided a nice explanation I wanted to add a simple graphic details to it to simplify the work for you – not all of us technically savvy. Click on image below to open full view in new window and see fix details below image:
brians-threaded-comments.jpg

  1. Step 1: Open Admin->Plugins->Plugin Editor and click on Brians Threaded Comments to open for editing (some hosts might require that you chmod the file to 666 or 777 prior to be able to do so).
  2. Step 2: Locate reRoot() function and replace content with content-main as shown in image. Hint: pay attention to position of sliding bar on image above to locate the function you need.

2. Separate Trackbacks From Comments in Brians Threaded Comments was provided by Tim Nash (who by the way has a great blog that I frequently read).

3. A few fixes borrowed from NSpeaks, even though author no longer uses plugin himself his fixes work nicely and here is list of what I have addressed using his guide:

  • Admin Is Now Recognized by plugin
  • Double Subscribe To Comments Option Removed
  • Comments Moderation text Added

Enhancements To Brians Threaded Comments

To make the commenting system more interactive and protected I have added some enhancements that will require installation of couple plugins. But if you decide Not To Use Them – I provide 2 versions of the file you can use: with and without enhancements:

  • MyBlogLog avatars integrated into comments system. This enhancement requires that you have installed MyAvatars plugin. I feel that this one is a very nice option I simply didn’t want to go without and it adds avatar at the bottom right corner of the comment. You can see it in image below or comment to see how it works – please be aware – all test comments will not be allowed brians-threaded-comment.jpg
  • Math Comment Spam Protection integrated into Brians Threaded Comments. This one is a rather nice companion for Akismet and its integration requires that you have the Math Comment Spam Protection installed. One added it will save you a lot of administrative grief by removing bot SPAM submission.

Fixed Brians Threaded Comments Download

As I have mentioned I will provide below 2 files with all afore mentioned integrated: 1 with enhancements and one without. But the installation is same for both:

Files below proved as Text Files. Simply download one that you need to your computer, rename it as comments.php (comments-enhanced.txt to comments.php) and then upload and replace your current theme comments.php file. Make sure to back up your current comments.php file in case you decide you don’t like what you get and want to go back to your original system!

  • Download Fixed Brians Threaded Comments – no enhancements
  • Download Fixed AND Enhanced Brians Threaded Comments

Please be advised I don’t try to claim ANY credit and simply provide the files for convenience of other people. All credit belongs to its author and many thanks go out to guys who provided the multitude of fixes I have integrated and present above. Enjoy.

UPDATE:

I have reworked the fix based on comments I have received and providing a new file download, it has all the enhancements but they are using “optional statements”, meaning if function doesn’t exist because you simply don’t have the plugin – it will be ignored.

Also make sure to watch the video that outlines entire process below:

Like This Post? Share It!

  • StumbleUpon
  • Digg
  • Google Bookmarks
  • del.icio.us
  • Mixx
  • MisterWong
  • Reddit
  • Sphinn
  • Propeller
  • Technorati
  • Facebook
  • E-mail this story to a friend!
Tags: , , , , , , ,
Technorati: blog, brians threaded comments, comments system, community, plugin, video-tutorial, wordpress, wordpress-plugins,

59 Responses to “Fixing Brians Threaded Comments Plugin”

  1. Tim Nash (2 comments.) says:

    I haven’t got around to completely sorting out my comments but its nice to see people fixing and expanding the idea, one further enhancement I would suggest is much of the CSS hidden in Brians code can be placed in your themes CSS file and those that require a bit of PHP can either be removed or just kept as they are.

    Thanks for the link glad you like the blog.

    Tim Nash’s last blog post..Green Screen production

    • TheSpot-er (971 comments.) says:

      Tim,

      Yes, that would be a next logical step :) I have looked at it as well as externalizing the Javascript that currently comes with the plugin – its quite hefty right now… but never got to it and since I don’t know WHEN I might be able to – I just provided what I have.

      Alex

  2. Tim Nash (2 comments.) says:

    Moving the CSS is not to bad, took about 10 minutes but the javascript I would leave where it is for the time being :D Still I did notice a huge speed increase with just moving the CSS so worthy you doing.

    Tim Nash’s last blog post..Green Screen production

    • TheSpot-er (971 comments.) says:

      Yeah, actually you were right. Just copying the css statements into my theme style.css and removing it from briansthreadedcomments.php file did the trick.

      I only found one php statement within it for getting the shrink size that is looking for value provided in Threaded Comments admin option. Simply replacing it with static value of whatever percentage I wanted works nicely.

      And last but not least – I didn’t see the reason to query the blog url and replaced it with static statement appropriate for my blog.

      Not sure if it improved the load speed but source looks cleaner :D

    • Andy Beard (6 comments.) says:

      I have been thinking of moving that horrible javascript for ages. I suppose I should do the CSS as well.

      Andy Beard’s last blog post..Green Pixel Dust Has A Negative

  3. NSpeaks (4 comments.) says:

    Thanks for the mention. Appreciated.

    NSpeaks’s last blog post..Rewarding Top Commentors for March

  4. Michael (1 comments.) says:

    Hi Alex,

    Michael from Germany here.

    Well done ..*-)

    Your fix might be just what i’m looking for.

    Will check it out now.

    Keep the good work up …*-)

    Michael

  5. Jeff (2 comments.) says:

    I know you’re not offering support on this, but I installed the fixed comments without enhancements, and it’s returning this error:
    Parse error: parse error, unexpected T_ELSE in /path/to/my/theme/comments.php on line 218
    Just wanted to report that. Thanks for offering this.

    • TheSpot-er (971 comments.) says:

      Jeff,

      Thanks I will look into it. In mean time you can download the Enhanced file and simply upload it. While it has a built in option for Avatars and Comments Spam Math – they are using the “if(function_exists” statement and should works just fine. Meaning – if plugin not installed – function will be simply ignored. Here is an example of function for MyAvatars: < ?php if(function_exists("MyAvatars")) MyAvatars(); ?>

      You can either delete it or leave it there, comments will work anyway…

      Alex

      • Jeff (2 comments.) says:

        Thanks Alex. I really enjoy your site. I’ve got the fixed comments working, but when I click “cancel reply”, the focus moves to the top of the page, and the comments box disappears. I did the “John Chow” fix. Anyone know what else I need to do?

        Jeff’s last blog post..Tell Us What You Think

    • Liana (2 comments.) says:

      I have the same problem with the unenhanced fix. I’ll try the enhanced version and hope it works.

      • TheSpot-er (971 comments.) says:

        Laina.

        Enhanced version uses IF EXISTS statement so it should work even if you don’t have those plugins installed. Please let me know if it works and I’ll remove the file that is failing.

        Thanks,
        Alex

        • Liana (2 comments.) says:

          Alex,

          I’m sorry to be a pain. The comments are back with the enhanced file, but now the comment text is running out of the comment box in Firefox. This was not the case before the threaded comments were added, so I suspect that this is the problem. I’m not sure how to fix it, though. I’ll probably just have to work without threading.

          Liana’s last blog post..She’s, Um…like You

  6. Fatih (1 comments.) says:

    Thanks for the enhancement. Wnat to try it right away, though I’m a bit doubtul if it fits with my template.

    Fatih’s last blog post..Steve Jobs and God

  7. Jo0Lz (6 comments.) says:

    Does this fixed version also work correctly on 2.3.3 installations?
    And, does anyone here know, how to make it use AJAX?

    Jo0Lz’s last blog post..Myth Buster!

  8. Jo0Lz (6 comments.) says:

    Hey, I’ve tried installing this plugin, in the enhanced kubrick theme, K2.
    Still having problems,

    Fatal error: Call to undefined function show_subscription_checkbox() in /home/joolz/domains/joolz.nl/public_html/wp-content/themes/k2/comments.php on line 197

    :{ So, it doesn’t work?

    Also, if I click the Reply to this comment, I get an error about missing Form.
    No hidden form field “comment-reply-ID”, please look at old comments.php and copy over the field?

    Using the Enhanced version, cause the fixed comments.php does not work, get an error about T_ELSE, like commented here in the comments.

    Jo0Lz’s last blog post..Cat burglars

    • TheSpot-er (971 comments.) says:

      Jo0Lz,

      show_subscription_checkbox() – comes from your blog not having Subscribe to comments plugin. I’ll have a look at the file again. Sorry been so swamped that simply have no time …

      Alex

      • Jo0Lz (6 comments.) says:

        Yeah I figured as much, installed the plugin and the error is gone. That other error was related to the change you described, changing content to content-main, so that error is gone aswell…

        However, I still have some issues, like when I cancel the “reply here” thing…

        The reply form goes missing, and when I want to reply I have to refresh the page… (If I don’t , I get the error that the div “addcomment” is missing, and I have to check the comments.php file…)

        Hope you can come up with a fix, ;)

        Greetings,

        Jo0Lz.

        Jo0Lz’s last blog post..Cat burglars

        • TheSpot-er (971 comments.) says:

          Yep, that one exists on my blogs as well …

          Sorry no fix for that one and since I personally don’t consider it to be such a big deal I don’t think I’ll be addressing it, sorry.

  9. TheSpot-er (971 comments.) says:

    Hey JoOLz, glad you got it working …

    Alex

  10. Anna Wise (1 comments.) says:

    How did you get commentluv to work with the threaded comments. On my installed wordpress blog, I cannot get the two to work together… any thoughts?

    Anna Wise’s last blog post..Wordless Wednesday – #5

  11. Jo0Lz (6 comments.) says:

    This is great, I even templated the comments from scratch, imho it looks a lot better now…

    See for yourself @ http://joolz.nl/about-jo0lz/

    *O*

    Jo0Lz’s last blog post..Networking?

  12. Chris Guthrie (4 comments.) says:

    It’s cool that you found a way to fix it, I might try it out. I never did install it because I had issues trying to run it on my old theme.

    I wonder why the original plug author released it and then never provided support?

    Chris Guthrie’s last blog post..21 ways to avoid saying MMO (Make Money Online)

  13. Does the enhanced version work with WP 2.5 since it has built in support for Gravatars already?
    Also, Mark Jaquith, seems to suggest that the ability to do threading is built into WordPress, and is there for plugin authors. Does this use the comment_parent column just in case they ever decide to make threading an option in the core?

  14. NSpeaks (4 comments.) says:

    Original Plugin updated to 1.5.15 – and don’t expect these enhancements to work in it….they are still not supported…

    I will recommend using this version only.

    NSpeaks’s last blog post..Wordpress 2.5 Beta Released

  15. TheSpot-er (971 comments.) says:

    @Brian – It works with 2.5 beat but gravatars are not built into this file. On existining functionality – I can only wish the core developers address it. If function if provided, why not integrate it into core, consdering how desirable the function is. Or at least do it with thier default theme as an optional feature to show developers how its done.

    @NSpeaks – Thanks. I just visited his blog and read it. Looks like his latest version is nothing more then couple bug fixes that are already addressed by other people. I can see his point and understand the time limitations and can’t really blame the guy …

    I guess we will wait for a next release to see all the fixes officially integrated.

    In mean time – I know the file I provide above works with 2.5 and 2.3. I will update the file to support built in gravatars once the 2.5 officially released.

    Alex

  16. TheSpot-er (971 comments.) says:

    IMPORTANT: Brian have implemented and addressed all the fixes discussed in this article into the latest version of his plugin:

    http://code.google.com/p/briansthreadedcomments/

    Please be sure to get the original plugin. All you need plus the functionality that will be available with WordPress 2.5 (Gravatars and MyAvatars) are built into new plugin.

    Alex

  17. Barbara Ling (19 comments.) says:

    Morning!

    Does anyone know how to hack BTC so that the Recaptcha shows up ABOVE the ‘Add Comment’ button?

    Thanks in advance,

    Barbara

    Barbara Lings last blog post..Man Flies Lawn Chair – Recapturing your childhood dreams

  18. Barbara Ling, Virtual Coach (19 comments.) says:

    Hi Alex,

    I’m using WP 2.5.1, and when I tried your comments.php, I got:

    Parse error: syntax error, unexpected ‘.’, expecting ‘)’ in /…/theme/comments.php on line 166

    Line 166 is:

    Logged in as <a href=”/wp-admin/profile.php”>. <a href=”/wp-login.php?action=logout” title=”Log out of this account”>Logout

    Any ideas?

    Thanks! Barbara

    Barbara Ling, Virtual Coachs last blog post..Know that number 1 SECRET communication tip? Here it is!

  19. TheSpot-er (971 comments.) says:

    Barbara,

    Try downloading Brian’s Latest code. He actually updated his own plugin to address multiple issues discussed here. So I would recommend you go to his plugin and if still errors – I’ll help ya!

    You know how to contact me – please do so!

    Alex

  20. william (1 comments.) says:

    Hi, Does anyone know how to modify the plugin to show admin/author comments as a different background colour?

    I tried various methods I found online but none seem to work.

    thanks!

  21. Suzie Cheel (1 comments.) says:

    Awesome, Thank you so much. I did have it working and when I changed themes no work:)
    I have stumbled this for you and others to find

    Suzie Cheels last blog post..A Time Consuming Lesson in Blog Maintenance!

  22. Threaded Comments User says:

    hello,

    i’ve tried both your fixed version, as well as the newest version from brian’s google project page (1.5.20), but i have been having the same problem with both.

    the threaded comments seem visually to display properly (showing comments that already existed before installing the program). but if you click “add comment”, it simply sends you to the blog root page. i don’t really understand this, heh.

    i really want to get this plugin to work :)

    have any ideas?

    if you can give me something that leads to a solution, i’ll paypal you $10… seriously!

  23. Mobi (2 comments.) says:

    To: heSpot-er:

    Parse error: syntax error, unexpected T_ELSE in C:\wamp\www\theme\wp-content\themes\VN-News\comments.php on line 246

    Mobis last blog post..Thời của Mobile 2.0

    • TheSpot-er (971 comments.) says:

      You are on windows server – I have no clue what it might make wrong. Sorry, I don’t deal with Windows.

      I recommend you get latest version of plugin from Brian, he implemented all the fixes.

  24. Yan Shall Blog (9 comments.) says:

    Thank you for showing me how to properly use this plugin of which I have been wanted to use but fail to do so. Little did I realize that I need to made changes to my comments.php.

    So I found yours and everything works as what I have expected. However, there is this little issue when I click “Click here to cancel “reply” the whole comment form jump to my footer and I have failed to find the solution.

    Can you help?

    Yan

    • TheSpot-er (971 comments.) says:

      Yan,

      In about a month WordPress 2.7 will come out and will have threaded comments as part of the core. I recommend not to waste time and do blogging :-) Sorry, I don’t know what the issue is but I know Brian supposedly fixed it with last version. try his plugin if still want to spend time on it.

      • Yan Shall Blog (9 comments.) says:

        Thanks for the heads up… and do you have any idea if upon submission the page doesn’t reload to the original article? If I couldn’t fixed this I would have dumped all together…

        Yan

  25. Kanishka (3 comments.) says:

    Hey i have been using this for a while.

    This didn’t seem to be good for me . :(

  26. TheSpot-er (971 comments.) says:

    Liana,

    No sure what to tell you … I have tested this one with several themes and had no issues. Might be some overlap of css styling of your theme and BTC plguin … sorry, can’t help you there.

  27. Jo0Lz (6 comments.) says:

    The bug does not exist on this current page…
    At least, i just tried, and when cancelling the reply, it just reroots below…

    Jo0Lz’s last blog post..Cat burglars

  28. Jo0Lz (6 comments.) says:

    ^^

    I fixed the bug. The ID “content” was different in my theme.
    I changed it, tried a few, got it working now…

    Now just some small tweaks, and I am once again a happy camper.

    Thanks!

    Jo0Lz’s last blog post..Cat burglars

  29. Richard (2 comments.) says:

    Very nice. Thanks for making this a joy to use.

    Richards last blog post..Weekly weigh in number five

Trackbacks/Pingbacks

  1. [...] Link : Fixing Brians Threaded Comments Plugin [...]

  2. [...] Hot on the heels of 1.5.15, a batch of fixes was implemented thanks to NSpeak’s prodding. They are mainly the fixes and some of the enhancements mentioned in NSpeaks blog article on how to hack my plugin, and an article he referred to on howtospoter.com about fixing the plugin also. [...]

  3. [...] my list, was upgrading the Brians Threaded Comments plugin. I’ve been running the old release, with the fixes you can find around the Internet. Now, Brian has released an all new version, which already [...]

  4. [...] Threaded Comments (Updated for Wordpress 2.5 and ready to use) – For more powerful use check HowtoSpotter’s Hacked Version of it(Obviously inspired by me – [...]

  5. [...] is just toooo good to keep to myself!  About a week ago, I tried to get Brian’s Theaded Comments to work on my blog.  Alas, the theme I’m using (black and white) apparently isn’t [...]

  6. Threaded Comment Wordpress Plugins…

    I have just added the brians’ threaded comment plugins (formerly nested comment plugins) here in this blog. I’ve planned to upload this nice plugins long ago but still couldn’t find the right time to do so or just forgot once I conn…

Leave a Reply

Comment Guidelines: After 3 approved comments - all your links become DoFollow links (controlled by LuciaLinkyLove). No Keywords In Name. No inappropriate or offensive comments. No links to inappropriate or offensive sites. Comments must contribute to the discussion. ALL SPAM DELETED!

Comments Manually Approved prior to appearing!

CommentLuv Enabled