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
    51 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.
  • Infrared the new WiFi?

    General wifi infrared
    4
    2 Votes
    4 Posts
    2k Views
    @JAC those speeds are indeed possible over light as a transport medium (if you consider the speed) but I can’t comprehend the distance quoted. If you happen to encounter a solid obstacle, the beam is either absorbed, or deflected meaning the data never arrives.
  • 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.
  • OKTA offering personal password manager

    General okta password manager
    31
    18 Votes
    31 Posts
    7k Views
    @Madchatthew yes, works well for us.
  • 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.
  • 12 Votes
    47 Posts
    12k Views
    @dave1904 just coming back to this thread as @DownPW and I both experienced issues with other plugins today, and the fix was to use the plugin ordering in the ACP and move the Harmony theme to the very top so it comes before everything else in terms of other plugins. It might be worth at least trying this to see if it gives you a result rather than the previous bulldozer approach. Thinking about it, the previous fix I proposed is along the same lines and disabling plugins does in fact change the order when they are enabled again, so this is definitely worth a try. Let me know how you get on.
  • Ranking system revisited

    Announcements reputation
    3
    3 Votes
    3 Posts
    1k Views
    @cagatay nodebb-plugin-user-level
  • Best antivirus software? (Looking to switch)

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