Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
- <?
- $countItems = 0;
- $oldItemNumber = 0;
- $Items =array();
- $Items1 = array();
- $Items2 = array();
- $Items3 = array();
- foreach ($arResult as $arItem){
- if ($arItem["DEPTH_LEVEL"] == 3){
- if ($oldItemNumber+1 == $arItem["ITEM_INDEX"]){
- if($countItems%3 == 0){
- $Items1[] = $arItem;
- }
- if($countItems%3 == 1){
- $Items2[] = $arItem;
- }
- if($countItems%3 == 2){
- $Items3[] = $arItem;
- }
- $oldItemNumber++;
- $countItems++;
- }
- }
- else{
- if ($countItems != 0){
- array_push($Items1,"</li><li>");
- array_push($Items2,"</li><li>");
- }
- $Items = array_merge($Items,$Items1,$Items2,$Items3);
- $Items1 = array();
- $Items2 = array();
- $Items3 = array();
- $oldItemNumber = $arItem["ITEM_INDEX"];
- $countItems = 0;
- }
- }
- $count = 0;
- foreach ($arResult as $arItem){
- if ($arItem["DEPTH_LEVEL"] == 3){
- if ($oldItemNumber+1 == $arItem["ITEM_INDEX"]) {
- if ($Items[$count+1] == "</li><li>"){
- $Items[$count]["PARAMS"]["END_TAG"] = "</li><li>";
- }
- $arResult[$arItem["ITEM_INDEX"]+1] = $Items[$count];
- $count++;
- if ($Items[$count] == "</li><li>"){
- $count++;
- }
- $oldItemNumber++;
- }
- }
- else{
- $oldItemNumber = $arItem["ITEM_INDEX"];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement