Example #1
0
pt; width: <?php 
echo $width;
?>
pt; background: <?php 
echo $background;
?>
">

<table class="header">
	<tr>
		<?php 
if (CSalePaySystemAction::GetParamValue("PATH_TO_LOGO", false)) {
    ?>
		<td style="padding-right: 5pt; ">
			<?php 
    $imgParams = CFile::_GetImgParams(CSalePaySystemAction::GetParamValue('PATH_TO_LOGO', false));
    ?>
			<?php 
    $imgWidth = $imgParams['WIDTH'] * 96 / (intval(CSalePaySystemAction::GetParamValue('LOGO_DPI', false)) ?: 96);
    ?>
			<img src="<?php 
    echo $imgParams['SRC'];
    ?>
" width="<?php 
    echo $imgWidth;
    ?>
" />
		</td>
		<?php 
}
?>
Example #2
0
 function Show2Images($strImage1, $strImage2, $iMaxW = 0, $iMaxH = 0, $sParams = false, $sPopupTitle = false, $iSizeWHTTP = 0, $iSizeHHTTP = 0)
 {
     if (!($arImgParams = CFile::_GetImgParams($strImage1, $iSizeWHTTP, $iSizeHHTTP))) {
         return "";
     }
     $strImage1 = htmlspecialcharsbx($arImgParams["SRC"]);
     $intWidth = $arImgParams["WIDTH"];
     $intHeight = $arImgParams["HEIGHT"];
     $strAlt = $arImgParams["ALT"];
     if ($sParams == false) {
         $sParams = 'border="0" alt="' . htmlspecialcharsEx($strAlt) . '"';
     } elseif (!preg_match("/(^|\\s)alt\\s*=\\s*([\"']?)(.*?)(\\2)/is", $sParams)) {
         $sParams .= ' alt="' . htmlspecialcharsEx($strAlt) . '"';
     }
     if ($iMaxW > 0 && $iMaxH > 0 && ($intWidth > $iMaxW || $intHeight > $iMaxH)) {
         $coeff = $intWidth / $iMaxW > $intHeight / $iMaxH ? $intWidth / $iMaxW : $intHeight / $iMaxH;
         $iHeight = intval(roundEx($intHeight / $coeff));
         $iWidth = intval(roundEx($intWidth / $coeff));
     } else {
         $iHeight = $intHeight;
         $iWidth = $intWidth;
     }
     if ($arImgParams = CFile::_GetImgParams($strImage2, $iSizeWHTTP, $iSizeHHTTP)) {
         if ($sPopupTitle === false) {
             $sPopupTitle = GetMessage("FILE_ENLARGE");
         }
         $strImage2 = htmlspecialcharsbx($arImgParams["SRC"]);
         $intWidth2 = $arImgParams["WIDTH"];
         $intHeight2 = $arImgParams["HEIGHT"];
         $strAlt2 = $arImgParams["ALT"];
         CFile::OutputJSImgShw();
         $strReturn = "<a title=\"" . $sPopupTitle . "\" onclick=\"ImgShw('" . CUtil::addslashes($strImage2) . "','" . $intWidth2 . "','" . $intHeight2 . "', '" . CUtil::addslashes(htmlspecialcharsEx(htmlspecialcharsEx($strAlt2))) . "'); return false;\" href=\"" . $strImage2 . "\" target=_blank>" . "<img src=\"" . $strImage1 . "\" " . $sParams . " width=" . $iWidth . " height=" . $iHeight . " /></a>";
     } else {
         $strReturn = "<img src=\"" . $strImage1 . "\" " . $sParams . " width=" . $iWidth . " height=" . $iHeight . " />";
     }
     return $strReturn;
 }
Example #3
0
     }
 }
 $arResult["Smiles"] = CBlogSmile::GetSmilesList();
 $arResult["SmilesCount"] = count($arSmileTmp["Smiles"]);
 $arResult["Images"] = array();
 if (!empty($arBlog) && ($arPost["ID"] > 0 || strlen($arResult["ERROR_MESSAGE"]) > 0)) {
     $arFilter = array("POST_ID" => $arParams["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "N");
     if ($arParams["ID"] == 0) {
         $arFilter["USER_ID"] = $arResult["UserID"];
     }
     $res = CBlogImage::GetList(array("ID" => "ASC"), $arFilter);
     while ($aImg = $res->Fetch()) {
         $aImgNew = CFile::ResizeImageGet($aImg["FILE_ID"], array("width" => 90, "height" => 90), BX_RESIZE_IMAGE_EXACT, true);
         $aImgNew["source"] = CFile::ResizeImageGet($aImg["FILE_ID"], array("width" => $arParams["IMAGE_MAX_WIDTH"], "height" => $arParams["IMAGE_MAX_HEIGHT"]), BX_RESIZE_IMAGE_PROPORTIONAL, true);
         $aImgNew["ID"] = $aImg["ID"];
         $aImgNew["params"] = CFile::_GetImgParams($aImg["FILE_ID"]);
         $aImgNew["fileName"] = substr($aImgNew["src"], strrpos($aImgNew["src"], "/") + 1);
         $aImgNew["fileShow"] = "<img src=\"" . $aImgNew["src"] . "\" width=\"" . $aImgNew["width"] . "\" height=\"" . $aImgNew["height"] . "\" border=\"0\" style=\"cursor:pointer\" onclick=\"InsertBlogImage_LHEPostFormId_blogPostForm('" . $aImg["ID"] . "', '" . $aImgNew["source"]['src'] . "', '" . $aImgNew["source"]['width'] . "');\" title=\"" . GetMessage("BLOG_P_INSERT") . "\">";
         $aImgNew["SRC"] = $aImgNew["source"]["src"];
         $aImgNew["FILE_NAME"] = $aImgNew["fileName"];
         $aImgNew["FILE_SIZE"] = $aImgNew["source"]["size"];
         $aImgNew["URL"] = $aImgNew["src"];
         $aImgNew["CONTENT_TYPE"] = "image/xyz";
         $aImgNew["THUMBNAIL"] = $aImgNew["src"];
         $aImgNew["DEL_URL"] = $APPLICATION->GetCurPageParam("del_image_id=" . $aImg["ID"] . "&" . bitrix_sessid_get(), array("sessid", "image_upload_frame", "image_upload", "do_upload", "del_image_id"));
         $arResult["Images"][] = $aImgNew;
     }
 }
 if (strpos($arResult["PostToShow"]["CATEGORY_ID"], ",") !== false) {
     $arResult["PostToShow"]["CATEGORY_ID"] = explode(",", trim($arResult["PostToShow"]["CATEGORY_ID"]));
 }
Example #4
0
             $arBlog = CBlog::GetByID($arPost["BLOG_ID"]);
         }
         CBlogPost::$arBlogPCCache[$arPost["BLOG_ID"]] = $arBlog;
     }
 }
 $strErrorMessage = '';
 if ($_POST["blog_upload_image_comment"] == "Y") {
     if ($_FILES["BLOG_UPLOAD_FILE"]["size"] > 0) {
         $arResult["imageUploadFrame"] = "Y";
         $APPLICATION->RestartBuffer();
         header("Pragma: no-cache");
         $arFields = array("MODULE_ID" => "blog", "BLOG_ID" => $arBlog["ID"], "POST_ID" => $arPost["ID"], "=TIMESTAMP_X" => $DB->GetNowFunction(), "TITLE" => "", "IMAGE_SIZE" => $_FILES["BLOG_UPLOAD_FILE"]["size"], "IS_COMMENT" => "Y", "URL" => $arBlog["URL"], "USER_ID" => IntVal($user_id));
         $arFields["FILE_ID"] = array_merge($_FILES["BLOG_UPLOAD_FILE"], array("MODULE_ID" => "blog", "del" => "Y"));
         if ($imgID = CBlogImage::Add($arFields)) {
             $aImg = CBlogImage::GetByID($imgID);
             $aImg["PARAMS"] = CFile::_GetImgParams($aImg["FILE_ID"]);
             $arResult["Image"] = array("ID" => $aImg["ID"], "SRC" => $aImg["PARAMS"]["SRC"], "WIDTH" => $aImg["PARAMS"]["WIDTH"], "HEIGHT" => $aImg["PARAMS"]["HEIGHT"]);
         } else {
             if ($ex = $APPLICATION->GetException()) {
                 $arResult["ERROR_MESSAGE"] = $ex->GetString();
             }
         }
         $this->IncludeComponentTemplate();
         return;
     }
 }
 if ($_POST["act"] != "edit") {
     if ($arResult["use_captcha"]) {
         include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/captcha.php";
         $captcha_code = $_POST["captcha_code"];
         $captcha_word = $_POST["captcha_word"];
Example #5
0
>
<div style="margin: 0pt; padding: <?php 
echo join('pt ', $margin);
?>
pt; width: <?php 
echo $width;
?>
pt; background: <?php 
echo $background;
?>
">
<div style="margin: 0pt; padding: 0pt;">
	<?php 
$pathToLogo = CSalePaySystemAction::GetParamValue("PATH_TO_LOGO", false);
if ($pathToLogo) {
    $imgParams = CFile::_GetImgParams($pathToLogo);
    $imgWidth = $imgParams['WIDTH'] * 96 / (intval(CSalePaySystemAction::GetParamValue('LOGO_DPI', false)) ?: 96);
    ?>
<img src="<?php 
    echo $imgParams['SRC'];
    ?>
" width="<?php 
    echo $imgWidth;
    ?>
" /><?php 
}
unset($pathToLogo);
?>
</div>
<br>
<div style="margin: 0pt; padding: 0pt;">