コード例 #1
1
ファイル: class.php プロジェクト: AlexPrya/redvent.ru
 function executeComponent()
 {
     $arFilter = array('IBLOCK_ID' => $this->arParams['IBLOCK_ID'], 'ACTIVE' => 'Y');
     if (true || $this->StartResultCache()) {
         $CIBlockElement = new CIBlockElement();
         $CFile = new \CFile();
         $aElts = array();
         $eltsSelectFields = array_merge(array('ID', 'NAME', 'CODE', 'PREVIEW_PICTURE', 'DETAIL_PICTURE', 'DETAIL_PAGE_URL'), $this->getIBlockProperties($this->arParams['IBLOCK_ID']));
         $rsElts = $CIBlockElement->GetList(array('SORT' => 'asc', 'date_active_from' => 'DESC'), $arFilter, false, false, array('ID', 'NAME'));
         if (intval($rsElts->SelectedRowsCount())) {
             while ($arElt = $rsElts->Fetch()) {
                 $aElts[] = array('ID' => $arElt['ID'], 'NAME' => $arElt['NAME']);
             }
             $arElt = $CIBlockElement->GetList(array('SORT' => 'asc', 'ID' => 'DESC'), array_merge($arFilter, array('ID' => $aElts[0]['ID'])), false, false, $eltsSelectFields)->GetNext();
             if ($arElt['DETAIL_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['DETAIL_PICTURE']);
             } elseif ($arElt['PREVIEW_PICTURE']) {
                 $arElt['DETAIL_PICTURE'] = $CFile->GetPath($arElt['PREVIEW_PICTURE']);
             }
             $arPrice = CPrice::GetList(array(), array("PRODUCT_ID" => $arElt['ID']))->Fetch();
             $arElt['PRICE'] = $arPrice['PRICE'];
             $this->arResult['ITEMS'] = $aElts;
             $this->arResult['ITEM'] = $arElt;
             $this->IncludeComponentTemplate();
         }
     }
 }
コード例 #2
0
function getPropDirectory(&$property)
{
    if (empty($property)) {
        return false;
    }
    if (!is_array($property)) {
        return false;
    }
    if (!isset($property['USER_TYPE_SETTINGS']['TABLE_NAME']) || empty($property['USER_TYPE_SETTINGS']['TABLE_NAME'])) {
        return false;
    }
    $highLoadInclude = \Bitrix\Main\Loader::includeModule('highloadblock');
    $highBlock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array("filter" => array('TABLE_NAME' => $property['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
    if (!isset($highBlock['ID'])) {
        return false;
    }
    $entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($highBlock);
    $entityDataClass = $entity->getDataClass();
    $entityList = $entityDataClass::getList();
    while ($arEntityItem = $entityList->Fetch()) {
        $val =& $property["VALUES"][$arEntityItem["UF_XML_ID"]];
        //foreach($property["VALUES"] as &$val){
        if (!empty($arEntityItem["UF_FILE"])) {
            $property["PICTURE_INCLUDED"] = true;
            $arEntityItem["~UF_FILE"] = $arEntityItem["UF_FILE"];
            $arEntityItem["PICTURE"] = CFile::GetPath($arEntityItem["~UF_FILE"]);
        }
        if (!empty($arEntityItem)) {
            $val = array_merge($val, $arEntityItem);
        }
        //}
        //echo'<pre>';print_r($arEntityItem);echo'</pre>';
    }
    return true;
}
コード例 #3
0
ファイル: class.php プロジェクト: ASDAFF/stex
 /**
  * Ресурс файла
  * @param  string  $field   Название поля для ресурса
  * @param  mixed $resized   Если необходим ресайзер
  * @return string           Ресурс
  */
 public function src($field, $resized = false)
 {
     if (false === $resized) {
         $src['src'] = CFile::GetPath($this->item[$field]);
     } else {
         $src = CFile::ResizeImageGet($this->item[$field], array("width" => $resized[0], "height" => $resized[1]), BX_RESIZE_IMAGE_EXACT, false);
     }
     return $src;
 }
コード例 #4
0
ファイル: .tags.class.php プロジェクト: ASDAFF/mp
 public function getElements($iblock_id)
 {
     $result = array();
     $arSelect = array("ID", "NAME", "PREVIEW_PICTURE");
     $arFilter = array("IBLOCK_ID" => $iblock_id, "ACTIVE_DATE" => "Y", "ACTIVE" => "Y");
     $res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
     while ($ob = $res->GetNextElement()) {
         $arFields = $ob->GetFields();
         $this->elemIcons[$arFields['ID']] = CFile::GetPath($arFields['PREVIEW_PICTURE']);
         $result[$arFields['ID']] = $arFields['NAME'];
     }
     return $result;
 }
コード例 #5
0
 /**
  * {@inheritdoc}
  */
 public function generateRow(&$row, $data)
 {
     $html = '';
     if ($this->getSettings('MULTIPLE')) {
     } else {
         $path = \CFile::GetPath($data[$this->code]);
         $rsFile = \CFile::GetByID($data[$this->code]);
         $file = $rsFile->Fetch();
         if ($path) {
             $html = '<a href="' . $path . '" >' . $file['FILE_NAME'] . ' (' . $file['FILE_DESCRIPTION'] . ')' . '</a>';
         }
         $row->AddViewField($this->code, $html);
     }
 }
コード例 #6
0
ファイル: File.php プロジェクト: marvin255/bxar
 /**
  * Возвращает значение для записи в базу данных
  * @return mixed
  */
 public function getValueToDb()
 {
     $val = $this->getValue();
     if (!empty($val['error'])) {
         return null;
     }
     $return = null;
     if (is_numeric($val)) {
         if ($this->getParam('FROM_MULTIPLE')) {
             $return['VALUE'] = \CFile::MakeFileArray(\CFile::GetPath($val));
         } else {
             $return = null;
         }
     } elseif (is_array($val) && isset($val['tmp_name'])) {
         $ext = pathinfo($val['tmp_name'], PATHINFO_EXTENSION);
         if ($ext === '' && !empty($val['name'])) {
             $oldName = file_exists($val['tmp_name']) ? $val['tmp_name'] : $_SERVER['DOCUMENT_ROOT'] . $val['tmp_name'];
             /* feature 24/11/2016, add exceptions if not exists file */
             if (!file_exists($oldName)) {
                 throw new \Exception('bxar: Doesn\'t exists file');
             }
             $newName = dirname($oldName) . '/f_' . time() . mt_rand() . $val['name'];
             if (file_exists($newName) || !rename($oldName, $newName)) {
                 throw new \Exception('bxar: Can\'t upload file');
             }
             $val['tmp_name'] = $newName;
         }
         if ($this->getParam('ID') !== null) {
             $val = ['VALUE' => $val];
         } else {
             $val['del'] = 'Y';
         }
         $return = $val;
     } elseif (file_exists($val)) {
         $return = \CFile::MakeFileArray($val);
         $return['del'] = 'Y';
         $return['module'] = 'iblock';
     } elseif (strpos($val, 'http://') === 0 && ($content = @file_get_contents($val)) !== false) {
         $extension = pathinfo($val, PATHINFO_EXTENSION);
         $temp = tempnam(sys_get_temp_dir(), 'TUX') . ($extension ? '.' . $extension : '');
         file_put_contents($temp, $content);
         $return = \CFile::MakeFileArray($temp);
         $return['del'] = 'Y';
         $return['module'] = 'iblock';
     } else {
         $return = array('del' => 'Y');
     }
     return $return;
 }
コード例 #7
0
ファイル: Article.php プロジェクト: irotaev/vector-vip.server
 public function __construct(array $init = array())
 {
     $this->_id = isset($init['id']) ? $init['id'] : '';
     $this->_name = isset($init['name']) ? $init['name'] : '';
     $this->_detailText = isset($init['detailText']) ? $init['detailText'] : '';
     $this->_dateActiveFrom = isset($init['dateActiveFrom']) ? $init['dateActiveFrom'] : '';
     $this->_previewText = isset($init["previewText"]) ? $init['previewText'] : '';
     $this->_code = isset($init["code"]) ? $init['code'] : '';
     $this->_previewImgID = isset($init["previewImgID"]) ? $init['previewImgID'] : '';
     $this->_SectionName = isset($init['SectionName']) ? $init['SectionName'] : null;
     if (isset($init['photoGalleryID'])) {
         $this->_articleMapper = new ArticleMapper();
         $imagesID = $this->_articleMapper->getByIblockID(5, array(), (int) $init['photoGalleryID']);
         $images = array();
         foreach ($imagesID as $imageID) {
             $imagePath = \CFile::GetPath((int) $imageID->previewImgID);
             $image = new NSImage\Image((int) $imageID->previewImgID);
             array_push($images, $image);
         }
         $this->_imageGallery = $images;
     }
 }
コード例 #8
0
ファイル: iblocks.php プロジェクト: akniyev/itprom_dobrohost
function wfIBSearchElementsByProp($IBLOCK_ID = false, $prop = array(), $fields = array(), $limit = 0)
{
    if (empty($prop)) {
        return false;
    }
    $arOrder = array("SORT" => "ASC");
    if (!empty($IBLOCK_ID)) {
        $arFilter["IBLOCK_ID"] = $IBLOCK_ID;
    }
    $arFilter["ACTIVE"] = "Y";
    $arFilter = array_merge($arFilter, $prop);
    $arSelect = array("ID", "IBLOCK_ID", "NAME", "DETAIL_PAGE_URL", "PREVIEW_PICTURE", "PREVIEW_TEXT");
    if (!empty($fields)) {
        $arSelect = array_merge($arSelect, $fields);
    }
    $arGroupBy = false;
    if ($limit > 0) {
        $arNavStartParams = array("nTopCount" => $limit);
    } else {
        $arNavStartParams = false;
    }
    $elm = CIBlockElement::GetList($arOrder, $arFilter, $arGroupBy, $arNavStartParams, $arSelect);
    $result = array();
    while ($el = $elm->GetNext()) {
        $array = array("NAME" => $el["NAME"], "URL" => $el["DETAIL_PAGE_URL"], "ID" => $el["ID"], "TEXT" => $el["PREVIEW_TEXT"]);
        $array["IMAGE_P"] = CFile::GetPath($el["PREVIEW_PICTURE"]);
        foreach ($fields as $value) {
            if (substr_count($value, "PROPERTY_") > 0) {
                $array[str_replace("PROPERTY_", "", $value)] = $el[$value . "_VALUE"];
            } else {
                $array[$value] = $el[$value];
            }
        }
        $result[] = $array;
    }
    return $result;
}
コード例 #9
0
ファイル: template.php プロジェクト: akniyev/arteva.ru
            </div>
            <div class="row">
                <div class="info-block">
                    <p class="header">Email</p>
                    <p class="block-info">
                        <a href="mailto:<?=$arResult["PROPERTIES"]["EMAIL"]["~VALUE"]?>"><?=$arResult["PROPERTIES"]["EMAIL"]["~VALUE"]?></a>
                    </p>
                </div>
                <div class="info-block">
                    <p class="header">Режим работы </p>
                    <p class="block-info"><?=$arResult["PROPERTIES"]["WORK"]["~VALUE"]?></p>
                </div>
            </div>
        </div>
    </div>
    <div class="howto-find-wrapper">
        <p class="find-header">Как нас найти</p>
        <aside>
            <div class="salon-route-cnt">
                <img src="<?=CFile::GetPath($arResult["PROPERTIES"]["WHERE"]["VALUE"])?>" alt=""/>
            </div>
        </aside>
        <div class="salon-route-info">
            <?=$arResult["~DETAIL_TEXT"]?>
            <?if ($arResult["PROPERTIES"]["LAT"]["VALUE"] && $arResult["PROPERTIES"]["LONG"]["VALUE"]):?>
                <p><a class="btn important js-show-on-map" href="#map" onclick="ga('send', 'event', 'show-map', 'open');">Показать на карте</a></p>
                <div class="fbx-content" id="map" data-lat="<?=$arResult["PROPERTIES"]["LAT"]["VALUE"]?>" data-long="<?=$arResult["PROPERTIES"]["LONG"]["VALUE"]?>"></div>
            <?endif?>
        </div>
    </div>
</div>
コード例 #10
0
ファイル: dop_detail.php プロジェクト: dayAlone/MyQube
						<div class="info-block-text"><?php 
    echo $arEvent["PREVIEW_TEXT"];
    ?>
</div>
					</div>
			<?php 
}
?>
		</div>
		<!-- Правый блок с текстом и каментами -->
		<div class="right-block"><div class="right-block-inner">
		<?php 
/*echo "<xmp>"; print_r($arEvent); echo "</xmp>";*/
?>
		<img src="<?php 
echo CFile::GetPath($arEvent["DETAIL_PICTURE"]);
?>
" width="540">
			<div class="like-menu">
					<?php 
$res_like = CIBlockElement::GetList(array(), array("IBLOCK_ID" => 6, "PROPERTY_LIKE" => $arEvent['ID'], "PROPERTY_USER" => $USER->GetID()), array());
$GLOBALS['gl_active'] = $res_like;
$GLOBALS['gl_like_id'] = "like_post_" . $arEvent["ID"];
$GLOBALS['gl_like_numm'] = intval($arEvent["PROPERTIES"]["LIKES"]["VALUE"]);
$GLOBALS['gl_like_param'] = "event_id";
$GLOBALS['gl_like_js'] = $GLOBALS['gl_like_js'] == 1 ? 0 : 1;
$GLOBALS['gl_like_url'] = "/group/events/like_event.php";
$APPLICATION->IncludeComponent("bitrix:main.include", "", array("AREA_FILE_SHOW" => "file", "PATH" => "/like.php"));
?>
					<div class="comments-wrap">
								<div class="comments-icon"></div>
コード例 #11
0
ファイル: component.php プロジェクト: ASDAFF/mp
					if ($arSection = $section->GetNext())
						$detailURL = str_replace('#SECTION_CODE#', $arSection['CODE'], $detailURL);
				}


				if ($arParams['IMAGE'] == 'NOT_SHOW')
					$image = '';
				elseif ($arParams['IMAGE'] == 'PREVIEW_PICTURE')
					$image = CFile::GetPath($arElement['PREVIEW_PICTURE']);
				elseif ($arParams['IMAGE'] == 'DETAIL_PICTURE')
					$image = CFile::GetPath($arElement['DETAIL_PICTURE']);
				else
				{
					$db_props = CIBlockElement::GetProperty($arElement['IBLOCK_ID'], $arElement['ID'], array("sort" => "asc"), Array("CODE" => $arParams['IMAGE']));
					if ($arProps = $db_props->Fetch())
						$image = CFile::GetPath($arProps["VALUE"]);
					else
						$image = '';
				}

				$arResult['ITEMS'][] = array(
					'ELEMENT_ID' => $arElement['ID'],
					'ELEMENT_NAME' => $arElement['NAME'],
					'DETAIL_PAGE_URL' => $detailURL,
					'IMAGE' => $image,
					'COMMENTS_COUNT' => $arRes['COMMENTS_COUNT']
				);
			}
		}
		$this->IncludeComponentTemplate();
	}
コード例 #12
0
		0 => "",
		1 => "",
	),
	"SECTION_URL" => "/accessories/?SECTION_ID=#SECTION_ID#",
	"CACHE_TYPE" => "A",
	"CACHE_TIME" => "36000000",
	"CACHE_GROUPS" => "Y",
	"ADD_SECTIONS_CHAIN" => "Y"
	),
	false
);
*/
?>
<div class="gray_td">
	<h1>Матрасы</h1>
</div>
<?php 
$res = CIBlockSection::GetList(array("LEFT_MARGIN" => "ASC"), array("IBLOCK_ID" => 5, "SECTION_ID" => 110, "ACTIVE" => "Y", "GLOBAL_ACTIVE" => "Y"), true, array("ID", "NAME", "PICTURE"));
while ($arSection = $res->GetNext()) {
    if ($arSection["PICTURE"]) {
        $big_picture = CFile::GetPath($arSection["PICTURE"]);
        echo '<div style="float:left; overflow:hidden; width:230px; height:250px; margin:20px 20px 10px 0; text-align:center;"><a href="/partners/mattresses/?SECTION_ID=' . $arSection['ID'] . '"><img style="width:230px; margin-bottom:5px;" src="' . $big_picture . '"></a><br /><span style="font-size:11px; font-weight:600;">' . $arSection['NAME'] . '</span></div>';
    }
}
?>
<div style="clear: left"></div>
<br />
<br /> 

 <?php 
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/footer.php";
コード例 #13
0
ファイル: orderpayment.php プロジェクト: DarneoStudio/bitrix
 private static function getImgPathList()
 {
     $dbRes = PaySystemServiceTable::getList(array('select' => array('ID', 'PAYSYS_LOGOTIP' => 'ACTION.LOGOTIP')));
     $paySystems = $dbRes->fetchAll();
     $logotypes = array('/bitrix/images/sale/nopaysystem.gif');
     foreach ($paySystems as $paySystem) {
         if (empty($paySystem['PAYSYS_LOGOTIP'])) {
             $logotypes[$paySystem['ID']] = $logotypes[0];
         } else {
             $logotypes[$paySystem['ID']] = \CFile::GetPath($paySystem['PAYSYS_LOGOTIP']);
         }
     }
     return $logotypes;
 }
コード例 #14
0
    $resElement = CIBlockElement::GetList(array("SORT" => "ASC", "PROPERTY_PRIORITY" => "ASC"), $arElementFilter, false, array("nPageSize" => 50), $arElementSelect);
    $i = 0;
    while ($obElement = $resElement->GetNextElement()) {
        $i++;
        if ($i == 1) {
            echo "<tr>";
        }
        $arElementFields = $obElement->GetFields();
        if ($arElementFields['PROPERTY_FULLCOLOR_PIC_VALUE']) {
            $img_path = CFile::GetPath($arElementFields['PROPERTY_FULLCOLOR_PIC_VALUE']);
        } else {
            $img_path = CFile::GetPath($arElementFields['PREVIEW_PICTURE']);
        }
        $size = getimagesize($_SERVER['DOCUMENT_ROOT'] . $img_path);
        if ($arElementFields['PROPERTY_BLACKWHITE_PIC_VALUE']) {
            $img_path_bl = CFile::GetPath($arElementFields['PROPERTY_BLACKWHITE_PIC_VALUE']);
        } else {
            $img_path_bl = $img_path;
        }
        ?>
				
				<td class="catalog_td">
				<a href="/catalog/divan<?php 
        echo $arElementFields[ID];
        ?>
.htm"><img onMouseOver="this.src='<?php 
        echo $img_path;
        ?>
';" onMouseOut="this.src='<?php 
        echo $img_path_bl;
        ?>
コード例 #15
0
              <h1>дхбюмш юййнпденм</h1>
            </a></div>

<div class="gray_td_left" width="100%">
  <h1>ухрш опндюф!</h1>
</div>

<table cellspacing="0" cellpadding="0" width="100%" border="0">
  <tbody>
      
  <?php 
$arElementSelect = array("ID", "NAME", "PROPERTY_HIT", "PROPERTY_HIT_IMG", "PROPERTY_COLLECTION", "PREVIEW_TEXT", "IBLOCK_ID");
$arElementFilter = array("IBLOCK_ID" => IntVal(5), "ACTIVE" => "Y", "!PROPERTY_HIT" => false);
$resElement = CIBlockElement::GetList(array("SORT" => "RAND", "PROPERTY_PRIORITY" => "ASC"), $arElementFilter, false, array("nPageSize" => 4), $arElementSelect);
$i = 0;
while ($obElement = $resElement->GetNextElement()) {
    $i++;
    $arElementFields = $obElement->GetFields();
    $img_path = CFile::GetPath($arElementFields['PROPERTY_HIT_IMG_VALUE']);
    $size = getimagesize($_SERVER['DOCUMENT_ROOT'] . $img_path);
    $arCollection = GetIBlockElement($arElementFields[PROPERTY_COLLECTION_VALUE]);
    echo '<tr><td class="hit_td"><table cellspacing="0" cellpadding="0"><tr><td><a href="/redesign/catalog/byid.php?id=' . $arElementFields[ID] . '"><img class="hit_img" border="0" alt="' . $arElementFields[NAME] . '" src="' . $img_path . '" {$size[3]}></a></td></tr><tr><td>';
    ?>
<div onMouseOver="this.className='scrolling_div_hit_on';"  onMouseOut="this.className='scrolling_div_hit';"  class="scrolling_div_hit"><?php 
    echo '<h3 class="divan"><a class="divan_a" href="/redesign/catalog/byid.php?id=' . $arElementFields[ID] . '">ДХБЮМ ' . $arElementFields[NAME] . '</a></h3><h3 class="collection">йНККЕЙЖХЪ <strong>' . $arCollection[NAME] . '</strong></h3>' . $arElementFields[PREVIEW_TEXT] . '</div></td></tr></table></td></tr>';
}
?>

    
  </tbody>
</table>
コード例 #16
0
ファイル: dop_detail.php プロジェクト: dayAlone/MyQube
    ?>
') center center;"></a>
								<?php 
}
?>
							</div>
						</div>
						<div class="clear"></div>
						<div class="gallery_arrow_down"></div>
					</div>
				</div>
			</div>
			<div class="gallery_rightcol_sk"><div class="gallery_rightcol">
				<div class="gallery_photo_cont">
					<img src="<?php 
echo CFile::GetPath($arEvent["PROPERTIES"]["PHOTO"]["VALUE"][0]);
?>
" id="gallery_photo">
					<div class="gallery_photo_gradient"></div>
					<div class="gallery_nw_prev"></div>
					<div class="gallery_nw_next"></div>
					<div id="loaderImage"></div>
				</div>

				<div style="float:right; margin-top: 15px;">
					<div id="like_box">

					<?php 
$APPLICATION->IncludeComponent("radia:likes", "", array("ELEMENT" => 'photo_' . $arEvent["PROPERTIES"]["PHOTO"]["VALUE"][0]));
?>
					</div>
コード例 #17
0
ファイル: component.php プロジェクト: CheBurashka334/zakrepi
    'STYLE' => 'col l3',
    'IMG_URL' => $URL,
    'LINK' => $arBanner[0]['PROPERTY_LINK_VALUE'],
);


$elem =  CBannerGrid::getBannerGrid(7);
$arBanner = CBannerGrid::getElementIblockBanner($elem[0]['BG_IDBANERS']);
$URL = CFile::GetPath($arBanner[0]['PREVIEW_PICTURE']);

$arResult[6] = array(
    'SIZE' => 'small',
    'NUM' => 2,
    'SIZE_DIV' => 'small',
    'STYLE' => 'col l3',
    'IMG_URL' => $URL,
    'LINK' => $arBanner[0]['PROPERTY_LINK_VALUE'],
);

$elem =  CBannerGrid::getBannerGrid(8);
$arBanner = CBannerGrid::getElementIblockBanner($elem[0]['BG_IDBANERS']);
$URL = CFile::GetPath($arBanner[0]['PREVIEW_PICTURE']);
$arResult[7] = array(
    'SIZE' => 'big',
    'SIZE_DIV' => 'big',
    'STYLE' => 'col l6',
    'IMG_URL' => $URL,
    'LINK' => $arBanner[0]['PROPERTY_LINK_VALUE'],
);
$this->IncludeComponentTemplate();
コード例 #18
0
ファイル: app.php プロジェクト: dayAlone/MyQube
        }
        getResultJSON($log);
    }
    if ($_REQUEST["log"] !== "read" && $_REQUEST["log"] !== "write") {
        getResultJSON(array("status" => "ERROR", "status_msg" => "NO DATA"));
    }
}
/**
    Показ промо
*/
if ($_REQUEST["mode"] == "promo") {
    if (!$USER->IsAuthorized()) {
        exit;
    }
    $promo = CIBlockElement::GetProperty(18, 763)->GetNext();
    getResultJSON(array("status" => "OK", "status_msg" => "PROMO", "url_list" => array("http://" . SITE_SERVER_NAME . CFile::GetPath($promo["VALUE"])), "filetime" => array($promo["TIMESTAMP_X"])));
}
/**
    Добавление нового контакта
*/
if ($_REQUEST["mode"] == "new_contact") {
    if (!$USER->IsAuthorized()) {
        exit;
    }
    $json = json_decode(file_get_contents('php://input'), true);
    if (!isValidJSON($json)) {
        exit;
    }
    $contact_type = array(1 => 28, 2 => 29, 3 => 30, 4 => 31, 5 => 32, 6 => 45);
    $status = array("Y" => 1, "N" => 0);
    foreach ($json as $key => $val) {
コード例 #19
0
            ?>
">closed</a>&nbsp;
                    <div class="item-form-holder">
                        <div class="holder">
                            <a href="<?php 
            echo $arItem["DETAIL_PAGE_URL"];
            ?>
">
                                <div class="image">
                                    <?php 
            if (strlen($arItem["PREVIEW_PICTURE_SRC"]) > 0) {
                $url = $arItem["PREVIEW_PICTURE_SRC"];
            } elseif (strlen($arItem["DETAIL_PICTURE_SRC"]) > 0) {
                $url = $arItem["DETAIL_PICTURE_SRC"];
            } elseif (!empty($arItem["~PROPERTY_MORE_PHOTO_VALUE"])) {
                $url = CFile::GetPath(reset(explode(",", $arItem["~PROPERTY_MORE_PHOTO_VALUE"])));
            } else {
                $url = $templateFolder . "/images/no_photo.png";
            }
            ?>
                                        <img src="<?php 
            echo $url;
            ?>
" width="109" />
                                </div>
                            </a>
                            <div class="title">
                                <h2><a class="name" href="<?php 
            echo $arItem["DETAIL_PAGE_URL"];
            ?>
"><?php 
コード例 #20
0
                    $skidka_value = $arFields["PROPERTY_SKIDKA_VALUE"];
                }
                /* если есть скидка, то берется введенное значение */
                $html_temp .= '<div style="margin: 0px; padding: 0px; position: absolute; z-index: 90;"><div style="text-align:center; background: url(/images/skidka.gif) no-repeat center center; position: relative; left: 170px; top: -12px; color: #ffffff; height: 36px; width: 36px; " height=36 width=36 ><img src="/images/gif.gif" height="10" width="20"><br>-' . $skidka_value . '%</div></div>';
            }
            if ($arFields["PROPERTY_SOLD_VALUE"]) {
                $html_temp .= '<img style="position: absolute; z-index: 90; filter:alpha(opacity=50); /* IE 5.5+*/
-moz-opacity: 0.5; /* Mozilla 1.6 и ниже */
-khtml-opacity: 0.5; /* Konqueror 3.1, Safari 1.1 */
opacity: 0.5; /* CSS3 - Mozilla 1.7b +, Firefox 0.9 +, Safari 1.2+, Opera 9 */ " alt="Товар продан" src="/images/sold.gif">';
            }
            $html_temp .= '<a href="';
            $html_temp .= CFile::GetPath($arFields['PREVIEW_PICTURE']);
            $html_temp .= '" class="highslide" onclick="return hs.expand(this,{wrapperClassName: \'borderless floating-caption\', dimmingOpacity: 0.75, align: \'center\'})">
	<img style="padding: 0px; margin: 0px;" src="';
            $html_temp .= CFile::GetPath($arFields['PREVIEW_PICTURE']);
            $html_temp .= '" border="0" width="200" height="100"></a><div class="highslide-caption">' . $arFields['PREVIEW_TEXT'] . '</div></td></tr>
		<tr><td style="padding-top: 2px; padding-bottom: 2px;  background: #e9e9e9;" nowrap>';
            if ($arFields["PROPERTY_RAZMERI_VALUE"]) {
                $html_temp .= '&nbsp;' . $arFields["PROPERTY_RAZMERI_VALUE"];
            }
            $html_temp .= '</td><td style="padding-top: 2px; padding-bottom: 2px; background: #e9e9e9;" nowrap align="right">';
            if ($arFields["PROPERTY_SPAL_VALUE"]) {
                $html_temp .= 'сп.м.&nbsp;' . $arFields["PROPERTY_SPAL_VALUE"] . '&nbsp;';
            }
            $html_temp .= '</td></tr>
		<tr><td class="item_name_td"><a href="/catalog/divan' . $arFields["PROPERTY_TOVAR_VALUE"] . '.htm">';
            $res = CIBlockElement::GetByID($arFields["PROPERTY_TOVAR_VALUE"]);
            if ($ar_res = $res->GetNext()) {
                $html_temp .= $ar_res['NAME'];
            }
コード例 #21
0
ファイル: template.php プロジェクト: akniyev/arteva.ru
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<ul class="main-slider">
	<?foreach ($arResult["ITEMS"] as $key => $arItems) :?>
    	<li>
    		<a href="<?=$arItems["PROPERTIES"]["LINK"]["VALUE"]?>" class="bg-cover" style="background-image:url('<?=CFile::GetPath($arItems["~PREVIEW_PICTURE"])?>');">
    		</a>
 <?=$arItems["~PREVIEW_TEXT"]?>    	</li>
    <?endforeach?>
</ul>
コード例 #22
0
ファイル: wizard.php プロジェクト: Satariall/izurit
 function OnPostForm()
 {
     $wizard =& $this->GetWizard();
     $varNames = $wizard->GetVar("stamp_img");
     if (is_array($varNames)) {
         foreach ($varNames as $varName) {
             $imgID = $this->SaveFile($varName . "_img");
             if (IntVal($imgID) > 0) {
                 $wizard->SetVar($varName, CFile::GetPath($imgID));
             } else {
                 $wizard->SetVar($varName, $wizard->GetDefaultVar($varName));
             }
         }
     }
 }
コード例 #23
0
ファイル: component.php プロジェクト: ASDAFF/bitrix_portal1
    
    while ($item = $rsItems->GetNext()) {
        $arButtons = CIBlock::GetPanelButtons(
            $item["IBLOCK_ID"],
            $item["ID"],
            0,
            array("SECTION_BUTTONS"=>false, "SESSID"=>false)
        );
        $item["EDIT_LINK"] = $arButtons["edit"]["edit_element"]["ACTION_URL"];
        $item["DELETE_LINK"] = $arButtons["edit"]["delete_element"]["ACTION_URL"];

        if ($item["PREVIEW_PICTURE"]) {
            if ($arParams["RESIZE_PREVIEW_PICTURE"] === "Y") {
                $item["PREVIEW_PICTURE"] = \imageResize(array("WIDTH" => $arParams["RESIZE_WIDTH"], "HEIGHT" => $arParams["RESIZE_HEIGHT"], "MODE" => "cut"), \CFile::GetPath($item["PREVIEW_PICTURE"]));
            } else {
                $item["PREVIEW_PICTURE"] = \CFile::GetPath($item["PREVIEW_PICTURE"]);
            }
        }
        if ($arParams["SHOW_DATE"] === "Y") {
            $item["DATE"]["DAY"] = FormatDate('d', MakeTimeStamp($item["DATE_ACTIVE_FROM"]));
            $item["DATE"]["MONTH"] = FormatDate('F', MakeTimeStamp($item["DATE_ACTIVE_FROM"]));
        }
        if (!$item["PREVIEW_TEXT"]) {
            if ($arParams["CUT_TEXT_VALUE"]) {
                $item["PREVIEW_TEXT"] = \Ns\Bitrix\Helper::Create('iblock')->useVariant('text')->cut($item["PREVIEW_TEXT"], ($arParams["CUT_TEXT_VALUE"]) ? $arParams["CUT_TEXT_VALUE"] : false);
            }
        }
        $arResult["ITEMS"][$item["ID"]] = $item;
    }

    $obCache->EndDataCache(array("arResult" => $arResult));
コード例 #24
0
     $resSubs = CIBlockSection::GetList(array("left_margin" => "asc"), array("SECTION_ID" => $arResSect["ID"]), false);
     for ($f = 1; $arResSubs = $resSubs->Fetch(); $f++) {
         $child[$f] = $arResSubs["ID"];
     }
     if ($arParams["ELEMENT_CNT"] == "Y") {
         if ($arParams["ELEMENT_CNT_AVAILABLE"] == "Y") {
             if ($arParams["HIDE_ELEMENT"] != 'AVAILABLE') {
                 $availCnt = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $ar_res["ID"], "SECTION_ID" => $arResSect["ID"], "INCLUDE_SUBSECTIONS" => 'Y', "ACTIVE" => "Y", "CATALOG_AVAILABLE" => 'Y'), false, false, array("ID"));
                 $availCnt = $availCnt->SelectedRowsCount();
             }
             $cnt = $availCnt;
         } else {
             $cnt = $arResSect["ELEMENT_CNT"];
         }
     }
     $arResult[$i][3] = array("FROM_IBLOCK" => "1", "IS_PARENT" => "", "DEPTH_LEVEL" => $depthLevel, "PICTURE" => CFile::GetPath($arResSect["PICTURE"]), "ELEMENT_CNT" => $cnt, "CHILD_SECTION_ID" => $child);
     if ($level == 1) {
         $arResult[$i][3]["FILTER"] = $arFilterDefault + array("SECTION_ID" => $arResSect["ID"], "INCLUDE_SUBSECTIONS" => "Y");
     }
     $arResult[$i][3]["ITEM_IBLOCK_ID"] = $arResSect["ID"];
     $i++;
 }
 if ($arParams["DEPTH_LEVEL_FINISH"] >= 4) {
     $resElem = CIBlockElement::GetList(array($arParams["ELEMENT_SORT_FIELD"] => $arParams["ELEMENT_SORT_ORDER"]), array("IBLOCK_ID" => $ar_res["ID"], "SECTION_ID" => $arResSect["ID"]));
     while ($arResElem = $resElem->GetNext()) {
         $level = 3 + $arResSect["DEPTH_LEVEL"] - ($arParams["DEPTH_LEVEL_START"] - 1);
         if ($arParams["DEPTH_LEVEL_START"] <= 4) {
             if ($depthLevel < $level) {
                 if ($arParams["DEPTH_LEVEL_START"] <= 3) {
                     $arResult[$i - 1][3]["IS_PARENT"] = 1;
                 }
コード例 #25
0
ファイル: component.php プロジェクト: ASDAFF/bitrix-5
		if (!$arResult['FIRST_FLV_ITEM'] && $FileType == 'flv')
			$arResult['FIRST_FLV_ITEM'] = $PathToFile;
		if (!$arResult['FIRST_WMV_ITEM'] && $FileType == 'wmv')
			$arResult['FIRST_WMV_ITEM'] = $PathToFile;

		if (strpos($_SERVER['HTTP_HOST'], 'xn--') !== false) // It's cyrilyc site
		{
			$PathToFile = CHTTP::URN2URI($PathToFile);
		}


		$arResult["SECTIONS"][$SectionId]["ELEMENTS"][$arItem["ID"]] = array(
			"NAME" => $arItem["NAME"],
			"PREVIEW_TEXT" => $arItem["PREVIEW_TEXT"],
			"PREVIEW_PICTURE" => CFile::GetPath($arItem["PREVIEW_PICTURE"]),
			"DETAIL_PICTURE" => CFile::GetPath($arItem["DETAIL_PICTURE"]),
			"DURATION" => $Duration,
			"FILE_SIZE" => $FileSize,
			"FILE" => $PathToFile,
			"TYPE" => $FileType,
			"ID" => $arItem["ID"],
			"IBLOCK_SECTION_ID" => $arItem["IBLOCK_SECTION_ID"],
		);

		$arResult["RAW_FILES"][$PathToFile] = array("ID" => $arItem["ID"], "NAME" => $arItem["NAME"]);

		if(!$arResult["SECTIONS"][$SectionId]["ELEMENTS"][$arItem["ID"]]["PREVIEW_PICTURE"])
			$arResult["SECTIONS"][$SectionId]["ELEMENTS"][$arItem["ID"]]["PREVIEW_PICTURE"] = $arParams["DEFAULT_SMALL_IMAGE"];
		if(!$arResult["SECTIONS"][$SectionId]["ELEMENTS"][$arItem["ID"]]["DETAIL_PICTURE"])
			$arResult["SECTIONS"][$SectionId]["ELEMENTS"][$arItem["ID"]]["DETAIL_PICTURE"] = $arParams["DEFAULT_BIG_IMAGE"];
コード例 #26
0
ファイル: template.php プロジェクト: akniyev/arteva.ru
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?foreach ($arResult["ITEMS"] as $key => $arItems) :?>
    <li class="designer-project-item">
        <a href="<?=$arItems["~DETAIL_PAGE_URL"]?>">
            <img src="<?=CFile::GetPath($arItems["~PREVIEW_PICTURE"])?>" alt="<?=$arItems["NAME"]?>"/>
            <div class="caption">
                <p class="heading">
                	<?=$arItems["NAME"]?>
                </p>
                <div class="designer">
                	Дизайнер 
                	<p>
                		<?=$arItems["DISPLAY_PROPERTIES"]["DESIGNER"]["LINK_ELEMENT_VALUE"][$arItems["PROPERTIES"]["DESIGNER"]["VALUE"]]["NAME"]?>
                	</p>
                </div>
            </div>
        </a>
    </li>
<?endforeach?>
コード例 #27
0
 public function getInputCaptionImagePath($FIELD_SID)
 {
     if (!$this->isInputCaptionImage($FIELD_SID)) {
         return false;
     }
     if (empty($this->__form_input_caption_image_path_cache[$FIELD_SID])) {
         $this->__form_input_caption_image_path_cache[$FIELD_SID] = CFile::GetPath($this->arQuestions[$FIELD_SID]["IMAGE_ID"]);
     }
     return $this->__form_input_caption_image_path_cache[$FIELD_SID];
 }
コード例 #28
0
ファイル: component.php プロジェクト: ASDAFF/bitrix_portal1
    $rsItems = \CIBlockElement::GetList(
        false,
        $filter,
        false,
        false,
        array("IBLOCK_ID", "ID", "NAME", "PREVIEW_PICTURE", "PREVIEW_TEXT", "PROPERTY_LINK", "PROPERTY_HTML_NAME")
    );
    
    while ($item = $rsItems->Fetch()) {
        $arButtons = CIBlock::GetPanelButtons(
            $item["IBLOCK_ID"],
            $item["ID"],
            0,
            array("SECTION_BUTTONS"=>false, "SESSID"=>false)
        );
        $item["EDIT_LINK"] = $arButtons["edit"]["edit_element"]["ACTION_URL"];
        $item["DELETE_LINK"] = $arButtons["edit"]["delete_element"]["ACTION_URL"];

        if ($item["PREVIEW_PICTURE"]) {
            $item["PREVIEW_PICTURE"] = \imageResize(array("WIDTH" => "1600", "HEIGHT" => "305", "MODE" => "cut"), \CFile::GetPath($item["PREVIEW_PICTURE"]));
        }
        if (!$item["PREVIEW_TEXT"]) {
            $item["PREVIEW_TEXT"] = \Ns\Bitrix\Helper::Create('iblock')->useVariant('text')->cut($item["PREVIEW_TEXT"], ($arParams["CUT_TEXT_VALUE"]) ? $arParams["CUT_TEXT_VALUE"] : false);
        }
        $arResult["ITEMS"][$item["ID"]] = $item;
    }

    $obCache->EndDataCache(array("arResult" => $arResult));
}

$this->IncludeComponentTemplate();
コード例 #29
0
    function EditPost($params)
    {
        global $USER, $DB;
        $postId = IntVal(CBlogMetaWeblog::DecodeParams($params[0]["#"]["value"][0]["#"]));
        $user = CBlogMetaWeblog::DecodeParams($params[1]["#"]["value"][0]["#"]);
        $password = CBlogMetaWeblog::DecodeParams($params[2]["#"]["value"][0]["#"]);
        $arPostInfo = $params[3]["#"]["value"][0]["#"]["struct"][0]["#"]["member"];
        $publish = $params[4]["#"]["value"][0]["#"]["boolean"][0]["#"];
        foreach ($arPostInfo as $val) {
            ${$val["#"]["name"][0]["#"]} = CBlogMetaWeblog::DecodeParams($val["#"]["value"][0]["#"]);
        }
        $arCategory = array();
        if (is_array($categories["data"][0]["#"]["value"])) {
            foreach ($categories["data"][0]["#"]["value"] as $val) {
                $catTmp = CBlogMetaWeblog::DecodeParams($val["#"]);
                if (strlen($catTmp) > 0) {
                    $arCategory[] = $catTmp;
                }
            }
        }
        if (CBlogMetaWeblog::Authorize($user, $password)) {
            $result = '';
            $userId = $USER->GetID();
            if (IntVal($postId) > 0) {
                $arSelectedFields = array("ID", "BLOG_ID", "TITLE", "DATE_PUBLISH", "AUTHOR_ID", "DETAIL_TEXT", "DETAIL_TEXT_TYPE");
                $dbPost = CBlogPost::GetList(array(), array("AUTHOR_ID" => $userId, "ID" => $postId), false, array("nTopCount" => 1), $arSelectedFields);
                if ($arPost = $dbPost->Fetch()) {
                    $arBlog = CBlog::GetByID($arPost["BLOG_ID"]);
                    if (intval($arBlog["SOCNET_GROUP_ID"]) > 0 && CModule::IncludeModule("socialnetwork") && method_exists("CSocNetGroup", "GetSite")) {
                        $arSites = array();
                        $rsGroupSite = CSocNetGroup::GetSite($arBlog["SOCNET_GROUP_ID"]);
                        while ($arGroupSite = $rsGroupSite->Fetch()) {
                            $arSites[] = $arGroupSite["LID"];
                        }
                    } else {
                        $arSites = array(SITE_ID);
                    }
                    $CATEGORYtmp = array();
                    $dbCategory = CBlogCategory::GetList(array(), array("BLOG_ID" => $arPost["BLOG_ID"]));
                    while ($arCat = $dbCategory->Fetch()) {
                        $arCatBlog[ToLower($arCat["NAME"])] = $arCat["ID"];
                    }
                    foreach ($arCategory as $tg) {
                        $tg = trim($tg);
                        if (!in_array($arCatBlog[ToLower($tg)], $CATEGORYtmp)) {
                            if (IntVal($arCatBlog[ToLower($tg)]) > 0) {
                                $CATEGORYtmp[] = $arCatBlog[ToLower($tg)];
                            } else {
                                $CATEGORYtmp[] = CBlogCategory::Add(array("BLOG_ID" => $arPost["BLOG_ID"], "NAME" => $tg));
                                foreach ($arSites as $site_id_tmp) {
                                    BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/category/");
                                }
                            }
                        }
                    }
                    $dbSite = CSite::GetByID(SITE_ID);
                    $arSite = $dbSite->Fetch();
                    $serverName = htmlspecialcharsEx($arSite["SERVER_NAME"]);
                    if (strlen($serverName) <= 0) {
                        if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
                            $serverName = SITE_SERVER_NAME;
                        } else {
                            $serverName = COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
                        }
                    }
                    $dbImage = CBlogImage::GetList(array(), array("POST_ID" => false, "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "N"));
                    while ($arImage = $dbImage->Fetch()) {
                        $path = "";
                        $path = CFile::GetPath($arImage["FILE_ID"]);
                        $path = "http://" . $serverName . $path;
                        if (strpos($description, $path) !== false) {
                            $description = str_replace('<img src="' . $path . '" alt=""/>', "[IMG ID=" . $arImage["ID"] . "]", $description);
                            CBlogImage::Update($arImage["ID"], array("POST_ID" => $arPost["ID"]));
                        }
                    }
                    $arFields = array("TITLE" => $title, "DETAIL_TEXT" => $description, "DETAIL_TEXT_TYPE" => "html", "PUBLISH_STATUS" => $publish == 1 ? "P" : "D", "CATEGORY_ID" => implode(",", $CATEGORYtmp));
                    $postId = CBlogPost::Update($arPost["ID"], $arFields);
                    CBlogPostCategory::DeleteByPostID($arPost["ID"]);
                    foreach ($CATEGORYtmp as $v) {
                        CBlogPostCategory::Add(array("BLOG_ID" => $arPost["BLOG_ID"], "POST_ID" => $arPost["ID"], "CATEGORY_ID" => $v));
                    }
                    if (IntVal($postId) > 0) {
                        foreach ($arSites as $site_id_tmp) {
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/first_page/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/calendar/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/last_messages/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/commented_posts/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/popular_posts/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/last_comments/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/groups/" . $arBlog["GROUP_ID"] . "/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/trackback/" . $arPost["ID"] . "/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/comment/" . $arPost["ID"] . "/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/rss_out/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/rss_all/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/rss_sonet/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/rss_all/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/favorite/");
                            BXClearCache(True, "/" . $site_id_tmp . "/blog/" . $arBlog["URL"] . "/post/" . $arPost["ID"] . "/");
                        }
                        return '<params>
									<param>
										<value>
											<i4>' . $postId . '</i4>
										</value>
									</param>
								</params>';
                    } else {
                        return '<fault>
							<value>
								<struct>
									<member>
										<name>faultCode</name>
										<value><int>3</int></value>
										</member>
									<member>
										<name>faultString</name>
										<value><string>Error on saving post</string></value>
										</member>
									</struct>
								</value>
							</fault>';
                    }
                }
            }
        } else {
            return '<fault>
				<value>
					<struct>
						<member>
							<name>faultCode</name>
							<value><int>3</int></value>
							</member>
						<member>
							<name>faultString</name>
							<value><string>' . $arAuthResult["MESSAGE"] . '</string></value>
							</member>
						</struct>
					</value>
				</fault>';
        }
    }
コード例 #30
0
ファイル: template.php プロジェクト: akniyev/arteva.ru
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();?>
<?if ($arResult["PRODUCT_PROJECTS"]):?>
    <div class="outer-content-wrapper item-designers">
        <div class="content-wrapper">
            <p class="section-header">Товар в проектах дизайнеров</p>
            <ul class="item-designers-projects-list">
                <?foreach ($arResult["PRODUCT_PROJECTS"] as $key => $arProjects) :?>
                    <li>
                        <a href="<?=$arProjects["DETAIL_PAGE_URL"]?>">
                            <img src="<?=CFile::GetPath($arProjects["~PREVIEW_PICTURE"])?>" alt=""/>
                            <span><?=$arProjects["NAME"]?></span>
                        </a>
                    </li>
                <?endforeach?>
            </ul>
        </div>
    </div>
<?endif?>