Skip to content

New Code Repository

Announcements
  • Hi All,

    I’m thrilled to announce that I have decided to start migrating all of the code that is considered stable / production into a new sub category of “let’s build it” called Code Repository

    https://sudonix.org/category/29/code-respository

    There’s nothing to see here presently, although this will eventually become a one-stop library for all code I write (a good example here being OGProxy) - in effect, one place you can go to save you from having to trawl though thousands of posts (and yes, we do have thousands). In most cases, the category is going to be read only as a way of keeping it clean and distraction free. Of course, updates etc will be applied in the usual fashion, but any support requests, queries, or just discussion about the code should be raised in the usual places.

    I am also going to create a private GIT repository for all of this code to sit in. Based on this, you will find either gists or direct links to git code. I’ve chose this route for OGProxy as a trial to see if it will work, and it’s so much easier because there’s less clutter, and it’s simpler to navigate.

    I will also be moving the themes (swatch) CSS here, too, so you’ll also be able to take full advantage of that also.

    Enjoy.

  • @phenomlab very nice and useful idea

    Bravo Xd GIF


  • 0 Votes
    1 Posts
    16 Views
    No one has replied
  • 7 Votes
    9 Posts
    326 Views

    @crazycells that’s as good a test as any 🙂

  • 7 Votes
    3 Posts
    166 Views

    @DownPW Yes, this is the general idea. I’m also in the process of putting together a welcome message to be displayed when a new user registers so they can explore all of the services on offer.

  • 36 Votes
    55 Posts
    4k Views

    @DownPW I see why. The code relies on the existence of

    [component="topic/quickreply/container"]

    However, this by definition means that the below has to be enabled

    aeef638f-4188-489d-a9f2-f3a26dbca9d8-image.png

    It will then work

    7fb38631-e0f3-46ef-b652-00929d927b13-image.png

    For some unknown reason, this is hidden in Harmony, and only shows if you select it. In v2, it seems that the <section> is deleted altogether in Persona if “Quick Reply” is disabled, meaning it won’t fire as it can’t locate that specific component.

    The downside is that you might not want the quick reply function, but I think it’s a PITA to scroll up to the top of the post just to reply, so I have it on 🙂

  • 7 Votes
    3 Posts
    179 Views

    happy new year all 😉

  • 24 Votes
    49 Posts
    2k Views

    @crazycells You should be able to upvote more now as I’ve located the hard coded function in the plugin responsible for this and changed it from

    maxVotesPerUser(reputation) { let MIN = 5, MAX = 50; let calculatedVotesPerUser = Math.floor(reputation / 10); if (calculatedVotesPerUser < MIN) { calculatedVotesPerUser = MIN; } else if (calculatedVotesPerUser > MAX) { calculatedVotesPerUser = MAX; } return calculatedVotesPerUser; },

    to

    maxVotesPerUser(reputation) { let MIN = 5, MAX = 500; let calculatedVotesPerUser = Math.floor(reputation / 50); if (calculatedVotesPerUser < MIN) { calculatedVotesPerUser = MIN; } else if (calculatedVotesPerUser > MAX) { calculatedVotesPerUser = MAX; } return calculatedVotesPerUser; },

    It appears that the upvote limit is 10% of your reputation by default.

  • 0 Votes
    2 Posts
    291 Views

    @pwsincd I think you can use userData.isAdmin = isAdmin; if I’m not mistaken - see
    https://community.nodebb.org/topic/15128/how-to-hide-whitelist-user-field-only-to-owner-or-admin?_=1648802303112 for an example

  • 3 Votes
    12 Posts
    642 Views

    @phenomlab Inquiring minds will be curious. See my reply in the “Miscellany” thread, eh? 👍