Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Grammy on January 21, 2021, 07:17:05 AM

Title: A question about editing forum stats?
Post by: Grammy on January 21, 2021, 07:17:05 AM
Editing forum stats is probably a bad idea, I guess.  I got the idea from THIS THREAD (https://www.simplemachines.org/community/index.php?topic=365513.msg2498405#msg2498405).

Regular members can't see the normal forum stats but I don't mind users seeing Who's Online.  I just don't want them to view "Most Online Today, Most Online Ever..."  Would that be the "more stats" part of that block of code in BoardIndex.template.php?  If so, I don't seem to be able to comment that out cleanly, I get a syntax error. 

That should be my new user name:  Syntax Error.    :(

I assume it can be done...  just not by me, apparently.
Title: Re: A question about editing forum stats?
Post by: shadav on January 21, 2021, 11:10:11 AM
find
<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>

and either remove it or comment it out
IF YOU COMMENT IT OUT then you will need to move the '; to a new line
so then find
<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>';

replace
// <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>
';

Title: Re: A question about editing forum stats?
Post by: shadav on January 21, 2021, 11:13:34 AM
hm strange...
I tried commenting it out but it still shows up with the comments
I also tired
/** <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> */
';

same thing, it still showed up but with the comment...

I guess removing it is the only option
Title: Re: A question about editing forum stats?
Post by: Grammy on January 21, 2021, 11:56:06 AM
Hi, Shadav, and thanks so much!  So....  just try deleting that very last block of code you showed?


EDIT:  Deleted this

</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']), ')


and left the closing </p>';

That seems to have sorted it!  Thank you so much!   :)

Title: Re: A question about editing forum stats?
Post by: shadav on January 21, 2021, 12:09:32 PM
np :)

hehehe yes those pesky syntax errors and unable to load template above  :laugh:
it's almost always a forgotten echo ' or the closing ';
Title: Re: A question about editing forum stats?
Post by: Grammy on January 21, 2021, 12:54:34 PM
That's why I never close a file I'm editing or quit my ftp...  so I can hit "Undo" and get the "hell outta Dodge"!   :D
Title: Re: A question about editing forum stats?
Post by: Kindred on January 21, 2021, 01:46:09 PM
the problem was that you were still making the edits within an echo....

you needed to move the ';   to BEFORE the commented lines
Title: Re: A question about editing forum stats?
Post by: shadav on January 21, 2021, 01:49:28 PM
Quote from: Kindred on January 21, 2021, 01:46:09 PM
the problem was that you were still making the edits within an echo....

you needed to move the ;   to BEFORE the commented lines
ahhh, that makes sense

because the echo is basically telling it to display this information rendering the comments as text....

:laugh: dang echos anyways  :P