Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. stickmanray
    S
    • Profile
    • Following 1
    • Followers 0
    • Topics 4
    • Posts 8
    • Best 2
    • Groups 0

    stickmanray

    @stickmanray

    2
    Reputation
    316
    Profile views
    8
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    stickmanray Follow

    Best posts made by stickmanray

    • RE: Returning Connected MongoClient to Plugin: SOLVED

      So I ended up answering my own question:

      If you would like to tap into your db object from within a plugin and use mongoDB's native functions, 'db.client' will provide them.

      Example:

              var db = module.parent.require('./database');
      	
      	function getResult(req, res, next, callback){
      		 var data = db.client.collection('objects').find({cid: "1"}).toArray()//Query whatever
          		.then(function(data) {//Pass the promise through a callback
           			console.log(data.length); // Use this to debug
            			callback(req, res, data, next)//Send data to your render function or where ever
         			})
      	}
      

      Hope this saves someone else some time if they're trying to achieve the same thing!

      posted in General Discussion
      S
      stickmanray
    • How do I change the GDPR consent text on new registration?

      This is likely a very obvious answer but, I would like to tweak the wording of the GDPR consent that pops up when a user registers for the forum for two reasons:

      1. I would like to add some additional information that is specific
      2. The bottom paragraph where users have to check consent boxes, I have sentence that is cut off -> ' Unless explicitly changed in your user settings, this community delivers email digests every .'

      Is this text being pulled from the database? If so, against what key? If not I'm assuming it's hardcoded into some template/template partial/configFileName.json. I've been unable to find it thus far.

      Thanks for any insight! I appreciate it.

      posted in General Discussion
      S
      stickmanray

    Latest posts made by stickmanray

    • How do I change the GDPR consent text on new registration?

      This is likely a very obvious answer but, I would like to tweak the wording of the GDPR consent that pops up when a user registers for the forum for two reasons:

      1. I would like to add some additional information that is specific
      2. The bottom paragraph where users have to check consent boxes, I have sentence that is cut off -> ' Unless explicitly changed in your user settings, this community delivers email digests every .'

      Is this text being pulled from the database? If so, against what key? If not I'm assuming it's hardcoded into some template/template partial/configFileName.json. I've been unable to find it thus far.

      Thanks for any insight! I appreciate it.

      posted in General Discussion
      S
      stickmanray
    • RE: No way to add tags when composer loads through route

      Annnnd I just realized I can probably just make an ajax call to the /api/tags/tagName route and get all the information I need. 👍

      posted in Technical Support
      S
      stickmanray
    • RE: No way to add tags when composer loads through route

      If you do remove it, replacing it with some method to easily allow users to post to a specific category from a button located on a custom route / custom page would be great though - I'm sure there's already a way I'm not familiar with.

      It's working well for me at the moment with the exception of being able to add tags 🙂

      That being said; where are tags stored in the DB? I'm not seeing them on the posts and haven't seen a '_key: "tag:<tagname>"' thus far; any suggestions? I want to be able to sort posts by tag from within a custom view - I'm pretty sure there's already a way to do this I'm just now sure how.

      Thanks for your prompt response(s)!

      posted in Technical Support
      S
      stickmanray
    • RE: Is there a post-approval plugin? [SOLVED - more or less]

      Thanks for all the help guys;

      I was able to look through your plugin to get some insight on how to create a solution for my purposes - appreciate it!

      P.S. - I need some rep so I don't have to wait 300 seconds to post haha! I just posted a potential composer bug in the tech support forum 30 seconds before I saw this 0.o

      posted in General Discussion
      S
      stickmanray
    • No way to add tags when composer loads through route

      Hello nodebb devs!

      I'm not sure if this is a bug but for some reason I'm not able to add tags to posts underneath the compositon box when I reach my composer through the '/compose?' route which is an option offered which helps allow users to compose topics from other locations.

      A patch on this would be fantastic! 😉

      If not, how should I enable it if I'm being silly and missing something obvious?

      Thanks for any help anyone may be able to provide!

      posted in Technical Support
      S
      stickmanray
    • Is there a post-approval plugin? [SOLVED - more or less]

      I was wondering if anyone has built or is building a plugin that puts posts under 'x' category into a queue where admins must approve them before they show up?

      This would be, for example; for a category where the community could share tutorials but they would need to be looked over before posted live.

      If there isn't a plugin for this, any pseudo code or idea of how to start working on this would also be appreciated as I will start myself.

      Thanks!

      posted in General Discussion
      S
      stickmanray
    • RE: Returning Connected MongoClient to Plugin: SOLVED

      So I ended up answering my own question:

      If you would like to tap into your db object from within a plugin and use mongoDB's native functions, 'db.client' will provide them.

      Example:

              var db = module.parent.require('./database');
      	
      	function getResult(req, res, next, callback){
      		 var data = db.client.collection('objects').find({cid: "1"}).toArray()//Query whatever
          		.then(function(data) {//Pass the promise through a callback
           			console.log(data.length); // Use this to debug
            			callback(req, res, data, next)//Send data to your render function or where ever
         			})
      	}
      

      Hope this saves someone else some time if they're trying to achieve the same thing!

      posted in General Discussion
      S
      stickmanray
    • Returning Connected MongoClient to Plugin: SOLVED

      EDIT: SOLVED - SEE BELOW REPLY

      I've been searching for a few days and managed to hack together an implementation; but it's not correct.

      I would like to have access to my connected MongoClient in my plugin so I can access the database via the 'db.client.collection('colName').find({})' functionality; and other similar functionality through the MongoDB docs.

      I understand that I can use the db.getObject and such from the database layer (./src/database) but I want to write some custom methods that are based off of lower level calls to the db.

      Currently, my hacked-together plugin just creates a new connection and then closes it which is absolutely horrible for performance.

      I want to tap into the connection that's already present upon app startup and simply have access to the db object that will give me access to my 'nodebb' database.

      Any help with this would be greatly appreciated; thanks.

      posted in General Discussion
      S
      stickmanray