...

View Full Version : Insert Row After X Amount?



curb
11-28-2006, 12:57 AM
I'm still very new to php with the limited time I have so please bare with me. I have a gallery that will generate 3 images per row by using the break tag:


$num++;
$images.="<a href=\"$_url/image.php?u=galleries/$_GET[folder]/$file\" target='_blank'><img src=\"$_url.$gallery_path$_GET[folder]/tn-$file\"></a> \n";
if($num==3){
$images.="<br>";
$num="0";

I have 15 images total in each gallery so it'll generate 5 rows.

I'm trying to insert a qoute/description between one of the rows like below:

X X X
X X X
qoute
X X X
X X X
X X X

Thanks.

chump2877
11-28-2006, 02:21 AM
it's hard to tell exactly what you;re doing because there is not a lot of context code there to go by....can you show how you are looping through your image files (the code)?

But maybe something like this?:


$num++;
$images.="<a href=\"$_url/image.php?u=galleries/$_GET[folder]/$file\" target='_blank'><img src=\"$_url.$gallery_path$_GET[folder]/tn-$file\"></a> \n";
if($num==3)
{
if ($file == "somefile.jpg")
$images.="<br>".$quote."<br>"; // Insert HTML $quote here
else
$images.="<br>";

$num="0";



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum