Witam nie wiem jak przerobić pętle while tak aby co 3 wykonywany cykl dodawała mi fragment kody a dokładnie
pętla wywala mi zaznaczone tabelki w poziomie chce aby był to blok czy ktoś mi pomoże myślałem że zastosuje funkcje
<?if?>
ale coś mi nie wyszło
while ($item_details = $db->fetch_array($sql_select_auctions))
{
$width = 100/$nb_auctions . '%';
$main_image = $db->get_sql_field("SELECT media_url FROM " . DB_PREFIX . "auction_media WHERE
auction_id='" . $item_details['auction_id'] . "' AND media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC LIMIT 0,1", 'media_url');
$auction_link = process_link
('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id'])); $auction_link1 = ($item_details['auction_id']);
$auction_link_max = process_link
('auction_max', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id'])); $start = ('');
$koniec = ('');
(string) $pm_methods = null;
if (!empty($item_details['direct_payment'])) {
$dp_methods = $item->select_direct_payment($item_details['direct_payment'], $user_details['user_id'], true, true);
$pm_methods = $db->implode_array($dp_methods, ', ') . '<br>';
}
if (!empty($item_details['payment_methods'])) {
$offline_payments = $item->select_offline_payment($item_details['payment_methods'], true, true);
$pm_methods .= $db->implode_array($offline_payments, ', ');
}
$compared_items_content .= '' . $start . '<td width="' . $width . '" align="center" valign="top" class="catfeatmaincell"> '.
'<table width="100%" border="0" cellspacing="2" cellpadding="5" class="catfeattable"><tr><td><table width="100%" class="border"> '.
' <tr class="c2"> '.
' <td class="smallfont" height="50"><center><b><a href="' . $auction_link . '">' . $item_details['name'] . '</a></b></center></td> '.
' </tr></table>'.
' <tr class="smallfont" height="200"> '.
' <td align="center" class="catfeatpic"><a href="' . $auction_link . '"><img src="' . (((!empty($main_image)) ?
'thumbnail.php?pic=' . $main_image . '&w=200&sq=Y' : 'themes/' . $setts['default_theme'] . '/img/system/noimg.gif')) . '" border="0" alt="' . $item_details['name'] . '"></a></td> '. ' </tr> '.
' <tr><td align="right"><b>Nr. aukcji </b> ' . $auction_link1 . ' ' . user_pics1($item_details['owner_id']) . ' <table width="100%" class="border"><tr> '.
' <td height="50">' . $item_details['username'] . ' ' . user_pics($item_details['owner_id']) . '</td> '.
' </tr></table><br /> '.
' <table width="100%" class="border"><tr> '.
' <td class="catfeatc1"></td> '.
' </tr> '.
' <tr> '.
' <td class="catfeatc1"><b>' . GMSG_START_TIME . ':</b> ' . show_date($item_details['start_time']) . ' <br> '.
' <b>' . GMSG_END_TIME . ':</b> ' . show_date($item_details['end_time']) . ' </td> '.
' </tr> '.
' <tr> '.
' <td class="catfeatc1"><b>' . MSG_START_BID . ':</b> ' . $fees->display_amount($item_details['start_price'], $item_details['currency']) . ' <br> '.
' <b>' . MSG_CURRENT_BID . ':</b> ' . $fees->display_amount($item_details['max_bid'], $item_details['currency']) . ' <br> '.
' <b>' . MSG_NR_BIDS . ':</b> ' . $item_details['nb_bids'] . '</td> '.
' </tr> '.
' <tr> '.
' <td class="catfeatc1"><b>' . GMSG_BUYOUT . ':</b> ' . (($item_details['buyout_price']<=0) ? GMSG_NO : GMSG_YES . ', <b>' . GMSG_PRICE . ': ' . $fees->display_amount($item_details['buyout_price'], $item_details['currency']) . '</b>') . ' </td> '.
' </tr> '.
' <tr> '.
' <td class="catfeatc1"><b>' . MSG_PAYMENT_METHODS . ':</b> <br>' . $pm_methods . ' </td> '.
' </tr></table><br /> '.
' <table width="100%" class="border"><tr> '.
' <td class="catfeatc1" align="right">Odznacz aby nie porównywać w kolejnym rozdaniu <input type="checkbox" name="auction_id[]" value="' . $item_details['auction_id'] . '" checked></td></tr></table></td> '.
' </tr> '.
'</table></td>
#
' . $koniec . ' ';
}