archon810
Forum Replies Created
-
Looks like dsq is mentioned in more than one place too.
ack dsq include/compat.php 29:remove_filter( 'comments_number', 'dsq_comments_number' ); include/template-tags/theme.php 273: if ( function_exists( 'dsq_comments_template' ) ) { themes/classic/iphone/functions.php 221: if ( !function_exists( 'id_activate_hooks' ) || !function_exists( 'dsq_is_installed' ) ) { themes/classic/ipad/functions.php 204: if ( !function_exists( 'id_activate_hooks' ) || !function_exists( 'dsq_is_installed' ) ) {Hey Tyler,
I’m guessing they did it because (and I’m making an assumption here) the comment counts displayed are coming from WP and not Disqus, which has the potential of being severely out of sync.
Ideally, Disqus would apply the same logic (if it doesn’t already) as it does on the main site and replace the comment counts with the JS calls to the Disqus API – is it doing it if the code you mentioned is removed?
I am an active member of the WPTouch forums and have communicated with their team in the past, so I’ll try to get them to take a look at this issue.
Thanks, Tyler.
Pull request submitted: https://github.com/moskis/fancybox-for-wordpress/pull/1
Submitted pull request https://github.com/moskis/fancybox-for-wordpress/pull/1
Just search the code for
wp_schedule_single_event($ts, 'dsq_sync_forum');and you’ll see it in disqus.php.Yeah, a diagram would be awesome.
Hi Tyler, I was looking at pull requests earlier today actually and while I have a github account, I never actually dealt with pull requests before, and it wasn’t immediately obvious how to create one. I do want to figure it out though, so let me try to submit one for you.
As for the fork, I saw that some functions were exactly the same, including the one that got patched by WP, so the way I would have done it is only clone the necessary functions that you changed. Although it does make it safer if WP touches one of the functions that you call, it really isn’t any different than relying on using any other core functions – anything can change. As I said, I’m not sure Disqus is following all changes to the original export.php, so by cloning only the functions you need would have netted you not having to do anything at all here.
Alternatively, maybe not forking at all and using filters instead would have been even better and cleaner.
That’s great to hear that all of this is not in vain and movement will be made. What I keep finding though is that DISQUS features that are supposed to work are broken as if there is no QA in place for releases, and that’s making me nervous. I can’t even imagine how much I’m going to need to test every plugin update before my paranoia is satisfied. I think you can understand why, given how much time was spent on our integration, you know?
Tyler, I’m not sure that solution in the comment on that request would be ideal either – I’ve just replied there with my thoughts. Here they are, for posterity:
Tyler, what you’re saying is better, but if the close action is fired from WordPress upon closing comments, that means existing closed comments wouldn’t be supported by this if you’ve migrated to Disqus after having an established comment base.
Disqus should perhaps try to detect whether a given post has comments closed in WP but not in Disqus, and if they’re not closed on the remote side, issue a close action. Not sure what the best way is, but simply setting a flag that gets passed to the JS form would be a good start. The problem is, spammers can figure this out and unset the flag, unless you have a security mechanism in place that uses hashed API secret/key to pass parameters to the form.
Tyler, I’m sorry but the 2nd part of your answer directly contradicts what’s written here: http://docs.disqus.com/help/18/
Specifically: “Using the WordPress plugin?
Disqus will respect the WordPress settings with regards to closing comment threads. If you’re using WordPress, you can close comments by disabling comments for each post, or setting an Automatic closing timer in your WordPress discussion settings.”Imagine a blog with 500 closed comments – you can’t expect people to close them all manually in Disqus one by one, can you? I mean, that’s specifically what the document above is addressing. This functionality is broken.
Tyler, I looked through the code, and I’m not sure I follow its logic.
What is the expected result here? I would expect to see a Disqusified comment list with the exact same words “Comments are closed” as you’d get if you closed comments from within Disqus.
Looking through the code, I have a suspicion that instead the intention is to not load Disqus at all and rather show the theme’s comment template instead. I may be missing some logic, but the functions I was looking at are
dsq_comments_template()anddsq_can_replace().Specifically, I verified that
$post->comment_statusindsq_comments_template()returns “closed” correctly. The logic then doesn’t enter eitherifstatement and proceeds to set $EMBED=true (see below, I added a few debug statements, out of which only dsq1 was printed).The code enters dsq_can_replace() in the 2nd
ifclause and returns true atelse if ( 'all' == $replace ) { return true; }meaning Disqus can indeed replace and the form is embedded.This is confusing behavior, but then again, I’m not sure what the end result should be – in my opinion the correct logic should be to pass an additional parameter to the JS form that embeds comments which would then disallow showing of the comment entry field but otherwise show all the comments from Disqus and *not* the local db.
If the idea behind the logic is indeed what I think it is now, the theme comments would be shown which means comments from the local database, which can be vastly out of sync compared to Disqus due to moderation, editing, spamming, etc. Either way, neither behavior is happening, and the Disqus form shows itself with an open comment box.
If you need to take a look at all the variables (including disqus_replace = all), I pasted them in the original report.
// ugly global hack for comments closing $EMBED = false; function dsq_comments_template($value) { global $EMBED; global $post; global $comments; error_log("dsq1: " . $post->post_title . " " . $value . " " . $post->comment_status); if ( !( is_singular() && ( have_comments() || 'open' == $post->comment_status ) ) ) { error_log("dsq2: " . $post->post_title . " " . $post->comment_status); return; } if ( !dsq_is_installed() || !dsq_can_replace() ) { error_log("dsq3: " . $post->post_title . " " . $post->comment_status); return $value; } // TODO: If a disqus-comments.php is found in the current template's // path, use that instead of the default bundled comments.php //return TEMPLATEPATH . '/disqus-comments.php'; $EMBED = true; return dirname(__FILE__) . '/comments.php'; }Tyler, I closed it in WP by clicking the very same checkbox you’re talking about and unchecking it.
Closing directly in the Disqus form does work fine. However, the above should be working instead.
Forum: Plugins
In reply to: [Disqus Comment System] Will We Get SEO Benefit ?DISQUS syncs comments back to your local database and has an option to render them on your server for search engines to read. To users with JS enabled, the rendered comments will be quickly replaced via JS by the comment form itself. Users without JS will see the plain text rendered comments, but won’t be able to comment.
Turn off the DISQUS plugin for a moment and see if WordPress still says comments are turned off in those posts. If it does, then something else closed them on your side. If not, then something is wrong with DISQUS or someone closed the comments in DISQUS itself in certain posts (see http://docs.disqus.com/help/18/ for more info).