Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: ApplianceJunk on January 18, 2013, 10:15:04 PM

Title: How to remove redirect board redirect count?
Post by: ApplianceJunk on January 18, 2013, 10:15:04 PM
I would like to remove the part that shows the redirect count as shown in my attachment.

Think I'm looking in the right area, but not sure just what to edit.

BoardIndex.template.php

// 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">';


I'm I even looking in the right area?

Thanks,

Title: Re: How to remove redirect board redirect count?
Post by: Hj Ahmad Rasyid Hj Ismail on January 19, 2013, 02:58:16 AM
I am not testing this yet but try changing it to:

<p>', comma_format($board['posts']), ' ', $txt['posts'], ' <br />
', comma_format($board['topics']), ' ', $txt['board_topics'], '
</p>
Title: Re: How to remove redirect board redirect count?
Post by: NanoSector on January 19, 2013, 04:05:32 AM
Only change the similar part, don't replace all the code you posted with it.

(ahrasis, that should work, nice thinking ;))
Title: Re: How to remove redirect board redirect count?
Post by: ApplianceJunk on January 19, 2013, 09:19:27 AM
When I use the above code change instead of removing "11 Redirects" it changes it to, "11 Post 0 Topics".

Title: Re: How to remove redirect board redirect count?
Post by: NanoSector on January 19, 2013, 09:25:18 AM
Change the same piece into this:

<p>', $board['is_redirect'] ? '' : comma_format($board['posts']) . ' ' . $txt['posts'] . ' <br />' . comma_format($board['topics']) . ' ' . $txt['board_topics'], '</p>
Title: Re: How to remove redirect board redirect count?
Post by: ApplianceJunk on January 19, 2013, 09:40:12 AM
Yoshi2889, that works great! Thank you.
Title: Re: How to remove redirect board redirect count?
Post by: Hj Ahmad Rasyid Hj Ismail on January 19, 2013, 12:33:33 PM
Quote from: Yoshi2889 on January 19, 2013, 04:05:32 AM
(ahrasis, that should work, nice thinking ;))

You speak to soon. Thanks for the code Yoshi. I understand the ? and : function better today.
Title: Re: How to remove redirect board redirect count?
Post by: NanoSector on January 19, 2013, 12:34:27 PM
Quote from: ahrasis on January 19, 2013, 12:33:33 PM
Quote from: Yoshi2889 on January 19, 2013, 04:05:32 AM
(ahrasis, that should work, nice thinking ;))

You speak to soon. Thanks for the code Yoshi. I understand the ? and : function better today.
Hehe checking code from a smartphone isn't easy ;)

? and : is more like an if...else condition.
if ($this_is_true)
echo "Test";
else
echo "It was not true.";

equals to
echo $this_is_true ? "Test" : "It was not true.";

It's just a way to write shorter code :)
Title: Re: How to remove redirect board redirect count?
Post by: Hj Ahmad Rasyid Hj Ismail on January 19, 2013, 12:46:29 PM
Quote from: Yoshi2889 on January 19, 2013, 12:34:27 PM
It's just a way to write shorter code :)

Yup! And cleaner too. I really like it. I will practise using this more in the future.