I have this code for setting how many images appear per line. Its fine for the first set out, but any after it stay the same
$i = 0;
while ($row = mysql_fetch_array($sql1)) {
if (($row['type'] == "puzzle") and $row['amount'] == 15)
define('CARDS_PER_ROW', 3);
elseif ($row['amount'] == 5 || $row['amount'] == 10 || $row['amount'] == 15 || $row['amount'] == 20 || $row['amount'] == 25)
define('CARDS_PER_ROW', 5);
elseif ($row['amount'] == 4)
define('CARDS_PER_ROW', 4);
echo "<img src=\"{$row['url']}\" alt=\"{$row['alttext']}\" /> " ;
if (++$i % CARDS_PER_ROW == 0)
echo '<br />';
}
}
Take for example this page
http://www.darknesswithin.com.ru/users/user.php?user=Obi-Wan
Layout 1 appears fine, since theres 4 cards, but quigon doesn't. Theres 20 cards so it should be 5 per row
I'm not sure why its doing this, can anyone help