News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

How to hide views number

Started by Jeanraven, January 22, 2017, 05:46:07 PM

Previous topic - Next topic

Jeanraven

Hi! Does anybody know how can I hide the number of topic's views? Before I set stopspammer mode these numbers had risen up to fantastically high level!

Dzonny

Hello there!

In Themes/default/MessageIndex.template.php, find and remove this line of code:

<br />
', $topic['views'], ' ', $txt['views'], '

That should do the trick.  ;)

Kindred

It will still show on the actual topic, though...  might be better to reset the views count directly in the database....
Сл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."

Jeanraven

Quote from: Dzonny on January 22, 2017, 05:55:45 PM
Hello there!

In Themes/default/MessageIndex.template.php, find and remove this line of code:

<br />
', $topic['views'], ' ', $txt['views'], '

That should do the trick.  ;)

YEAH!!! It works! Thanks a lot!

Jeanraven

Quote from: Kindred on January 22, 2017, 09:12:56 PM
It will still show on the actual topic, though...  might be better to reset the views count directly in the database....
It will be nice, but all I tried gave nothing in result. Can you give me advise how to do it?

Kindred

in phpmyadmin


UPDATE smf_topics SET `num_views`=400 WHERE `num_views`> 400

Сл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."

Dzonny

Or you can also remove it from template alternatively, in Display.template.php find and remove:
&nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')

Kindred

Dzonny,  I think it would be better to just downgrade the numbers rather than removing code. :D
Сл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."

Advertisement: