Advertisement:

Author Topic: [Hack/SMF 2.0.x] Remove "Read xx times" from topic view *UPDATED*  (Read 27128 times)

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
This removes the Read counter from topic view and removes the Read columns from various lists and headers.
This package was made with the Curve theme in mind. It may not work correctly in other themes, nor will be updated to do so.

E.g. it replaces:
Quote
Topic: xxx (Read # times)

With just:
Quote
Topic: xxx
In the topic view.

Changelog
v0.2
+ Remove the count from the message index, thanks to CreativeITWorld.com :)

v0.3
+ Remove the Views column from the message index.

v0.4
+ Remove the Views column from the Unread Posts and Updated Topics pages, thanks to NewMoon :)

Package attached for easy install. Compatible with SMF 2.0.x.
« Last Edit: January 01, 2015, 05:37:00 PM by NanoSector »
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #1 on: July 09, 2012, 07:35:00 AM »
Also works in 2.1 Alpha as of now, for anyone interested.

Does anybody need to remove the counts from the topic index, too?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #2 on: July 14, 2012, 11:28:52 PM »
You should submit this to the mod site
« Last Edit: January 02, 2015, 12:46:25 AM by Mstcool »

Offline Antechinus

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 24,785
  • Master of BBC Abuse
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #3 on: July 15, 2012, 12:08:46 AM »
Also works in 2.1 Alpha as of now, for anyone interested.

Does anybody need to remove the counts from the topic index, too?

If you have the participation column enabled:

Code: [Select]
.topic_table .table_grid thead tr td:nth-child(3), .topic_table .table_grid tbody tr td:nth-child(4)
{
    display: none;
}

If you have the participation column disabled:

Code: [Select]
.topic_table .table_grid thead tr td:nth-child(3), .topic_table .table_grid tbody tr td:nth-child(3)
{
    display: none;
}

:D

Offline bigredinsider

  • Semi-Newbie
  • *
  • Posts: 10
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #4 on: July 15, 2012, 01:29:22 AM »
Got an error message when installing:

"Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF."



ok to continue?

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #5 on: July 15, 2012, 02:19:54 AM »
You can continue but make sure you back up your database and forum before clicking continue :P

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #6 on: July 15, 2012, 05:20:19 AM »
You should put this in the mod site
if not can i post it and give all credits to u? i never made one and i just want to post one without making it

Ill give all credits to u :)
Thank you for the offer Mstcool, but I think this is just a little too small for being in the mod site (my Lock Recycled Topics mod already was too small methinks, lol)
I will submit it though, if people want me to do that, heh.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Mstcool

  • Sr. Member
  • ****
  • Posts: 911
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #7 on: July 15, 2012, 07:58:43 PM »
Oh ok :)

Offline ocmdiaz714

  • Jr. Member
  • **
  • Posts: 202
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #8 on: September 03, 2012, 03:36:24 AM »
Any idea on how can I change "Read 1 times" to "Read 1 time"? And have it change to "times" once there's at least 2 views? Thanks.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #9 on: September 05, 2012, 01:39:29 AM »
Any idea on how can I change "Read 1 times" to "Read 1 time"? And have it change to "times" once there's at least 2 views? Thanks.
Sorry, I have no idea how to perform that. :(
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Tony Reid

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,154
  • Gender: Male
    • @AbsoluteBreeze on Twitter
    • www.fertilityfriends.co.uk
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #10 on: September 05, 2012, 03:48:13 AM »
not looked at the mod and dont need it - but for Yoshi - an example on doing something like that would be to use a conditional, something like....


echo 'total $hit '   . ($hit== 'hit' 'hits'); 




Tony Reid


My Big Board
www.FertilityFriends.co.uk/forum - An SMF powered forum with over 5 million posts

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #11 on: September 05, 2012, 09:34:19 AM »
not looked at the mod and dont need it - but for Yoshi - an example on doing something like that would be to use a conditional, something like....


echo 'total $hit '   . ($hit== 'hit' 'hits'); 





I know how to do it, but I have no idea where it is set. (language files 'course but where in the sources)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline Tony Reid

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,154
  • Gender: Male
    • @AbsoluteBreeze on Twitter
    • www.fertilityfriends.co.uk
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #12 on: September 05, 2012, 09:36:59 AM »
Hmmm.. maybe just use substr to trim the S off the existing language string and then add an 's' in the conditional.

Tony Reid


My Big Board
www.FertilityFriends.co.uk/forum - An SMF powered forum with over 5 million posts

Offline tommoty

  • Semi-Newbie
  • *
  • Posts: 29
    • Siam E-cig Club
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #13 on: September 09, 2012, 07:42:57 AM »
 :D :D

Offline CreativeITWorld.com

  • Semi-Newbie
  • *
  • Posts: 29
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #14 on: October 24, 2012, 10:23:20 PM »
A handy little hack and just what I was looking for, except that I wanted a little more ... but thanks to your efforts, I started looking around for myself and added this little portion to your coding.

Code: [Select]
        <file name="$themedir/MessageIndex.template.php">
                <operation>
                        <search position="replace"><![CDATA[<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>]]></search>
                        <add><![CDATA[<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
</td>]]></add>
</operation>
        </file>

I hope it's of use to you and you can add this mod along with the rest of the mods.

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view
« Reply #15 on: December 20, 2012, 03:19:18 AM »
A handy little hack and just what I was looking for, except that I wanted a little more ... but thanks to your efforts, I started looking around for myself and added this little portion to your coding.

Code: [Select]
        <file name="$themedir/MessageIndex.template.php">
                <operation>
                        <search position="replace"><![CDATA[<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>]]></search>
                        <add><![CDATA[<td class="stats ', $color_class, '">
', $topic['replies'], ' ', $txt['replies'], '
</td>]]></add>
</operation>
        </file>

I hope it's of use to you and you can add this mod along with the rest of the mods.
Thanks CreativeITWorld, and sorry for my late reply.
I will add this in the mod today. First got school however so it's gonna take some time :)
Thanks!
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view *UPDATED*
« Reply #16 on: December 21, 2012, 09:34:20 AM »
Updated the mod, thanks again CreativeITWorld.com :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.2] Remove "Read xx times" from topic view *UPDATED*
« Reply #17 on: December 25, 2012, 05:06:26 PM »
Updated again, now is compiled with my Mod Creator and also removes the Views header and sorting method.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Offline NewMoon

  • Newbie
  • *
  • Posts: 5
Re: [Hack/SMF 2.0.3] Remove "Read xx times" from topic view *UPDATED*
« Reply #18 on: December 31, 2014, 08:28:18 PM »
Thanks so much for this mod!  Worked like a charm!

I discovered that one of the template (Recent.template.php) that shows unread posts since last visit, wasn't included.  I modified your file and installed it on my forum.  Works great!

Feel free to add it to your official install file for others to use as well.  Happy New Year! :)

Code: [Select]
    <file name="$themedir/Recent.template.php">
        <operation>
            <search position="replace"><![CDATA[<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>]]></search>
            <add><![CDATA[<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
</td>]]></add>
        </operation>
    </file>
« Last Edit: January 01, 2015, 05:21:28 PM by NanoSector »

Offline NanoSector

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 10,500
  • Gender: Male
  • VC321xb47@aperture:~#
    • Yoshi2889 on GitHub
Re: [Hack/SMF 2.0.3] Remove "Read xx times" from topic view *UPDATED*
« Reply #19 on: January 01, 2015, 05:21:10 PM »
Thanks NewMoon, happy new year to you too! :)

I'll add it to the package in a minute. I've also wrapped your code in [code][/code] tags in your post, so it's more easily readable.

Thanks again!
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."