PDA

View Full Version : Repeat Regions


Creative Insanity
03-16-2006, 08:00 PM
You know how a repeat region is by default vertical, is it possible to make it go horizontal for a set number accross and then down 1 and do the same again?

I am getting a sore head and there is a lot of blood on the wall.. LOL

anywaone?

Creative Insanity
03-16-2006, 08:20 PM
Ok I got them going horizontal.. now how to stop at 3 across..

I need a script something like

if something something =3 then somthing </tr><tr> ?? err.. dunno ???

where's that wall again. LOL

davidj
03-17-2006, 07:50 AM
in your DO{ loop


$count = 1

DO{

$count = $count+1;

**repeating data here**

if ($count == 3){echo '
';}

Creative Insanity
03-17-2006, 08:22 AM
Cheers dj, I got it sorta working.. but only does 2 across instead of three.. bit it is a start.

?php

while($row = mysql_fetch_array($result))

{ $count = $count+1;
?>
<td width="30%">

<table width="100%" border="0" cellpadding="0" cellspacing="4" onMouseOver="this.style.backgroundColor='#e5fafa';" onMouseOut="this.style.backgroundColor='#FFFFFF';" class="border">
<tr>
<td valign="top" align="center"><?php echo $row["itemImg"]; ?></td>
</tr>
<tr>
<td valign="top" align="center"><?php echo $row["itemName"]; ?></td>
</tr>
<tr>
<td valign="top" align="left"><?php echo $row["itemDesc"]; ?></td>
</tr>
<tr>
<td valign="top">&qty=1" target="cart">Add Item (cart.php?action=add_item&id=<?php echo $row[)</td>
</tr>
</table>

<?php

if ($count == 3){echo '</tr><tr>';}
}
?>

Creative Insanity
03-17-2006, 08:29 AM
Ah huh cracked it dj.. ta heaps for the index.. why didn't I think of that way.
Must pf been all the head againts the wall trick. LOL

anyhoo we sussed it and now got going across 3 and then starts new table row.
Just changed this line
if ($count == 3){echo '</tr><tr>';}
to this
if ($count == 4){echo '</tr><tr>';}

Creative Insanity
03-17-2006, 09:05 AM
hehe silly me LOL

Since $count=1 then == 3 and what it was doing was correct as it had already counted 1.. so that ment I would of only got 2 across before it dropped. So changed the $count =0 was better, and looked better also.. silly silly me.

Me tinks DJ was testing the old bugger.. LOL.. ya nearly got me.. but dis kiwi is pretty sharp LOL

davidj
03-17-2006, 09:32 AM
darn it

ill get ya next time

davidj
03-17-2006, 01:37 PM
you have a typo in your demo

>>>> Nice tee shit

its funny ... hehe

Creative Insanity
03-17-2006, 05:23 PM
Yeah there is bound to be a heap more typos before I am finished.
I am changing the complete front end of a music producing site from top to bottom and also adding some features and extra bits.. that shop is one of the extra bits and there are a heap more also.. now that you have see it dj I will remove the link as it is still a little hush hush.. (he says after splattering it on the net LOL)