WordPress.org

Ready to get started?Download WordPress

Forums

AJAX Comments (17 posts)

  1. Loving how the posts are posted here now. Any chance of seeing something like it for WordPress?

    Also, while on the subject of AJAX and comments, I have a page that takes WAY too long to load, due to there being quite a few comments as well as the IP2Country plugin that I'm using (it has to query a table for each comment).

    Rather than disable the plugin or the plugin just for that page, I was thinking it'd be cool to be able to be able to not display the comments on a certain post/page unless a link is clicked.

    Now sure, that could be done via PHP (which is how I was going to do it) or even with some show/hide Javascript (although that still queries the DB when generating the page, so that kinda defeats the purpose), I was thinking it'd be cool to do it via AJAX.

    Thoughts?

  2. eragle
    Member
    Posted 8 years ago #

    I think the show/hide would be very do-able. But like you said it would still query the db so it would only be for cosmetic purposes.

  3. Well, no, if it's using AJAX, (if I understand correctly how AJAX works that is), it'd only query the database if the comments were requested to be displayed.

    I mean, I have an AJAX powered search form on my site that displays search results as you type using the live loading of a PHP search results script.

    I was thinking the same thing, except for comments.

  4. eragle
    Member
    Posted 8 years ago #

    Hmmm....not sure on the details of AJAX, but I understood it differently. But of course I have this nasty habit of being wrong about these sort of things. ;)

    If it DIDN'T query unless displayed, that would be uber-cool.

  5. Kafkaesqui

    Posted 8 years ago #

  6. tparlin
    Member
    Posted 8 years ago #

    I just added ajax comments to squible. You can see how it works by downloading the latest version of squible at http://www.squible.com/my-work/squible

  7. Awesome! Any chance of making it a plugin or packaging up just that code by itself so I don't have to go steal it manually outta your theme? (Sorry, but I have no interest in using your theme -- it's not for me. ;))

  8. tparlin
    Member
    Posted 8 years ago #

    Hi Viper,

    A plugin? No, but here are directions and a download.

  9. drazin
    Member
    Posted 8 years ago #

    i followed the directions...but when it says to replace the comments.php, i dont have a comments.php i have wp-comments-post and reply and other things but none that you refrence....

    what do i do?

  10. vkaryl
    Member
    Posted 8 years ago #

    drazin, what version of wp are you running?

  11. drazin
    Member
    Posted 8 years ago #

    1.5.2

  12. vkaryl
    Member
    Posted 8 years ago #

    You may need to copy comments.php from the default theme folder then. Some themes don't include that file....

  13. moshu
    Member
    Posted 8 years ago #

    drazin, you are looking for the comments.php in the wrong place! comments.php is a template files - which means it should be in wp-content/themes/yourtheme folder.
    (wp-comments-post.php is in the root dir of WP!)

  14. qzplx
    Member
    Posted 8 years ago #

    hello, im use wp 2.0 why its not work ??

  15. Usayd
    Member
    Posted 8 years ago #

    I just borrowed the comments.php and ajaxcomments files from K2: http://www.binarybonsai.com/k2/

  16. dontspamjay
    Member
    Posted 8 years ago #

    just wanted to see how these comments work

  17. srevacwerdna
    Member
    Posted 8 years ago #

    Sorry - just testing the comments system!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags