[FX.php List] Help needed to rewrite old FMP tags to PHP ( to
achieve different table rows color )
Lars Arl é r
la at mediadesign.dk
Tue Mar 29 02:04:04 MST 2005
Hi and thanks in advance.
What I try to achieve is to make every second table row different color,
Other solution or options are welcome
Basically I need to make a include statement like this in PHP
<tr [FMP-include:../rowcolor.TXT]>
Would this work ??
<tr <? include_once('rowcolor.PHP'); ?> >
----------------------------------------------------------------------------
<? foreach($searchResult['data'] as $key=>$searchData){ ?>
<table width="100%" border="0" cellpadding="2"cellspacing="0">
<tr [FMP-include:../rowcolor.txt]>
<td><?php echo $value['recid'][0]; ?>
<? Echo $searchData['recid'][0]; ?></td>
<td><? echo $searchData['Headline'][0]; ?></td>
<td><? echo $searchData['category'][0]; ?></td>
</tr>
</table>
<? } ?>
-----------------------------------------------------------------------
-------------- included rowcolor.TXT -------------------------------
[FMP-IF:
CurrentRecordNumber .eq. 1] BGCOLOR="#DDDDDD"
[FMP-Else]
[FMP-IF:
CurrentRecordNumber .eq. 3] BGCOLOR="#DDDDDD"
[FMP-Else]
[FMP-IF:
CurrentRecordNumber .eq. 5] BGCOLOR="#DDDDDD"
[FMP-Else]
[FMP-IF:
CurrentRecordNumber .eq. 7] BGCOLOR="#DDDDDD"
[FMP-Else]
[FMP-IF:
CurrentRecordNumber .eq. 9] BGCOLOR="#DDDDDD"
[/FMP-IF]
[/FMP-IF]
[/FMP-IF]
[/FMP-IF]
[/FMP-IF]
-------------------------------------------------------------------------
-------------- included rowcolor.PHP -------------------------------
If($CurrentRecordNumber ==`1`){`BGCOLOR="# DDDDDD"`); }
else
If($CurrentRecordNumber ==`3`){`BGCOLOR="# DDDDDD"`); }
else
If($CurrentRecordNumber ==`5`){`BGCOLOR="# DDDDDD"`); }
Else
If($CurrentRecordNumber ==`7`){`BGCOLOR="# DDDDDD"`); }
else
If($CurrentRecordNumber ==`9`){`BGCOLOR="# DDDDDD"`); }
Else
-------------------------------------------------------------------------
Lars Arlér
More information about the FX.php_List
mailing list