News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

How to remove the words "posts" and "topics" from child board indexes

Started by wynnyelle, April 05, 2012, 08:29:39 PM

Previous topic - Next topic

wynnyelle

This is what I want to remove:

http://i251.photobucket.com/albums/gg308/wynnyelle/lose-these-words.jpg

It's already up top that they are the numbers of posts and threads, the words down there with the numbers on every single one are redundant, so I want to take those out. Would anyone know how?

Thank you!

Sir Osis of Liver


That looks like a custom theme, so don't know if this will help, but in Curve the child board post/topic info is in MessageIndex.template.php, here -



// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="stats windowbg">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>



Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

wynnyelle

Thanks; would removing any of that cause errors, though? I went through major errors when trying to do similar cosmetic cleanup work on threads and posts last year.

Marcus Forsberg

As long as you remove them correctly without messing up the PHP syntax, you won't run in to any errors at all. It's just a simple edit.

Sir Osis of Liver


If you just remove the $txt variables, it shouldn't affect anything else.  You can even change a letter - $txt['board_topicx'] - and the text will disappear without changing the formatting.

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

Marcus Forsberg

Quote from: Krash. on April 08, 2012, 02:27:58 PM
If you just remove the $txt variables, it shouldn't affect anything else.  You can even change a letter - $txt['board_topicx'] - and the text will disappear without changing the formatting.

That wouldn't be a very good idea, though, calling for an undefined index. Better to remove it entirely. ;)

Chalky

Or just comment it out with // first to be on the safe side?

Sir Osis of Liver

Quote from: Marcus Forsberg on April 08, 2012, 02:33:46 PM
Quote from: Krash. on April 08, 2012, 02:27:58 PM
If you just remove the $txt variables, it shouldn't affect anything else.  You can even change a letter - $txt['board_topicx'] - and the text will disappear without changing the formatting.

That wouldn't be a very good idea, though, calling for an undefined index. Better to remove it entirely. ;)

It werks gud!   You can also find the variables in the language file and make them blank.  But it's best to edit out the variables.

Commenting out the line removes all the post/topic info, including the numbers, not just the text labels.

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

Marcus Forsberg

Quote from: Krash. on April 08, 2012, 03:22:53 PM
It werks gud!

Um, no. It causes an undefined index in the error log. ;) You don't want that. Just remove the variables, there is no reason not to.

wynnyelle

Yeah--I know about undefined indexes. We have a whole slew of those already.

I'm so sorry to those of you who have given me directions here, but I just don't understand how to remove these commands to make those words not show up. :(

Sir Osis of Liver

Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood


Sir Osis of Liver


Ok, no way to test this but .....

Find this:



<td class="windowbg2b" valign="middle" align="center" style="width: 8ex;">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />

</p>
</td>
<td class="windowbg2b" valign="middle" align="center" style="width: 8ex;">
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</p>
</td>



Change to this:



<td class="windowbg2b" valign="middle" align="center" style="width: 8ex;">
<p>', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : ' ' , ' <br />

</p>
</td>
<td class="windowbg2b" valign="middle" align="center" style="width: 8ex;">
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . ' ' , '
</p>
</td>



Even if the whole world has forgotten,
The song remembers when.

                              - H. Prestwood

wynnyelle

I now have a test site environment. I tried this and it worked ! Thank you!

Advertisement: