Hello Guest
No Avatar
Sign In to Remove
Posts: 
15
Reputation: 
2
Posted: August 13, 2011, 6:29 AM
  • Group: Member
Hey, it's me again  :(

sorry, but I guess I have another question incomming. I do not like the redirection counter shown next to a board that redirects to an html page. I sucessfully managed to remove it from my first board two days ago but unluckily I forgot how...
Maybe there is a chance to remove it for all redirection boards?

I allready tried to edit the BoardIndex.template.php at this position:
Code: [Select]
<td class="boardindex_board_stats">
<center>
<small>
', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</small>
</center>
</td>

I tried to remove some parts but all that happened are the following things:
1. Redirections are not longer titled as redirections, they are now "posts"
2. The redirections were removed, but also the posts and topics of normal boards
3. Only the count of the redirection was left, so there was a "3" in this case

different combinations all resulted in one of the listed results, so I don't know what is left to do and I can't remember what I did to remove it at the first board...
Maybe someone is able to help me?
Posts: 
400
Reputation: 
20
Posted: August 13, 2011, 7:10 AM  -- Last Edit: August 13, 2011, 7:12 AM by MLM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Code: [Select]
<td class="boardindex_board_stats">
<center>
<small>
', comma_format($board['posts']), ' ', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], ' <br />
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
</small>
</center>
</td>

Alright let me break the above code down for you after I formated it.(the above is not the solution). It is also hard to tell apart the double single quotes(') from a normal quote(").

This is the number of posts or if it is a redirect then this is the number of redirects:
Code: [Select]
', comma_format($board['posts']), '
This is saying if board is redirect then say "Redirects" after the number, OTHERWISE say "Posts".
Code: [Select]
', $board['is_redirect'] ? $txt['redirects'] : $txt['posts'], '
Now this statement is a bit tricky especially on these forums because double single quotes '' and quotes " look the same but... This is saying if the board is a redirect then output nothing because the number of redirects and text was already outputted in the above piece of code and redirects doesnt have 2 lines of stuff unlike posts and topics. So if it isnt a redirect then it outputs the number of topics along with the text "Topics".
Code: [Select]
', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'], '
To break the above piece of code down a little further... The following would output for example "17 Topics". Notice it is joined by "."
comma_format($board['topics']) :: Number of topics
' ' :: Its a space
$txt['board_topics'] :: "Topics"
Code: [Select]
comma_format($board['topics']) . ' ' . $txt['board_topics']


Soooooooo.. What you need to do is use the same concept of the conditional statment(if)
Code: [Select]
', $board['is_redirect'] ? 'is redirect' : 'normal' ,'
Here is the fixed code that should work but it is untested.
ALSO, try writing the code yourself before opening the spoiler. Just use it to check your work.
[spoiler]

<td class="boardindex_board_stats">
   <center>
      <small>
         ', $board['is_redirect'] ? '' : comma_format($board['posts']) . ' ' . $txt['posts'] ,' <br />
         ', $board['is_redirect'] ? '' : comma_format($board['topics']) . ' ' . $txt['board_topics'] ,'
      </small>
   </center>
</td>


Hope ya got it right :)
[/spoiler]
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
15
Reputation: 
2
Posted: August 13, 2011, 11:28 PM
  • Group: Member
hey,

I tried to change the code in the way you said, but unluckily I failed.... at the end it looked like some piece of... erm...
One time it killed me the complete template, maybe I forgot something somewhere and one other time i was able to remove the word "redirect" again, but none of my tries sucessfully removed the count of the redirections. But your code worked, so finally I was able to remove it.

Maybe you can help me to understand what the right code means. So the first statement ', $board['is_redirect'] ? ' of course checks if the board is a redirection-board. And then obviously there is following what happens when it is no redirection board. And if I got it correct now, the empty room between the two ' between ?' and ': says, that there is then nothing, right?
Posts: 
400
Reputation: 
20
Posted: August 14, 2011, 8:45 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
hey,

I tried to change the code in the way you said, but unluckily I failed.... at the end it looked like some piece of... erm...
One time it killed me the complete template, maybe I forgot something somewhere and one other time i was able to remove the word "redirect" again, but none of my tries sucessfully removed the count of the redirections. But your code worked, so finally I was able to remove it.

Maybe you can help me to understand what the right code means. So the first statement ', $board['is_redirect'] ? ' of course checks if the board is a redirection-board. And then obviously there is following what happens when it is no redirection board. And if I got it correct now, the empty room between the two ' between ?' and ': says, that there is then nothing, right?

Yep if you write '' (<--- those are single quotes) two single quotes then it is nothing.
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
15
Reputation: 
2
Posted: August 14, 2011, 6:06 PM
  • Group: Member
Okay, then I got it right! =D

One question: It seems that only the counter of redirections at the main page is removed. When I enter a board with a child board that redirects, there is still the redirection-counter. Can you tell me in which template I can found those lines?
Posts: 
400
Reputation: 
20
Posted: August 15, 2011, 6:54 AM
  • Group: Administrator
  • AIM: mlm@visualpulse.net
  • deviantART: MadLittleMods
  • Photobucket: MadLittleMods
Okay, then I got it right! =D

One question: It seems that only the counter of redirections at the main page is removed. When I enter a board with a child board that redirects, there is still the redirection-counter. Can you tell me in which template I can found those lines?

MessageIndex.template.php - Unfortunately they are separate things but you can just copy paste stuff into it since the variables are the same.
<3 Nerve, Sk8, Labradoodle, Austin
Posts: 
15
Reputation: 
2
Posted: August 15, 2011, 7:16 AM
  • Group: Member
Thanks a lot  :D