News:

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

Main Menu

How to hide number of posts and topics from guest

Started by M4R1O, July 23, 2014, 09:23:44 AM

Previous topic - Next topic

M4R1O

Is this possible? Forum is private and guests should not see this information, this red is what I want to hide from guests

mashby

Themes/BoardIndex.template.php. Look for this:
// 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>
</td>
<td class="lastpost">';

Replace with this:
// Show some basic information about the number of posts, etc.
echo '
</td>';
if ($context['user']['is_logged'])
{
echo '
<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>
</td>';
}
echo '
<td class="lastpost">';


Moving this to SMF coding discussion next...also make sure you have an editing environment you have an Undo function, just in case my coding isn't quite right.
Always be a little kinder than necessary.
- James M. Barrie

M4R1O


mashby

Just noticed this codebit a little lower...
echo '
<tbody class="divider">
<tr>
<td colspan="4"></td>
</tr>
</tbody>';
If a user is logged in that is correct, otherwise guests should only have colspan="3". Not sure how to code that other than a lazy way. Hmm..
Always be a little kinder than necessary.
- James M. Barrie

M4R1O

I do not see the difference, where is it? To leave 4 or ...

mashby

Can you provide a link to your site? As a guest, you might see the difference. Maybe it's not a big deal. There's just a missing TD in the last TR of that TABLE. :)
Always be a little kinder than necessary.
- James M. Barrie

Advertisement: