Skip to content

Custom Board Stats Widget

Moved Let's Build It
28 4 10.1k 1
  • wrote on last edited by phenomlab
    #1

    I had someone mention to me yesterday that they liked the footer widget present on the Categories page, which looks like the below

    86490b64-c376-4d65-bb58-7ab6974b3531-image.png

    This isn’t custom code at all, but in fact the “Board Stats” widget which is added when nodebb-widget-board-stats is installed. However, there were various elements I didn’t like - particularly, the layout, which by default (on here) would have looked like this

    8afe3e4a-3d0b-4600-94ee-2f49fc9755e1-image.png

    There’s nothing “wrong” with it (apart from the fact that the calculations seem a little off with actual users vs guests - not a show stopper for me), but I didn’t want some elements to be displayed, and so I used the below CSS to hide them, and then modify the alignment so it looks like the first image

    .widget-board-stats {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-around;
    }
    .widget-board-stats h3 {
        display: none;
    }
    

    This basically hides anything in that widget that uses h3 as the header, and then arranges the widget itself so that flex-direction and justify-content are included which lines up everything nicely.

    If you’d like the widget to look like a card, you can set that in the widget itself by adding the below code into the widget container

    <div class="card"><h5 class="card-header">{{title}}</h5><div class="card-body">{{body}}</div></div>
    

    Effectively, the below.

    72cd64c2-cd44-4195-8906-438d9126ee45-image.png

    Or, you can drag the card element into the container area like the below, and drop it

    fabebce6-0b44-4ad9-9160-023103dc0aa5-image.png

    Enjoy.

  • phenomlab phenomlab moved this topic from Code Respository on
  • wrote on last edited by
    #2

    @phenomlab , thanks for the explanation. it looks great!
    a quite traditional stats box, just like how it has been in old forums 🙂

  • phenomlab phenomlab referenced this topic on
  • wrote on last edited by
    #3

    @phenomlab how can i add board statics?

  • @phenomlab how can i add board statics?

    wrote on last edited by
    #4

    @cagatay once you’ve installed the plugin, you’ll need to add it as a widget.

  • wrote on last edited by
    #5

    i can not find this plugin in plugins search

    image.png

  • i can not find this plugin in plugins search

    image.png

    wrote on last edited by
    #6

    @cagatay install it via CLI

  • wrote on last edited by
    #7
    This post is deleted!
  • wrote on last edited by
    #8

    Mark hi i istalled and added the stats but in english language. How can i change it in turkish one?

  • Mark hi i istalled and added the stats but in english language. How can i change it in turkish one?

    wrote on last edited by
    #9

    @cagatay that’s a question for the NodeBB devs I think. You could perhaps use the nodebb-plugin-customize to do the translations.

    Not sure if they exist in Transiflex either, so you may need to add these manually.

  • Mark hi i istalled and added the stats but in english language. How can i change it in turkish one?

    wrote on last edited by
    #10

    @cagatay if you can share the github page of the plugin, I can send Turkish translation as “pull request” …

  • @cagatay if you can share the github page of the plugin, I can send Turkish translation as “pull request” …

    wrote on last edited by
    #11

    @crazycells that would be very useful

  • wrote on last edited by
    #12
  • wrote on last edited by
    #13

    I asked @barisusakli to add multi-language support to this plugin… I will send an update after him…

    As an alternative (but more laborious) method, you can fork the plugin to your github profile and change the translation here on this page:

    https://github.com/psychobunny/nodebb-widget-board-stats/blob/master/public/templates/widgets/board-stats.tpl

    and then, install the plugin from your github page to the forum instead of the regular plugin…

  • wrote on last edited by
    #14

    if i can found where is this plugin saved in my files of nodebb, i can edit byself but cant found in modules files or plugin files …

  • if i can found where is this plugin saved in my files of nodebb, i can edit byself but cant found in modules files or plugin files …

    wrote on last edited by
    #15

    @cagatay is it’s installed, it’ll be there. Sometimes they aren’t necessarily in the order you’d expect.

  • if i can found where is this plugin saved in my files of nodebb, i can edit byself but cant found in modules files or plugin files …

    wrote on last edited by
    #16

    @cagatay yes, that is also good idea, but I do not know if it stays overwritten all the time (does doing “plugin reset” reset the files? I do not know)

  • @cagatay yes, that is also good idea, but I do not know if it stays overwritten all the time (does doing “plugin reset” reset the files? I do not know)

    wrote on last edited by
    #17

    @crazycells it’ll be overwritten. My recommendation here in the absence of Transiflex would be to use the customize plugin

  • wrote on last edited by
    #18

    @phenomlab @barisusakli updated the plugin but with another name.
    so could you please update your edit code also on it?

    new plugin name;

     @nodebb/nodebb-widget-board-stats@2.0.0
    
  • @phenomlab @barisusakli updated the plugin but with another name.
    so could you please update your edit code also on it?

    new plugin name;

     @nodebb/nodebb-widget-board-stats@2.0.0
    
    wrote on last edited by
    #19

    @cagatay there’s no chages needed?

  • wrote on last edited by DownPW
    #20

    No just css maybe @phenomlab

    I have installed the plugin and ask modification to @barisusakli

    see here, here and [here](https://community.nodebb.org/post/97623

    With no bugs, i can use it, and even combined with the other plugin

    🙂


Related Topics
  • NodeBB Twitter / X embeds

    Let's Build It twitter script
    34
    21 Votes
    34 Posts
    16k Views
    DownPW
    @phenomlab said: @DownPW thanks for spotting (and fixing) this issue. I admittedly threw this together quickly for @jac some time ago, and it hasn’t had any love since. If OK with you, I’ll merge these changes into the github repository? No problem dude
  • Extended functions for Q&A NodeBB plugin

    Let's Build It q&a panels cards
    3
    4
    5 Votes
    3 Posts
    3k Views
    DownPW
    Very good like always
  • Switch between list and card view function

    Moved Let's Build It cards layout css
    107
    1
    50 Votes
    107 Posts
    57k Views
    phenomlab
    @crazycells [image: image.png] [image: image.png]
  • What's your go to product for site stats?

    Let's Build It umami stats
    27
    2
    15 Votes
    27 Posts
    9k Views
    phenomlab
    For anyone else coming here and is struggling to get pm2 to work with Umami (as I did - it started, but never seemed to work after a reboot which is pretty useless), you can use the below. Obviously, change the parts noted inside the [brackets]. Follow the below instructions: Instructions Open a terminal and create a new systemd service file: sudo nano /etc/systemd/system/umami.service Add the following content to the file: [Unit] Description=Umami Analytics Server After=network.target [Service] Type=simple User=[umami user] WorkingDirectory=[path to umami] ExecStart=/usr/local/bin/node [path to umami]/node_modules/.bin/next start Restart=on-failure [Install] WantedBy=multi-user.target Replace [umami user] with the username of the user that should run the Umami service, and [path to umami] with the actual path to your Umami installation. Save the file and exit the editor. Reload the systemd manager configuration: sudo systemctl daemon-reload Enable the Umami service to start on boot: sudo systemctl enable umami.service Start the Umami service: sudo systemctl start umami.service You can check the status of the service with: sudo systemctl status umami.service This systemd service file will ensure that Umami starts automatically when the system boots, and it will restart the service if it fails. Remember to adjust the WorkingDirectory and ExecStart paths according to where Umami is installed on your system, and ensure that Node.js is installed and accessible at /usr/bin/node (or adjust the path to Node.js as necessary).
  • Threaded post support for NodeBB

    Let's Build It threading nodebb
    146
    3
    50 Votes
    146 Posts
    116k Views
    phenomlab
    Updated git for above change https://github.com/phenomlab/nodebb-harmony-threading/commit/14a4e277521d83d219065ffb14154fd5f5cfac69
  • Create a dynamic category list

    Moved Let's Build It dynamic categories api
    16
    3
    14 Votes
    16 Posts
    7k Views
    phenomlab
    Hmm - seems I never committed this code. I’ll do that now… EDIT - here it is https://github.com/phenomlab/category-list/tree/main
  • Corporate Bullshit Generator

    Moved Let's Build It cbg coding
    17
    9 Votes
    17 Posts
    6k Views
    Madchatthew
    @phenomlab said in Corporate Bullshit Generator: Yes, absolutely. Either those buzzwords get cheesier or I’m just getting older and less tolerant. I think it is both LOL
  • NodeBB vs Discourse

    Chitchat nodebb discourse board
    25
    6 Votes
    25 Posts
    14k Views
    RiekMedia
    @phenomlab said in NodeBB vs Discourse: Hetzner eh ? I use them also. In fact, Sudonix is hosted in Nuremberg yes i’m also at hetzner, i have been a customer there for years with a reseller account for domains. My VPS that I host there are also in Nuremberg