A question about editing forum stats?

Started by Grammy, January 21, 2021, 07:17:05 AM

Previous topic - Next topic

Grammy

Editing forum stats is probably a bad idea, I guess.  I got the idea from THIS THREAD.

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.

shadav

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


shadav

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

Grammy

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!   :)


shadav

np :)

hehehe yes those pesky syntax errors and unable to load template above  :laugh:
it's almost always a forgotten echo ' or the closing ';

Grammy

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

Kindred

#6
the problem was that you were still making the edits within an echo....

you needed to move the ';   to BEFORE the commented lines
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

shadav

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

Advertisement: