Skip to content
  • What is NodeBB for ChatGPT

    General Discussion
    4
    2 Votes
    4 Posts
    873 Views
    crazycellsC
    @omega well, there are rules to follow... [image: gizmo-gremlins.gif]
  • NTFY: NodeBB

    Technical Support
    24
    0 Votes
    24 Posts
    3k Views
    phenomlabP
    @julian Confirmed working - thanks.
  • 0 Votes
    2 Posts
    373 Views
    julianJ
    MongoDB is the recommended data store. For development I use redis because it is just easier for me to use (e.g. zrange sortedSet 0 -1 vs db.objects.find({ _key: "sortedSet" }).pretty();) All three are supported by the NodeBB team
  • 1 Votes
    11 Posts
    1k Views
    phenomlabP
    @julian said in is nodebb the right choice ? why the community is not vary "active "? installed nodebb and finds it vary enjoyable so far, where is everyone?: I will say this, however... I refuse to believe that humanity will stoop to the lowest common denominator. Yes, maybe we'll go through phases where we just send memes to one another, but we will always rise above and return to a medium where long-form content is shared and appreciated. We will always need long-form journalism, and yes, even forum software for in-depth discussion. This is a great point. Long-form responses that actually explain something add far more weight and value in my view. I'm no fan of the tldr brigade, and it's just being lazy. Yes, I appreciate that (in the case of my forum which offers solutions) people are keen to get to the bottom line, but if you don't read the thread in it's entirety, what did you learn exactly ? The answer? Nothing - you just got the answer which you won't remember when the same issue occurs in the future
  • 3.0.0 Bug Report Thread

    Bug Reports
    414
    2 Votes
    414 Posts
    328k Views
    barisB
    @brazzerstop https://github.com/NodeBB/NodeBB/issues/11902
  • NodeBB logs to journalctl?

    Solved Technical Support
    5
    0 Votes
    5 Posts
    721 Views
    julianJ
    Hooray! Thanks for coming back and confirming the new file works for you
  • 1 Votes
    2 Posts
    808 Views
    omegaO
    Cool and for context a link to the upgrade doc section - https://docs.nodebb.org/configuring/upgrade/
  • 1 Votes
    20 Posts
    5k Views
    PitaJP
    @fevzikorkutata I don't understand what you're saying. That fix is in 1.17.0 so you shouldn't have run into that issue if you went straight from 1.0.3 to 1.17.0 as I recommended.
  • Apache2 Reverse-Proxy for NodeBB - Snippet

    Tutorials
    3
    2 Votes
    3 Posts
    963 Views
    dogsD
    @gotwf I'm not sure it's been weeks ago I wrote this. Maybe I did not find this or something didn't work for me. I can't tell you... Greets
  • 0 Votes
    1 Posts
    677 Views
    dogsD
    This is just a little snippet. This is about the question How can I add custom data to a post? a small tutorial How to add custom data permanently to a post It will be saved into the object: You need the following hook: { "hook": "filter:post.create", "method": "postCreate" } This hook is fired, when a Post is created. So it contains RAW Data. A filter:hook like "hook": "filter:post.create" can be edited before beeing proceeded. plugin.postCreate = function(data, callback){ // Edit data here callback(null, data); } You can access all Data you can work with via the data object. All those filter-hooks needs callbacks. The callback contains the modified / added / removed data. Whats inside the data object? The data object contains two main objects. this.post this.data post: { pid: 259, uid: 2, tid: 111, content: '### This is just a little snippet.', timestamp: 1617150411838 }, data: { uuid: '7277s31-6d23-43sa-1284-ad27e42yx879', title: 'How to add custom data to post serverside - in a nutshell', content: '### This is just a little snippet.', thumb: '', cid: '2', tags: [], uid: 2, req: { [...] }, timestamp: 1617150411838, fromQueue: false, tid: 111, ip: '111.123.2123.21', isMain: true } } With all the data you can work with. But only this.post is directly effected (lol) to the post Object. If you add data here. It will be attached to the post forever and you can access it any time. Even after plugin disable. So now add custom data: plugin.postCreate = function(data, callback){ // adds data **PERMANENT** to post // before any other procession -> RAW DATA (markdown) //data.post.myData = "directly effected to post you can work with it in next step"; //data.data.myData = "other data for other things I don't know"; var myData = {}; myData.name = "Schmock"; myData.signature = "raz0rn"; // Stick myData to post object data.post.myData = myData; // Debug? // console.log("POST CREATE", data); // finish the process() - passes on modified data callback(null, data); } So myData has added to post: post: { pid: 259, uid: 2, tid: 111, content: '### This is just a little snippet.', timestamp: 1617150411838, myData: { name = "Schmock", signature = "raz0rn", } } The data is stored. Everybody is happy. [image: tenor.gif] How to add dynamic data before render a post in template It wont be saved to the object. You can use this for dynamic things or logic before rendering the page.: You need the following hook: { "hook": "filter:topics.addPostData", "method": "addPostData" } This hook is fired before engine renders the template. It also needs a callback because its a filter-hook. plugin.addPostData = function(data, callback){ // modify data temporarily before it gets passed on to next step callback(null, data); } Same thing as above. Only the hook is different. And the data we are changing is temporarily. Data contains all data we can use for the dynamicness lol: . plugin.addPostData = function(data, callback){ // You can work with pre-parsed and already saved data .... // or put in something very flexible without saving to db like jquery-like dynamic etc etc // Debug? // console.log("addPostData?", data) var _posts = data.posts; _posts.forEach(function(post){ if(post.myData){ // add data to post if "myData" is there post.content = "THIS POST HAS MY OWN DATA -> CONTENT IS OVERWRITTEN"; } // this here affects all posts post.user.signature = "Ihr seid alle Schmocks!"; }); // Overwrite data and pass modified data on to the template engine data.posts = _posts; callback(null, data); } Now you can work with posts like a boss. [image: 1617153057423-bildschirmfoto-2021-03-31-um-03.10.32.png] [image: tenor.gif] Thanks and bye Important Note: Remind, that myData is available via API. https://nodebb.development.fail/api/topic/114/new-post returns your added data "content": "THIS POST AS MY OWN DATA -> CONTENT IS OVERWRITTEN", "myData": { "name": "Schmock", "signature": "raz0rn" }
  • 0 Votes
    5 Posts
    1k Views
    dogsD
    @pitaj Nice that was easy! Thank you
  • 0 Votes
    18 Posts
    3k Views
    barisB
    Yes you can use them inside the AMD module but keep in mind once you add an event listener on the window object it will be called everytime there is an action:ajaxify.end. If you don't want it triggered after you leave that page you need to turn it off with $(window).off('eventName', myMethod)
  • 0 Votes
    11 Posts
    1k Views
    Keng HerK
    @dogs Not sure if this is still relevant to you, but I followed your code and was getting the same results. The code wasn't firing despite having a console log in the theme.js file. Then I decided to click on the 'Clone widgets from...' and selected 'Categories'. After that all of the .tpl names showed up in the drop down. After that any changes to the theme.js file are firing as should. Make sure you build and restart. I am using the included GRUNT to make development faster. Cheers!
  • 2 Votes
    3 Posts
    956 Views
    dogsD
    @aleksei I read your topic: https://community.nodebb.org/topic/15252/execute-custom-js-on-infinite-scroll and saw you're dealing with C4D-Files.
  • 1 Votes
    3 Posts
    884 Views
    dogsD
    @pitaj Thank you so much! That worked.
  • 6 Votes
    3 Posts
    1k Views
    manolinoM
    @kadmy , sure: upload the file controls.png from the plugin folder \node_modules\bxslider\dist into NodeBB assets. The file looks like the bitmap below. [image: 1611963514006-controls.png] Then change the LESS to .my-wrapper { box-shadow: none; border: none; .bx-prev { background: url(/assets/uploads/controls.png) no-repeat 0px -32px; } .bx-next { background: url(/assets/uploads/controls.png) no-repeat -43px -32px; } } This file contains the standard bxSlider. But you can use any other icon. Just upload it or point to the url of your preference. Please update to v0.1.2 for more fixes.
  • 0 Votes
    2 Posts
    693 Views
    barisB
    https://github.com/NodeBB/NodeBB/issues/9204
  • 0 Votes
    5 Posts
    1k Views
    dogsD
    @baris Thank you very much. This worked! €: I additionally use the hook $(window).on('action:ajaxify.start', function (ev, data) { $('div.topic-header-image').hide(); }); so that the header container with the image is hiding immediatly and before ajaxify.end
  • 0 Votes
    7 Posts
    1k Views
    dogsD
    @pitaj Many thanks for your effort Okay so I just npm link'ed my plugin again so I thought some file will be updated. But they weren't. Here is my full source code of libary.js: 'use strict'; /* NodeBB Basic Plugin Libraries */ const controllers = require('./lib/controllers'); const plugin = {}; /* Third Party Libraries */ const Discord = require("discord.js"); const fs = require("fs"); // Nodebb Discord Bot const config = JSON.parse(fs.readFileSync("./utils/config.json", "utf-8")); var client = new Discord.Client(); let debug = true; plugin.init = function (params, callback, client) { myDebug("nodebb-discord-bot-started"); callback(); }; function myDebug(msg){ if(debug){ console.log(msg); } } module.exports = plugin; 2021-01-12T10:46:19.318Z [4567/4689] - error: Error: ENOENT: no such file or directory, open './utils/config.json' at Object.openSync (fs.js:462:3) at Object.readFileSync (fs.js:364:35) at Object.<anonymous> (/home/ubuntu/nodebb-linked-modules/nodebb-plugin-makesmart-discord-bot/library.js:15:30) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.Plugins.requireLibrary (/home/ubuntu/nodebb/src/plugins/index.js:70:39) I tried it with path again: // Nodebb Discord Bot var configpath = path.join(__dirname, 'utils', 'config.json'); const config = JSON.parse(fs.readFileSync(configpath, "utf-8")); var client = new Discord.Client(); an suddenly ... it worked! o.O 2021-01-12T10:51:15.711Z [4567/4765] - info: [api] Adding 2 route(s) to `api/v3/plugins` 2021-01-12T10:51:15.889Z [4567/4765] - info: Routes added 2021-01-12T10:51:15.933Z [4567/4765] - info: NodeBB Ready 2021-01-12T10:51:15.943Z [4567/4765] - info: Enabling 'trust proxy' 2021-01-12T10:51:15.972Z [4567/4765] - info: NodeBB is now listening on: 0.0.0.0:4567 I think it was really because I ran npm link again. Funny.* I'm sorry. Most of the time, the problem is in front of the computer. But still a strange behavior in my opinion. Well ... Good to know for the future. @PitaJ as mentioned thank you for you effort. For any others having the same issue: Read the Stackoverflow Solution posted by @PitaJ right here If it still not work use npm link in ./nodebb again to refresh something in the plugin folder ...I dont know tbh ...
  • Write-API post as a Guest?

    NodeBB Plugins
    1
    0 Votes
    1 Posts
    487 Views
    dogsD
    Hey! Is it possible to post as Guest via the write API? I tried to reply to a topic via: const bodyParameters = { _uid: 0, content: "It works!" }; But it does not work. Is it possible to post as a Guest and set a username with the request or is it only possible to use the write api with a existing uid? Looking forward to your answers.