Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. jongarrison
    • Profile
    • Following 6
    • Followers 4
    • Topics 29
    • Posts 121
    • Best 30
    • Groups 1

    jongarrison

    @jongarrison

    Plugin & Theme Dev

    My current client will be using NodeBB to manage a yearly festival that will allow participants to discuss festival topics, purchase tickets and participate in forums that are only for ticket holders.

    The versatility and extensibility of NodeBB make it a great foundation platform for creating a wide variety of sites that require user interaction and control of permissions.

    56
    Reputation
    1224
    Profile views
    121
    Posts
    4
    Followers
    6
    Following
    Joined Last Online
    Website linkedin.com/in/jonathangarrison Location Port Townsend, Washington, USA

    jongarrison Unfollow Follow
    Plugin & Theme Dev

    Best posts made by jongarrison

    • [slush-nodebb-plugin] NodeBB New Plugin Generator - Request for feedback

      I've created and published a tool for helping to generate new NodeBB plugins. I'd be interested in people's feedback on how well it works and additional functionality. Launching the tool prompts the user about necessary features and then generates a plugin .

      The generator can currently help to:

      • Correctly create the package.json and plugin.json files with the appropriate default contents
      • Create the stub methods and files for a new widget
      • Create the stub methods and files for listening to a system hook
      • Create the stub methods and files for a custom admin page
      • Create the stub methods and files for a custom page
      • Register a stub javascript file that will be injected on all NodeBB pages
      • Register a stub style template (less/css) that will be injected on all NodeBB pages
      • Register a reference to a template folder for overriding system templates

      I've tested this out in a variety of ways and it seems to work properly as of NodeBB 0.8.2

      You can find the ReadMe with installation instructions here:

      Thanks for any feedback!

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • Created a NodeBB-Backup tool - Request For Feedback

      I saw that version 0.8.0 was released. This is my second upgrade and I realized I should have a quick way to consistently run backups that would record the version that was backed up and time of the backup. I'm still new to Node.js and NodeBB so I thought I'd do it as a globally installable npm tool.

      After installing the tool (npm install -g nodebb-backup) you just run it from your nodebb installation directory:

      nodebb-backup

      The version number captured is from package.json and the mongo info (yes, mongo only right now) is loaded from config.json. As described in the upgrade docs for NodeBB (https://docs.nodebb.org/vi/latest/upgrading/) it dumps the db and saves the /uploads directory. The db dump and /uploads copy are compressed into a tar named like this:

      nodebb-backup-2015-09-01_2236-v0.7.3.tar
      (which is saved to the directory above your nodebb install)

      If this is useful to you, could you review the code and let me know if you think it is doing the right thing? Also, there are a number of additions that I think would be useful:

      • Be able to provide a path to place the resulting back up file
      • Redis support
      • Maybe be able to restore from a provided tar file?

      Anything else? Thanks for looking.

      Github: https://github.com/jongarrison/nodebb-backup
      Npm: https://www.npmjs.com/package/nodebb-backup

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: NodeBB multisite / network feature?

      Multi-tenancy would be a great feature for NodeBB.

      posted in Feature Requests
      jongarrison
      jongarrison
    • RE: How to guide for writing your first plugin

      I created a very simple skeleton plugin for reference that works as of NodeBB 0.7.2 https://github.com/jongarrison/nodebb-plugin-skeleton

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • [nodebb-widget-singlepost] Ever wanted to embed a post in a widget?

      I created this widget for a client that wanted to be able to manage some widget content on various pages as if it were a post. So I created this widget that allows you to embed a post by its ID number as a widget.

      You can use this to create fully custom static(ish) pages in conjunction with the plugin nodebb-plugin-custom-static-pages. And then you can manage that page as if it were a post with the familiar capabilities.

      To use this widget install the plugin via npm nodebb-widget-singlepost (https://www.npmjs.com/package/nodebb-widget-singlepost)

      WARNING: Feature. I wanted to have the general site content posts hidden in a category that users wouldn't normally see. The widget does not respect normal access privileges and will render any post that you tell it to, including posts that the user doesn't normally have access to. As far as I can tell, the widget params never touch the client and so this shouldn't be a security hole. If you think this is incorrect, please let me know.

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: NodeBB For a Complete Beginner

      @AccessDenied
      I went through the same process as you a few months ago and I was able to find much of what I needed between these sources:

      1. The docs: https://docs.nodebb.org/en/latest/ (google searches will often send you to out of date versions, watch the urls!)
      2. The source: https://github.com/NodeBB/NodeBB (Having a good IDE helps with making sense of the source and doing good searches)
      3. I got a lot of help from purchasing Webstorm IDE (https://www.jetbrains.com/webstorm/) I've also heard people here like using Sublime Text with a lot of plugins installed.
      4. Finding any existing plugin with related functionality to what I was trying to do was very helpful. For some reason, I found the Mandrill email plugin really helpful at first (https://github.com/akhoury/nodebb-plugin-emailer-mandrill), but just dig around until you find something with functionality related to what you are trying to do.
      5. Lastly, I'd search and ask questions here under the plugins category (https://community.nodebb.org/category/7/nodebb-plugins). I've asked a lot of newb questions and the community has been awesome.

      A few more notes. When I was first interested in Javascript and Node.js about a year ago, I went through a bunch of tutorials online. I found this one to be very well done: https://github.com/workshopper/learnyounode

      Also, after developing a few plugins myself, I wrote this Slush based tool for generating NodeBB plugins based on a number of questions:

      Good luck!

      posted in NodeBB Development
      jongarrison
      jongarrison
    • RE: Documentation on making ajaxify.go work for custom routes?

      @julian Thanks for the link to nodebb-plugin-quickstart, the really important bit for me was the comment in nodebb-plugin-quickstart/lib/controllers.js:

      /*
      	Make sure the route matches your path to template exactly.
      	If your route was:
      		myforum.com/some/complex/route/
      	your template should be:
      		templates/some/complex/route.tpl
      	and you would render it like so:
      		res.render('some/complex/route');
      */
      

      I hadn't seen that mentioned anywhere else. So, if I understand custom routes finally, there are really three important routes really:

      1. The normal Express route which renders the full page with the header. This handles browser requests straight to the custom route.
      2. API route for Ajaxify. The custom plugin code sends some json, which nodebb adds some additional json to.
      3. Template route for Ajaxify, which is implied from the url for the api path.
      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: Overriding Admin tpl's From A Plugin?

      I tried this today and I was able to override an admin template. I'm not sure what I did incorrectly when I tried earlier. Thanks for confirming that this could be done!

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: How do I insert associative arrays in plugin templates?

      @psychobunny said:

      ajaxify.data.get

      Woah! That's kick ass! There is a lot of data ready to go in that ajaxify.data object. That changes the way I think about loading data into NodeBB templates.

      For anyone else interested, in your browser js console just type "ajaxify.data" to see what NodeBB already has loaded for you.

      Is this the best spot to learn more about ajaxify? http://4nf.org/

      posted in NodeBB Development
      jongarrison
      jongarrison
    • RE: Way to get req (and maybe res) objects during a widget render?

      Cool! Just signed it.

      posted in Plugin Development
      jongarrison
      jongarrison

    Latest posts made by jongarrison

    • RE: Looks like your connection to NodeBB was lost, please wait while we try to reconnect. on 1.4.4

      Fixed a problem for me on a new test server too. Thanks @baris !

      posted in Technical Support
      jongarrison
      jongarrison
    • RE: Estimated Costs?

      @julian I've had a server under light load on a $5 Digital Ocean for over a year without a crash. The trick seems to be large amounts of swap.

      posted in General Discussion
      jongarrison
      jongarrison
    • RE: Plugin Templates Not Loading - Hello new build system!

      Found the solution, It turns out that I had missed this blog post before upgrading to 1.4.x:

      Introducing the build system in v1.4.x
      ./nodebb build
      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: Plugin Templates Not Loading - Hello new build system!

      Interesting, I had thought they were in /public/templates. Was that in older versions?

      In any event, the server wasn't loading new templates coming in with an updated plugin.

      I'm in the process of trying out a few things with the server now.

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • Plugin Templates Not Loading - Hello new build system!

      I recently deployed a new public Ubuntu server with Nodebb 1.4.3 and then upgraded to 1.4.4. For some reason, my plugin's template files are not being loaded into the nodebb/plugin/templates directory now.

      Has anyone seen anything like this before?

      Locally, when I do a "./nodebb dev" startup I see this in my logs:

      6/3 16:14 [28897] - verbose: [plugins] /header.tpl replaced by ...
      

      On my public server I don't see this even when doing the dev start.

      To set up this new server, I followed the docs here: https://nodebb.readthedocs.io/en/latest/installing/os/ubuntu.html

      Any ideas?

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: Solved - Installation Errors v1.4.3

      Never mind, it was a simple memory issue that was causing npm install to die.

      Fixed with these instructions:

      posted in General Discussion
      jongarrison
      jongarrison
    • Solved - Installation Errors v1.4.3

      Hi guys,

      I'm doing an install of nodebb v1.4.3 on a clean new Ubuntu 16.04 server and following the instructions from:
      https://docs.nodebb.org/en/latest/installing/os/ubuntu.html

      The instructions seem to be evolving nicely, but I ran into an error with he npm dependency installation:

      $ sudo npm install --production
      
      npm WARN deprecated mongodb@2.2.16: Please upgrade to 2.2.19 or higher
      npm WARN deprecated wrench@1.5.9: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
      Killed          ...] | extract:passport-local: sill gunzTarPerm extractEntry less/bootstrap-rtl/pager-rtl.less
      
      
      $ sudo ./nodebb setup
      
      NodeBB could not be started because it's dependencies have not been installed.
      Please ensure that you have executed "npm install --production" prior to running NodeBB.
      
      For more information, please see: https://docs.nodebb.org/en/latest/installing/os.html
      
      Could not start: MODULE_NOT_FOUND
      

      Any advice?

      Thanks!

      posted in General Discussion
      jongarrison
      jongarrison
    • Want a NodeBB REPL (command line interface)?

      I wanted to debug some code I had written in my plugin and did a quick search to see if I could create a Node.js REPL that would function in the context of my plugin. It turned out to be quite simple to do.

      Just add this to your plugin's static:app.load method:

            setTimeout(function() {
              console.log("About to start REPL");
              var repl = require("repl");
      
              var util = require('util');
              var replServer = repl.start({
                prompt: "swf-cms> ",
                breakEvalOnSigint: true,
                ignoreUndefined: true,
                useGlobal: true,
                useColors: true
              });
      
              var context = replServer.context;
              context.require = require;
              context.module = module;
              
              context.context = util.inspect(replServer.context, {depth: 0});
            }, 3000);
      

      You'll want to wrap this in something to prevent it from running outside of dev mode. Also, load up the context object with anything that you want to be conveniently available in the REPL. FYI, I used the setTimeout to give Nodebb a chance to finish loading before it gives you the prompt.

      Have fun.

      posted in NodeBB Plugins
      jongarrison
      jongarrison
    • RE: Serious error! nodebb.org is in redirect loop (which prevents admin plugins pages from loading)

      @julian Yikes!

      posted in NodeBB Development
      jongarrison
      jongarrison
    • RE: Serious error! nodebb.org is in redirect loop (which prevents admin plugins pages from loading)

      @julian Thanks.

      Should something be changed in the acp so that a remote error doesn't prevent management of NodeBB installs everywhere?

      posted in NodeBB Development
      jongarrison
      jongarrison