The Bleeding Edge forum uses NodeBB - https://www.bleedingedge.com/forums
Best posts made by danlong
-
RE: Who is using NodeBB?
-
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');
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!
-
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 -
RE: Setting the language - server-side / client-side
@PitaJ Does config.userLang set the language for guests? Or is that a different property?
-
RE: Setting the language - server-side / client-side
@PitaJ Perfect, thank you. That's done the trick
-
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 CookieIs there a way to read cookies in the
middleware.autoLocale
function? (src/middleware/headers.js) req.cookies = {} at this point.
However, inside thefunction translate(str, req, res, next) {
req.cookies is a full object as I expect (src/middleware/render.js)Thanks!
-
RE: Who is using NodeBB?
The Bleeding Edge forum uses NodeBB - https://www.bleedingedge.com/forums
-
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. -
'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. -
RE: Database queries - topics
Thanks @baris, the latter approach works so I'll go with that
-
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 functionCategories.buildTopicsSortedSet
. In it, topics can be ordered by 'most_posts' like soset = '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