Hidden Users on index

Get help with installation and running phpBB 3.1.x here. Please do not post bug reports, feature requests, or extension related questions here.
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: phpBB 3.1.x is at its End of Life stage and support will NOT be provided after July 1st, 2018.
Locked
travel
Registered User
Posts: 131
Joined: Sun Jan 11, 2015 7:21 pm

Hidden Users on index

Post by travel » Mon May 11, 2015 7:40 pm

How to change this:

Code: Select all

93 registered, 4 hidden and 1337 guests
to this (only in users online part):

Code: Select all

93 registered and 1337 guests
:?:

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Hidden Users on index

Post by Oyabun1 » Mon May 11, 2015 10:13 pm

You would need an extension for that. Have a look in the Extensions Database. If you can't find one that is suitable you could look in [3.1.x] Extensions in Development, but note that extensions in development are not intended for a live board. If there is nothing there you could have a look in [3.1.x] Extension Requests and if it hasn't already been requested make a request there.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Hidden Users on index

Post by javiexin » Wed May 13, 2015 12:55 pm

Or you could simply replace the language var:

Go to language/en/common.php
Find:

Code: Select all

    // "... :: x registered and y hidden"
    'ONLINE_USERS_TOTAL'        => array(
        1    => 'In total there is <strong>%1$d</strong> user online :: %2$s and %3$s',
        2    => 'In total there are <strong>%1$d</strong> users online :: %2$s and %3$s',
    ),
    // "... :: x registered, y hidden and z guests"
    'ONLINE_USERS_TOTAL_GUESTS'    => array(
        1    => 'In total there is <strong>%1$d</strong> user online :: %2$s, %3$s and %4$s',
        2    => 'In total there are <strong>%1$d</strong> users online :: %2$s, %3$s and %4$s',
    ),
Replace with:

Code: Select all

    // "... :: x registered and y hidden" becomes "... :: x registered"
    'ONLINE_USERS_TOTAL'        => array(
        1    => 'In total there is <strong>%1$d</strong> user online :: %2$s',
        2    => 'In total there are <strong>%1$d</strong> users online :: %2$s',
    ),
    // "... :: x registered, y hidden and z guests" becomes "... :: x registered and z guests"
    'ONLINE_USERS_TOTAL_GUESTS'    => array(
        1    => 'In total there is <strong>%1$d</strong> user online :: %2$s and %4$s',
        2    => 'In total there are <strong>%1$d</strong> users online :: %2$s and %4$s',
    ),
  
You may need to adjust the total number of users so that it does match though...
Regards
-javiexin

User avatar
david63
Registered User
Posts: 16814
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Hidden Users on index

Post by david63 » Wed May 13, 2015 2:04 pm

javiexin wrote:Or you could simply replace the language var:
Will that not result in sprintf errors unless you modify the code as well?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

User avatar
javiexin
Code Contributor
Posts: 1157
Joined: Wed Oct 12, 2011 11:46 pm
Location: Madrid, Spain
Name: Javier
Contact:

Re: Hidden Users on index

Post by javiexin » Wed May 13, 2015 3:16 pm

david63 wrote:
javiexin wrote:Or you could simply replace the language var:
Will that not result in sprintf errors unless you modify the code as well?
It shouldn't, it is just a parameter not being used.

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: Hidden Users on index

Post by Oyabun1 » Wed May 13, 2015 10:35 pm

Since language packs, other than British English, are usually updated by issuing new versions if you make the change to a language file you would not only need to make the change to all installed languages you would need to redo the changes after every update. Hence it is better if it was done with an extension.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

travel
Registered User
Posts: 131
Joined: Sun Jan 11, 2015 7:21 pm

Re: Hidden Users on index

Post by travel » Sun Jun 21, 2015 5:36 pm

javiexin,
thank you!

Locked

Return to “[3.1.x] Support Forum”