A
A
Alexey Verkhovtsev2016-08-24 06:13:13
PHP
Alexey Verkhovtsev, 2016-08-24 06:13:13

Why is the file not included in 1s Bitrix?

Hello, I made a separate template for displaying the full news of the component, it contains require_once SITE_TEMPLATE_PATH . '/sess_config.php'; I'm trying to insert a file, but nothing comes out, no errors are shown, but after this line nothing is displayed, as if the file does not exist, what should I do?
Full template code

<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/** var array $arParams */
/** var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** var CBitrixComponentTemplate $this */
/** var string $templateName */
/** var string $templateFile */
/** var string $templateFolder */
/** var string $componentPath */
/** var CBitrixComponent $component */
$this->setFrameMode(true);
?>
<?if($arParams["DISPLAY_PICTURE"]!="N" && is_array($arResult["DETAIL_PICTURE"])):?>
"
width="<?=$arResult["DETAIL_PICTURE"]["WIDTH"]?>"
height="<?=$arResult["DETAIL_PICTURE"]["HEIGHT"]?>"
alt="<?=$arResult["DETAIL_PICTURE"]["ALT"]?>"
title="<?=$arResult["DETAIL_PICTURE"]["TITLE"]?>"
/>
<?endif?>
<?if($arParams["DISPLAY_DATE"]!="N" && $arResult["DISPLAY_ACTIVE_FROM"]):?>
<?=$arResult["DISPLAY_ACTIVE_FROM"]?>
<?endif;?>
<?if($arParams["DISPLAY_NAME"]!="N" && $arResult["NAME"]):?>
<?=$arResult["NAME"]?>
<?endif;?>
<?if($arParams["DISPLAY_PREVIEW_TEXT"]!="N" && $arResult["FIELDS"]["PREVIEW_TEXT"]):?>
<?=$arResult["FIELDS"]["PREVIEW_TEXT"];unset($arResult["FIELDS"]["PREVIEW_TEXT"]);?>
<?endif;?>
<?if($arResult["NAV_RESULT"]):?>
<?if($arParams["DISPLAY_TOP_PAGER"]):?><?=$arResult["NAV_STRING"]?>
<?endif;?>
<?echo $arResult["NAV_TEXT"];?>
<?if($arParams["DISPLAY_BOTTOM_PAGER"]):?>
<?=$arResult["NAV_STRING"]?><?endif;?>
<?elseif(strlen($arResult["DETAIL_TEXT"])>0):?>
<?echo $arResult["DETAIL_TEXT"];?>
<?else:?>
<?echo $arResult["PREVIEW_TEXT"];?>
<?endif?>

<?foreach($arResult["FIELDS"] as $code=>$value):
if ('PREVIEW_PICTURE' == $code || 'DETAIL_PICTURE' == $code)
{
?><?=GetMessage("IBLOCK_FIELD_".$code)?>: <?
if (!empty($value) && is_array($value))
{
?>" width="<?=$value["WIDTH"]?>" height="<?=$value["HEIGHT"]?>"><?
}
}
else
{
?><?=GetMessage("IBLOCK_FIELD_".$code)?>: <?=$value;?><?
}
?>
<?endforeach; ?>

<?/*
foreach($arResult["DISPLAY_PROPERTIES"] as $pid=>$arProperty):?>

<?=$arProperty["NAME"]?>: 
<?if(is_array($arProperty["DISPLAY_VALUE"])):?>
<?=implode(" / ", $arProperty["DISPLAY_VALUE"]);?>
<?else:?>
<?=$arProperty["DISPLAY_VALUE"];?>
<?endif?>


<?endforeach;
*/?>
<? if(array_key_exists("USE_SHARE", $arParams) && $arParams["USE_SHARE"] == "Y")
{
?>


<?
$APPLICATION->IncludeComponent("bitrix:main.share", "", array(
"HANDLERS" => $arParams["SHARE_HANDLERS"],
"PAGE_URL" => $arResult["~DETAIL_PAGE_URL"],
"PAGE_TITLE" => $arResult["~NAME"],
"SHORTEN_URL_LOGIN" => $arParams["SHARE_SHORTEN_URL_LOGIN"],
"SHORTEN_URL_KEY" => $arParams["SHARE_SHORTEN_URL_KEY"],
"HIDE" => $arParams["SHARE_HIDE"],
),
$component,
array("HIDE_ICONS" => "Y")
);
?>

<?
}
?>

<?php print_r($arResult['DISPLAY_PROPERTIES']); ?>

<? if($arResult['DISPLAY_PROPERTIES']['FILE_DOC']['FILE_VALUE']['SRC'] || $arResult['PROPERTIES']['FILE_PDF']): ?>
<? if($arResult['DISPLAY_PROPERTIES']['FILE_TITLE']['VALUE']): ?>

<? if($arResult['DISPLAY_PROPERTIES']['FILE_PDF']['FILE_VALUE']['SRC']): ?>




Открыть образец PDF:
<?= $arResult['DISPLAY_PROPERTIES']['FILE_TITLE'][...


<? endif; ?>
<? if($arResult['DISPLAY_PROPERTIES']['FILE_DOC']['FILE_VALUE']['SRC']): ?>
<?php
require_once SITE_TEMPLATE_PATH . '/sess_config.php';
$_SESSION['curUrl'] = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
$_SESSION['curId'] = $_GET['ID'];
$mrh_login = "";
$mrh_pass1 = "";
$inv_id = 0;
$inv_desc = "Оплата доступа к .doc файлу";
$out_summ = "2.00";
$IsTest = 1;
$crc = md5("$mrh_login:$out_summ:$inv_id:$mrh_pass1");
$url = '';
$title = '';
if(isset($_COOKIE['paySuccess'])) {

$paySuccess2 = unserialize(base64_decode($_COOKIE['paySuccess']));
if(in_array($_GET['ID'], $paySuccess2)) {
$url = $arResult['DISPLAY_PROPERTIES']['FILE_DOC']['FILE_VALUE']['SRC'];
$title = $arResult['DISPLAY_PROPERTIES']['FILE_TITLE']['VALUE'];
}
else {
$title = 'Нажмите, чтобы оплатить';
$url = "https://auth.robokassa.ru/Merchant/Index.aspx?Mrch...".
"OutSum=$out_summ&InvId=$inv_id&Desc=$inv_desc&SignatureValue=$crc&IsTest=$IsTest";
}
}
else {
$title = 'Нажмите, чтобы оплатить';
$url = "https://auth.robokassa.ru/Merchant/Index.aspx?Mrch...".
"OutSum=$out_summ&InvId=$inv_id&Desc=$inv_desc&SignatureValue=$crc&IsTest=$IsTest";
}
?>




Скачать редактируемую версию в формате DOC:
<?= $title; ?>

Стоимость скачивания: 50 р.
Способы оплаты:



<? endif; ?>

<? endif; ?>
<? endif; ?>
<? //print_r($paySuccess2); ?>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexey Verkhovtsev, 2016-08-24
@seftomsk

In short, I don’t know if I did it right or not, but it worked only with this method require($_SERVER["DOCUMENT_ROOT"]."/bitrix/templates/razorvem/sess_config.php");

C
crazyhat, 2016-08-24
@crazyhat

Sorry for the offtopic, but this is Bitrix, there is nothing to be surprised about.

O
Oleg Maksimenko, 2016-08-24
@olegprof

Print out SITE_TEMPLATE_PATH and you will see that there is no root document in it. This constant is not intended for that.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question