The forum of the forums

Would you like to react to this message? Create an account in a few clicks or log in to continue.
The forum of the forums
4 posters

    Removing "Members Connected During Last x Hours"

    SirLaplace
    SirLaplace
    Forumember


    Male Posts : 50
    Reputation : 4
    Language : Turkish, English

    Solved Removing "Members Connected During Last x Hours"

    Post by SirLaplace October 13th 2022, 7:27 am

    Hello, I'm using ModernBB in my forum.

    As you all know there is this information on the bottom of the forum that lists all the members connected during last x hours.

    I'd really like to remove the phrase "Members Connected During Last x Hours" from there but keep the member list anyway, so that I can write a customised title in there instead.

    Same goes with the "registered online users" info. I'm really not sure if it's possible but I wanted to check with here anyway, maybe someone found a work around or something.

    Thanks in advance.


    Last edited by zachwinch on October 13th 2022, 5:16 pm; edited 1 time in total
    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51498
    Reputation : 3523
    Language : English
    Location : United States

    Solved Re: Removing "Members Connected During Last x Hours"

    Post by SLGray October 13th 2022, 7:55 am

    I believe you can edit the text in the templates.

    If I remember correctly, it should be in the one for the homepage/index in general.



    Removing "Members Connected During Last x Hours" Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    Razor12345
    Razor12345
    Support Moderator
    Support Moderator


    Male Posts : 1575
    Reputation : 266
    Language : Ukr, Rus, Eng
    Location : Ukraine

    Solved Re: Removing "Members Connected During Last x Hours"

    Post by Razor12345 October 13th 2022, 9:38 am

    Good afternoon!

    AP - Display - Templates - General - index_body

    Find (this is field "Registered Users"):

    Code:
    {LOGGED_IN_USER_LIST}

    Replace by this:

    Code:
    <span id="liul">{LOGGED_IN_USER_LIST}</span>
    <script type="text/javascript">document.getElementById('liul').innerHTML=document.getElementById('liul').innerHTML.replace(/Registered Users:/,"New text of value users");</script>

    New text of value users - is the new text that will be displayed.

    Find (this is field "Members connected during last 24 hours"):

    Code:
    {L_CONNECTED_MEMBERS}

    Replace by this:

    Code:
    <span id="lcm">{L_CONNECTED_MEMBERS}</span>

    Save - Publish

    Then AP - Modules - HTML & JAVASCRIPT - Javascript codes management - Create a new Javascript
    Title: Anyone
    Placement: In the home page
    Javascript Code:

    Code:
    jQuery(document).ready(function(){

        var el1 = $('#lcm');

        el1.html(el1.html().replace('Members connected during last 24 hours :', '12345678910'));

        });

    12345678910 - is the new text that will be displayed.

    Submit

    Result:

    Removing "Members Connected During Last x Hours" Ouo35

    P.S. In writing this answer, I used materials of administrator Celina

    Ape, sivastar, TonnyKamper, SirLaplace and كونان2000 like this post

    SirLaplace
    SirLaplace
    Forumember


    Male Posts : 50
    Reputation : 4
    Language : Turkish, English

    Solved Re: Removing "Members Connected During Last x Hours"

    Post by SirLaplace October 13th 2022, 5:15 pm

    SLGray wrote:I believe you can edit the text in the templates.

    If I remember correctly, it should be in the one for the homepage/index in general.

    As the area only gave {LOGGED_IN_USER_LIST} and {L_CONNECTED_MEMBERS} but not a text indicator written before, I wasn't able to simply delete the text part and define my own without javascript.

    Razor12345 wrote:Good afternoon!

    AP - Display - Templates - General - index_body

    Find (this is field "Registered Users"):

    Code:
    {LOGGED_IN_USER_LIST}

    Replace by this:

    Code:
    <span id="liul">{LOGGED_IN_USER_LIST}</span>
    <script type="text/javascript">document.getElementById('liul').innerHTML=document.getElementById('liul').innerHTML.replace(/Registered Users:/,"New text of value users");</script>

    New text of value users - is the new text that will be displayed.

    Find (this is field "Members connected during last 24 hours"):

    Code:
    {L_CONNECTED_MEMBERS}

    Replace by this:

    Code:
    <span id="lcm">{L_CONNECTED_MEMBERS}</span>

    Save - Publish

    Then AP - Modules - HTML & JAVASCRIPT - Javascript codes management - Create a new Javascript
    Title: Anyone
    Placement: In the home page
    Javascript Code:

    Code:
    jQuery(document).ready(function(){

        var el1 = $('#lcm');

        el1.html(el1.html().replace('Members connected during last 24 hours :', '12345678910'));

        });

    12345678910 - is the new text that will be displayed.

    Submit

    Result:

    Removing "Members Connected During Last x Hours" Ouo35

    P.S. In writing this answer, I used materials of administrator Celina

    But this one worked like a charm! Just the way I wanted. Thanks everyone, including Celina.
    This problem is officially solved.

    Note: (For those who might be looking this code in the future) Since my forum was not in English language, I had to rephrase the areas like "Members connected during last 24 hours :" in the forum language, as written exactly in the forum. If the code can't select the words, it's not able to replace.

    Thanks again, everyone.
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15311
    Reputation : 1705
    Language : English,Greek
    Location : Greece

    Solved Re: Removing "Members Connected During Last x Hours"

    Post by skouliki October 13th 2022, 7:13 pm

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules


      Current date/time is September 23rd 2024, 3:27 am