How to remove redirect board redirect count?

Started by ApplianceJunk, January 18, 2013, 10:15:04 PM

Previous topic - Next topic

ApplianceJunk

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,


Hj Ahmad Rasyid Hj Ismail

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>

NanoSector

Only change the similar part, don't replace all the code you posted with it.

(ahrasis, that should work, nice thinking ;))
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."

ApplianceJunk

When I use the above code change instead of removing "11 Redirects" it changes it to, "11 Post 0 Topics".


NanoSector

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

ApplianceJunk


Hj Ahmad Rasyid Hj Ismail

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.

NanoSector

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

Hj Ahmad Rasyid Hj Ismail

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.

Advertisement: