Subscribe: WordPress MU Forums Topic: AJAX Comments Plugin
http://mu.wordpress.org/forums/rss.php?topic=2807
Added By: Feedage Forager Feedage Grade A rated
Language: English
Tags:
ajax plugin  ajax  check  comment  file  loads  lunabyte ajax  ovidiu ajax  plugin  plugins  prototype  scriptaculous  suleiman 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: WordPress MU Forums Topic: AJAX Comments Plugin

WordPress MU Forums Topic: AJAX Comments Plugin



WordPress MU Forums Topic: AJAX Comments Plugin



Published: Tue, 20 Feb 2018 14:34:00 +0000

 



lunabyte on "AJAX Comments Plugin"

Mon, 26 Mar 2007 14:37:56 +0000

Dig in, and edit.




Ovidiu on "AJAX Comments Plugin"

Mon, 26 Mar 2007 09:34:16 +0000

[SOLVED]
for my part at least.

Sorry for bothering you, I just noticed I had replaced the non-working plugin with another one based on jquery from here:
http://jowra.com/journal/2007/01/wordpress-plugin-jquery-ajax-comments/

so basically it was my fault, I had two Ajax-comments plugins active,...

[ANOTHER RELATED PROBLEM]
I just noticed one of my bloggers has loaded prototype 3 times!!!

1. his theme (blue-moon) loads it as it seems to be needed
2. addicted to livesearch (plugin) loads it
3. lightbox plugin loads it
4. kaccordion plugin loads a prototype_light version

so how can I generally deal with these problems?

I mean I can't seriously go ahead and edit all of these themes/plugins and ad if function_exists statements to all of them checking for all others??? Isn't there a way to check if a certain file is loaded, instead of checking for the existence of all other functions?

what about this idea: http://www.silpstream.com/blog/wp-scriptaculous/ thats a plugin that loads scriptaculous and sets an option that scriptaculous is installed. any plugin using scriptaculous could check if this option is set and if yes doesn't need to load its own scriptaculous files.... could't something similar be achieved/made for prototype?

Please suggest a way to prevent things like I describe (aka prototype loading 3x on a blog).




Ovidiu on "AJAX Comments Plugin"

Sun, 25 Mar 2007 13:50:34 +0000

thx, I tried this:




inside the ajax-comments.php file. If I check the site I am testign it: http://sibiu.zice.ro/2007/03/25/coyote-party-liquid/ it shows that prototype was only loaded once. still if you comment, the comment is successfully saved but the page does not display it, aka it does not refresh...

any more ideas? you can go ahead and spam-comment that article, I'll delete the comments in a day or two.




lunabyte on "AJAX Comments Plugin"

Sat, 24 Mar 2007 16:48:58 +0000

Depends on how it's set up.

For me, all my themes use Ajax and paged comments. In the case above, if live search and ajax comments are both "forced" for use, live search would be on every page so you could just remove the call to add prototype in the second plugin.

If it's something that can be selected, and one may or may not be selected, you can wrap the call to insert the link to prototype in the head in a function_exists check. This of course checking to see if the function that loads prototype in the "other" plugin exists. Then load it if it doesn't.




Ovidiu on "AJAX Comments Plugin"

Sat, 24 Mar 2007 11:48:49 +0000

can someone give me some advice how to prevent 2 plugins from loading the same file, aka prototype? I have never touched such things :-(




Ovidiu on "AJAX Comments Plugin"

Fri, 23 Mar 2007 17:39:53 +0000

thx but it did not work for me.
I found the error: prototype is loaded twice... another plugin loading it...

any idea what the most elegant way would be to solve this?
maybe finding the place where each of these plugins loads the prototype file and make it an "if exists", don't load? but how to check if it is already loaded?

I am open for suggestions...

you can check it out here: http://sibiu.zice.ro
I checked the site with a firefox plugin, it shows me prototype is loaded twice. it even shows me who is loading it, its ajax comments and addicted to live search...




suleiman on "AJAX Comments Plugin"

Fri, 23 Mar 2007 16:37:21 +0000

Ovidiu, I'll send you across my modded plugin buddy :)




Ovidiu on "AJAX Comments Plugin"

Fri, 23 Mar 2007 08:48:11 +0000

the original page: http://www.mikesmullin.com/2006/06/05/ajax-comments-20/ is greeting me with an 500 server error for the last 2 days, can someone mail me this plugin so I can modify it like suleiman suggested? ovizii at zice dot ro




jshare on "AJAX Comments Plugin"

Fri, 23 Mar 2007 08:19:11 +0000

Suleiman, if this means Ajax Comments works with SK2 on WPMU, congratulations! And thanks! I was using it for awhile but that was the main reason I turned it off, SK2 was too important to get in place. I'm sure that many other people will appreciate this.




lunabyte on "AJAX Comments Plugin"

Thu, 22 Mar 2007 13:44:05 +0000

I must have started with something else. I don't have a plugin file at all. I'd have to dig and see what I started with, but time's a little short at the moment.




suleiman on "AJAX Comments Plugin"

Thu, 22 Mar 2007 05:23:27 +0000

From the plugin author's comments page, and for anyone else who was getting flustered by this:

1. Change line 177 of ajax-comments.php from

wp_new_comment(array(

to

$new_comment_ID = wp_new_comment(array(

2. Change line 199 of ajax-comments.php from

$comment = $wpdb->get_row("SELECT * FROM {$wpdb->comments} WHERE comment_ID = {$wpdb->insert_id} LIMIT 1;");

to

$comment = $wpdb->get_row("SELECT * FROM {$wpdb->comments} WHERE comment_ID = {$new_comment_ID};");

Works like a gem :)




suleiman on "AJAX Comments Plugin"

Thu, 22 Mar 2007 04:39:31 +0000

well double check if it does in fact work fine.

On my own wpmu site the comment does in fact "post" appropriately, but the initial posting appears to be from someone else.

e.g., if I fill in "Suleiman" in the name field and type in my comment, then the comment that appears via the AJAX interface will show up with another name and another comment (or even a blank comment). If you refresh the page then you see the correct name and comment data was in fact posted, but you wouldn't be able to tell from Smullin's plugin.

It wasn't until after some digging that I realized the plugin was pulling bad comments from SK2 and displaying them in place of the actual comments.




lunabyte on "AJAX Comments Plugin"

Thu, 22 Mar 2007 03:28:14 +0000

Works fine for me, but I've heavily modified it to fit my needs.

Come to think of it, I don't think I'm even using this one. Maybe it was, I dunno. I have ajax comments, and they initially came from somewhere. lol




suleiman on "AJAX Comments Plugin"

Thu, 22 Mar 2007 01:54:33 +0000

luna, how are you using this plugin with SK2?

From Smullin's website:

UPDATE: Unfortunately, Spam Karma does not play well with this plugin. For those seeking an alternative, I recommend AuthImage. *crossing-fingers* I have never been spammed with it—ever.




lunabyte on "AJAX Comments Plugin"

Fri, 08 Dec 2006 17:27:51 +0000

As a note, it's with a subdomain set-up. username.domain.tld




lunabyte on "AJAX Comments Plugin"

Fri, 08 Dec 2006 16:35:45 +0000

I checked out the ajax comment plugin from Mike Smullin, recommended in another thread, and I'm having a few issues with it.

I'd "prefer" to run it as an mu-plugin, but something is preventing it's use in that capacity.

It works just fine sitting in the plugins directory, as a note.

Here's where I got with this.

First I looked through the code of the plugin. No biggie. It has an easy way of modifying the location, so I did that. Plugged it in, and it wasn't responding.

Note, the original file path as defined in the plugin was 'wp-content/plugins/ajax-comments/', which I changed to 'wp-content/mu-plugins/'.

OK, so I checked it in the standard plugins directory. It was fine.

OK, so I went through and hardcoded the paths instead of using the defined vars from the top. I went 1 by 1. (This is working with the plugins directory)

First the loading image. I stuck it in wp-includes/images/, and it was fine.

Next, I hardcoded the path to scriptaculous (at the bottom), which was just fine as well.

The final paths were the ones that directly reference the plugin file.

So now, I edit those, turn off the plugin for the account I was testing with (and moved the ajax-comment directory out of plugins to another temp location), and added the modified plugin file into mu-plugins.

It partially worked. The plugin adds a tiny script tag right after the comment form, which was there.

Problem being, that's all it did.

Double check, triple check the paths to the file. (check)

Load the file directly, and see if there's a parse error. (check, with none)

File permissions? (check, 755)

Dir permissions? (check, 755)

So by this point, everything "seems" translated properly, yet it still isn't working.

It includes itself (to add some functions) as a script through a hook for wp_head, which it is included up there. So on submission of the form, it should execute one of the functions from this inclusion. It does not, and acts like js is disabled and processes through the normal comment path.

So, has anyone got this to work as an mu-plugin vice standard plugin?

Maybe I've overlooked something?