News:

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

Main Menu

[Hack/SMF 2.0.x] Remove "Read xx times" from topic view *UPDATED*

Started by NanoSector, May 19, 2012, 02:46:19 PM

Previous topic - Next topic

NanoSector

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:
QuoteTopic: xxx (Read # times)

With just:
QuoteTopic: 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.
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."

NanoSector

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

Mstcool

#2
You should submit this to the mod site

Antechinus

Quote from: Yoshi2889 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?

If you have the participation column enabled:

.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:

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


:D

bigredinsider

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?

Mstcool

You can continue but make sure you back up your database and forum before clicking continue :P

NanoSector

Quote from: Mstcool on July 14, 2012, 11:28:52 PM
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."


ocmdiaz714

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.

NanoSector

Quote from: ocmdiaz714 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.
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."

Tony Reid

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

NanoSector

Quote from: Tony Reid 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'); 





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

Tony Reid

Hmmm.. maybe just use substr to trim the S off the existing language string and then add an 's' in the conditional.

Tony Reid


CreativeITWorld.com

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.

        <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.

NanoSector

Quote from: CreativeITWorld.com 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.

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

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

NanoSector

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

NewMoon

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

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

NanoSector

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

Advertisement: