nodebb-plugin-blog-comments2 and WordPress, nothing at all. Ideas?



  • I haven't worked with PHP in over 13 years, and barely know WP, but as a volunteer helping on a project, we have have been trying to get the plugin nodebb-plugin-blog-comments2 to work with a Wordpress install on Pagely.
    We installed the plugin on NodeBB v1.4.4., and activated, and restarted NodeBB just for good measure.
    The login as admin, and go to Plugins > Blog Comments.
    Created a "Name of Blog" of "JQ"
    Link to the page: http://www.zombieorpheus.com/videos/jq-episode-01-02/
    Category ID: 2
    And saved those settings.
    Then on the WordPress WordPress 4.7.3 server,
    We enabled the JSON API plugin and Activated the various sections.
    Then we edited the comments.php in our theme ( /wp-content/themes/YOUR_THEME/comments.php )as per this page's directions:
    https://www.npmjs.com/package/nodebb-plugin-blog-comments2
    with the following code:
    <?php
    if ( post_password_required() )
    return;
    ?>

    <a id="nodebb-comments"></a>
    <script type="text/javascript">
    var nodeBBURL = '//fora.zombieorpheus.com', //is the leading "//" supposed to be there? removing it made no difference.
    wordpressURL = '<?php get_site_url(); ?>',
    articleID = '<?php echo the_ID(); ?>',
    // blogger = 'name'; //OPTIONAL. Assign an blogger name to disdinguish different blogger. Omit it to fallback to 'default'
    // categoryID = 1; // OPTIONAL. Forces a Category ID in NodeBB.
    // Omit it to fallback to specified IDs in the admin panel.

    (function() {
    var nbb = document.createElement('script'); nbb.type = 'text/javascript'; nbb.async = true;
    nbb.src = nodeBBURL + '/plugins/nodebb-plugin-blog-comments2/lib/wordpress.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(nbb);
    })();
    </script>
    <noscript>Please enable JavaScript to view comments</noscript>

    And then try calling it from any of the pages:
    <span id="nodebb-comments"></span> Comments
    Then save/Update the page, and load it from another browser.

    We can see the "Comments" text, but no comments, nothing shows up related to the function of the plugin.

    Any ideas what other pieces we're missing?
    Thanks!



  • Hmmm, is it possibly related to CSP permissions of Javascript?
    https://www.ipsec.pl/web-application-security/2013/mess-x-frame-options-allowall.html
    Or am I barking up the wrong tree?
    Update: okay, that is opposite of goals. We have working iFrame from WP to NodeBB, we're trying to get away from the iFrame and make the plugin work for NodeBB comments to show up within the WP page...


  • Global Moderator

    Are there any JS errors on the page? You might try changing articleID = '<?php echo the_ID(); ?>', to articleID = '<?php echo the_ID(); ?>';

    Also, can you please edit the post to use actual code blocks? Use triple-backticks (```) on both ends of the code to do this. Good luck.



  • This post is deleted!


  • @PitaJ said in nodebb-plugin-blog-comments2 and WordPress, nothing at all. Ideas?:

    Are there any JS errors on the page? You might try changing articleID = '<?php echo the_ID(); ?>', to articleID = '<?php echo the_ID(); ?>';

    I tried that change, I don't see any difference alas.
    The only errors I see in the JS browser console is:

    Uncaught TypeError: $ is not a function
        at HTMLDocument.<anonymous> (mega.js?ver=2.0.0:2)
        at j (jquery-1.11.3.min.js:2)
        at Object.fireWith [as resolveWith] (jquery-1.11.3.min.js:2)
        at Function.ready (jquery-1.11.3.min.js:2)
        at HTMLDocument.J (jquery-1.11.3.min.js:2)
    


  • @PitaJ

    Also, can you please edit the post to use actual code blocks? Use triple-backticks (```) on both ends of the code to do this. Good luck.

    I tried adding the triple ticks, and received the following errors when trying to Submit:
    "Error: Post content was flagged as spam by Akismet.com". ?


  • Admin

    We don't support blog-comments2. Use the original please.



  • @julian Ah, didn't know that was an issue. We'll give the original a shot then. Thanks!


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.