Skip to content

custom plugin - increment in reputations

General
4 2 1.4k 1
  • Hi

    I am trying to create plugin for after each reply increment in in the reputation point of topic Author.

    I tried something in library.js file. (Two more files i have created package.json and plugin.js)

    Could you please help me to correct out.

    '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;
    
    
  • Hi

    I am trying to create plugin for after each reply increment in in the reputation point of topic Author.

    I tried something in library.js file. (Two more files i have created package.json and plugin.js)

    Could you please help me to correct out.

    '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;
    
    

    @Vijay-Kumavat-0 are you attempting to modify or extend nodebb-plugin-rewards-essential?

  • Yes, I saw this plugin,

    But i tried to create new rather than customize nodebb-plugin-rewards-essential. Because it is bit confusing me.

    Am i on the right track?

  • Yes, I saw this plugin,

    But i tried to create new rather than customize nodebb-plugin-rewards-essential. Because it is bit confusing me.

    Am i on the right track?

    @Vijay-Kumavat-0 I think you’d be better off customising the plugin above to be honest. It seems like you’d be reinventing the wheel otherwise.

    I’d modify

    /nodebb/node_modules/nodebb-rewards-essentials/lib/conditions.js
    /nodebb/node_modules/nodebb-rewards-essentials/lib/rewards.js

    These seem to be the two files that control what is in the dropdown lists.


Related Topics
  • Cloud Storage

    General zeitkapsl europe cloud proton storage
    2
    0 Votes
    2 Posts
    49 Views
    For EU-based, end-to-end encrypted cloud storage, here are the strongest options beyond what you’re already using: Tresorit (Switzerland) : Probably the gold standard for E2EE. Zero-knowledge, Swiss/EU data residency, excellent for both file sync and secure sharing. More expensive than competitors but very polished and audited. Filen (Germany) : Zero-knowledge E2EE by default, generous free tier (10GB), very competitive pricing on paid plans, and lifetime plans available. Open-source clients. Popular on the privacy subreddits as a Proton Drive alternative. Internxt (Spain) : Open-source, zero-knowledge E2EE, GDPR-based. Offers storage plus a few extra privacy tools. Lifetime plans available. Younger company, so weigh that against the price. pCloud (Switzerland, registered in EU) : Massive caveat: E2EE is not default. It’s a paid add-on called “pCloud Crypto.” Without it your files are encrypted at rest but not zero-knowledge. The draw is genuine lifetime plans, which can be cost-effective over years if you trust their longevity.
  • 3 Votes
    7 Posts
    2k Views
    @phenomlab I will have to test this out in my virtual environment. I have an Arch KDE Plasma install in virtualbox that I am testing a bunch of things out before I actually wipe the hard drive and install linux. I am currently in the process of copying my Arch test web server over to virtualbox on linux to make sure that it works. This is the virtual server that I test updates on before updating the production server. I can’t remember the error I was getting but I think it had to do with the network device. That was on the virtualbox side. So the cloud storage will be the next thing that I test.
  • Windows 10 End of Life

    General windows linux arch end of life
    10
    2 Votes
    10 Posts
    2k Views
    @phenomlab this looks very nice as well. It is nice that they keep the KDE Neon a rolling release so you will get those updated apps even though Ubuntu isn’t a rolling release. Is it a rolling distro? KDE neon is rolling for KDE software. The Ubuntu base OS is not, but certain packages will be updated as needed to support KDE software requiring newer library versions than what is provided by Ubuntu. Apps from the main repositories are not rolling either, and therefore can be up to two years old. Users are encouraged not to use them, and to instead get apps from Snap or Flatpak using KDE’s Discover app store. In neon, Discover is set up to only show apps from these sources, filtering out apps from the repositories.
  • Adding reputation

    Solved Customisation reputation
    17
    1
    4 Votes
    17 Posts
    3k Views
    @OT very odd. Shouldn’t be that complex, but glad you have it working.
  • 2 Votes
    6 Posts
    1k Views
    @dave1904 I’d start by adding a console.log function to hookData so you can see what is being returned return hookData; console.log(hookData):
  • Ranking system revisited

    Announcements reputation
    3
    3 Votes
    3 Posts
    1k Views
    @cagatay nodebb-plugin-user-level
  • Nodebb best plugins

    General nodebb plugins
    18
    7 Votes
    18 Posts
    4k Views
    @phenomlab thanks
  • Best antivirus software? (Looking to switch)

    General
    35
    19 Votes
    35 Posts
    8k Views
    @phenomlab or Challenge Accepted haha