WordPress.org

Ready to get started?Download WordPress

Forums

Comments have gone loopy! (12 posts)

  1. divrom
    Member
    Posted 9 years ago #

    Hi, my site (www.churchexperiment.com) has been up for quite a while with no real problems. Then I tried to set up an alternate background for comments as explained here: http://gfmorris.org/archives/2004/07/29/alternating-comment-classes/
    Everything went fine until we decided to ditch the backgrounds and removed it from the CSS. I was wary of taking out the wrong bits from wp-comments.php, so I just uploaded the original version from the initial installation. Now it's gone bezerk!
    Now no comments appear - though they are listed in the recent comments on the right and the comments will say something like "2 comments" but then not actually show any. There is also this error message which I assume refers to wp-comments:
    Database error: [You have an error in your SQL syntax near 'WHERE comment_post_ID = '33' AND comment_approved = '1' ORDER BY comment_date' at line 1]
    SELECT * FROM WHERE comment_post_ID = '33' AND comment_approved = '1' ORDER BY comment_date
    See, for example: http://www.churchexperiment.com/archives/2004/07/11/scaling-down/#comments
    Nothing I try (including uploading different versions of wp-comments.php) seems to solve the problem. Any ideas?

  2. NuclearMoose
    Member
    Posted 9 years ago #

    divrom,
    I'll look into this and see what I can come up with.

  3. Amit Gupta
    Member
    Posted 9 years ago #

    Did you backup your files before modifying them?

  4. carthik
    Member
    Posted 9 years ago #

    Try replacing all the *comments files with files from a feshly downloaded WP package, and make sure you have the WP version numbers matched up, in case you were using 1.0.2 or something.

  5. divrom
    Member
    Posted 9 years ago #

    No, Amit, where's the challenge in that?! ;o) I didn't backup anything 'cos it didn't enter my head that there would be a problem.
    2fargon, tried that - no change.

  6. divrom
    Member
    Posted 9 years ago #

    Here's some added info:
    When I go into admin and go to EDIT --> comments, I get this message..

    Database error: [You have an error in your SQL syntax near 'ORDER BY comment_date DESC LIMIT 20' at line 1]
    SELECT * FROM ORDER BY comment_date DESC LIMIT 20
    No comments found.

    The silly thing is that I know there are comments and they even show up in the recent comments list on the right.

  7. divrom
    Member
    Posted 9 years ago #

    Any other ideas?
    We had done most of the testing and were on the verge of making this our main site. The only thing left, after customising it to work like a mini-CMS, was a bit of tweaking.
    So I'm extremely reluctant to re-install!

  8. schlosna
    Member
    Posted 9 years ago #

    It sounds like your settings might be messed up. Check the /wp-settings.php file for this line (18):

    $tablecomments = $table_prefix . 'comments';

    That's what it should be set to from the default install.

  9. divrom
    Member
    Posted 9 years ago #

    Thanks for that Schlosna. I'd got it sorted just before I saw your post.
    In the end I had to edit wp-comments.php and change line 20:
    $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date");
    to
    $comments = $wpdb->get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date");
    Works fine now, 'cept for the numbers all being the same (so I just changed it to a UL).

  10. Matt Mullenweg
    Troublemaker
    Posted 9 years ago #

    That means you downloaded a mismatched file from a different version, and you may have other problems in the future. It sounds like you're running 1.2, and the file you downloaded is not 1.2, it's CVS.

  11. gfmorris
    Member
    Posted 9 years ago #

    I guess I could be nice and offer up a copy of a non-hacked wp-comments.php from the WP 1.2 package to people who decide that they don't need my functionality.

  12. divrom
    Member
    Posted 9 years ago #

    Yeah, I'm worried about those problems, allusion.
    The line I added was taken from a WuhWuh version of wp-comments.php (is that the same as CVS?). I am running 1.2 as you said. But I tried everything else - bar reinstalling everything - and this is the only thing that worked.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.