Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
$arIDs = []; $subQuery = CIBlockElement::SubQuery('PROPERTY_CML2_LINK', ['ACTIVE..
Decoded Output download
<?
$arIDs = [];
$subQuery = CIBlockElement::SubQuery('PROPERTY_CML2_LINK', ['ACTIVE' => 'Y', 'CATALOG_AVAILABLE' => 'Y', '>CATALOG_PRICE_8' => 0]);
$rsProduct = CIBlockElement::GetList(['HAS_DETAIL_PICTURE' => 'desc', 'CREATED_DATE' => 'desc'], [
"ACTIVE" => "Y",
"!CODE" => '',
"IBLOCK_ID" => IBLOCK_ID_CATALOG,
'CATALOG_AVAILABLE' => 'Y',
0 => [
'LOGIC' => 'OR',
['ID' => $subQuery],
['>CATALOG_PRICE_8' => 0]
]
], false, ['nTopCount' => 20], ["ID", "IBLOCK_ID", "PROPERTY_CUSTOM_LABEL", 'NAME', 'CATALOG_AVAILABLE', 'CREATED_DATE']);
while ($arProduct = $rsProduct->Fetch()) {
if ($params['SHOW_NEW']) {
p('NEW ' . $arProduct['CREATED_DATE'] . ' ' . $arProduct['NAME']);
}
$arPropValue = [];
$rsProp = CIBlockElement::GetProperty($arProduct['IBLOCK_ID'], $arProduct["ID"], [], ["CODE" => "LABEL"]);
$isNew = false;
while ($arProp = $rsProp->Fetch()) {
if ($arProp["VALUE_XML_ID"] == "new") {
$isNew = true;
} else {
$arPropValue[] = $arProp["VALUE"];
}
}
if (!$isNew $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'NEW') {
$arIDs[$arProduct["ID"]] = $arProduct["ID"];
}
if (!$isNew) {
$arPropValue[] = IBLOCK_ENUM_VALUE_NEW;
CIBlockElement::SetPropertyValuesEx($arProduct["ID"], $arProduct['IBLOCK_ID'], ["LABEL" => $arPropValue, "CUSTOM_LABEL" => 'NEW']);
}
}
//
$rsProduct = CIBlockElement::GetList([], ["ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG, 'PROPERTY_LABEL' => [IBLOCK_ENUM_VALUE_HIT, IBLOCK_ENUM_VALUE_NEW], '!ID' => $arIDs], false, false, ["ID", "IBLOCK_ID", "PROPERTY_CUSTOM_LABEL", "PROPERTY_LABEL", 'CATALOG_PRICE_8', 'CATALOG_AVAILABLE']);
while ($arProduct = $rsProduct->Fetch()) {
$arPropValue = [];
$rsProp = CIBlockElement::GetProperty($arProduct['IBLOCK_ID'], $arProduct["ID"], [], ["CODE" => "LABEL"]);
$isSale = false;
while ($arProp = $rsProp->Fetch()) {
if (
$arProp["VALUE_XML_ID"] == "hit" && $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'HIT'
$arProp["VALUE_XML_ID"] == "new" && $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'NEW'
$arProduct["CATALOG_AVAILABLE"] != "Y"
$arProduct["CATALOG_PRICE_8"] <= 0
) {
} else {
$arPropValue[] = $arProp["VALUE"];
}
}
if (empty($arPropValue))
$arPropValue = false;
CIBlockElement::SetPropertyValuesEx($arProduct["ID"], $arProduct['IBLOCK_ID'], ["LABEL" => $arPropValue, "CUSTOM_LABEL" => '']);
} ?>
Did this file decode correctly?
Original Code
$arIDs = [];
$subQuery = CIBlockElement::SubQuery('PROPERTY_CML2_LINK', ['ACTIVE' => 'Y', 'CATALOG_AVAILABLE' => 'Y', '>CATALOG_PRICE_8' => 0]);
$rsProduct = CIBlockElement::GetList(['HAS_DETAIL_PICTURE' => 'desc', 'CREATED_DATE' => 'desc'], [
"ACTIVE" => "Y",
"!CODE" => '',
"IBLOCK_ID" => IBLOCK_ID_CATALOG,
'CATALOG_AVAILABLE' => 'Y',
0 => [
'LOGIC' => 'OR',
['ID' => $subQuery],
['>CATALOG_PRICE_8' => 0]
]
], false, ['nTopCount' => 20], ["ID", "IBLOCK_ID", "PROPERTY_CUSTOM_LABEL", 'NAME', 'CATALOG_AVAILABLE', 'CREATED_DATE']);
while ($arProduct = $rsProduct->Fetch()) {
if ($params['SHOW_NEW']) {
p('NEW ' . $arProduct['CREATED_DATE'] . ' ' . $arProduct['NAME']);
}
$arPropValue = [];
$rsProp = CIBlockElement::GetProperty($arProduct['IBLOCK_ID'], $arProduct["ID"], [], ["CODE" => "LABEL"]);
$isNew = false;
while ($arProp = $rsProp->Fetch()) {
if ($arProp["VALUE_XML_ID"] == "new") {
$isNew = true;
} else {
$arPropValue[] = $arProp["VALUE"];
}
}
if (!$isNew $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'NEW') {
$arIDs[$arProduct["ID"]] = $arProduct["ID"];
}
if (!$isNew) {
$arPropValue[] = IBLOCK_ENUM_VALUE_NEW;
CIBlockElement::SetPropertyValuesEx($arProduct["ID"], $arProduct['IBLOCK_ID'], ["LABEL" => $arPropValue, "CUSTOM_LABEL" => 'NEW']);
}
}
//
$rsProduct = CIBlockElement::GetList([], ["ACTIVE" => "Y", "IBLOCK_ID" => IBLOCK_ID_CATALOG, 'PROPERTY_LABEL' => [IBLOCK_ENUM_VALUE_HIT, IBLOCK_ENUM_VALUE_NEW], '!ID' => $arIDs], false, false, ["ID", "IBLOCK_ID", "PROPERTY_CUSTOM_LABEL", "PROPERTY_LABEL", 'CATALOG_PRICE_8', 'CATALOG_AVAILABLE']);
while ($arProduct = $rsProduct->Fetch()) {
$arPropValue = [];
$rsProp = CIBlockElement::GetProperty($arProduct['IBLOCK_ID'], $arProduct["ID"], [], ["CODE" => "LABEL"]);
$isSale = false;
while ($arProp = $rsProp->Fetch()) {
if (
$arProp["VALUE_XML_ID"] == "hit" && $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'HIT'
$arProp["VALUE_XML_ID"] == "new" && $arProduct['PROPERTY_CUSTOM_LABEL_VALUE'] == 'NEW'
$arProduct["CATALOG_AVAILABLE"] != "Y"
$arProduct["CATALOG_PRICE_8"] <= 0
) {
} else {
$arPropValue[] = $arProp["VALUE"];
}
}
if (empty($arPropValue))
$arPropValue = false;
CIBlockElement::SetPropertyValuesEx($arProduct["ID"], $arProduct['IBLOCK_ID'], ["LABEL" => $arPropValue, "CUSTOM_LABEL" => '']);
}
Function Calls
None |
Stats
MD5 | fa89aadcc99a1291900612ccdcdeced8 |
Eval Count | 0 |
Decode Time | 48 ms |