Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. danlong
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 24
    • Best 2
    • Groups 0

    danlong

    @danlong

    5
    Reputation
    41
    Profile views
    24
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    danlong Follow

    Best posts made by danlong

    • RE: Who is using NodeBB?

      The Bleeding Edge forum uses NodeBB - https://www.bleedingedge.com/forums

      posted in General Discussion
      D
      danlong
    • RE: More group badges

      @baris Yes, thanks.

      I had to include this line, the function is in there:

      var groups = require.main.require('./src/groups');

      posted in Plugin Development
      D
      danlong

    Latest posts made by danlong

    • RE: Setting the language - server-side / client-side

      @PitaJ I think I have a very edge-case scenario, I've found a solution for guests and logged in users.

      Thanks for your help and point in the right direction!

      posted in Technical Support
      D
      danlong
    • RE: Setting the language - server-side / client-side

      @PitaJ OK, I'll check it again - it seems to change the timedate for guests, nothing else gets translated. It's only logged-in users which seem to be effected by the config.userLang

      Passing the ?lang= for a guest doesn't seem to work either

      posted in Technical Support
      D
      danlong
    • RE: Setting the language - server-side / client-side

      @PitaJ Does config.userLang set the language for guests? Or is that a different property?

      posted in Technical Support
      D
      danlong
    • RE: Setting the language - server-side / client-side

      @PitaJ Perfect, thank you. That's done the trick 🙂

      posted in Technical Support
      D
      danlong
    • Setting the language - server-side / client-side

      Is there a way to set the NodeBB language in either the server or client js?

      I have a cookie that contains the language code I want to set the forum to.

      Is there a hook I can use on the server-side to set the language, or equally something on the client side I can use to change the locale?

      Is there a way I can hook into the User's 'language' selector options to roll my own solution?

      Note: passing ?lang=[LANGAUGE] in the URL isn't an option
      Note: Using the User settings isn't an option as I need to set the language before this point, from a Cookie

      Is there a way to read cookies in the middleware.autoLocale function? (src/middleware/headers.js) req.cookies = {} at this point.
      However, inside the function translate(str, req, res, next) { req.cookies is a full object as I expect (src/middleware/render.js)

      Thanks!

      posted in Technical Support
      D
      danlong
    • RE: Who is using NodeBB?

      The Bleeding Edge forum uses NodeBB - https://www.bleedingedge.com/forums

      posted in General Discussion
      D
      danlong
    • RE: 'Popular' date filter

      I re-wrote the category controller (src > controllers > category.js) to handle passing ?term=x query through and only getting the relevant topics.

      posted in Technical Support
      D
      danlong
    • 'Popular' date filter

      Is there a way to be able to filter topics on a category page by:

      • day
      • week
      • month

      The functionality that exists on the 'popular' page in NodeBB has the functionality I need, but adding ?term=daily into the URL doesn't update the category page listings.

      posted in Technical Support
      D
      danlong
    • RE: Database queries - topics

      Thanks @baris, the latter approach works so I'll go with that 🙂

      posted in Technical Support
      D
      danlong
    • Database queries - topics

      I've added a couple of hooks which add a new node on to topic data, which is either true or false depending on other some logic I've written.

      {
          "hook": "filter:topic.create",
          "method": "createTopic"
      },
      {
          "hook": "filter:topic.edit",
          "method": "editTopic"
      }
      

      When topics are loaded onto a category page, I want to return only those which have the new node === true

      In src > categories > topics.js, there's a function Categories.buildTopicsSortedSet. In it, topics can be ordered by 'most_posts' like so set = 'cid:' + cid + ':tids:posts'

      Is there a way that I can manipulate this to look for my new node condition? (I need to be able to fetch these topics at this point in the query because of pagination. If I fetch 5 topics at a time and filter them after this point, I could end up with 0 matched topics. I always want to fetch the maximum number of matching topics).

      --

      Edit: I should also mention I'm using a Postgres DB

      posted in Technical Support
      D
      danlong