• Hey guys,

    I just wrote my first plugin for WordPress, and it needs testing. I don’t have a huge amount of free time to test, so I’d love if people could tell me what they think. So far I’m sure it works on WP 2.0…

    Anyway, Expand Comments is a plugin that uses AJAX to provide a blog with a link on the bottom of each post. When the link is pressed, the comments (read from the RSS feed) will be appeneded immediately below the post, without any page refreshing. It really speeds up the reading of a site, and also gives it a sexy feel. The comments can then be hidden by clicking the same link. Each expansion/contraction of a comment section is only downloaded once. after that, CSS just hides/displays the comments.

    This is my first real time working with javascript, and first time ever with any php. I’m sure there’s a lot to improve upon, so I’m hoping you guys can help me with that.

    The plugin also degrades gracefully. If the user is not using javascript, the “Expand” link becomes the RSS link to that post.

    to see a working demo, go to my site: https://nymb.us

    You can find a bit more info + download at https://nymb.us/?page_id=45

    thanks

Viewing 12 replies - 31 through 42 (of 42 total)
  • I am not sure this is it because my rss feeds build as my base url.

    I am wondering though, I use the feedburner redirect. Do you think this has something to do with the problem?

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    well, I know that error is caused by a redirect error. I’m unfamiliar with what feedburner redirect does, but if it causes rss requests to be redirected to a different site, that would cause that error

    edit: okay, just looked at the feedburner stuff. If you have the feedburner cache on some other server, then yes, when the javascript requests the feed, it will be redirected. currently I’m debating using the feed anymore, since it might just be easier to make my own database queries for the comments.

    *sniffle* I really want this plugin…. ??

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    I just put version 0.4 up, big changes include:

    +Now has an options page for intro/outro (non-link text before and after link), expand/collapse text, and no-javascript text
    +new file exp-com.php: copy exp-com.php to the ROOT directory of your website and enable the fetch via exp-com.php option. This fixes the issue of rss feeds being on external sites. This is only partially tested with my setup, so let me know how this works for people.

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    Good News! 0.5 is out, and I believe it will fix most if not all of the issues people are having.

    The problem was in the javascript that would find the div for the comments. I had it based on the default theme, which was rather silly of me. I now have it changed to a much more universal way, which just so happens to be faster/cleaner code. huzzah!

    anyway, download it and let me know if there are any issues ??

    First, the instructions on the Options page on how to use the exp-com.php file are not complete, I had to come back to this thread to figure out to put the file in the root directory.

    Second, when I enabled the use of that file (because the show comments link would send to the RSS feed if I didnt’ have the www infront of my domain) the javascript will change the expand comments to collapse comments, but it doesn’t actually chage the page. No comments are loaded, it just switches the wording. Not sure why this is happening and I don’t ahve the time to figure it out now.

    I love the idea of this plugin and hope you can keep improving on it. It’s a great idea whos time has come.

    I’ve got an RSS feed for this thread so I’ll keep in touch.

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    https://nymb.us/?page_id=45

    New version 0.6:
    No longer gets data from RSS, communicates to exp-com.php which talks to the sql server. This provides loads more functionality, plus a bit more straightforwardness.

    If you have 0.5 working, I highly suggest you hold on to it. If you want this one (for things like comment author links) then keep the two installs seperate, and follow the directions for 0.6. then turn off 0.5, and turn on 0.6 and see if it works. if something breaks, let me know, and revert. I’ll be watching this thread and the one on my site for problems.

    sphagnum

    (@sphagnum)

    Excellent. One bug I’ve noticed is if I only have one comment and it’s a trackback/pingback, the Expand comments link still shows up but when you click the link it doesn’t show anything. Do you have this plugin set up to filter out pingbacks and trackbacks from the viewing? And if so, could you alter it so the Expand Comments link doesn’t appear if the only comment left is a trackback?

    sphagnum

    (@sphagnum)

    Also, what exactly do I have to edit to insert the proper CSS for this plugin?

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    I haven’t tested with trackbacks/pingbacks, so I’ll have to get to work on that. Also, the css was set to what the default comments had in the kubrick theme. You can look at the function ‘handleAsyncRet’ in expand-comments.js to see what the classNames are set to. I’ll be working on documentation for that sort of thing this weekend.

    sphagnum

    (@sphagnum)

    Ok, so I got it set up and working on my site.

    https://peatbog.net

    It actually works pretty nice once I figured out how to altar the CSS, but if you want this plugin to be universal in the slightest that has to be worked on. I not an expert in code, especially javascript, so it took me several hours finding out what to change and what ids and classes to add to my CSS stylesheet to get the comments to look like normal.

    Maybe you can add some variables in the options page that ask what div or class surrounds the comment author, timestamp, and comment text? Just an idea…

    But yeah, it works pretty well now and I am enjoying this feature very much! Thanks.

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    That’s a great idea sphagum, I’ll definitely add that. It will most likely be something like
    CSS:
    content div: [text input]
    author link: [text input]

    etc.

Viewing 12 replies - 31 through 42 (of 42 total)
  • The topic ‘New Plugin: Expand Comments (w/ AJAX)’ is closed to new replies.