Вместо того, что бы осуждать, надо помогать, либо молчать.
Код |
---|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
$eventID = intval($_GET["ID"]);
if (!empty($eventID)) {
$arReviewsIDs = array();
$arFeedbacksList = array();
$rsEventsList = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 10, "ID" => $eventID, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y"), false, false, array("PROPERTY_EVENTS"));
while ($arEvent = $rsEventsList->Fetch()) {
if (!empty($arEvent['PROPERTY_EVENTS_VALUE'])) {
$arReviewsIDs[] = $arEvent['PROPERTY_EVENTS_VALUE'];
}
}
if (!empty($arReviewsIDs)) {
$rsReviewsList = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 11, "ID" => $arReviewsIDs, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y"), false, false, array("PROPERTY_REVIEWS"));
while ($arReview = $rsReviewsList->Fecth()) {
if (!empty($arReview["PROPERTY_REVIEWS_VALUE"])) {
$arFeedbacksList[] = $arReview["PROPERTY_REVIEWS_VALUE"];
}
}
}
unset($eventID, $arReviewsIDs, $rsEventsList, $arEvent, $rsReviewsList, $arReview);
echo '<pre>';
print_r($arFeedbacksList);
echo '</pre>';
}
|
либо, если связка правильно сделана, то хватит и такого
Код |
---|
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
$eventID = intval($_GET["ID"]);
if (!empty($eventID)) {
$arReviewsIDs = array();
$arFeedbacksList = array();
$rsEventsList = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 10, "ID" => $eventID, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y"), false, false, array("PROPERTY_EVENTS.PROPERTY_REVIEWS"));
while ($arEvent = $rsEventsList->Fetch()) {
if(!empty($arEvent['PROPERTY_EVENTS_PROPERTY_REVIEWS_VALUE'])) {
$arFeedbacksList[] = $arEvent['PROPERTY_EVENTS_PROPERTY_REVIEWS_VALUE'];
}
}
unset($eventID, $arReviewsIDs, $rsEventsList, $arEvent);
echo '<pre>';
print_r($arFeedbacksList);
echo '</pre>';
}
|