I'm working on a phpbb theme and want to format some rows differently depending on how many rows have already been drawn.
Here's my attempt:
It should be noted I don't know any php -.-
This basically does nothing.
What I did (or intended to do):
Set a variable to 0:
<?php $numbercount = 0; ?>
Add 1 each time a row is drawn:
<?php $numbercount = $numbercount + 1; ?>
Format differently if it's equal to five:
<?php if ($numbercount == 5) echo "style='background-color: #ff0000'" ?>
What I'm actually planning to do is hide certain rows, but I figure if I can work this out first then it would help.
Here's my attempt:
Code:
<?php $numbercount = 0; ?>
<!-- BEGIN topicrow -->
<?php $numbercount = $numbercount + 1; ?>
<tr>
<td class="row1" <?php if ($numbercount == 5) echo "style='background-color: #ff0000'" ?> width="100%">
<!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a><!-- ENDIF -->
<!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>ORGy AWARD vote:</b> <!-- ENDIF --><a title="{L_POSTED}: {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><b><!-- ENDIF -->{topicrow.TOPIC_TITLE}<!-- IF topicrow.S_UNREAD_TOPIC --> ~ You have not yet voted in this award<!-- ENDIF -->
</td>
</td>
</tr>
<!-- END topicrow -->
It should be noted I don't know any php -.-
This basically does nothing.
What I did (or intended to do):
Set a variable to 0:
<?php $numbercount = 0; ?>
Add 1 each time a row is drawn:
<?php $numbercount = $numbercount + 1; ?>
Format differently if it's equal to five:
<?php if ($numbercount == 5) echo "style='background-color: #ff0000'" ?>
What I'm actually planning to do is hide certain rows, but I figure if I can work this out first then it would help.