• 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 15 replies - 16 through 30 (of 42 total)
  • Thread Starter bitwisemcgee

    (@bitwisemcgee)

    hm, I think you’re having a similar problem as viper, if I try and use the Expand Comments it says that makeAjaxRequest isn’t found (which lives in expand-comments.js). On your site, where is the plugin directory located? ie, I can browse directly to expand-comments.js by the following:
    https://nymb.us/wp-content/plugins/expand-comments/expand-comments.js
    but your is a 404, so I guess its a bit different for you.

    most likely I need to get the wp setting for plugin locations, rather than have it hard coded like I do. see if you can find how to browse to the javascript file, and post the url for it here

    thanks, and sorry for the trouble

    What about an plugin to “Expand More with AJAX”? ??

    okay, i had it in the actual plugin folder. i can add it to expand-comments/

    Okay, i updated and added the expand-comments/ folder and inserted the *.js , but instead of showing rss feeds, it just doesnt show anything at all.

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    hm, well, the js is working, and so is the ajax (since ‘Loading…’ is replaced, which is done by ajax) My first guess is that the js can’t find the div to put the comments into. do you know javascript? you can try and edit the expand-comments.php file so that the javascript inside there will do an ‘alert()’ with some debug info in it, namely, what it thinks appendDiv is in line 88. Perhaps just add ‘alert(appendDiv.id);’ after that line, and see what the alert says when you click the link

    didnt work. No alert. I placed it after the appendDIV line.

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    odd, my guess is that it might be a result of some other errors on your page. Try adding some ‘alert(“got here”)’ type of stuff to see where the code is bombing out. If you don’t want to do that, try cleaning up the site until it validates, hopefully that will fix it.

    also, I’ve only tested this stuff in IE and FF, so other browsers might have issues. If you know it works for a certain browser, please let me know

    *sigh* this looks really nice, but I’ll wait until ya have something more concrete. starting to get frustrated from figuring it out. Great plugin though!

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    no worries, hopefully the solution will pop up soon ??

    Most likely I’ll get to the other enhancements this weekend, namely:
    User defined link title (passed to the function)
    User defined ‘intro’ and ‘outro’ (non link items displayed before and after link)
    div is added only if comments exist

    if there are any other ideas, speak up!

    interesting, the “RSS feed for this thread” link right above the entry box on this WP forum page does not work for me but I get feeds from 57 other sites fine, oh well, at least now I can track this thru my profile here, can’t wait to try your plugin Bit.

    I am having the same problem with the RSS feed page opening up instead of the js doing its magic.

    Has anyone figured out the problem? Viper, you have it working on your test blog, what did you do to fix it?

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    there was a problem with expand-comments.js being loaded via relativue url (/wp-content/plugins/expand-comments/expand-comments.js) but Viper’s install dir was different. version 0.2 should fix this. If you are using firefox, open the javascript console and click the link. If you get the error ‘makeAjaxRequest not defined’, that means the expand-comments.js file wasn’t sourced. could you post the link to the blog where the problem is?

    subscribed to rss for this plugin.

    My site is
    https://onebigdog.net

    I know I will need to redirect to that but will wait until I get it working

    The error I get in the js console is:

    Error: [Exception… “‘Permission denied to call method XMLHttpRequest.open’ when calling method: [nsIDOMEventListener::handleEvent]” nsresult: “0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “<unknown>” data: no]

    Thread Starter bitwisemcgee

    (@bitwisemcgee)

    BigDog, that’s a relatively easy fix. This is in the readme, but that error is from the browser not letting the javascript try and get data from a remote page. This is a security feature so js on pages don’t download stuff that could be ‘untrustworthy’.

    I had this issue when users would go to my site as https://www.nymb.us and click an expand link. For my setup, wordpress builds the rss links as https://nymb.us&#8230; so when the javascript would try and download the rss, firefox felt it was going to a different site (since, technically, https://www.nymb.us and nymb.us could be two different sites). My fix was to redirect all requests to https://www.nymb.us back to nymb.us

    also, 0.3 is up, with only minor changes until I get more information on the errors people are having. if you do have problems, try this one anwyway.

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