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.


Related Topics
  • ANNOUCEMENT: New NTFY Server

    Announcements
    9
    7 Votes
    9 Posts
    700 Views

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

  • Welcome to NodeBB V3!

    Pinned Moved General
    1
    0 Votes
    1 Posts
    242 Views
    No one has replied
  • 36 Votes
    55 Posts
    5k 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 🙂

  • 24 Votes
    49 Posts
    3k 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.

  • Detect if user is admin

    General
    2
    0 Votes
    2 Posts
    490 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

  • New Twitter handle

    Announcements
    4
    5 Votes
    4 Posts
    422 Views

    Off course 😉

  • New blog section added

    Announcements
    1
    0 Votes
    1 Posts
    497 Views
    No one has replied
  • New "quote" feature added

    Announcements
    12
    3 Votes
    12 Posts
    924 Views

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