Photolog multiple columns…
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>
September 2nd, 2002 at 12:49 am
Rock on!! I’ve been thinking about making categories for my photolog and was curious how to go about putting the thumbnails in a little more tabled layout
Thank you for saving me the extra hours of frustration of having to think this code out myself 
November 10th, 2002 at 9:22 am
This script from scriptygoddess is very handy and I wanted to bookmark it here as well. While originally intended to
January 29th, 2003 at 8:23 am
You can use the MTGrid plugin to create tables without JavaScript or PHP programming.
January 29th, 2003 at 8:08 pm
i am trying this code and it will not show anything past the first row…does it extend? ie i have 4 entries and a 3-column layout and i only see my first 3 entries..the 4th has disappeared!
February 25th, 2003 at 11:31 pm
If it weren’t for the generous people who share their code, this site would have long ago lost it’s fizz. The related resources to the right list all the script sources I’ve used on this site at one time or another. Related resources: myimages/bulletg…
July 10th, 2003 at 2:33 pm
Okay, I’m thoroughly lost here. I have this scriipt (in PHP form) working perfectly on one page:
http://haloandhorns.com/f16/archives.php
Here is the txt file:
http://haloandhorns.com/f16/debug/archiving.txt
But then on this second page (different site) I cannot get it working.
http://bluewyrmartwerks.com/archives.php
Here is the txt file:
http://bluewyrmartwerks.com/debug/archiving.txt
Its driving me batty, and if you happen to see something I’m missing, I’ll be very happy!
October 6th, 2003 at 6:34 pm
I think today my lomo is going to come. And this weekend in Georgia is sales tax holiday. I think we all know that a new scanner is in my future. I was inspired to get the lomo by a.life.uncommon….
November 15th, 2003 at 6:05 am
I think today my lomo is going to come. And this weekend in Georgia is sales tax holiday. I think we all know that a new scanner is in my future. I was inspired to get the lomo by a.life.uncommon….
December 28th, 2003 at 12:09 pm
The JavaScript Source is a great place to find javascript resources and Scripty Goddess is a goldmine of PHP and other scripts tailored for the movable type environment. Also, another good source for tips is Girlie Matters. You may also want to check o…
March 29th, 2004 at 9:21 am
Does it work with Rows as well?
I need 5 cols and 2 rows (10 images per page)
is that possible?
Does it integrate with MTPaginate?
I tried MTGrid but it doesn’t seem to integrate with MTpaginate.