• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

[nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget)

Scheduled Pinned Locked Moved NodeBB Plugins
356 Posts 71 Posters 236.5k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by phenomlab
    #341

    @baris No - see below for a new post (Ghost) I just created

    The DIV is empty on the screen, but in the code, I see

    803573dc-ebdf-475b-8e68-93e28acc7190-image.png

    It's almost like it thinks the post is already published 😕

    PitaJP 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    replied to phenomlab on last edited by PitaJ
    #342

    @phenomlab does the ghost script get loaded from your NodeBB site?

    phenomlabP 1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #343

    @phenomlab I will publish a new version for you to test.

    phenomlabP 1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to PitaJ on last edited by
    #344

    @PitaJ Yes, I think this is the case as previously created blog posts seem to work fine and are pulling comments.

    8d129858-57b1-4598-bede-b11fc13d71af-image.png

    1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by
    #345

    @baris Thanks

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #346

    Please try with v0.8.5

    phenomlabP 1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by phenomlab
    #347

    @baris Still the same I'm afraid. Installed, rebuilt and restarted. Also seeing this in the logs

    2022-03-10T19:13:05.237Z [4567/195325] - error: GET /comments/get/622a4540dbb475d0e913fa95/0
    TypeError: Cannot read property 'postcount' of null
        at Comments.getCommentData (/home/sudonix/nodebb/node_modules/nodebb-plugin-blog-comments/library.js:95:24)
        at async /home/sudonix/nodebb/src/routes/helpers.js:60:5
    2022-03-10T19:13:31.810Z [4567/195325] - error: GET /comments/get/622a4540dbb475d0e913fa95/0
    TypeError: Cannot read property 'postcount' of null
        at Comments.getCommentData (/home/sudonix/nodebb/node_modules/nodebb-plugin-blog-comments/library.js:95:24)
        at async /home/sudonix/nodebb/src/routes/helpers.js:60:5
    
    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #348

    Did you make a new blog post after upgrading plugin to 0.8.5? Can you send a link to it?

    phenomlabP 1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by
    #349

    @baris said in [nodebb-plugin-blog-comments] Blog Commenting Engine (Ghost, Wordpress widget):

    Did you make a new blog post after upgrading plugin to 0.8.5? Can you send a link to it?

    Yes, here you go
    https://content.sudonix.com/testing-2/

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #350

    Ok try with 0.8.6 and let me know.

    phenomlabP 1 Reply Last reply
    0
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by
    #351

    @baris That works

    d22625e2-c3e7-4559-bbef-c632bd9c53e7-image.png

    What changed ? It was working fine ?

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #352

    It was due to an bug I introduced when I rewrote the plugin a while back, when there was no topic found on the nodebb side it was sending back 404, instead it needs to return 200 but an undefined topic id so it can display the publish article button.

    fix: do not 404 if mapping isnt established yet · psychobunny/nodebb-plugin-blog-comments@72df076

    Lets NodeBB act as a comments engine/widget for your blog - fix: do not 404 if mapping isnt established yet · psychobunny/nodebb-plugin-blog-comments@72df076

    favicon

    GitHub (github.com)

    phenomlabP 1 Reply Last reply
    1
  • phenomlabP Offline
    phenomlabP Offline
    phenomlab
    replied to <baris> on last edited by
    #353

    @baris Great ! Thanks for fixing this.

    barisB 1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    replied to phenomlab on last edited by
    #354

    @phenomlab No worries, thanks for reporting the issue.

    1 Reply Last reply
    1
  • G Offline
    G Offline
    Gliding9426
    wrote on last edited by
    #355

    Hi, i read all the posts on this topic and everyone is only talking about wordpress or ghost integration. Does the generic php version work?

    I get "Commenting is disabled" on posts, even if i'm currently signed in to the forum as admin.

    Besides the problems with CORS (browsers blocked the request and i took hours to find the right headers to let it work, as "accept origin *" is no more supported and it only accepts a single domain), I can't get it work.

    This is the json generated by the php code:

     articleID = "ID"; #i hardcoded this to ID for testing purposes, but change to a md5 hash it did not change the result
    var articleData ={
            "title_plain":"post title",
            "url":"https:\/\/www.example.com\/posts\/2023-04-23-test\/",
            "markDownContent":"post summary" #tags and category were omitted in my latest test, it did not change the result when they were present
        };
    

    so the javascript then does a request to https://forum.otherdomain.com/comments/get/ID/0 and the content of that request is:

    {
        "posts": [],
        "postCount": 0,
        "user": {
            "uid": 0,
            "username": "[[global:guest]]",
            "displayname": "[[global:guest]]",
            "userslug": "",
            "fullname": "[[global:guest]]",
            "email": "",
            "icon:text": "?",
            "icon:bgColor": "#aaa",
            "groupTitle": "",
            "groupTitleArray": [],
            "status": "offline",
            "reputation": 0,
            "email:confirmed": 0
        },
        "template": "<!-- IF tid -->\n\t<!-- IF atTop -->\n\t\t<div class=\"topic-profile-pic user\">\n\t\t\t<!-- IF isLoggedIn -->\n\t\t\t<img src=\"{user.picture}\" class=\"profile-image\" />\n\t\t\t<!-- ELSE -->\n\t\t\t<img src=\"https://1.gravatar.com/avatar/177d180983be7a2c95a4dbe7451abeba?s=95&d=&r=PG\" class=\"profile-image\" />\n\t\t\t<!-- ENDIF isLoggedIn -->\n\t\t</div>\n\t\t<form action=\"{relative_path}/comments/reply\" method=\"post\">\n\t\t\t<textarea id=\"nodebb-content\" class=\"form-control\" name=\"content\" placeholder=\"Join the conversation\" rows=\"3\"></textarea>\n\t\t<!-- IF isLoggedIn -->\n\t\t\t<small>Signed in as <strong>{user.username}</strong>. <strong id=\"nodebb-error\"></strong></small>\n\t\t\t<button class=\"btn btn-primary\">Post a Reply</button>\n\t\t\t<input type=\"hidden\" name=\"_csrf\" value=\"{token}\" />\n\t\t\t<input type=\"hidden\" name=\"tid\" value=\"{tid}\" />\n\t\t\t<input type=\"hidden\" name=\"url\" value=\"{redirect_url}\" />\n\t\t</form>\n\t\t<!-- ELSE -->\n\t\t</form>\n\t\t<button class=\"btn btn-primary\" id=\"nodebb-register\">Register</button>\n\t\t<button class=\"btn btn-primary\" id=\"nodebb-login\">Login</button>\n\t\t<br />\n\t\t<!-- ENDIF isLoggedIn -->\n\t<!-- ENDIF atTop -->\n\n\t<ul id=\"nodebb-comments-list\">\n\t\t<!-- BEGIN posts -->\n\t\t<li <!-- IF pagination --> class=\"nodebb-post-fadein\" <!-- ENDIF pagination --> <!-- IF !posts.index --> class=\"nodebb-post-fadein\" <!-- ENDIF !posts.index --> >\n\t\t\t<div class=\"topic-item\">\n\t\t\t\t<div class=\"topic-body\">\n\t\t\t\t\t<div class=\"topic-profile-pic\">\n\t\t\t\t\t\t<a href=\"{relative_path}/user/{user.userslug}\">\n\t\t\t\t\t\t\t<!-- IF user.picture -->\n\t\t\t\t\t\t\t<img src=\"{user.picture}\" alt=\"{user.username}\" class=\"profile-image\" title=\"{user.username}\">\n\t\t\t\t\t\t\t<!-- ELSE -->\n\t\t\t\t\t\t\t<div class=\"profile-image\" style=\"background-color: {user.icon:bgColor}\" title=\"{user.username}\" alt=\"{user.username}\">{user.icon:text}</div>\n\t\t\t\t\t\t\t<!-- ENDIF user.picture -->\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"topic-text\">\n\t\t\t\t\t\t<div class=\"post-content\" itemprop=\"text\"><small><strong>{user.username}</strong> commented {posts.timestamp}</small><br />{posts.content}</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</li>\n\t\t<!-- END posts -->\n\t</ul>\n\t<br />\n\n\t<!-- IF atBottom -->\n\t\t<div class=\"topic-profile-pic user\">\n\t\t\t<!-- IF isLoggedIn -->\n\t\t\t<img src=\"{user.picture}\" class=\"profile-image\" />\n\t\t\t<!-- ELSE -->\n\t\t\t<img src=\"http://1.gravatar.com/avatar/177d180983be7a2c95a4dbe7451abeba?s=95&d=&r=PG\" class=\"profile-image\" />\n\t\t\t<!-- ENDIF isLoggedIn -->\n\t\t</div>\n\t\t<form action=\"{relative_path}/comments/reply\" method=\"post\">\n\t\t\t<textarea id=\"nodebb-content\" class=\"form-control\" name=\"content\" placeholder=\"Join the conversation\" rows=\"3\"></textarea>\n\t\t<!-- IF isLoggedIn -->\n\t\t\t<small>Signed in as <strong>{user.username}</strong>. <strong id=\"nodebb-error\"></strong></small>\n\t\t\t<button class=\"btn btn-primary\">Post a Reply</button>\n\t\t\t<input type=\"hidden\" name=\"_csrf\" value=\"{token}\" />\n\t\t\t<input type=\"hidden\" name=\"tid\" value=\"{tid}\" />\n\t\t\t<input type=\"hidden\" name=\"url\" value=\"{redirect_url}\" />\n\t\t</form>\n\t\t<!-- ELSE -->\n\t\t</form>\n\t\t<button class=\"btn btn-primary\" id=\"nodebb-register\">Register</button>\n\t\t<button class=\"btn btn-primary\" id=\"nodebb-login\">Login</button>\n\t\t<br />\n\t\t<!-- ENDIF isLoggedIn -->\n\t<!-- ENDIF atBottom -->\n\n\t<small class=\"nodebb-copyright\">Powered by <a href=\"http://nodebb.org\" target=\"_blank\">NodeBB</a> &bull; <a href=\"{relative_path}/topic/{tid}\">View original thread</a></small>\n\t<button class=\"btn btn-primary\" <!-- IF !posts.length -->style=\"display: none\"<!-- ENDIF !posts.length --> id=\"nodebb-load-more\">Load more comments...</button>\n<!-- ELSE -->\n\tCommenting has been disabled.\n\t<!-- IF isAdmin -->\n\t<form action=\"{relative_path}/comments/publish\" method=\"post\">\n\t\t<button class=\"btn btn-primary\">Publish this article to NodeBB</button>\n\t\t<input type=\"hidden\" name=\"markdown\" id=\"nodebb-content-markdown\" />\n\t\t<input type=\"hidden\" name=\"title\" id=\"nodebb-content-title\" />\n\t\t<input type=\"hidden\" name=\"cid\" id=\"nodebb-content-cid\" />\n\t\t<input type=\"hidden\" name=\"tags\" id=\"nodebb-content-tags\" />\n\t\t<input type=\"hidden\" name=\"id\" value=\"{article_id}\" />\n\t\t<input type=\"hidden\" name=\"url\" value=\"{redirect_url}\" />\n\t\t<input type=\"hidden\" name=\"_csrf\" value=\"{token}\" />\n\t</form>\n\t<!-- ENDIF isAdmin -->\n<!-- ENDIF tid -->\n",
        "token": "XXXXX",
        "isAdmin": false,
        "isLoggedIn": false,
        "tid": null,
        "category": null,
        "mainPost": null,
        "atTop": true,
        "atBottom": false
    }
    

    and it only shows "Commenting is disabled".

    Console log does not show any other error (there were many errors until i fixed the CORS header issue on the proxy server)

    Maybe on modern browsers this kind of cross domain communication is forbidden? Meaning the forum should be on the same domain?

    1 Reply Last reply
    0
  • G Offline
    G Offline
    Gliding9426
    wrote on last edited by
    #356

    Forgot to mention that if i open that URL from the browser window I get the expected result in the JSON, the response contains

        "isAdmin": true,
        "isLoggedIn": true,
    

    It looks like if the browser does the request in the page via the javascript, could not access the cookies and so it gets a "logged out" json (but i tested on clean ms edge with no cookie blocking)

    Ps: i could not edit the other post because of a weird issue, I'm going to open another post to ask if this is intended behavior

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development