Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. aii
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Groups 0

    aii

    @aii

    0
    Reputation
    576
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    aii Follow

    Latest posts made by aii

    • RE: Setting up email

      After I activate the plugin and click on Emailer (Local) from the intstalled plugins menu I get a 404:

      "Not Found

      You seem to have stumbled upon a page that does not exist. Return to the home page."

      No errors in the log, but there was this warning:

      warn: [plugins/nodebb-plugin-emailer-local] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: filter:admin.header.build

      ./nodebb dev gave me this warning:

      warn: Route requested but not found: /admin/plugins/emailer-smtp

      posted in General Discussion
      A
      aii
    • Setting up email

      Hello,

      How do you set up email on nodebb? I installed nodedb-plugin-emailer-local, but it doesn't seem to work for V 0.5.2..

      posted in General Discussion
      A
      aii
    • RE: How to guide for writing your first plugin

      This is an improvement of psychobunny's example which adds module support. The "callbacked" field in plugin.json may be unnecessary, all the code that I've seen checks that the last argument is a function before it treats it as a callback.

      plugin.json:

      {
         "id": "nodebb-plugin-youtube"
       , "name": "NodeBB YouTube Plugin"
       , "description": "NodeBB Plugin that enables users to embed YouTube videos inline in their posts."
       , "url": "https://github.com/psychobunny/nodebb-plugin-youtube"
       , "library": "./library.js"
       , "hooks": [
          {
           "hook": "filter:post.parse"
            , "method": "parse"
            , "callbacked": true
          }
       ]
      }
      

      library.js:

      /*
         nodebb modules (eg db) have paths that are relative to the object javascript source file.
         nodejs modules (eg async) have no path.
      */
      
      (function(Youtube) {
       'use strict'
      
       var  async = module.parent.require('async')
            db = module.parent.require('./database')
      
       Youtube.parse = function(postContent, callback) {
         postContent = postContent.replace(
           /<a href="(?:https?:\/\/)?(?:www\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=)?(.+)<\/a>/g,
           '<iframe class="youtube-plugin" width="640" height="360" src="http://www.youtube.com/embed/$1" frameborder="0" allowfullscreen></iframe>'
         )
         callback(null, postContent)
       }
      
      }(module.exports))
      
      posted in NodeBB Plugins
      A
      aii