106
Programming / Need help... PHP code
« on: March 17, 2011, 12:43:21 PM »
Hello. Please help me with next... I`m not a programmer, very difficult for me
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 3;
$bgcounter = 3;
while ($image_row = $site_db->fetch_array($result)) {
if ($count == 3) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("mscomments_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$thumbnails = "</table>\n";
}
}
I need to show next:
<table.....>
<tr>
<td>3 thumbnails</td>
</tr>
<tr>
<td>3 thumbnails</td>
</tr>
.......
</table>
many thanks!
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 3;
$bgcounter = 3;
while ($image_row = $site_db->fetch_array($result)) {
if ($count == 3) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row);
$thumbnails .= $site_template->parse_template("mscomments_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$thumbnails = "</table>\n";
}
}
I need to show next:
<table.....>
<tr>
<td>3 thumbnails</td>
</tr>
<tr>
<td>3 thumbnails</td>
</tr>
.......
</table>
many thanks!