Skip to content
  • 0 Votes
    3 Posts
    1k Views
    G
    @mana Thank you
  • Hide category from feeds

    Unsolved Plugin Development
    1
    0 Votes
    1 Posts
    417 Views
    magnusvhendinM
    Is there some way to hide all topics within a category from all feeds (recent, popular, new, the digest)? I need the topics to be accessible (and usable) to all users directly, but not searchable or showing up at random.
  • 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 ...
  • How to use Third-Party libraries?

    Solved Plugin Development
    1
    2 Votes
    1 Posts
    547 Views
    dogsD
    Whats the right way to use third party libraries? I tried to do it descriped in the docs: https://docs.nodebb.org/development/plugins/libraries/ But it doenst work. I want to use Swiper in my Theme: https://swiperjs.com/get-started/ I tried it with "modules": { "swiper.js": "node_modules/swiper/swiper-bundle.min.js" } in client.js i used: require(['swiper'], function (Swiper) { var mySwiper = new Swiper('.swiper-container', { // Optional parameters direction: 'vertical', loop: true, // If we need pagination pagination: { el: '.swiper-pagination', }, // Navigation arrows navigation: { nextEl: '.swiper-button-next', prevEl: '.swiper-button-prev', }, // And if we need scrollbar scrollbar: { el: '.swiper-scrollbar', }, }) }); The Javascript from Swiper does not load. Can you help me? I also treid to import it directly via html <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css"> <script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script> and I also copied the contents of: https://unpkg.com/[email protected]/swiper-bundle.js and createt a file unter /lib/swiper-bundle.min.js. Nothing worked for me. The JS is still not loading... Looking forward to your answers! I fixed it. I am sorry. In my development I use grunt. But it seems that I doesnt load new libraries if installen. So I determinated the process Ctrl+C and restarted it using grunt. The librariers are loaded and the third party library works well now using: "modules": { "swiper.js": "node_modules/swiper/swiper-bundle.min.js" } require(['swiper'], function (Swiper) { var mySwiper = new Swiper('.swiper-container', { ... ... ... }) }
  • 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.
  • Use Websockets in own Plugin

    Solved Plugin Development
    4
    0 Votes
    4 Posts
    1k Views
    dogsD
    I still have a question. Everything works fine at the moment. Send data from the client to the server isn't a problem now. But how can I emit a event to all connected clients serverside? Something e.g myPlugin.emit('plugins.publishMessage', {data: "Some data"}, function(err, result) { console.log(result); }); After one hour spending searching different topics and some code I found the solution. Besides the custom clientside Sockets const myPluginSockets = require.main.require('./src/socket.io/plugins'); you have to define the Server Sockets too const myPluginSockets = require.main.require('./src/socket.io/plugins'); const serverSockets = require.main.require('./src/socket.io'); Now you can emit events from server side to the clients: serverSockets.server.sockets.emit('messageReceive', data); to receive the event clientside, you can use following in ur main.js file: socket.on('messageReceive', function(data){ console.log(data); }); Client console output: {msg: "my message"} Maybe I'll write a little Tutorial on this because I am probably not the only one who does not understand it so easily.
  • 0 Votes
    2 Posts
    551 Views
    julianJ
    Hi @avan-sardar, welcome! find a topic based on uid and a custom session ID Is this a requirement? If your plugin is listening for something like action:post.save, then you can process the stripe payment. The action hook itself also sends the post data, which contains the pid and tid. Without more context, I am afraid I will not be able to help further.
  • Send invite without a user

    Unsolved Plugin Development
    4
    0 Votes
    4 Posts
    867 Views
    PitaJP
    Please report this issue on Github.
  • How to deal with placeholder in URL?

    Solved Plugin Development
    2
    0 Votes
    2 Posts
    455 Views
    barisB
    req.params.tag will give you the parameter.
  • Knowledgebase plugin: Script error

    NodeBB Plugins
    3
    0 Votes
    3 Posts
    732 Views
    jrlinuxJ
    @julian not directly after enabling. I have now tried ./nodebb build. Still returns script error in Google Chrome I think I installed the plugin correctly. [image: 2OAVeMK.png] [image: bwTBjuL.png]
  • 0 Votes
    3 Posts
    876 Views
    dogsD
    @PitaJ I want to display it on a existing page e.g on users profile page. What do I have to to, to add it to an existing route? E.g /user/pasib Could you give me some links, or a little example how I cant add a simple backend variable to the frontend. Thank you
  • How to work with the postData-Object?

    Solved NodeBB Development
    2
    0 Votes
    2 Posts
    650 Views
    julianJ
    @pasib when you concatenated the object, it got stringified. Try console.log('test', postData);
  • 0 Votes
    14 Posts
    2k Views
    barisB
    @Onur-Baran Should be not much left on 1.15.0 milestone. https://github.com/NodeBB/NodeBB/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.15.0
  • 0 Votes
    3 Posts
    505 Views
    S
    I don't believe that there is one. I think that you'd need to write your own to have this functionality.
  • Rebuilding after plugin installation

    NodeBB Plugins
    7
    0 Votes
    7 Posts
    1k Views
    C
    @PitaJ said in Rebuilding after plugin installation: This is expected behavior. After installing and activating a plugin, you are supposed to Rebuild & Restart. There's a special button in the ACP to perform this. Then there is no problem. Thank you for your answers.
  • 0 Votes
    2 Posts
    469 Views
    julianJ
    The first plugin is the one written by @psychobunny, and is actively maintained. The others are forks.
  • 0 Votes
    1 Posts
    471 Views
    Varun Ganesh DV
    I'm using Newsletter plugin. But it shows forum title at the beginning of subject How to remove it? @administrators
  • 0 Votes
    5 Posts
    1k Views
    Varun Ganesh DV
    @yariplus ok let me try
  • How to use Netease cloud Music plug-in?

    Plugin Requests
    1
    0 Votes
    1 Posts
    333 Views
    biezhiB
    nodebb-plugin-cloudmusic A plugin about using netease cloudmusic(using ). I can't find a way to use it. What's the format?
  • Private forum plugin

    NodeBB Development
    19
    0 Votes
    19 Posts
    2k Views
    F
    @julian ok, I was thinking that the nbbpm was here for that! Thank you for your answer!