Очень долго грузится страница 30-40 секунд.
Помогите оптимизировать код для более быстрой работы.
Помогите оптимизировать код для более быстрой работы.
Код |
---|
<? if(CModule::IncludeModule("iblock")) { $IBLOCK_ID = Array("4","6","10","20","22","24","26","28"); $IBLOCK_ID = $_GET['IBLOCK_ID']; $dbElements = CIBlockElement::GetList( array('SORT' => 'ASC', 'xml_id'), array( 'IBLOCK_TYPE' => 'catalog', 'IBLOCK_ID' => $IBLOCK_ID, ), false, array( 'nTopCount' => 150 ) ); $rows = 30; $echo_tr = 0; echo "<table width=100%>"; for($i=0;$i<$rows;$i++) { while($arItem = $dbElements->GetNext()) { if(isset($arItem["DETAIL_PICTURE"])) { if($echo_tr == 0) echo "<tr>"; $db_props = CIBlockElement::GetProperty($arItem["IBLOCK_ID"], $arItem["ID"], "sort", "asc", array()); $PROPS = array(); while($ar_props = $db_props->Fetch()) $PROPS[$ar_props['CODE']] = $ar_props['VALUE']; $art = $PROPS["ARTICLE"]; echo "<td>"; echo "<table class=tovar><tr><td>"; echo "<div class=tovar><center><a href='/search/?q=".$PROPS["ARTICLE"]."'>".$PROPS["ARTICLE"]." (".$PROPS["MAKER"].") <br>"; echo "<table height=120px width=185px align=center><tr><td align=center>"; echo CFile::ShowImage($arItem["DETAIL_PICTURE"], 100, 100, "border=0", "/search/?q=$art", true, $PROPS["ARTICLE"], 100, 100)."<br>"; echo "</td></tr></table>"; echo $arItem["NAME"]." </a></center></div>"; echo "</td></tr></table>"; echo "</td>"; $echo_tr++; if($echo_tr == 5) { echo "</tr>"; $echo_tr = 0; } } } } echo "</table>"; $PROPS["N"] = $arItem["NAME"]; } ?> |