$arWaterMark = array(
"name" => "watermark",
"position" => "bc",
"type" => "image",
"size" => "real",
"coefficient" => "1",
"fill" => "exact",
"file" => "[url]http://192.168.1.139/watermark.png",[/url]
"text" => "Водяной знак!",
"color" => "ff0000",
"use_copyright" => "Y" // ( использовать ли знак копирайта перед текстом )
);
if (!is_array($arResult['SECTION'])
{
$dbRes = CIBlock::GetByID($arResult['IBLOCK_ID']
if ($arIBlock = $dbRes->GetNext())
{
$arIBlock["~LIST_PAGE_URL"] = str_replace(
array("#SERVER_NAME#", "#SITE_DIR#", "#IBLOCK_TYPE_ID#", "#IBLOCK_ID#",
"#IBLOCK_CODE#", "#IBLOCK_EXTERNAL_ID#", "#CODE#",
array(SITE_SERVER_NAME, SITE_DIR, $arIBlock["IBLOCK_TYPE_ID"], $arIBlock["ID"],
$arIBlock["CODE"], $arIBlock["EXTERNAL_ID"], $arIBlock["CODE"],
strlen($arParams["IBLOCK_URL"]? trim($arParams["~IBLOCK_URL"]: $arIBlock["~LIST_PAGE_URL"]
);
$arIBlock["~LIST_PAGE_URL"] = preg_replace("'/+'s", "/", $arIBlock["~LIST_PAGE_URL"]
$arIBlock["LIST_PAGE_URL"] = htmlspecialchars($arIBlock["~LIST_PAGE_URL"]
$arResult['IBLOCK'] = $arIBlock;
}
}
if(is_array($arResult["DETAIL_PICTURE"])
{
$arFileTmp = CFile::ResizeImageGet(
$arResult['DETAIL_PICTURE'],
array("width" => 224, 'height' => 26,
BX_RESIZE_IMAGE_PROPORTIONAL,
false,
$arWaterMark
);
$arSize = getimagesize($_SERVER["DOCUMENT_ROOT"].$arFileTmp["src"]
$arResult['DETAIL_PICTURE_350'] = array(
'SRC' => $arFileTmp["src"],
'WIDTH' => IntVal($arSize[0],
'HEIGHT' => IntVal($arSize[1],
);
}
if (is_array($arResult['MORE_PHOTO'] && count($arResult['MORE_PHOTO'] > 0)
{
unset($arResult['DISPLAY_PROPERTIES']['MORE_PHOTO']
foreach ($arResult['MORE_PHOTO'] as $key => $arFile)
{
$arFileTmp = CFile::ResizeImageGet(
$arFile,
array("width" => 85, 'height' => 85),
BX_RESIZE_IMAGE_PROPORTIONAL,
false,
$arWaterMark
);
$arSize = getimagesize($_SERVER["DOCUMENT_ROOT"].$arFileTmp["src"]
$arFile['PREVIEW_WIDTH'] = IntVal($arSize[0]
$arFile['PREVIEW_HEIGHT'] = IntVal($arSize[1]
$arFile['SRC_PREVIEW'] = $arFileTmp['src'];
$arResult['MORE_PHOTO'][$key] = $arFile;
}
}
$arResult['PRICES']['PRICE']['PRINT_VALUE'] =
number_format($arResult['PROPERTIES']['PRICE']['VALUE'], 0, '.', ' ');
$arResult['PRICES']['PRICE']['PRINT_VALUE'] .= ' '.$arResult['PROPERTIES']['PRICECURRENCY']['VALUE_ENUM'];
|