A help with design
Posted: Thu Feb 12, 2004 3:27 pm
I have this script and I'm trying to reduce the amounts of line in the script, I got the logic and everything figure out but I want to try and reduce this snipplet of my script but have no idea where to start? Anyone know of any ideas
TY
Code: Select all
<?php
if ($map=="de_dust2") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$dust2record</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$dust2percent %</font></td>\n";
}elseif ($map == "de_aztec") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$aztecrecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$aztecpercent %</font></td>\n";
}elseif ($map == "de_nuke") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$nukerecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$nukepercent %</font></td>\n";
}elseif ($map == "de_train") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$trainrecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$trainpercent %</font></td>\n";
}elseif ($map == "de_cpl_fire") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$firerecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$firepercent %</font></td>\n";
}elseif ($map == "de_cpl_mill") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$millrecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$millpercent %</font></td>\n";
}elseif ($map == "de_inferno") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$infernorecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$infernopercent %</font></td>\n";
}elseif ($map == "de_cbble") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$cbblerecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$cbblepercent %</font></td>\n";
}elseif ($map == "de_comrade") {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$comraderecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$comradepercent %</font></td>\n";
}elseif ($map != $maplist) {
echo "<td width="4%" height="22" background="record_table_rowbg.jpg"></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$map</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$comraderecord</font></td>\n".
"<td width="32%" height="22" background="record_table_rowbg.jpg"><font size="2">$comradepercent %</font></td>\n";
}
}
?>