Skip to content

General Discussion

A place to talk about whatever you want

3.8k Topics 23.3k Posts
  • Anyway to override the tab behavior on full composer?

    Solved
    3
    0 Votes
    3 Posts
    165 Views
    PitaJP

    Put this in your Custom Javascript in the ACP:

    $(() => app.require('hooks').then((hooks) => { hooks.on('action:composer.enhanced', ({ postContainer }) => { postContainer.find('textarea.write').on('keydown', function (e) { if (e.key == 'Tab') { e.preventDefault(); var start = this.selectionStart; var end = this.selectionEnd; // set textarea value to: text before caret + tab + text after caret this.value = this.value.substring(0, start) + "\t" + this.value.substring(end); // put caret at right position again this.selectionStart = this.selectionEnd = start + 1; } }); }); }));
  • GDPR compliance for US based forums

    1
    0 Votes
    1 Posts
    169 Views
    R

    I'm trying to understand the legal implications of allowing EU residents to create accounts on a US based forum. Is it sufficient to place verbiage in the ToS that requires acceptance of data residency in the US?

    For example

    We care about data privacy and security. By using the Site, you agree to be bound by our Privacy Policy which is incorporated into these Terms of Use. Please be advised the Site is hosted in the United States. If you access the Site from any other region of the world with laws or other requirements governing personal data collection, use, or disclosure that differ from applicable laws in the United States, then through your continued use of the Site, you are transferring your data to the United States, and you agree to have your data transferred to and processed in the United States.

    Are there any other clauses that need to be clearly identified? We do state the identifiers collected when creating an account

    All data collected is solely for the purpose of providing unique indentifiers in order to allow for the creation of a user account that is then used to access our services. None of this data is shared with 3rd parties, and our own usage is restricted to informational messaging around the operation and functionality of the application. We may ask for and store the following data elements as part of our Sign Up process:

    Username (can be fully anonymous)
    A valid email address
    A valid phone number for dual factor authentication (optional)

    Any gotchas to be wary of? or any advice in general would be much appreciated.

  • Monetizing your board... how?

    8
    0 Votes
    8 Posts
    303 Views
    N

    @julian

    My assumption is more nefarious

    Yes, depending on what the code is and how unsuspecting the target forum/service owner it.
    You'd think that would be a one time payment though. "Here, put this plugin on your site, it does this little thing and we'll pay you $200/month for that". It would not be user count based which is why I was thinking they are gaining more data when more users are providing it.

    I cannot imagine how many think they are making a few bucks every month but causing massive problems on the Internet unknowingly.

    @eeeee Good of you to spot this and even share it.

  • Alternative monetization of forum

    5
    0 Votes
    5 Posts
    296 Views
    julianJ

    @NodeHam My assumption is more nefarious... I think it is to build out a botnet. At a single command all connected clients will spam a target 😬

  • Raising and lowering the reputation of users

    11
    0 Votes
    11 Posts
    687 Views
    barisB

    This will be in core in 3.3.0 https://github.com/NodeBB/NodeBB/issues/11842

  • textcomplete-item

    4
    0 Votes
    4 Posts
    229 Views
    vijay kumavatV

    Hay @baris ,

    (https://github.com/julianlam/nodebb-plugin-mentions/blob/master/static/autofill.js#L94)

    This works for me for this . Thanks

  • 0 Votes
    6 Posts
    218 Views
    phenomlabP

    @eeeee Because a 1080 pixel mobile screen does not mean 1080px wide. If you look at how responsive CSS works in Bootstrap (breakpoints) you'll see what I mean.

    @media (min-width:320px) { /* smartphones, iPhone, portrait 480x320 phones */ } @media (min-width:481px) { /* portrait e-readers (Nook/Kindle), smaller tablets @ 600 or @ 640 wide. */ } @media (min-width:641px) { /* portrait tablets, portrait iPad, landscape e-readers, landscape 800x480 or 854x480 phones */ } @media (min-width:961px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ } @media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ } @media (min-width:1281px) { /* hi-res displays */ }

    The "sweet spot" for most mobile devices sits at around 767px

  • How can I assign variable in .tpl?

    7
    0 Votes
    7 Posts
    318 Views
    G

    @PitaJ Thank you for reply.

  • Complex: having API call within widget

    16
    0 Votes
    16 Posts
    574 Views
    PitaJP

    Benchpress/templates.js has always used a single { to wrap variable substitution.

    I agree before is not commonly used, but using { is an industry standard for format strings and templates.

    Not sure what documents you read about escaping, it appears I don't actually have that documented. But to escape you should be able to add a single backslash before the opening {:

    if (something) \{ stuff() }

    But even just putting a semicolon in there should work

    if (something) { stuff(); }
  • 0 Votes
    12 Posts
    2k Views
    M

    @Nuran-Akimbek said in TypeError: Cannot read properties of undefined (reading 'split'):

    Hi, a have a same error (Cannot read properties of undefined (reading 'split')) on my forum. Please, write final solution have you solve it

    I solved it by doing a

    ./nodebb restart
  • 0 Votes
    6 Posts
    299 Views
    G

    @josef I got it, thanks.

  • startup nodebb after server reboot

    Solved
    7
    0 Votes
    7 Posts
    320 Views
    julianJ

    @陈洁 wow, that is definitely a power user setup!

    One thing I have struggled with is proper logging with systemd. At some point it seemed to stop emitting logs properly, and I could only either have logs sent to the journal for viewing with journalctl, or output to the regular log file at logs/output.log, not both. 🤷

    Regardless, @josef I'm glad you got it working 😄

  • Where to store persistent widget variable?

    2
    0 Votes
    2 Posts
    166 Views
    barisB

    For a counter like that you would need to create a custom widget that stores the counter in the database and increase it by 1 on the server side as well whenever the user renders it or performs whatever the action is. You can make custom socket.io events or create a new API route.

    Incrementing the value in the database is a simple db call like await db.incrObjectField('myCustomWidget', 'counter');

  • Change in "reply to xxxx" text

    9
    0 Votes
    9 Posts
    470 Views
    barisB

    Did you set the username field of all users to an email in the database? If that's the case and the old username isn't stored anywhere you can't bring it back. If you are just using a hook to set username to email then you can disable that code and username should go back to normal.

    The displayname property is calculated from user.fullname and user.username based on the user setting show my fullname and if they have entered a fullname in their edit profile page.

  • Gap in categories

    5
    0 Votes
    5 Posts
    202 Views
    D

    Yeah, all the same 🙂 Have just resized them though and all seems ok now. Thanks all.

  • 0 Votes
    11 Posts
    577 Views
    julianJ

    @eeeee Cool! We both learned something new today.

  • Nodebb API development history

    10
    0 Votes
    10 Posts
    510 Views
    julianJ

    @eeeee re: auto upgrade button

    We don't implement this because of the customizable nature of NodeBB. It is possible that if someone had a lot of plugins and they upgraded to a version that was incompatible, NodeBB might go down and not come back up.

    So it'd be like a "shoot yourself in the foot" button 😆

  • New admin panel

    5
    4 Votes
    5 Posts
    347 Views
    julianJ

    Hey, you guys were supposed to be teased about this coming up, but then I got busy and didn't finish writing the post...

    Then @baris finished the refresh 😆

  • Custom javascript, why is it not running?

    10
    0 Votes
    10 Posts
    413 Views
    julianJ

    @phenomlab Doesn't hurt.

    If you execute .ready() and the page is already ready, then it will just fire the callback immediately.

  • 0 Votes
    8 Posts
    368 Views
    vijay kumavatV

    I am trying to add this code in custom plugin file => library.js file

    For every reply should add reputation point in Topic author.

    'use strict'; var Topics = require.main.require('./src/topics'); var User = require.main.require('./src/user'); var meta = require.main.require('./src/meta'); var reputationPoints = 1; // Number of reputation points to award per reply var plugin = {}; plugin.postReply = async function (payload) { var tid = payload.topic.tid; var topic = await Topics.getTopicFields(tid, ['uid']); await User.incrementUserReputationBy(topic.uid, reputationPoints); // Increase reputation points by the specified amount }; module.exports = plugin;

    But no luck.. 😞