Skip to content
  • 0 Votes
    5 Posts
    1k Views
    dogsD
    @pitaj Nice that was easy! Thank you
  • 0 Votes
    18 Posts
    3k Views
    <baris>B
    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
    2k 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
    1k 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
    963 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
    861 Views
    <baris>B
    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
    2k 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
    534 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
    3 Posts
    958 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
    700 Views
    julianJ
    @pasib when you concatenated the object, it got stringified. Try console.log('test', postData);
  • 1 Votes
    11 Posts
    2k Views
    S
    @PitaJ said in Any tips for installing NodeBB on AWS Lightsail?: As long as Lightsail doesn't limit the capabilities of their VPS, I don't see why it would be any different from a normal install on Ubuntu. yeah, it's identical. LightSail ends up being exactly like a DO or Vultr.
  • 0 Votes
    5 Posts
    2k Views
    F
    Problem solved, for the record I have added all file on my GitHub: https://github.com/LM1LC3N7/Dockerfiles/blob/master/nodebb/README.md
  • 0 Votes
    4 Posts
    1k Views
    dogsD
    @Witzker Webserver in this case means PHP / MYSQL / Apache 2 You would need node.js based Web-Environment
  • Nodebb How do I setup from scratch?

    Technical Support
    5
    0 Votes
    5 Posts
    913 Views
    PitaJP
    https://docs.nodebb.org/installing/os/ for installation instructions.
  • 12 Votes
    9 Posts
    2k Views
    dogsD
    Nice
  • Plugin usage metrics

    NodeBB Development
    3
    5 Votes
    3 Posts
    837 Views
    gotwfG
    Awesome. Thanks bunches for this.
  • 9 Votes
    4 Posts
    1k Views
    S
    Three sites updated thus far, no issues.