Jump to content

Featured Replies

Posted

On the who's online block, the number of members and guests have been removed.

You can access the full list and it will tell you the number of members online, not the guests, which I'm not hugely bothered by as many were bots.

I just kind of miss having that number there to gauge how busy it is on the home page than trying to guess looking at a block of text.

I renamed in languages Whos Online to Fans Online to suit my site, but like this would be nice whilst retaining the language string so a Taylor Swift fan site could have 267 Swifties Online for example.

Screenshot 2025-02-05 at 18.41.08.png

Agreed, it's useful for transparency and to show how active the site is. I tend to think that when people hide this sort of information or the block itself, they are hiding something. I know in admin forums, there's often talk about certain tactics to fake your site to look busier, but the information is still relevant.

I have made a block using IP.Pages which bring it back; it also slightly redesigns the look.

dvBfnKu.png

I know not all have pages, but someone else might release a more suitable version. I would be happy to share the code. For my personal preferences, I want to put the (See full list) to the right, and I need to give the user area a bit more padding on the right. My live site is nearly set up perfectly; however, v5 has some slight differences.

Another nudge on this - would be great to be able to see the number online at a glance again. Thanks!

It's good to gauge who is reading and not logged in. I'm very surprised that was removed. It seems as important as showing online members to me.

  • Author
On 2/7/2025 at 4:02 PM, AintNobody said:

I have made a block using IP.Pages which bring it back; it also slightly redesigns the look.

dvBfnKu.png

I know not all have pages, but someone else might release a more suitable version. I would be happy to share the code. For my personal preferences, I want to put the (See full list) to the right, and I need to give the user area a bit more padding on the right. My live site is nearly set up perfectly; however, v5 has some slight differences.

Only just seen this. Awesome.

Never realised this was possible.

I have created one now with my suggestion which was super simple.

Below is how for users with the Pages app.

  1. In admincp go to under Page Management go to Blocks

  2. Click Create New Block, select Plugin and in the Plugin drop down, what should be the 5th option, select Who's Online.

  3. Give the block a title and template key at the bottom

  4. Now click the Content tab, in the drop down menu that says "use this template as-is" open that menu and select "Use as a base for custom template"

  5. On Row 4 you should see

{lang="block_whosOnline"}

Add {$memberCount} before it and leave a space.

So it looks like

{$memberCount} {lang="block_whosOnline"}

Now press save.

That's the block complete.

  1. Next up, go to Languages, press the Translate globe icon.

  2. Search for Who's Online, what should be the top option. It's key is block_whosOnline

  3. Rename that what you want, Gamers Online, Swifties Online, whatever suits your community/

Now go to your front end, Page Editor, drag your new block on to your front-page :)

Below is now mine which you can see at https://dcfcfans.uk

Please note, this count only shows the total number of members online, it does not include guests. If one of the lovely developers can advise on what string can be used for the total count, that would be amazing.

Screenshot 2025-02-13 at 17.24.55.png

  • Author

Ok, further update.

For anyone wanting to achieve this look.

Screenshot 2025-02-13 at 18.10.31.png

  1. In admincp go to under Page Management go to Blocks

  2. Click Create New Block, select Plugin and in the Plugin drop down, what should be the 5th option, select Who's Online.

  3. Give the block a title and template key at the bottom

  4. Now click the Content tab, in the drop down menu that says "use this template as-is" open that menu and select "Use as a base for custom template"

  5. On Row 4 you should see

{lang="block_whosOnline"}

Replace this with

{lang="block_whosOnline"}: {lang="block_whos_online_info_members" pluralize="$memberCount"}, {lang="block_whos_online_info_guests" pluralize="$guests"}

Now go to your front end, Page Editor, drag your new block on to your front-page :)

Edited by Day.

can also add this to get the full picture

{lang="block_whos_online_info_anonymous" pluralize="$anonymous"}

Edited by sound

  • Author

Ok, for the pista de resistance, are you ready for this?

If you would like the block to look like this

Screenshot 2025-02-13 at 19.16.19.png

Screenshot 2025-02-13 at 19.14.33.png

  1. In admincp go to under Page Management go to Blocks

  2. Click Create New Block, select Plugin and in the Plugin drop down, what should be the 5th option, select Who's Online.

  3. Give the block a title and template key at the bottom

  4. Now click the Content tab, in the drop down menu that says "use this template as-is" open that menu and select "Use as a base for custom template"

Replace the entire contents with:

<div data-controller='core.front.core.onlineUsersWidget' style="border-radius:inherit">
    <h3 class='ipsWidget__header'>
        <span>
           <a href='{url="app=core&module=online&controller=online"}'>{lang="block_whosOnline"}</a> <span style='font-size: var(--i-font-size); font-weight: 400; color: var(--i-color_soft); margin-left: 1em;'>{lang="block_whos_online_info_members" pluralize="$memberCount"}, {lang="block_whos_online_info_guests" pluralize="$guests"}</span>
        </span>
    </h3>
    <div class='ipsWidget__content ipsWidget__padding'>
        <ul class='ipsList ipsList--csv'>
            {{if $memberCount}}
                {{foreach $members as $row}}
                    <li data-memberId="{$row['member_id']}">{template="userLinkFromData" group="global" app="core" params="$row['member_id'], $row['member_name'], $row['seo_name'], $row['member_group'], TRUE"}</li>
                {{endforeach}}
            {{else}}
                <li class='i-color_soft' data-noneOnline>{lang="whos_online_users_empty"}</li>
            {{endif}}
        </ul>
    </div>
</div>

Please note, the "See full list" link has been removed as it drops to a new line on mobile. With the code above, you can click on "Who's Online" and this will take you to the full online page. For me it looks a little tidier this way.

Oh I have also removed the anonymous count, why? Because surely if you're anonymous, you should be anonymous right?

Hope that helps and thanks for coming on this journey with me. I love this software! 😍

Edited by Day.

Brilliant work @Day. I will use that! Would there be a key to add back anon users too?

Edited by LemonGrenade

  • Author
1 minute ago, LemonGrenade said:

Brilliant work @Day. I will use that! Would there be a key to add back anon users too or will that show as well?

If you want to show anonymous as well use this

<div data-controller='core.front.core.onlineUsersWidget' style="border-radius:inherit">
    <h3 class='ipsWidget__header'>
        <span>
           <a href='{url="app=core&module=online&controller=online"}'>{lang="block_whosOnline"}</a> <span style='font-size: var(--i-font-size); font-weight: 400; color: var(--i-color_soft); margin-left: 1em;'>{lang="block_whos_online_info_members" pluralize="$memberCount"}, {lang="block_whos_online_info_anonymous" pluralize="$anonymous"}, {lang="block_whos_online_info_guests" pluralize="$guests"}</span>
        </span>
    </h3>
    <div class='ipsWidget__content ipsWidget__padding'>
        <ul class='ipsList ipsList--csv'>
            {{if $memberCount}}
                {{foreach $members as $row}}
                    <li data-memberId="{$row['member_id']}">{template="userLinkFromData" group="global" app="core" params="$row['member_id'], $row['member_name'], $row['seo_name'], $row['member_group'], TRUE"}</li>
                {{endforeach}}
            {{else}}
                <li class='i-color_soft' data-noneOnline>{lang="whos_online_users_empty"}</li>
            {{endif}}
        </ul>
    </div>
</div>

Thanks @Day. Great work! Will this save during updates too?

  • Author
Just now, LemonGrenade said:

Thanks @Day. Great work! Will this save during updates too?

Yes it's a custom block so any update will not overwrite it. I've used @Ehren var thingy's as well so if you change the overall font size on your site, this will adjust inline with that and it uses the soft colour that you have chosen in your Typography settings. Hopefully by tagging him he will drop by and appraise my work and offer any advice if it needs tidying up. For now though it works!

You will find the block right at the bottom of the list in Page Editor.

Edited by Day.

Great work @Day. Is there something that could be added in that code to change the font colour of just that smaller font detail? So, keep it separate from the Typography settings if on light mode and the content box background is of a dark colour?

It would be interesting to hear from @Matt if leaving this out was intentional on version 5 or just something left off unintentionally.

  • Management
20 minutes ago, LemonGrenade said:

Great work @Day. Is there something that could be added in that code to change the font colour of just that smaller font detail? So, keep it separate from the Typography settings if on light mode and the content box background is of a dark colour?

It would be interesting to hear from @Matt if leaving this out was intentional on version 5 or just something left off unintentionally.

The simple answer is that calculating the number of online users can be quite slow, more so if you're using Redis as it has to use a complex key sort and we felt that the efficiency increase was worth the inconvenience.

It's good though that Invision Community offers powerful tools so those that want to restore it, can.

Recently Browsing 0

  • No registered users viewing this page.