Здравствуйте!
Есть код с датой:
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
CModule::IncludeModule('iblock');
if($_POST){
$selected=$_SESSION["items"][$_POST["vote"]];
$db_props = CIBlockElement::GetProperty(34, $selected['ID'], array("sort" => "asc"), Array("CODE"=>"VOTES"));
if($ar_props = $db_props->Fetch()){
$votes=intval($ar_props['VALUE']);
$votes++;
CIBlockElement::SetPropertyValuesEx($selected['ID'], false, array("VOTES" => $votes));
}
unset($_SESSION["items"]);
}
$date_m=date("m");
$from=".".($date_m).".".date("Y")." 00:00:00";
$arFilter = Array("IBLOCK_ID"=>34, "ACTIVE"=>"Y",">=DATE_ACTIVE_FROM"=>$from);
$arSelect = Array("ID", "NAME", "DATE_ACTIVE_FROM","PREVIEW_PICTURE");
$res = CIBlockElement::GetList(Array("RAND"=>"ASC"), $arFilter, false, Array("nPageSize"=>2), $arSelect);
$items=array();
while($ob = $res->Fetch()){
$items[]=$ob;
}
$arResult["items"]=$items;
$_SESSION['items']=$items;
$res_total = CIBlockElement::GetList(Array("RAND"=>"ASC"), $arFilter, false, false, $arSelect);
$arResult["total"]=$res_total->SelectedRowsCount();
$this->IncludeComponentTemplate();
Когда дата выглядит так, как в коде, то я вижу все фото из папки ID 34.
Что сделать с датой, чтобы увидеть фото от определенной даты, а не все?
Есть код с датой:
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();
CModule::IncludeModule('iblock');
if($_POST){
$selected=$_SESSION["items"][$_POST["vote"]];
$db_props = CIBlockElement::GetProperty(34, $selected['ID'], array("sort" => "asc"), Array("CODE"=>"VOTES"));
if($ar_props = $db_props->Fetch()){
$votes=intval($ar_props['VALUE']);
$votes++;
CIBlockElement::SetPropertyValuesEx($selected['ID'], false, array("VOTES" => $votes));
}
unset($_SESSION["items"]);
}
$date_m=date("m");
$from=".".($date_m).".".date("Y")." 00:00:00";
$arFilter = Array("IBLOCK_ID"=>34, "ACTIVE"=>"Y",">=DATE_ACTIVE_FROM"=>$from);
$arSelect = Array("ID", "NAME", "DATE_ACTIVE_FROM","PREVIEW_PICTURE");
$res = CIBlockElement::GetList(Array("RAND"=>"ASC"), $arFilter, false, Array("nPageSize"=>2), $arSelect);
$items=array();
while($ob = $res->Fetch()){
$items[]=$ob;
}
$arResult["items"]=$items;
$_SESSION['items']=$items;
$res_total = CIBlockElement::GetList(Array("RAND"=>"ASC"), $arFilter, false, false, $arSelect);
$arResult["total"]=$res_total->SelectedRowsCount();
$this->IncludeComponentTemplate();
Когда дата выглядит так, как в коде, то я вижу все фото из папки ID 34.
Что сделать с датой, чтобы увидеть фото от определенной даты, а не все?