Skip to content
  • 2 Votes
    1 Posts
    413 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', { ... ... ... }) }
  • 0 Votes
    1 Posts
    401 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.

  • 0 Votes
    4 Posts
    868 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
    420 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
    676 Views
    PitaJP

    Please report this issue on Github.

  • 0 Votes
    2 Posts
    373 Views
    barisB

    req.params.tag will give you the parameter.

  • 0 Votes
    3 Posts
    547 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.

    a0d73f88-e0f2-4fa5-a298-1e2f5fcf273b-image.png

    f19252e0-cda1-40e0-91d5-5e38802d9907-image.png

  • 0 Votes
    3 Posts
    724 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

  • 0 Votes
    2 Posts
    488 Views
    julianJ

    @pasib when you concatenated the object, it got stringified.

    Try console.log('test', postData); πŸ™‚

  • 0 Votes
    14 Posts
    1k 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
    392 Views
    S

    I don't believe that there is one. I think that you'd need to write your own to have this functionality.

  • 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
    382 Views
    julianJ

    The first plugin is the one written by @psychobunny, and is actively maintained. The others are forks.

  • 0 Votes
    1 Posts
    374 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
    747 Views
    Varun Ganesh DV

    @yariplus ok let me try

  • 0 Votes
    1 Posts
    247 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?😒 😰

  • 0 Votes
    19 Posts
    2k Views
    F

    @julian ok, I was thinking that the nbbpm was here for that!
    Thank you for your answer!

  • 1 Votes
    8 Posts
    869 Views
    barisB

    You can find the source here https://community.nodebb.org/post/64258

  • 0 Votes
    1 Posts
    244 Views
    G

    i need get the fields of an authorized user

  • write widget

    Plugin Development
    9
    0 Votes
    9 Posts
    769 Views
    G

    @baris i love u