Was reminded of this script by looking through my referrers… had forgotten about it. Wanted to post it here so I don't lose it again.
The following script is really designed for a photo log… it will set up your page (MT specific) so that it automatically generates a table with 3 columns (You can actually customize it to be however number of columns you choose…
Javascript version:
<script language="javascript">
<!–
// number of columns
var numColmax = 3;
var numCol = 1;
var done=false;
//–>
</script>
<table width="400" border=1 cellspacing=3 cellpadding=0>
<MTEntries>
<script language="javascript">
<!–
if (numCol == 1) {
document.write("<tr>");
}
//–>
</script>
<td>
<a href="<$MTEntryLink$>">
<$MTEntryTitle$>
<br>
<$MTEntryExcerpt$>
</a>
</p>
</td>
<script language="javascript">
<!–
numCol++
done = false
if (numCol > numColmax) {
document.write("</tr>");
numCol=1;
done = true;
}
//–>
</script>
</MTEntries>
<script language="javascript">
<!–
if (!(done)) {
for (i=0; numCol <= numColmax; i++ )
{
document.write("<td> </td>")
numCol++
}
}
if ((numCol >= numColmax) && !(done)) {
document.write("</tr>")
}
//–>
</script>
</table>
————————
PHP version:
<?
// number of columns
$numColmax = 3;
$numCol = 1;
$done=false;
?>
<table width="400" border=1 cellspacing=3 cellpadding=0>
<MTEntries>
<?
if ($numCol == 1) { ?>
<tr>
<? } ?>
<td>
<a href="<$MTEntryLink$>">
<$MTEntryTitle$>
<br>
<$MTEntryExcerpt$>
</a>
</p>
</td>
<?
$numCol++;
$done = false;
if ($numCol > $numColmax) { ?>
</tr>
<?
$numCol=1;
$done = true;
} ?>
</MTEntries>
<?
if (!($done)) {
for ($i=0; $numCol <= $numColmax; $i++ )
{ ?>
<td> </td>
<?
$numCol++;
}
}
if (($numCol >= $numColmax) && !($done)) {
?>
</tr>
<? } ?>
</table>