• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. mootzville
    • Profile
    • Following 0
    • Followers 1
    • Topics 14
    • Posts 86
    • Best 17
    • Controversial 0
    • Groups 0

    mootzville

    @mootzville

    22
    Reputation
    1172
    Profile views
    86
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    mootzville Unfollow Follow

    Best posts made by mootzville

    • RE: Developing a child theme vs forking an existing theme

      @arasbm I clone vanilla and was building a theme at one point, but after a version update, some of the routes changed and I didn't feel like tracing them, so instead I opted to just piggyback on the stock themes.

      What I do is pretty basic, but probably not the most performant...though, I haven't noticed any lag yet...

      In vanilla -- and probably lavender too -- there is a file called theme.less. For vanilla, it has 3 imports:

      @import "./less/bootstrap/bootstrap";
      @import "./less/vanilla";
      @import "modules";
      

      I just add my additional less file(s) there and make my mods, so theme.less looks like this:

      @import "./less/bootstrap/bootstrap";
      @import "./less/vanilla";
      @import "modules";
      @import "custom";
      @import "sbox";
      

      Here I adding a custom.less file and sbox.less. The custom.less is for the general theme and sbox is for customizations to the shoutbox plugin widget. These will be the last two less files imported, so they'll overwrite an other css they collide with, so long as the prior css is not marked !important

      That's how I modify my css -- for now anyway. For the html, I make backup copies of the .tpl file I want to change. So, if I want to change footer.tpl I just cp footer.tpl footer.backup and now I can mod the html without worry...and if something breaks, then I just cp footer.backup footer.tpl and all is well...

      Lastly, there is also the theme.js file located in the nodebb-theme-vanilla/lib folder. This is where the widget areas are defined for the theme. If you've noticed, the widget areas are different for vanilla and lavender. To add widget areas you have to kind of know what you're doing, but it basically works like this:

      1. Add a widget location object to the theme.js file. <-- Look at the theme.js file and you'll see what I mean.
      2. Edit the .tpl file and add the widget location html

      I suggest as an experiment try adding a sidebar widget location to the topic.tpl for the vanilla theme. It's easy because you can basically just look at lavenders theme.js and topic.tpl as a reference.

      That's pretty much it for how involved I get with it. You can go much deeper into it, but I try to keep the front end dev to a minimum because it can be very tedious...

      So, to summarize:

      1. Append your .less to the end of the theme.less file.
      2. Backup .tpl files as .backup before changing.
      3. Add widget areas as needed.

      Now when changes/updates break the theme it's really easy to migrate...

      EDIT: Also, to be clear, I am not saying this is the best way...I know it isn't, but it is an easy way and you don't have to get your hands too dirty. It's also easy to re-init after upgrades...

      Also, I had never really messed with bootstrap until I began messing with nodebb, but the variables.less file is a good reference for variables you may want to set in your custom less files.

      posted in Technical Support
      mootzville
      mootzville
    • RE: This is a relly cool projekt

      This is a really cool project BUT...

      It should just install itself and set up my server for me and think of a neat forum idea and implement it for me and go out and get users for me and rub me down with hot oils every night before bed...but it doesn't so keep it up fellas and let me know when it does...

      Oh and it has to stay FREE, but generate about $10k/month in google ad revenue for me...I might even be willing to settle for $9k/month, but it would have to provide the hot oil rubs for both morning and night in that instance and be lavender scented...

      posted in General Discussion
      mootzville
      mootzville
    • RE: Copying Vanilla Theme

      @sdnyco & @Tanner

      I had the same problem, but after looking through the code I found the solution...maybe you have as well, but I thought I'd put it up here for others.

      When you clone the nodebb-theme-vanilla folder you also have to add this line to your theme.json file:

      "templates": "templates"

      Should work fine after that. Basically, what happens is when nodebb loads it looks for that line in your theme.json file and if it doesn't find it it defaults to using the vanilla theme templates. So, even though it might be telling you your theme is loaded, it's not...kind of confusing.

      posted in Technical Support
      mootzville
      mootzville
    • RE: is it possible to configure daily email to send only if there is at least one event?

      @arasbm said:

      There have been no active topics in the past day

      I don't have an exact answer, but I can steer you in the right direction...

      src/emailer.js has this code in it:

      			Plugins.fireHook('action:email.send', {
      				to: results.email,
      				from: meta.config['email:from'] || '[email protected]',
      				subject: translated[2],
      				html: translated[0],
      				plaintext: translated[1],
      				template: template,
      				uid: uid
      			});
      

      A hacky way might be to wrap that method in an if statement like this:

      if (translated[1] !== "There have been no active topics in the past day") {
      			Plugins.fireHook('action:email.send', {
      				to: results.email,
      				from: meta.config['email:from'] || '[email protected]',
      				subject: translated[2],
      				html: translated[0],
      				plaintext: translated[1],
      				template: template,
      				uid: uid
      			});
      }
      

      THIS IS NOT AN EXACT ANSWER. I'm just throwing this out there to steer towards a solution. I have no idea what translated[1] would give you...

      Using grep helps with this type of stuff...for example from your nodebb root you can do:

      grep -r "There have been no active topics in the past day"
      

      It will search recursively through and spit out the file name and line of text wherever it finds the matched string...I use this a lot for tracing functionality through nodebb core. Really helpful if you are writing plugins and want to trace the hooks to their source...

      posted in General Discussion
      mootzville
      mootzville
    • RE: Understanding the templating engine & middleware

      Ya, so I was dumb...I have a local dev instance and a staging server. I was playing around with some things and forgot to switch the theme back to vanilla which explains why I was missing the navbar for the login screen...boo me.

      But yes, thanks for pointing that out. The template engine and middleware are making a lot more sense now after looking through the source for the last 2 days...

      I'm going to start looking to add/update the documentation here soon...some of the stuff can drive you crazy if you aren't familiar with the version changes.

      Also, after reading through most of core at this point I have to say it's an impressive piece of kit. Thumbs up to the core devs. @julian @baris @psychobunny

      EDIT: Also, anyone else who comes across this thread...if you really want to save yourself some time banging your head against the wall -- like I did -- take a few days to really dive into the nodebb source. It has been a good lesson in object-oriented javascript -- so many objects 🙂 -- done right. I've realized I'm approaching things more from a functional perspective, so this has been an eye opener for me.

      posted in General Discussion
      mootzville
      mootzville
    • RE: Copying Vanilla Theme

      No worries @sdnyco. Enjoy!

      posted in Technical Support
      mootzville
      mootzville
    • nodebb-plugin-sso-linkedin

      I made a linkedin auth plugin for nodebb. Ripped off most of @julian's code from his google auth plugin and made it work for linkedin.

      npm install nodebb-plugin-sso-linkedin

      It's OAuth 1.0 currently. I'm planning to make it work for 2.0 as well...or maybe just make a separate plugin for 2.0...we'll see.

      Enjoy and let me know if anyone runs into any issues.

      posted in NodeBB Plugins
      mootzville
      mootzville
    • Helmet - Express Middleware

      Found a nice article on a module I hadn't seen before called Helmet. It's an express middleware that makes adding content security policy to your express app pretty straightforward. Thought I'd put it up here and suggest looking into adding it to the nodebb core.

      posted in NodeBB Development
      mootzville
      mootzville
    • NodeBB Versioning System

      I am trying to fully grasp the versioning system for nodebb and have a couple questions...

      1. Do versions get bumped every time a pull request gets merged?
      2. Is there a place on github I can look for current master version?

      I'm running 0.5.0-4, but noticed after a git pull my version went to 0.5.0. Having said that, the merge didn't work properly and I ended up just resetting the branch anyway, but I wanted to find out where I could follow the versions as merges happen...

      Thanks,

      Levi

      posted in General Discussion
      mootzville
      mootzville
    • RE: error: EMFILE, too many open files

      @skulasekar Have you tried disabling your plugins and themes to ensure it is nodebb itself giving you issues?

      ./nodebb reset plugins
      ./nodebb reset themes

      posted in NodeBB Development
      mootzville
      mootzville

    Latest posts made by mootzville

    • RE: Who is using NodeBB?

      https://brokerbacon.com

      Landing page is more of a prototype than a final version -- aka needs a lot of work -- but things are progressing.

      posted in General Discussion
      mootzville
      mootzville
    • RE: Invalid CSRF token

      I figured out my issue...

      MongoDB user I was using had a readWrite role, but I guess it needs the dbAdmin role as well. When I tried creating a new user in the nodebb admin area, then it would make things go wonky without the dbAdmin role and result in invalid csrf tokens.

      posted in NodeBB Development
      mootzville
      mootzville
    • RE: Invalid CSRF token

      I'm also getting an invalid csrf error while trying to log in if anyone can help me out...

      I'm runnning 0.5.7 and reset theme and plugins, but not luck. I looked at mongodb and the sessions collection grows by about 6-9 documents each page request...weird. This is a development instance, so I'm the only one...

      Also, I was logged in on Chrome and noticed I couldn't log in on Firefox...just Chrome for some reason. So, I cleared my cache in Chrome and it started giving me errors

      posted in NodeBB Development
      mootzville
      mootzville
    • RE: December Reading List!

      @aixnr I'm currently reading 'A History of the Internet and the Digital Future' by Johnny Ryan

      Great read so far...

      posted in General Discussion
      mootzville
      mootzville
    • mongodb management service

      I was at a mongodb meetup in Dublin the other night and they did a presentation on their mongodb management service (I'm not actually sure that's what it's called). Anyway, it's awesome and worth checking out, so I figured I'd mention it: https://mms.mongodb.com/

      If you are on AWS, you will mess yourself when you see how simply you can set up a sharded cluster with replica sets.

      posted in General Discussion
      mootzville
      mootzville
    • RE: Add menu items to Lavendar.

      @Chris Depending on what you want to do you can use hooks like @a_5mith suggested. The hook you'd want to use is: filter:header.build

      What I don't like about the hook though is it just appends the new items to the end of the existing ones...I don't think you can change the order, or remove existing ones. I could be wrong though.

      -- or --

      The menu.tpl for lavender is actually being pulled in from the vanilla theme:
      nodebb-theme-vanilla/templates/partials/menu.tpl

      So, just copy the menu.tpl from vanilla to your lavender partials folder and change as needed.

      posted in General Discussion
      mootzville
      mootzville
    • RE: Understanding the templating engine & middleware

      Ya, so I was dumb...I have a local dev instance and a staging server. I was playing around with some things and forgot to switch the theme back to vanilla which explains why I was missing the navbar for the login screen...boo me.

      But yes, thanks for pointing that out. The template engine and middleware are making a lot more sense now after looking through the source for the last 2 days...

      I'm going to start looking to add/update the documentation here soon...some of the stuff can drive you crazy if you aren't familiar with the version changes.

      Also, after reading through most of core at this point I have to say it's an impressive piece of kit. Thumbs up to the core devs. @julian @baris @psychobunny

      EDIT: Also, anyone else who comes across this thread...if you really want to save yourself some time banging your head against the wall -- like I did -- take a few days to really dive into the nodebb source. It has been a good lesson in object-oriented javascript -- so many objects 🙂 -- done right. I've realized I'm approaching things more from a functional perspective, so this has been an eye opener for me.

      posted in General Discussion
      mootzville
      mootzville
    • RE: best method of programmatically adding users

      What kind of changes?

      posted in General Discussion
      mootzville
      mootzville
    • Understanding the templating engine & middleware

      Ok, this may be obvious, but I just don't see it...

      Why does the navbar (menu bar) not load on the login page?

      It looks like it's set up the same way as the other routes & templates which means header.tpl would load which in turn would also load partials/menu.tpl.

      What am I missing here?

      EDIT: Maybe it's not so obvious after all...?

      posted in General Discussion
      mootzville
      mootzville
    • RE: is it possible to configure daily email to send only if there is at least one event?

      @arasbm said:

      There have been no active topics in the past day

      I don't have an exact answer, but I can steer you in the right direction...

      src/emailer.js has this code in it:

      			Plugins.fireHook('action:email.send', {
      				to: results.email,
      				from: meta.config['email:from'] || '[email protected]',
      				subject: translated[2],
      				html: translated[0],
      				plaintext: translated[1],
      				template: template,
      				uid: uid
      			});
      

      A hacky way might be to wrap that method in an if statement like this:

      if (translated[1] !== "There have been no active topics in the past day") {
      			Plugins.fireHook('action:email.send', {
      				to: results.email,
      				from: meta.config['email:from'] || '[email protected]',
      				subject: translated[2],
      				html: translated[0],
      				plaintext: translated[1],
      				template: template,
      				uid: uid
      			});
      }
      

      THIS IS NOT AN EXACT ANSWER. I'm just throwing this out there to steer towards a solution. I have no idea what translated[1] would give you...

      Using grep helps with this type of stuff...for example from your nodebb root you can do:

      grep -r "There have been no active topics in the past day"
      

      It will search recursively through and spit out the file name and line of text wherever it finds the matched string...I use this a lot for tracing functionality through nodebb core. Really helpful if you are writing plugins and want to trace the hooks to their source...

      posted in General Discussion
      mootzville
      mootzville

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact