[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)
-
suggestions:
-option to only show comments with at least x number of upvote/favorite
-or way to filter comments and not show all of them in blog -
I am using Ghost v0.5.8 and the required APIs that this plugin expects are not publicly accessible, my workaround was to monkey-patch the embed.js script in a very ugly hackish way, basically removing the ajax calls to the API and using a simple markdown with just the link to the post as the initial topic post on nodeBB, here is the gist:
nodebb-plugin-blog-comment monkey-patch
nodebb-plugin-blog-comment monkey-patch. GitHub Gist: instantly share code, notes, and snippets.
Gist (gist.github.com)
if (data.isAdmin) { //var adminXHR = newXHR(); //adminXHR.open('GET', '/ghost/api/v0.1/posts/' + articleID); //adminXHR.onload = function() { //if (adminXHR.status >= 200 && adminXHR.status < 400) { //var articleData = JSON.parse(adminXHR.responseText), //markdown = articleData.markdown.split('\n\n').slice(0,2).join('\n\n') + '\n\n**Click [here]('+articlePath+') to see the fu$ var markdown = '\n\n**Click [here]('+articlePath+') to see the full blog post**'; var title = $('.post-title').text(); document.getElementById('nodebb-content-markdown').value = markdown; document.getElementById('nodebb-content-title').value = title; //document.getElementById('nodebb-content-title').value = articleData.title; //} else { //nodebbDiv.innerHTML = 'Welcome ' + data.user.username + ', <a href="/ghost">sign in to Ghost</a> to enable the publish button.</a>$ //} //} //adminXHR.send(); }
The file lives under
nodebb/node_modules/nodebb-plugin-blog-comments/public/lib/embed.js
I've also made a blog post in Portuguese about how to install NodeBB and this plugin to be the comments system of a Ghost blog.
The solution is not clean, you have to go through all your posts and click the green button to make the initial topics on nodeBB, displaying an error json in the browser (but the thread is created anyways) and nodeBB will crash almost every time you create the new topics, but all this hassle is hopefully one-time-per-post only, so it is something I can live with for now.
I suggest people waiting for the clean solution to subscribe to the Ghost bug https://github.com/TryGhost/Ghost/issues/4181 and the nodebb-plugin-blog-comments bug https://github.com/psychobunny/nodebb-plugin-blog-comments/issues/17 to track the updates, or even beter, to submit a nice pull request to this plugin.
-
Which is the last compatible version from ghost that can manage the plugin?
-
I've just released v0.3.0 of this plugin:
- Fixed quite a few server crashes (especially when publishing)
- Compatible with NodeBB 0.6x+ and Ghost 0.5.10
- Added tags support for Ghost
EDIT: Updated OP
-
@psychobunny
I've recently upgraded to NodeBB V0.8.0 and I encounter a wordpress comment plugins problem.
When I'm on wordpress, I still can view comments and respond to them, no problem, but when I created a new blog entry and wanted to create the entry on nodeBB but when I click on the button "Publish This Article to NodeBB" I got
{"error":"unable to post topic"} in browser return page
Do you think this can come from V0.8.0 update ?
thanks for your help -
Can you post the error on nodebb server?
-
@psychobunny
I launched./nodebb dev
but once launched it does not give me any error as soon as I click on publish button in wordpressI put the full trace in case (and yes once started I clicked to publish ;-))
NodeBB v0.8.0 Copyright (C) 2013-2014 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 1 process(es). 2/9 13:11 [11619] - info: Time: Wed Sep 02 2015 13:11:29 GMT+0200 (CEST) 2/9 13:11 [11619] - info: Initializing NodeBB v0.8.0 2/9 13:11 [11619] - verbose: * using configuration stored in: /usr/local/share/nodebb/config.json 2/9 13:11 [11619] - verbose: * using redis store at 127.0.0.1:6379 2/9 13:11 [11619] - verbose: * using themes stored in: /usr/local/share/nodebb/node_modules 2/9 13:11 [11619] - verbose: Checking dependencies for outdated modules 2/9 13:11 [11619] - verbose: [notifications.init] Registering jobs. 2/9 13:11 [11619] - info: [themes] Using theme nodebb-theme-persona 2/9 13:11 [11619] - verbose: [plugins] Initializing plugins system 2/9 13:11 [11619] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-composer-default 2/9 13:11 [11619] - verbose: [plugins] Found 10 js file(s) for plugin nodebb-plugin-composer-default 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-composer-default 2/9 13:11 [11619] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-markdown 2/9 13:11 [11619] - verbose: [plugins] Found 2 js file(s) for plugin nodebb-plugin-markdown 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-markdown 2/9 13:11 [11619] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-mentions 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-mentions 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-mentions 2/9 13:11 [11619] - verbose: [plugins] Found 1 css file(s) for plugin nodebb-widget-essentials 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-widget-essentials 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-rewards-essentials 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-rewards-essentials 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-soundpack-default 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-google-analytics 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-google-analytics 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-emailer-ssl-smtp 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-blog-comments 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-blog-comments 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-dbsearch 2/9 13:11 [11619] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-custom-pages 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-custom-pages 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-custom-pages 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-gravatar-extended 2/9 13:11 [11619] - verbose: [plugins] Found 1 less file(s) for plugin nodebb-plugin-spam-be-gone 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-spam-be-gone 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-spam-be-gone 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-sso-github 2/9 13:11 [11619] - warn: [plugins/nodebb-plugin-sso-google] Hook `filter:user.delete` is deprecated, please use an alternative 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-sso-google 2/9 13:11 [11619] - warn: [plugins/nodebb-plugin-sso-facebook] Hook `filter:user.delete` is deprecated, please use an alternative 2/9 13:11 [11619] - verbose: [plugins] Found 1 js file(s) for plugin nodebb-plugin-sso-facebook 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-sso-facebook 2/9 13:11 [11619] - warn: [plugins/nodebb-plugin-sso-twitter] Hook `filter:user.delete` is deprecated, please use an alternative 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-plugin-sso-twitter 2/9 13:11 [11619] - verbose: [plugins] Found 4 js file(s) for plugin nodebb-theme-persona 2/9 13:11 [11619] - verbose: [plugins] Loaded plugin: nodebb-theme-persona 2/9 13:11 [11619] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it. * nodebb-plugin-emailer-ssl-smtp * nodebb-plugin-blog-comments * nodebb-plugin-custom-pages * nodebb-plugin-gravatar-extended * nodebb-plugin-spam-be-gone 2/9 13:11 [11619] - info: [plugins] Plugins OK 2/9 13:11 [11619] - verbose: [meta/css] Minifying LESS/CSS 2/9 13:11 [11619] - verbose: [sounds] Sounds OK 2/9 13:11 [11619] - verbose: [meta/templates] Compiling templates 2/9 13:11 [11619] - verbose: [meta/js] Minification complete 2/9 13:11 [11619] - verbose: [meta/js] Client-side minfile committed to disk. 2/9 13:11 [11619] - verbose: [meta/templates] Successfully compiled templates. 2/9 13:11 [11619] - verbose: [meta/css] admin.css committed to disk. 2/9 13:11 [11619] - info: NodeBB Ready 2/9 13:11 [11619] - info: Enabling 'trust proxy' 2/9 13:11 [11619] - info: NodeBB is now listening on: 0.0.0.0:4567 2/9 13:11 [11619] - info: [plugins/spam-be-gone] Settings loaded 2/9 13:11 [11619] - verbose: [hotswap] Router with id `plugins` replaced successfully 2/9 13:11 [11619] - verbose: [plugins] All plugins reloaded and rerouted 2/9 13:11 [11619] - verbose: [meta/css] stylesheet.css committed to disk. 2/9 13:11 [11619] - verbose: [hotswap] Router with id `auth` replaced successfully
the browser windows is
hope this help
-
Anyway, as a temp solution, I digged into the code but was unable to find what I needed, so maybe you can help me.
I wanted to try this (sure it should works)- I Create a new post on my nodebb forum and I get the database postID
- I create a new Blog article on my wordpress forum and get ArticleID
Where do I put the link between both (I can do it manually inserting value in database), I think I just need to put NodeBB postID in wordpress database (near it's ArticleID), but I didn't found where. Any ideas ?
oH, just to let you know, my wordpress blog and my nodebb community are hosted on same VM (not same fqdn)
Thks
-
@psychobunny
Oh, got a workaround, I really need to sleep more than 4 hours a night, the table was in front of my eyes it's in nodeBB database tableblog-comments
, just needed to add into this a new entry with key='blog post ID' and value='NodeBB topic ID'In Wordpress database I get the post ID going to admin panel/posts then leaving the mouse on post link and looking the link in browser status bar
or with this mysql query on wordpress database to list them allSELECT post_date, ID, post_title, guid, post_status, post_type FROM wp_posts WHERE post_parent=0 ORDER BY `post_date` DESC
To find the NodeBB topic number into NodeBB, just create a topic then in Forum then find the post in the forum and leave the mouse on post link and looking the link in browser status bar
I've done it with Redis Desktop Mananager
In case it can help
-
Experiencing this issue on Wordpress as well.
-
@overlawled
Not sure if the problem comes from NodeBB upgrade or wordpress upgrade. Would be cool to have this fixed -
Is it related to this issue?
I haven't used WP in a while so I'm not up to date with their changes. If not can you submit another issue?
-
@watomsk said:
Can this plugin work even if Wordpress and NodeBB are in different servers (DO droplets), or do they have to be installed in the same server?
Yes, this worked for me, different droplets on same domain. Currently it links a WordPress install with a NodeBB forum both on separate domains though on the same droplet.
-
Updated blog comments plugin to 0.4.3
- Updated for NodeBB 0.8.x
- ACP page redesigned
- Fixed bugs with publishing and CORS errors
-
I have a small issue with the plugin. It was working fine, and now for some reason new Wordpress articles won't display the button to create a thread for the article in NodeBB, but existing comments on Wordpress articles already published to NodeBB seem to work fine.
Is there anything I can do to make the publish-to-nodebb button appear again?
Thank you
-
Sorry, I missed this. Does downgrading this plugin work though?
npm install [email protected]
Just want to make sure its not a WP upgrade that made a difference and not the plugin
-
@psychobunny
which version you want me to test ?