I realised, that every designer needs a good portfolio.
Than I started to make it. Here is what I have now.
There must be fore modes, with columns changing like this:
In these examples slash is eval to class=\"Boxright\" (the dotted line in the screenshot). What do I need to change in my code?PHP Code:1
2
3
4
5
6
AND
1 / 2
3 / 4
5 / 6
AND
1 / 2 / 3
4 / 5 / 6
AND
1 / 2 / 3 / 4
5 / 6 / 7 / 8
9/ 10/ 11/12
The MySQL database. Works ok.PHP Code:<table align="center" cellpadding="0" cellspacing="4" width="540">
<?
$cols = "2"; // 2 row mode
$query = "SELECT * FROM imglib WHERE cat='$c' ORDER BY $so $o LIMIT $initialPhoto, $it";
if(!$result = mysql_query($query)) echo "Query failed";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$data = $row["url"];
if ($i == 0) {
echo "<tr>";
}
if (($i % $cols) == 0 ) { // if ($i == $cols)
echo "</tr><tr>";
echo "<tr>";
echo "<td width=\"540\" height=\"30\" colspan=\"2\" class=\"BoxBellow\">";
echo "<p> </p>";
echo "</td>";
echo "</tr>";
$i = 0;
}
if ((1&$i)) { // odd shows no dotted line
echo "<td width=\"270\">";
}
if (!(1&$i)) { // even shows a dotted line
echo "<td width=\"270\" class=\"Boxright\">";
}
itemplaceholder();
echo "</td>";
$i++;
}
if ($i != $cols)
echo "</tr>";
?>
</table>
Nothing works, just the page numeration (separate) works, but no table displayed (<table> tags are THERE). The other variant code:PHP Code:CREATE TABLE imglib (
id int(10) unsigned NOT NULL auto_increment,
cat varchar(21) default 'gif',
type varchar(21) NOT NULL default 'Website template',
desc text NOT NULL,
url varchar(20) default NULL,
price tinytext NOT NULL,
author varchar(255) default 'Tagore',
timestamp timestamp(14) NOT NULL,
PRIMARY KEY (id)
) TYPE=MyISAM;
INSERT INTO imglib VALUES (1, 'gif', 'Vector logo', '', 's001', '$25', 'MGJ', 20030511040034);
INSERT INTO imglib VALUES (2, 'gif', 'Vector logo', '', 's002', 'FREE', 'MGJ', 20030511194715);
INSERT INTO imglib VALUES (3, 'gif', 'Vector logo', '', 's003', '$30', 'MGJ', 20030510181227);
PHP Code:$columns = 2
$counter = 0;
echo "<tr>";
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
if ($counter % ($columns++)) { // Row change
echo "</tr><tr>";
} elseif (($counter % ($columns++)) == $columns) { // Last td on a row
echo "<td>"
itemplaceholder();
echo "</td>"
} else { // Normal td
echo "<td>".$row['ID']."</td>";
echo "<td><img src=\"img/divider.gif\" /></td>";
}
$counter++;
}
echo "</tr>";


Reply With Quote
Bookmarks