Remove / hide Most Online Today: Most Online Ever

Started by atticuk, November 10, 2014, 01:48:22 PM

Previous topic - Next topic

atticuk

Hi

Would it be possible to have a mod that will either remove 'Most Online Today:  Most Online Ever' or at least hide it from view. I've tried using permissions but got no where. I've tried to edit the code but again didn't achieve a result.

I'm using the latest  SMF 2.0.9 | SMF © 2014, Simple Machines forum with no mods.
Cheers
atticuk

Gwenwyfar

Not sure if this would disable the "most online ever", but there's an option to disable that on the second menu on the admin panel.
"It is impossible to communicate with one that does not wish to communicate"

atticuk

#2
Hi and thanks for answering. I'm assuming you mean the second menu left named Configuration?

I've tried every possible button on and off but the  'Most Online Today:  Most Online Ever' remains on the screen.

It would be great it it was possible to switch  'Most Online Today:  Most Online Ever' to the admin panel though.

br360

If you want to remove it, that bit of code is in boardindex.template.php



   echo '
         </p>
         <p class="last smalltext">
            ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
            ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
         </p>';


I just tested it, and it does remove it; however, backup that file just in case.

Antes

That probably break the template bit... you should keep the </p>


   echo '
         </p>
         <p class="last smalltext">
            ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
            ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
         </p>';


   echo '
         </p>';

br360

Quote from: Antes on November 10, 2014, 05:29:23 PM
That probably break the template bit... you should keep the </p>


   echo '
         </p>';


Leaving just that part in, actually just broke the template for me.

Antes

It shouldn't... deleting that closing tag should create invalid validation.

br360

That's what I figured too, and since you obviously have way better coding skills than I do, I tried your method instead. ;)

However removing this-

   echo '
         </p>
         <p class="last smalltext">
            ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
            ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
         </p>';


but leaving this-

   echo '
         </p>';


does give a template parse error for me.

Antes

I didn't get any parse errors, maybe a keyboard issue of mine ' or ; got wrong output (somehow)... but its better to remove the following code only makes it clean :P (or should :D)

         <p class="last smalltext">
            ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
            ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')
         </p>

Gwenwyfar

#9
Quote from: atticuk on November 10, 2014, 04:44:30 PM
Hi and thanks for answering. I'm assuming you mean the second menu left named Configuration?

I've tried every possible button on and off but the  'Most Online Today:  Most Online Ever' remains on the screen.

It would be great it it was possible to switch  'Most Online Today:  Most Online Ever' to the admin panel though.
Yes, features and options -> General. Have a smf translation turned on for a while to test it, forgot what exactly those were called in english :P

An option to disable it would be nice if this was something needed often amongst smf users, but being as simple of a change as Antes and br360 pointed out, having a mod just for that seems to be a bit overkill.
"It is impossible to communicate with one that does not wish to communicate"

atticuk

Hi Antes,  br360  and Fortytwo

Thanks for all your help, I can confirm that  removing the code below and suggested by Antes has done the job.... much appreciation Antes.

@Fortytwo ... It may be a simple mod but I can think of numerous reasons why a site may want to switch between showing most online ever live to just allow it to be shown in the Admin area.

Thank you for your input.
Regards and thanks to you all
atticuk


<p class="last smalltext">
            ', $txt['most_online_today'], ': <strong>', comma_format($modSettings['mostOnlineToday']), '</strong>.
            ', $txt['most_online_ever'], ': ', comma_format($modSettings['mostOnline']), ' (', timeformat($modSettings['mostDate']), ')

Gwenwyfar

I'm curious now, care to go into detail on what would be these reasons? I can't think of any myself, other than just not wanting the feature.  :P

I imagine if anyone decided to make the mod they'd want to know what people would use it for as well  ;)
"It is impossible to communicate with one that does not wish to communicate"

br360

Not sure what atticuk's reasons would be for not wanting it shown, but I can understand an admin not wanting that to be visible if the number of most online today/ever was very low.

If I was to log on to a site and saw that most online ever was say 8 or 9, not sure I would want to stick around the site as it might appear to have little content or lacking a community in general.

Gwenwyfar

Yeah, that would be useful, but already something a bit different than his original suggestion, that's why I asked :P
"It is impossible to communicate with one that does not wish to communicate"

atticuk

Hi

Another is just privacy, it's not necessary to show everybody that sort of information.

Plus it does make a cleaner index page.

That's my reason

Advertisement: